Version Description
Download this release
Release Info
Developer | gpriday |
Plugin | SiteOrigin Widgets Bundle |
Version | 1.9.0 |
Comparing to | |
See all releases |
Code changes from version 1.8.6 to 1.9.0
- base/css/admin.css +41 -10
- base/css/post-selector.css +23 -1
- base/inc/actions.php +63 -8
- base/inc/fields/autocomplete.class.php +61 -0
- base/inc/fields/base.class.php +10 -2
- base/inc/fields/checkboxes.class.php +2 -1
- base/inc/fields/container-base.class.php +1 -1
- base/inc/fields/css/date-range-field.css +9 -0
- base/inc/fields/date-range.class.php +123 -0
- base/inc/fields/factory.class.php +1 -1
- base/inc/fields/icon.class.php +9 -1
- base/inc/fields/image-size.class.php +1 -1
- base/inc/fields/js/autocomplete-field.js +119 -0
- base/inc/fields/js/autocomplete-field.min.js +1 -0
- base/inc/fields/js/code-field.js +624 -623
- base/inc/fields/js/date-range-field.js +83 -0
- base/inc/fields/js/date-range-field.min.js +1 -0
- base/inc/fields/js/icon-field.js +173 -164
- base/inc/fields/js/icon-field.min.js +1 -1
- base/inc/fields/js/lib/pikaday/pikaday.css +222 -0
- base/inc/fields/js/lib/pikaday/pikaday.js +1193 -0
- base/inc/fields/js/lib/pikaday/pikaday.min.js +1 -0
- base/inc/fields/js/media-field.js +401 -371
- base/inc/fields/js/media-field.min.js +1 -1
- base/inc/fields/js/order-field.js +30 -17
- base/inc/fields/js/order-field.min.js +1 -1
- base/inc/fields/js/posts-field.js +43 -0
- base/inc/fields/js/posts-field.min.js +1 -0
- base/inc/fields/js/tinymce-field.js +123 -120
- base/inc/fields/js/tinymce-field.min.js +1 -1
- base/inc/fields/number.class.php +7 -1
- base/inc/fields/posts.class.php +164 -5
- base/inc/fields/select.class.php +3 -2
- base/inc/fields/text-input-base.class.php +19 -2
- base/inc/lessc.inc.php +180 -3579
- base/inc/lib/Less/Autoloader.php +79 -0
- base/inc/lib/Less/Cache.php +319 -0
- base/inc/lib/Less/Colors.php +170 -0
- base/inc/lib/Less/Configurable.php +69 -0
- base/inc/lib/Less/Environment.php +166 -0
- base/inc/lib/Less/Exception/Chunk.php +203 -0
- base/inc/lib/Less/Exception/Compiler.php +11 -0
- base/inc/lib/Less/Exception/Parser.php +125 -0
- base/inc/lib/Less/Functions.php +1188 -0
- base/inc/lib/Less/Less.php.combine +17 -0
- base/inc/lib/Less/Mime.php +41 -0
- base/inc/lib/Less/Output.php +49 -0
- base/inc/lib/Less/Output/Mapped.php +122 -0
- base/inc/lib/Less/Parser.php +2816 -0
- base/inc/lib/Less/SourceMap/Base64VLQ.php +187 -0
- base/inc/lib/Less/SourceMap/Generator.php +365 -0
- base/inc/lib/Less/Tree.php +90 -0
- base/inc/lib/Less/Tree/Alpha.php +51 -0
- base/inc/lib/Less/Tree/Anonymous.php +58 -0
- base/inc/lib/Less/Tree/Assignment.php +39 -0
- base/inc/lib/Less/Tree/Attribute.php +54 -0
- base/inc/lib/Less/Tree/Call.php +121 -0
- base/inc/lib/Less/Tree/Color.php +230 -0
- base/inc/lib/Less/Tree/Comment.php +51 -0
- base/inc/lib/Less/Tree/Condition.php +72 -0
- base/inc/lib/Less/Tree/DefaultFunc.php +34 -0
- base/inc/lib/Less/Tree/DetachedRuleset.php +40 -0
- base/inc/lib/Less/Tree/Dimension.php +201 -0
- base/inc/lib/Less/Tree/Directive.php +100 -0
- base/inc/lib/Less/Tree/Element.php +75 -0
- base/inc/lib/Less/Tree/Expression.php +97 -0
- base/inc/lib/Less/Tree/Extend.php +77 -0
- base/inc/lib/Less/Tree/Import.php +304 -0
- base/inc/lib/Less/Tree/Javascript.php +30 -0
- base/inc/lib/Less/Tree/Keyword.php +44 -0
- base/inc/lib/Less/Tree/Media.php +179 -0
- base/inc/lib/Less/Tree/Mixin/Call.php +202 -0
- base/inc/lib/Less/Tree/Mixin/Definition.php +241 -0
- base/inc/lib/Less/Tree/NameValue.php +51 -0
- base/inc/lib/Less/Tree/Negative.php +37 -0
- base/inc/lib/Less/Tree/Operation.php +70 -0
- base/inc/lib/Less/Tree/Paren.php +35 -0
- base/inc/lib/Less/Tree/Quoted.php +81 -0
- base/inc/lib/Less/Tree/Rule.php +115 -0
- base/inc/lib/Less/Tree/Ruleset.php +643 -0
- base/inc/lib/Less/Tree/RulesetCall.php +26 -0
- base/inc/lib/Less/Tree/Selector.php +168 -0
- base/inc/lib/Less/Tree/UnicodeDescriptor.php +29 -0
- base/inc/lib/Less/Tree/Unit.php +147 -0
- base/inc/lib/Less/Tree/UnitConversions.php +35 -0
- base/inc/lib/Less/Tree/Url.php +76 -0
- base/inc/lib/Less/Tree/Value.php +48 -0
- base/inc/lib/Less/Tree/Variable.php +52 -0
- base/inc/lib/Less/Version.php +15 -0
- base/inc/lib/Less/Visitor.php +49 -0
- base/inc/lib/Less/Visitor/extendFinder.php +114 -0
- base/inc/lib/Less/Visitor/import.php +139 -0
- base/inc/lib/Less/Visitor/joinSelector.php +70 -0
- base/inc/lib/Less/Visitor/processExtends.php +469 -0
- base/inc/lib/Less/Visitor/toCSS.php +292 -0
- base/inc/lib/Less/VisitorReplacing.php +75 -0
- base/inc/post-selector.php +33 -231
- base/js/admin.js +1175 -960
- base/js/admin.min.js +1 -1
- base/js/meta-box-manager.js +55 -55
- base/siteorigin-widget.class.php +45 -28
- compat/builders.php +4 -0
- compat/compat.php +4 -0
- compat/elementor/styles.css +16 -1
- compat/visual-composer/front_enqueue_js.js +15 -0
- compat/visual-composer/front_enqueue_js.min.js +1 -0
- compat/visual-composer/siteorigin_widget_vc_template.php +6 -0
- compat/visual-composer/sowb-vc-widget.js +80 -0
- compat/visual-composer/sowb-vc-widget.min.js +1 -0
- compat/visual-composer/styles.css +17 -0
- compat/visual-composer/visual-composer.php +296 -0
- icons/fontawesome/filter.php +108 -0
- icons/fontawesome/font/FontAwesome.otf +0 -0
- icons/fontawesome/font/fontawesome-webfont.eot +0 -0
- icons/fontawesome/font/fontawesome-webfont.svg +6 -486
base/css/admin.css
CHANGED
@@ -16,6 +16,19 @@
|
|
16 |
width: 18px;
|
17 |
height: 18px;
|
18 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
.siteorigin-widget-form {
|
20 |
display: block !important;
|
21 |
margin: 15px 0;
|
@@ -387,7 +400,9 @@
|
|
387 |
margin-bottom: 15px;
|
388 |
}
|
389 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items,
|
390 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items
|
|
|
|
|
391 |
margin: 0;
|
392 |
padding: 0;
|
393 |
background: #fff;
|
@@ -396,7 +411,9 @@
|
|
396 |
border: 1px solid #e4e4e4;
|
397 |
}
|
398 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li,
|
399 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li
|
|
|
|
|
400 |
cursor: pointer;
|
401 |
padding: 5px 10px;
|
402 |
color: #32373c;
|
@@ -405,19 +422,27 @@
|
|
405 |
font-size: 0.95em;
|
406 |
}
|
407 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li.selected,
|
408 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li.selected
|
|
|
|
|
409 |
background: #e1edfa;
|
410 |
}
|
411 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:hover,
|
412 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:hover
|
|
|
|
|
413 |
background: #eaf2fa;
|
414 |
}
|
415 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:last-child,
|
416 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:last-child
|
|
|
|
|
417 |
border-bottom: 0;
|
418 |
}
|
419 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li span,
|
420 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li span
|
|
|
|
|
421 |
font-size: 0.9em;
|
422 |
display: inline-block;
|
423 |
float: right;
|
@@ -425,19 +450,25 @@
|
|
425 |
margin-left: 10px;
|
426 |
}
|
427 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,
|
428 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading
|
|
|
|
|
429 |
min-height: 40px;
|
430 |
background: #FFFFFF url("img/wpspin_light.gif") center center no-repeat;
|
431 |
}
|
432 |
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
433 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,
|
434 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading
|
|
|
|
|
435 |
background-image: url("img/wpspin_light-2x.gif");
|
436 |
background-size: 16px 16px;
|
437 |
}
|
438 |
}
|
439 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading li,
|
440 |
-
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading li
|
|
|
|
|
441 |
display: none;
|
442 |
}
|
443 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .buttons,
|
@@ -535,8 +566,8 @@
|
|
535 |
margin-left: -11px;
|
536 |
margin-top: -10px;
|
537 |
font-size: 21px;
|
538 |
-
text-align: center;
|
539 |
color: #666666;
|
|
|
540 |
}
|
541 |
.so-widgets-dialog .so-widgets-dialog-frame {
|
542 |
top: 80px;
|
16 |
width: 18px;
|
17 |
height: 18px;
|
18 |
}
|
19 |
+
.siteorigin-widget-form-notification {
|
20 |
+
padding: 8px 12px;
|
21 |
+
border: 1px solid #a4cadd;
|
22 |
+
background-color: #CDE2EC;
|
23 |
+
margin-bottom: 20px;
|
24 |
+
}
|
25 |
+
.siteorigin-widget-form-notification > span {
|
26 |
+
line-height: 22px;
|
27 |
+
}
|
28 |
+
.siteorigin-widget-form-notification > a.button.button-small {
|
29 |
+
margin-left: 10px;
|
30 |
+
height: 22px;
|
31 |
+
}
|
32 |
.siteorigin-widget-form {
|
33 |
display: block !important;
|
34 |
margin: 15px 0;
|
400 |
margin-bottom: 15px;
|
401 |
}
|
402 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items,
|
403 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items,
|
404 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts,
|
405 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts {
|
406 |
margin: 0;
|
407 |
padding: 0;
|
408 |
background: #fff;
|
411 |
border: 1px solid #e4e4e4;
|
412 |
}
|
413 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li,
|
414 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li,
|
415 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li,
|
416 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li {
|
417 |
cursor: pointer;
|
418 |
padding: 5px 10px;
|
419 |
color: #32373c;
|
422 |
font-size: 0.95em;
|
423 |
}
|
424 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li.selected,
|
425 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li.selected,
|
426 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li.selected,
|
427 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li.selected {
|
428 |
background: #e1edfa;
|
429 |
}
|
430 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:hover,
|
431 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:hover,
|
432 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li:hover,
|
433 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li:hover {
|
434 |
background: #eaf2fa;
|
435 |
}
|
436 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:last-child,
|
437 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:last-child,
|
438 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li:last-child,
|
439 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li:last-child {
|
440 |
border-bottom: 0;
|
441 |
}
|
442 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li span,
|
443 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li span,
|
444 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li span,
|
445 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li span {
|
446 |
font-size: 0.9em;
|
447 |
display: inline-block;
|
448 |
float: right;
|
450 |
margin-left: 10px;
|
451 |
}
|
452 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,
|
453 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading,
|
454 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading,
|
455 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading {
|
456 |
min-height: 40px;
|
457 |
background: #FFFFFF url("img/wpspin_light.gif") center center no-repeat;
|
458 |
}
|
459 |
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
460 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,
|
461 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading,
|
462 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading,
|
463 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading {
|
464 |
background-image: url("img/wpspin_light-2x.gif");
|
465 |
background-size: 16px 16px;
|
466 |
}
|
467 |
}
|
468 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading li,
|
469 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading li,
|
470 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading li,
|
471 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading li {
|
472 |
display: none;
|
473 |
}
|
474 |
.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .buttons,
|
566 |
margin-left: -11px;
|
567 |
margin-top: -10px;
|
568 |
font-size: 21px;
|
|
|
569 |
color: #666666;
|
570 |
+
text-align: center;
|
571 |
}
|
572 |
.so-widgets-dialog .so-widgets-dialog-frame {
|
573 |
top: 80px;
|
base/css/post-selector.css
CHANGED
@@ -1 +1,23 @@
|
|
1 |
-
.sow-select-posts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.sow-select-posts {
|
2 |
+
margin-top: 6px;
|
3 |
+
position: relative;
|
4 |
+
}
|
5 |
+
.sow-select-posts .sow-current-count {
|
6 |
+
position: absolute;
|
7 |
+
top: -10px;
|
8 |
+
right: -10px;
|
9 |
+
border-radius: 9px;
|
10 |
+
background: #f92700;
|
11 |
+
border: 1px solid #da0900;
|
12 |
+
display: block;
|
13 |
+
line-height: 14px;
|
14 |
+
font-size: 7px;
|
15 |
+
width: 17px;
|
16 |
+
height: 17px;
|
17 |
+
text-align: center;
|
18 |
+
vertical-align: middle;
|
19 |
+
font-weight: bold;
|
20 |
+
color: #FFFFFF;
|
21 |
+
box-sizing: border-box;
|
22 |
+
padding-top: 1px;
|
23 |
+
}
|
base/inc/actions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Action for displaying the widget preview.
|
5 |
*/
|
6 |
-
function siteorigin_widget_preview_widget_action(){
|
7 |
if( empty( $_POST['class'] ) ) exit();
|
8 |
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
9 |
|
@@ -22,6 +22,9 @@ function siteorigin_widget_preview_widget_action(){
|
|
22 |
wp_enqueue_style( 'theme-css', get_stylesheet_uri(), array(), rand( 0, 65536 ) );
|
23 |
wp_enqueue_style( 'so-widget-preview', plugin_dir_url( __FILE__ ) . '../css/preview.css', array(), rand( 0,65536 ) );
|
24 |
|
|
|
|
|
|
|
25 |
ob_start();
|
26 |
$widget->widget( array(
|
27 |
'before_widget' => '',
|
@@ -56,16 +59,14 @@ function siteorigin_widget_preview_widget_action(){
|
|
56 |
add_action('wp_ajax_so_widgets_preview', 'siteorigin_widget_preview_widget_action');
|
57 |
|
58 |
/**
|
59 |
-
* Action to handle searching
|
60 |
*/
|
61 |
-
function
|
62 |
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
63 |
|
64 |
-
header('content-type: application/json');
|
65 |
-
|
66 |
// Get all public post types, besides attachments
|
67 |
$post_types = (array) get_post_types( array(
|
68 |
-
'public'
|
69 |
) );
|
70 |
|
71 |
if ( ! empty( $_REQUEST['postTypes'] ) ) {
|
@@ -87,7 +88,7 @@ function siteorigin_widget_search_posts_action(){
|
|
87 |
$post_types = "'" . implode("', '", array_map( 'esc_sql', $post_types ) ) . "'";
|
88 |
|
89 |
$results = $wpdb->get_results( "
|
90 |
-
SELECT ID, post_title, post_type
|
91 |
FROM {$wpdb->posts}
|
92 |
WHERE
|
93 |
post_type IN ( {$post_types} ) AND post_status = 'publish' {$query}
|
@@ -95,10 +96,64 @@ function siteorigin_widget_search_posts_action(){
|
|
95 |
LIMIT 20
|
96 |
", ARRAY_A );
|
97 |
|
|
|
98 |
echo json_encode( apply_filters( 'siteorigin_widgets_search_posts_results', $results ) );
|
99 |
exit();
|
100 |
}
|
101 |
-
add_action('wp_ajax_so_widgets_search_posts', '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
function siteorigin_widget_remote_image_search(){
|
104 |
if( empty( $_GET[ '_sononce' ] ) || ! wp_verify_nonce( $_GET[ '_sononce' ], 'so-image' ) ) {
|
3 |
/**
|
4 |
* Action for displaying the widget preview.
|
5 |
*/
|
6 |
+
function siteorigin_widget_preview_widget_action() {
|
7 |
if( empty( $_POST['class'] ) ) exit();
|
8 |
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
9 |
|
22 |
wp_enqueue_style( 'theme-css', get_stylesheet_uri(), array(), rand( 0, 65536 ) );
|
23 |
wp_enqueue_style( 'so-widget-preview', plugin_dir_url( __FILE__ ) . '../css/preview.css', array(), rand( 0,65536 ) );
|
24 |
|
25 |
+
$sowb = SiteOrigin_Widgets_Bundle::single();
|
26 |
+
$sowb->register_general_scripts();
|
27 |
+
|
28 |
ob_start();
|
29 |
$widget->widget( array(
|
30 |
'before_widget' => '',
|
59 |
add_action('wp_ajax_so_widgets_preview', 'siteorigin_widget_preview_widget_action');
|
60 |
|
61 |
/**
|
62 |
+
* Action to handle searching posts
|
63 |
*/
|
64 |
+
function siteorigin_widget_action_search_posts() {
|
65 |
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
66 |
|
|
|
|
|
67 |
// Get all public post types, besides attachments
|
68 |
$post_types = (array) get_post_types( array(
|
69 |
+
'public' => true,
|
70 |
) );
|
71 |
|
72 |
if ( ! empty( $_REQUEST['postTypes'] ) ) {
|
88 |
$post_types = "'" . implode("', '", array_map( 'esc_sql', $post_types ) ) . "'";
|
89 |
|
90 |
$results = $wpdb->get_results( "
|
91 |
+
SELECT ID AS 'value', post_title AS label, post_type AS 'type'
|
92 |
FROM {$wpdb->posts}
|
93 |
WHERE
|
94 |
post_type IN ( {$post_types} ) AND post_status = 'publish' {$query}
|
96 |
LIMIT 20
|
97 |
", ARRAY_A );
|
98 |
|
99 |
+
header('content-type: application/json');
|
100 |
echo json_encode( apply_filters( 'siteorigin_widgets_search_posts_results', $results ) );
|
101 |
exit();
|
102 |
}
|
103 |
+
add_action('wp_ajax_so_widgets_search_posts', 'siteorigin_widget_action_search_posts');
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Action to handle searching taxonomy terms.
|
107 |
+
*/
|
108 |
+
function siteorigin_widget_action_search_terms() {
|
109 |
+
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
110 |
+
global $wpdb;
|
111 |
+
$term = !empty($_GET['term']) ? stripslashes($_GET['term']) : '';
|
112 |
+
$term = trim($term, '%');
|
113 |
+
|
114 |
+
$query = $wpdb->prepare("
|
115 |
+
SELECT terms.term_id, terms.slug AS 'value', terms.name AS 'label', termtaxonomy.taxonomy AS 'type'
|
116 |
+
FROM $wpdb->terms AS terms
|
117 |
+
JOIN $wpdb->term_taxonomy AS termtaxonomy ON terms.term_id = termtaxonomy.term_id
|
118 |
+
WHERE
|
119 |
+
terms.name LIKE '%s'
|
120 |
+
LIMIT 20
|
121 |
+
", '%'.$term.'%');
|
122 |
+
|
123 |
+
$results = array();
|
124 |
+
|
125 |
+
foreach ( $wpdb->get_results( $query ) as $result ) {
|
126 |
+
$results[] = array(
|
127 |
+
'value' => $result->type . ':' . $result->value,
|
128 |
+
'label' => $result->label,
|
129 |
+
'type' => $result->type,
|
130 |
+
);
|
131 |
+
}
|
132 |
+
|
133 |
+
header('content-type:application/json');
|
134 |
+
echo json_encode( $results );
|
135 |
+
exit();
|
136 |
+
}
|
137 |
+
add_action('wp_ajax_so_widgets_search_terms', 'siteorigin_widget_action_search_terms');
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Action for getting the number of posts returned by a query.
|
141 |
+
*/
|
142 |
+
function siteorigin_widget_get_posts_count_action() {
|
143 |
+
|
144 |
+
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
145 |
+
|
146 |
+
$query = stripslashes( $_POST['query'] );
|
147 |
+
|
148 |
+
header('content-type: application/json');
|
149 |
+
|
150 |
+
echo json_encode( array( 'posts_count' => siteorigin_widget_post_selector_count_posts( $query ) ) );
|
151 |
+
|
152 |
+
exit();
|
153 |
+
}
|
154 |
+
|
155 |
+
add_action( 'wp_ajax_sow_get_posts_count', 'siteorigin_widget_get_posts_count_action' );
|
156 |
+
|
157 |
|
158 |
function siteorigin_widget_remote_image_search(){
|
159 |
if( empty( $_GET[ '_sononce' ] ) || ! wp_verify_nonce( $_GET[ '_sononce' ], 'so-image' ) ) {
|
base/inc/fields/autocomplete.class.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class SiteOrigin_Widget_Field_Autocomplete
|
5 |
+
*/
|
6 |
+
class SiteOrigin_Widget_Field_Autocomplete extends SiteOrigin_Widget_Field_Text_Input_Base {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* An array of post types to use in the autocomplete query. Only used for posts.
|
10 |
+
*
|
11 |
+
* @access protected
|
12 |
+
* @var array
|
13 |
+
*/
|
14 |
+
protected $post_types;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Indicates which database table will be used to retrieve autocomplete suggestions.
|
18 |
+
* Currently only `posts` and `terms` are allowed.
|
19 |
+
*
|
20 |
+
* @access protected
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected $source;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The CSS classes to be applied to the rendered text input.
|
27 |
+
*/
|
28 |
+
protected function get_input_classes() {
|
29 |
+
return array( 'widefat', 'siteorigin-widget-input', 'siteorigin-widget-autocomplete-input' );
|
30 |
+
}
|
31 |
+
|
32 |
+
protected function get_default_options() {
|
33 |
+
$defaults = parent::get_default_options();
|
34 |
+
$defaults['source'] = 'posts';
|
35 |
+
return $defaults;
|
36 |
+
}
|
37 |
+
|
38 |
+
protected function render_after_field( $value, $instance ) {
|
39 |
+
$post_types = ! empty( $this->post_types ) && is_array( $this->post_types ) ? implode( ',', $this->post_types ) : '';
|
40 |
+
?>
|
41 |
+
<div class="existing-content-selector">
|
42 |
+
|
43 |
+
<input type="text" class="content-text-search"
|
44 |
+
data-post-types="<?php echo esc_attr( $post_types ) ?>"
|
45 |
+
data-source="<?php echo esc_attr( $this->source ) ?>"
|
46 |
+
placeholder="<?php esc_attr_e( 'Search', 'so-widgets-bundle' ) ?>"/>
|
47 |
+
|
48 |
+
<ul class="items"></ul>
|
49 |
+
|
50 |
+
<div class="buttons">
|
51 |
+
<a href="#" class="button-close button"><?php esc_html_e('Close', 'so-widgets-bundle') ?></a>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
<?php
|
55 |
+
parent::render_after_field( $value, $instance );
|
56 |
+
}
|
57 |
+
|
58 |
+
function enqueue_scripts() {
|
59 |
+
wp_enqueue_script( 'so-autocomplete-field', plugin_dir_url( __FILE__ ) . 'js/autocomplete-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
|
60 |
+
}
|
61 |
+
}
|
base/inc/fields/base.class.php
CHANGED
@@ -125,6 +125,14 @@ abstract class SiteOrigin_Widget_Field_Base {
|
|
125 |
* @var boolean
|
126 |
*/
|
127 |
protected $is_container;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
|
130 |
/* ============================================================================================================== */
|
@@ -352,9 +360,9 @@ abstract class SiteOrigin_Widget_Field_Base {
|
|
352 |
*
|
353 |
* @param $value mixed The value to be sanitized.
|
354 |
* @param $instance array The widget instance.
|
355 |
-
* @param $old_value The old value of this field.
|
356 |
*
|
357 |
-
* @return mixed|string
|
358 |
*/
|
359 |
public function sanitize( $value, $instance = array(), $old_value = null ) {
|
360 |
|
125 |
* @var boolean
|
126 |
*/
|
127 |
protected $is_container;
|
128 |
+
/**
|
129 |
+
* Additional CSS classes to output in this field's HTML class attribute. It is left up to the field's render_field
|
130 |
+
* function to output these classes.
|
131 |
+
*
|
132 |
+
* @access protected
|
133 |
+
* @var array
|
134 |
+
*/
|
135 |
+
protected $input_css_classes;
|
136 |
|
137 |
|
138 |
/* ============================================================================================================== */
|
360 |
*
|
361 |
* @param $value mixed The value to be sanitized.
|
362 |
* @param $instance array The widget instance.
|
363 |
+
* @param $old_value mixed The old value of this field.
|
364 |
*
|
365 |
+
* @return mixed|string
|
366 |
*/
|
367 |
public function sanitize( $value, $instance = array(), $old_value = null ) {
|
368 |
|
base/inc/fields/checkboxes.class.php
CHANGED
@@ -16,13 +16,14 @@ class SiteOrigin_Widget_Field_Checkboxes extends SiteOrigin_Widget_Field_Base {
|
|
16 |
$value = array( $value );
|
17 |
}
|
18 |
|
|
|
19 |
foreach( $this->options as $id => $label ) {
|
20 |
?>
|
21 |
<label for="<?php echo esc_attr( $this->element_id ) ?>-<?php echo esc_attr( $id ) ?>" class="so-checkbox-label">
|
22 |
<input
|
23 |
type="checkbox"
|
24 |
class="siteorigin-widget-input"
|
25 |
-
name="<?php echo esc_attr( $this->element_name ) ?>[]"
|
26 |
value="<?php echo esc_attr( $id ) ?>"
|
27 |
id="<?php echo esc_attr( $this->element_id ) ?>-<?php echo esc_attr( $id ) ?>"
|
28 |
<?php checked( in_array( $id, $value ) ) ?>
|
16 |
$value = array( $value );
|
17 |
}
|
18 |
|
19 |
+
$i = 0;
|
20 |
foreach( $this->options as $id => $label ) {
|
21 |
?>
|
22 |
<label for="<?php echo esc_attr( $this->element_id ) ?>-<?php echo esc_attr( $id ) ?>" class="so-checkbox-label">
|
23 |
<input
|
24 |
type="checkbox"
|
25 |
class="siteorigin-widget-input"
|
26 |
+
name="<?php echo esc_attr( $this->element_name ) ?>[<?php echo esc_attr( $i++ ) ?>]"
|
27 |
value="<?php echo esc_attr( $id ) ?>"
|
28 |
id="<?php echo esc_attr( $this->element_id ) ?>-<?php echo esc_attr( $id ) ?>"
|
29 |
<?php checked( in_array( $id, $value ) ) ?>
|
base/inc/fields/container-base.class.php
CHANGED
@@ -119,4 +119,4 @@ abstract class SiteOrigin_Widget_Field_Container_Base extends SiteOrigin_Widget_
|
|
119 |
return $value;
|
120 |
}
|
121 |
|
122 |
-
}
|
119 |
return $value;
|
120 |
}
|
121 |
|
122 |
+
}
|
base/inc/fields/css/date-range-field.css
CHANGED
@@ -6,9 +6,18 @@
|
|
6 |
display: inline-block;
|
7 |
width: 35px;
|
8 |
}
|
|
|
|
|
|
|
9 |
.siteorigin-widget-form .siteorigin-widget-field-type-date-range > div input[type="text"].datepicker {
|
10 |
width: 258px;
|
11 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
.pika-single {
|
13 |
z-index: 999999;
|
14 |
}
|
6 |
display: inline-block;
|
7 |
width: 35px;
|
8 |
}
|
9 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-date-range > div span:last-child {
|
10 |
+
margin-left: 10px;
|
11 |
+
}
|
12 |
.siteorigin-widget-form .siteorigin-widget-field-type-date-range > div input[type="text"].datepicker {
|
13 |
width: 258px;
|
14 |
}
|
15 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-date-range .sowb-relative-date > input {
|
16 |
+
max-width: 100px;
|
17 |
+
}
|
18 |
+
.siteorigin-widget-form .siteorigin-widget-field-type-date-range .sowb-relative-date > select {
|
19 |
+
min-width: inherit;
|
20 |
+
}
|
21 |
.pika-single {
|
22 |
z-index: 999999;
|
23 |
}
|
base/inc/fields/date-range.class.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class SiteOrigin_Widget_Field_Date_Range
|
5 |
+
*/
|
6 |
+
class SiteOrigin_Widget_Field_Date_Range extends SiteOrigin_Widget_Field_Base {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Either 'relative' or 'specific'. Whether to allow relative or specific date selection.
|
10 |
+
*
|
11 |
+
* @access protected
|
12 |
+
* @var array
|
13 |
+
*/
|
14 |
+
protected $date_type;
|
15 |
+
|
16 |
+
protected function render_field( $value, $instance ) {
|
17 |
+
|
18 |
+
if ( $this->date_type == 'specific' ) {
|
19 |
+
$this->render_specific_date_selector();
|
20 |
+
} else {
|
21 |
+
$this->render_relative_date_selector( $value );
|
22 |
+
}
|
23 |
+
?><input type="hidden"
|
24 |
+
class="siteorigin-widget-input"
|
25 |
+
value="<?php echo esc_attr( $value ) ?>"
|
26 |
+
name="<?php echo esc_attr( $this->element_name ) ?>" /><?php
|
27 |
+
}
|
28 |
+
|
29 |
+
private function render_specific_date_selector() {
|
30 |
+
?><div class="sowb-specific-date-after"><span><?php
|
31 |
+
_e( 'From', 'so-widgets-bundle' );
|
32 |
+
?></span><input type="text" class="datepicker after-picker"/></div><?php
|
33 |
+
?><div class="sowb-specific-date-before"><span><?php
|
34 |
+
_e( 'to', 'so-widgets-bundle' );
|
35 |
+
?></span><input type="text" class="datepicker before-picker"/></div><?php
|
36 |
+
}
|
37 |
+
|
38 |
+
private function render_relative_date_selector( $value ) {
|
39 |
+
$value = json_decode(
|
40 |
+
$value,
|
41 |
+
true
|
42 |
+
);
|
43 |
+
|
44 |
+
$from = ! empty( $value['from'] ) ? $value['from'] : array();
|
45 |
+
$this->render_relative_date_selector_part( 'from', __( 'From', 'so-widgets-bundle' ), $from );
|
46 |
+
|
47 |
+
$to = ! empty( $value['to'] ) ? $value['to'] : array();
|
48 |
+
$this->render_relative_date_selector_part( 'to', __( 'to', 'so-widgets-bundle' ), $to );
|
49 |
+
}
|
50 |
+
|
51 |
+
private function render_relative_date_selector_part( $name, $label, $value ) {
|
52 |
+
$units = $this->get_units();
|
53 |
+
|
54 |
+
$val = ! empty( $value['value'] ) ? $value['value'] : 0;
|
55 |
+
$unit = ! empty( $value['unit'] ) ? $value['unit'] : 'days';
|
56 |
+
|
57 |
+
?><div class="sowb-relative-date" data-name="<?php echo esc_attr( $name ) ?>"><span><?php
|
58 |
+
echo esc_html( $label );
|
59 |
+
?></span><input type="number" min="0" step="1" class="sowb-relative-date-value" value="<?php echo esc_attr( $val ) ?>"/>
|
60 |
+
<select class="sowb-relative-date-unit">
|
61 |
+
<?php foreach( $units as $value => $label) : ?>
|
62 |
+
<option value="<?php echo esc_attr( $value ) ?>" <?php selected( $value, $unit ) ?>><?php echo $label ?></option>
|
63 |
+
<?php endforeach; ?>
|
64 |
+
</select><span><?php _e( 'ago', 'so-widgets-bundle' ); ?></span></div><?php
|
65 |
+
}
|
66 |
+
|
67 |
+
private function get_units() {
|
68 |
+
return array(
|
69 |
+
'days' => __( 'days', 'so-widgets-bundle' ),
|
70 |
+
'weeks' => __( 'weeks', 'so-widgets-bundle' ),
|
71 |
+
'months' => __( 'months', 'so-widgets-bundle' ),
|
72 |
+
'years' => __( 'years', 'so-widgets-bundle' ),
|
73 |
+
);
|
74 |
+
}
|
75 |
+
|
76 |
+
public function enqueue_scripts() {
|
77 |
+
wp_register_style( 'sowb-pikaday', plugin_dir_url(__FILE__) . 'js/lib/pikaday/pikaday.css' );
|
78 |
+
wp_register_script( 'sowb-pikaday', plugin_dir_url(__FILE__) . 'js/lib/pikaday/pikaday' . SOW_BUNDLE_JS_SUFFIX . '.js', array( ), '1.5.1' );
|
79 |
+
wp_enqueue_style( 'so-date-range-field', plugin_dir_url(__FILE__) . 'css/date-range-field.css', array( 'sowb-pikaday' ), SOW_BUNDLE_VERSION );
|
80 |
+
wp_enqueue_script( 'so-date-range-field', plugin_dir_url(__FILE__) . 'js/date-range-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery', 'sowb-pikaday' ), SOW_BUNDLE_VERSION );
|
81 |
+
}
|
82 |
+
|
83 |
+
protected function sanitize_field_input( $value, $instance ) {
|
84 |
+
if ( $this->date_type == 'specific' ) {
|
85 |
+
if ( ! empty( $value ) ) {
|
86 |
+
$value = json_decode(
|
87 |
+
$value,
|
88 |
+
true
|
89 |
+
);
|
90 |
+
if ( ! empty( $value['after'] ) ) {
|
91 |
+
$value_after = new DateTime( $value['after'] );
|
92 |
+
$value['after'] = $value_after->format( 'Y-m-d' );
|
93 |
+
}
|
94 |
+
if ( ! empty( $value['before'] ) ) {
|
95 |
+
$value_before = new DateTime( $value['before'] );
|
96 |
+
$value['before'] = $value_before->format( 'Y-m-d' );
|
97 |
+
}
|
98 |
+
} else {
|
99 |
+
$value = array( 'after' => '', 'before' => '' );
|
100 |
+
}
|
101 |
+
} else if ( $this->date_type == 'relative' ) {
|
102 |
+
if ( ! empty( $value ) ) {
|
103 |
+
$value = json_decode(
|
104 |
+
$value,
|
105 |
+
true
|
106 |
+
);
|
107 |
+
$unit_keys = array_keys( $this->get_units() );
|
108 |
+
foreach( array( 'from', 'to' ) as $key ) {
|
109 |
+
if ( empty( $value[$key] ) ) {
|
110 |
+
$value[$key] = array();
|
111 |
+
}
|
112 |
+
$item = $value[$key];
|
113 |
+
$val = empty( $item['value'] ) ? 0 : intval( $item['value'] );
|
114 |
+
$unit = ( ! empty( $item['unit'] ) && in_array( $item['unit'], $unit_keys ) ) ? $item['unit'] : $unit_keys[0];
|
115 |
+
$value[$key] = array( 'value' => $val, 'unit' => $unit );
|
116 |
+
}
|
117 |
+
} else {
|
118 |
+
$value = array( 'from' => array(), 'to' => array() );
|
119 |
+
}
|
120 |
+
}
|
121 |
+
return json_encode( $value );
|
122 |
+
}
|
123 |
+
}
|
base/inc/fields/factory.class.php
CHANGED
@@ -58,4 +58,4 @@ class SiteOrigin_Widget_Field_Factory {
|
|
58 |
private function get_class_prefixes() {
|
59 |
return apply_filters( 'siteorigin_widgets_field_class_prefixes', array( 'SiteOrigin_Widget_Field_' ) );
|
60 |
}
|
61 |
-
}
|
58 |
private function get_class_prefixes() {
|
59 |
return apply_filters( 'siteorigin_widgets_field_class_prefixes', array( 'SiteOrigin_Widget_Field_' ) );
|
60 |
}
|
61 |
+
}
|
base/inc/fields/icon.class.php
CHANGED
@@ -4,6 +4,14 @@
|
|
4 |
* Class SiteOrigin_Widget_Field_Icon
|
5 |
*/
|
6 |
class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
protected $icons_callback;
|
9 |
|
@@ -39,7 +47,7 @@ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
|
39 |
<input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
|
40 |
class="siteorigin-widget-icon-icon siteorigin-widget-input" />
|
41 |
|
42 |
-
<div class="siteorigin-widget-icon-icons"></div>
|
43 |
</div>
|
44 |
<?php
|
45 |
}
|
4 |
* Class SiteOrigin_Widget_Field_Icon
|
5 |
*/
|
6 |
class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
7 |
+
/**
|
8 |
+
* The number of visible rows in the icons selector.
|
9 |
+
*
|
10 |
+
* @access protected
|
11 |
+
* @var int
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
protected $rows = 3;
|
15 |
|
16 |
protected $icons_callback;
|
17 |
|
47 |
<input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
|
48 |
class="siteorigin-widget-icon-icon siteorigin-widget-input" />
|
49 |
|
50 |
+
<div class="siteorigin-widget-icon-icons" style="height: <?php echo ( $this->rows * 54 ) - 3 ?>px;"></div>
|
51 |
</div>
|
52 |
<?php
|
53 |
}
|
base/inc/fields/image-size.class.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
* Class
|
5 |
*/
|
6 |
class SiteOrigin_Widget_Field_Image_Size extends SiteOrigin_Widget_Field_Select {
|
7 |
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* Class SiteOrigin_Widget_Field_Image_Size
|
5 |
*/
|
6 |
class SiteOrigin_Widget_Field_Image_Size extends SiteOrigin_Widget_Field_Select {
|
7 |
|
base/inc/fields/js/autocomplete-field.js
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global jQuery, soWidgets */
|
2 |
+
|
3 |
+
(function( $ ) {
|
4 |
+
|
5 |
+
$( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-autocomplete', function ( e ) {
|
6 |
+
var $$ = $(this);
|
7 |
+
|
8 |
+
var getSelectedItems = function() {
|
9 |
+
var selectedItems = $$.find( 'input.siteorigin-widget-input' ).val();
|
10 |
+
return selectedItems.length === 0 ? [] : selectedItems.split( ',' );
|
11 |
+
};
|
12 |
+
|
13 |
+
var updateSelectedItems = function() {
|
14 |
+
var selectedItems = getSelectedItems();
|
15 |
+
$$.find( 'ul.items > li' ).each( function ( index, element ) {
|
16 |
+
var $li = $( this );
|
17 |
+
|
18 |
+
if ( selectedItems.indexOf( $li.data( 'value' ) ) > -1 ) {
|
19 |
+
$li.addClass( 'selected' );
|
20 |
+
} else {
|
21 |
+
$li.removeClass( 'selected' );
|
22 |
+
}
|
23 |
+
} );
|
24 |
+
};
|
25 |
+
|
26 |
+
// Function that refreshes the list of
|
27 |
+
var request = null;
|
28 |
+
var refreshList = function(){
|
29 |
+
if( request !== null ) {
|
30 |
+
request.abort();
|
31 |
+
}
|
32 |
+
|
33 |
+
var $contentSearchInput = $$.find('.content-text-search');
|
34 |
+
var query = $contentSearchInput.val();
|
35 |
+
var source = $contentSearchInput.data('source');
|
36 |
+
var postTypes = $contentSearchInput.data('postTypes');
|
37 |
+
|
38 |
+
var $ul = $$.find('ul.items').empty().addClass('loading');
|
39 |
+
return $.get(
|
40 |
+
soWidgets.ajaxurl,
|
41 |
+
{ action: 'so_widgets_search_' + source, query: query, postTypes: postTypes },
|
42 |
+
function(results) {
|
43 |
+
results.forEach(function (item) {
|
44 |
+
if (item.label === '') {
|
45 |
+
item.label = ' ';
|
46 |
+
}
|
47 |
+
// Add all the items
|
48 |
+
$ul.append(
|
49 |
+
$('<li>')
|
50 |
+
.html(item.label + '<span>(' + item.type + ')</span>')
|
51 |
+
.data(item)
|
52 |
+
);
|
53 |
+
});
|
54 |
+
$ul.removeClass('loading');
|
55 |
+
}
|
56 |
+
);
|
57 |
+
};
|
58 |
+
|
59 |
+
$$.find('.siteorigin-widget-autocomplete-input').click(function () {
|
60 |
+
var $s = $$.find('.existing-content-selector');
|
61 |
+
$s.show();
|
62 |
+
|
63 |
+
var refreshPromise = new $.Deferred();
|
64 |
+
if( $s.is(':visible') && $s.find('ul.items li').length === 0 ) {
|
65 |
+
refreshPromise = refreshList();
|
66 |
+
} else {
|
67 |
+
refreshPromise.resolve();
|
68 |
+
}
|
69 |
+
|
70 |
+
refreshPromise.done( updateSelectedItems );
|
71 |
+
});
|
72 |
+
|
73 |
+
var closeContent = function () {
|
74 |
+
$$.find('.existing-content-selector').hide();
|
75 |
+
};
|
76 |
+
|
77 |
+
$(window).mousedown(function (event) {
|
78 |
+
var mouseDownOutside = $$.find(event.target).length === 0;
|
79 |
+
if ( mouseDownOutside ) {
|
80 |
+
closeContent();
|
81 |
+
}
|
82 |
+
});
|
83 |
+
|
84 |
+
$$.find('.button-close').click( closeContent );
|
85 |
+
|
86 |
+
// Clicking on one of the url items
|
87 |
+
$$.on( 'click', '.items li', function(e) {
|
88 |
+
e.preventDefault();
|
89 |
+
var $li = $(this);
|
90 |
+
var selectedItems = getSelectedItems();
|
91 |
+
var clickedItem = $li.data( 'value' );
|
92 |
+
|
93 |
+
var curIndex = selectedItems.indexOf( clickedItem );
|
94 |
+
|
95 |
+
if ( curIndex > -1 ) {
|
96 |
+
selectedItems.splice( curIndex, 1 );
|
97 |
+
$li.removeClass( 'selected' );
|
98 |
+
} else {
|
99 |
+
selectedItems.push( clickedItem );
|
100 |
+
$li.addClass( 'selected' );
|
101 |
+
}
|
102 |
+
var $input = $$.find('input.siteorigin-widget-input');
|
103 |
+
$input.val( selectedItems.join(',') );
|
104 |
+
$input.change();
|
105 |
+
} );
|
106 |
+
|
107 |
+
var interval = null;
|
108 |
+
$$.find('.content-text-search').keyup( function(){
|
109 |
+
if( interval !== null ) {
|
110 |
+
clearTimeout(interval);
|
111 |
+
}
|
112 |
+
|
113 |
+
interval = setTimeout(function(){
|
114 |
+
refreshList();
|
115 |
+
}, 500);
|
116 |
+
} );
|
117 |
+
} );
|
118 |
+
|
119 |
+
})( jQuery );
|
base/inc/fields/js/autocomplete-field.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",function(t){var n=e(this),i=function(){var e=n.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},a=function(){var t=i();n.find("ul.items > li").each(function(n,i){var a=e(this);t.indexOf(a.data("value"))>-1?a.addClass("selected"):a.removeClass("selected")})},l=null,s=function(){null!==l&&l.abort();var t=n.find(".content-text-search"),i=t.val(),a=t.data("source"),s=t.data("postTypes"),o=n.find("ul.items").empty().addClass("loading");return e.get(soWidgets.ajaxurl,{action:"so_widgets_search_"+a,query:i,postTypes:s},function(t){t.forEach(function(t){""===t.label&&(t.label=" "),o.append(e("<li>").html(t.label+"<span>("+t.type+")</span>").data(t))}),o.removeClass("loading")})};n.find(".siteorigin-widget-autocomplete-input").click(function(){var t=n.find(".existing-content-selector");t.show();var i=new e.Deferred;t.is(":visible")&&0===t.find("ul.items li").length?i=s():i.resolve(),i.done(a)});var o=function(){n.find(".existing-content-selector").hide()};e(window).mousedown(function(e){var t=0===n.find(e.target).length;t&&o()}),n.find(".button-close").click(o),n.on("click",".items li",function(t){t.preventDefault();var a=e(this),l=i(),s=a.data("value"),o=l.indexOf(s);o>-1?(l.splice(o,1),a.removeClass("selected")):(l.push(s),a.addClass("selected"));var d=n.find("input.siteorigin-widget-input");d.val(l.join(",")),d.change()});var d=null;n.find(".content-text-search").keyup(function(){null!==d&&clearTimeout(d),d=setTimeout(function(){s()},500)})})}(jQuery);
|
base/inc/fields/js/code-field.js
CHANGED
@@ -12,634 +12,635 @@
|
|
12 |
|
13 |
(function(undefined){
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
|
633 |
}).call(this);
|
634 |
|
|
|
635 |
|
636 |
( function( $ ) {
|
637 |
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
|
645 |
} )( jQuery );
|
12 |
|
13 |
(function(undefined){
|
14 |
|
15 |
+
'use strict';
|
16 |
+
|
17 |
+
var BehaveHooks = BehaveHooks || (function(){
|
18 |
+
var hooks = {};
|
19 |
+
|
20 |
+
return {
|
21 |
+
add: function(hookName, fn){
|
22 |
+
if(typeof hookName == "object"){
|
23 |
+
var i;
|
24 |
+
for(i=0; i<hookName.length; i++){
|
25 |
+
var theHook = hookName[i];
|
26 |
+
if(!hooks[theHook]){
|
27 |
+
hooks[theHook] = [];
|
28 |
+
}
|
29 |
+
hooks[theHook].push(fn);
|
30 |
+
}
|
31 |
+
} else {
|
32 |
+
if(!hooks[hookName]){
|
33 |
+
hooks[hookName] = [];
|
34 |
+
}
|
35 |
+
hooks[hookName].push(fn);
|
36 |
+
}
|
37 |
+
},
|
38 |
+
get: function(hookName){
|
39 |
+
if(hooks[hookName]){
|
40 |
+
return hooks[hookName];
|
41 |
+
}
|
42 |
+
}
|
43 |
+
};
|
44 |
+
|
45 |
+
})(),
|
46 |
+
Behave = Behave || function (userOpts) {
|
47 |
+
|
48 |
+
if (typeof String.prototype.repeat !== 'function') {
|
49 |
+
String.prototype.repeat = function(times) {
|
50 |
+
if(times < 1){
|
51 |
+
return '';
|
52 |
+
}
|
53 |
+
if(times % 2){
|
54 |
+
return this.repeat(times - 1) + this;
|
55 |
+
}
|
56 |
+
var half = this.repeat(times / 2);
|
57 |
+
return half + half;
|
58 |
+
};
|
59 |
+
}
|
60 |
+
|
61 |
+
if (typeof Array.prototype.filter !== 'function') {
|
62 |
+
Array.prototype.filter = function(func /*, thisp */) {
|
63 |
+
if (this === null) {
|
64 |
+
throw new TypeError();
|
65 |
+
}
|
66 |
+
|
67 |
+
var t = Object(this),
|
68 |
+
len = t.length >>> 0;
|
69 |
+
if (typeof func != "function"){
|
70 |
+
throw new TypeError();
|
71 |
+
}
|
72 |
+
var res = [],
|
73 |
+
thisp = arguments[1];
|
74 |
+
for (var i = 0; i < len; i++) {
|
75 |
+
if (i in t) {
|
76 |
+
var val = t[i];
|
77 |
+
if (func.call(thisp, val, i, t)) {
|
78 |
+
res.push(val);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
return res;
|
83 |
+
};
|
84 |
+
}
|
85 |
+
|
86 |
+
var defaults = {
|
87 |
+
textarea: null,
|
88 |
+
replaceTab: true,
|
89 |
+
softTabs: true,
|
90 |
+
tabSize: 4,
|
91 |
+
autoOpen: true,
|
92 |
+
overwrite: true,
|
93 |
+
autoStrip: true,
|
94 |
+
autoIndent: true,
|
95 |
+
fence: false
|
96 |
+
},
|
97 |
+
tab,
|
98 |
+
newLine,
|
99 |
+
charSettings = {
|
100 |
+
|
101 |
+
keyMap: [
|
102 |
+
{ open: "\"", close: "\"", canBreak: false },
|
103 |
+
{ open: "'", close: "'", canBreak: false },
|
104 |
+
{ open: "(", close: ")", canBreak: false },
|
105 |
+
{ open: "[", close: "]", canBreak: true },
|
106 |
+
{ open: "{", close: "}", canBreak: true }
|
107 |
+
]
|
108 |
+
|
109 |
+
},
|
110 |
+
utils = {
|
111 |
+
|
112 |
+
_callHook: function(hookName, passData){
|
113 |
+
var hooks = BehaveHooks.get(hookName);
|
114 |
+
passData = typeof passData=="boolean" && passData === false ? false : true;
|
115 |
+
|
116 |
+
if(hooks){
|
117 |
+
if(passData){
|
118 |
+
var theEditor = defaults.textarea,
|
119 |
+
textVal = theEditor.value,
|
120 |
+
caretPos = utils.cursor.get(),
|
121 |
+
i;
|
122 |
+
|
123 |
+
for(i=0; i<hooks.length; i++){
|
124 |
+
hooks[i].call(undefined, {
|
125 |
+
editor: {
|
126 |
+
element: theEditor,
|
127 |
+
text: textVal,
|
128 |
+
levelsDeep: utils.levelsDeep()
|
129 |
+
},
|
130 |
+
caret: {
|
131 |
+
pos: caretPos
|
132 |
+
},
|
133 |
+
lines: {
|
134 |
+
current: utils.cursor.getLine(textVal, caretPos),
|
135 |
+
total: utils.editor.getLines(textVal)
|
136 |
+
}
|
137 |
+
});
|
138 |
+
}
|
139 |
+
} else {
|
140 |
+
for(i=0; i<hooks.length; i++){
|
141 |
+
hooks[i].call(undefined);
|
142 |
+
}
|
143 |
+
}
|
144 |
+
}
|
145 |
+
},
|
146 |
+
|
147 |
+
defineNewLine: function(){
|
148 |
+
var ta = document.createElement('textarea');
|
149 |
+
ta.value = "\n";
|
150 |
+
|
151 |
+
if(ta.value.length==2){
|
152 |
+
newLine = "\r\n";
|
153 |
+
} else {
|
154 |
+
newLine = "\n";
|
155 |
+
}
|
156 |
+
},
|
157 |
+
defineTabSize: function(tabSize){
|
158 |
+
if(typeof defaults.textarea.style.OTabSize != "undefined"){
|
159 |
+
defaults.textarea.style.OTabSize = tabSize; return;
|
160 |
+
}
|
161 |
+
if(typeof defaults.textarea.style.MozTabSize != "undefined"){
|
162 |
+
defaults.textarea.style.MozTabSize = tabSize; return;
|
163 |
+
}
|
164 |
+
if(typeof defaults.textarea.style.tabSize != "undefined"){
|
165 |
+
defaults.textarea.style.tabSize = tabSize; return;
|
166 |
+
}
|
167 |
+
},
|
168 |
+
cursor: {
|
169 |
+
getLine: function(textVal, pos){
|
170 |
+
return ((textVal.substring(0,pos)).split("\n")).length;
|
171 |
+
},
|
172 |
+
get: function() {
|
173 |
+
|
174 |
+
if (typeof document.createElement('textarea').selectionStart==="number") {
|
175 |
+
return defaults.textarea.selectionStart;
|
176 |
+
} else if (document.selection) {
|
177 |
+
var caretPos = 0,
|
178 |
+
range = defaults.textarea.createTextRange(),
|
179 |
+
rangeDupe = document.selection.createRange().duplicate(),
|
180 |
+
rangeDupeBookmark = rangeDupe.getBookmark();
|
181 |
+
range.moveToBookmark(rangeDupeBookmark);
|
182 |
+
|
183 |
+
while (range.moveStart('character' , -1) !== 0) {
|
184 |
+
caretPos++;
|
185 |
+
}
|
186 |
+
return caretPos;
|
187 |
+
}
|
188 |
+
},
|
189 |
+
set: function (start, end) {
|
190 |
+
if(!end){
|
191 |
+
end = start;
|
192 |
+
}
|
193 |
+
if (defaults.textarea.setSelectionRange) {
|
194 |
+
defaults.textarea.focus();
|
195 |
+
defaults.textarea.setSelectionRange(start, end);
|
196 |
+
} else if (defaults.textarea.createTextRange) {
|
197 |
+
var range = defaults.textarea.createTextRange();
|
198 |
+
range.collapse(true);
|
199 |
+
range.moveEnd('character', end);
|
200 |
+
range.moveStart('character', start);
|
201 |
+
range.select();
|
202 |
+
}
|
203 |
+
},
|
204 |
+
selection: function(){
|
205 |
+
var textAreaElement = defaults.textarea,
|
206 |
+
start = 0,
|
207 |
+
end = 0,
|
208 |
+
normalizedValue,
|
209 |
+
range,
|
210 |
+
textInputRange,
|
211 |
+
len,
|
212 |
+
endRange;
|
213 |
+
|
214 |
+
if (typeof textAreaElement.selectionStart == "number" && typeof textAreaElement.selectionEnd == "number") {
|
215 |
+
start = textAreaElement.selectionStart;
|
216 |
+
end = textAreaElement.selectionEnd;
|
217 |
+
} else {
|
218 |
+
range = document.selection.createRange();
|
219 |
+
|
220 |
+
if (range && range.parentElement() == textAreaElement) {
|
221 |
+
|
222 |
+
normalizedValue = utils.editor.get();
|
223 |
+
len = normalizedValue.length;
|
224 |
+
|
225 |
+
textInputRange = textAreaElement.createTextRange();
|
226 |
+
textInputRange.moveToBookmark(range.getBookmark());
|
227 |
+
|
228 |
+
endRange = textAreaElement.createTextRange();
|
229 |
+
endRange.collapse(false);
|
230 |
+
|
231 |
+
if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
|
232 |
+
start = end = len;
|
233 |
+
} else {
|
234 |
+
start = -textInputRange.moveStart("character", -len);
|
235 |
+
start += normalizedValue.slice(0, start).split(newLine).length - 1;
|
236 |
+
|
237 |
+
if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
|
238 |
+
end = len;
|
239 |
+
} else {
|
240 |
+
end = -textInputRange.moveEnd("character", -len);
|
241 |
+
end += normalizedValue.slice(0, end).split(newLine).length - 1;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
return start==end ? false : {
|
248 |
+
start: start,
|
249 |
+
end: end
|
250 |
+
};
|
251 |
+
}
|
252 |
+
},
|
253 |
+
editor: {
|
254 |
+
getLines: function(textVal){
|
255 |
+
return (textVal).split("\n").length;
|
256 |
+
},
|
257 |
+
get: function(){
|
258 |
+
return defaults.textarea.value.replace(/\r/g,'');
|
259 |
+
},
|
260 |
+
set: function(data){
|
261 |
+
defaults.textarea.value = data;
|
262 |
+
}
|
263 |
+
},
|
264 |
+
fenceRange: function(){
|
265 |
+
if(typeof defaults.fence == "string"){
|
266 |
+
|
267 |
+
var data = utils.editor.get(),
|
268 |
+
pos = utils.cursor.get(),
|
269 |
+
hacked = 0,
|
270 |
+
matchedFence = data.indexOf(defaults.fence),
|
271 |
+
matchCase = 0;
|
272 |
+
|
273 |
+
while(matchedFence>=0){
|
274 |
+
matchCase++;
|
275 |
+
if( pos < (matchedFence+hacked) ){
|
276 |
+
break;
|
277 |
+
}
|
278 |
+
|
279 |
+
hacked += matchedFence+defaults.fence.length;
|
280 |
+
data = data.substring(matchedFence+defaults.fence.length);
|
281 |
+
matchedFence = data.indexOf(defaults.fence);
|
282 |
+
|
283 |
+
}
|
284 |
+
|
285 |
+
if( (hacked) < pos && ( (matchedFence+hacked) > pos ) && matchCase%2===0){
|
286 |
+
return true;
|
287 |
+
}
|
288 |
+
return false;
|
289 |
+
} else {
|
290 |
+
return true;
|
291 |
+
}
|
292 |
+
},
|
293 |
+
isEven: function(_this,i){
|
294 |
+
return i%2;
|
295 |
+
},
|
296 |
+
levelsDeep: function(){
|
297 |
+
var pos = utils.cursor.get(),
|
298 |
+
val = utils.editor.get();
|
299 |
+
|
300 |
+
var left = val.substring(0, pos),
|
301 |
+
levels = 0,
|
302 |
+
i, j;
|
303 |
+
|
304 |
+
for(i=0; i<left.length; i++){
|
305 |
+
for (j=0; j<charSettings.keyMap.length; j++) {
|
306 |
+
if(charSettings.keyMap[j].canBreak){
|
307 |
+
if(charSettings.keyMap[j].open == left.charAt(i)){
|
308 |
+
levels++;
|
309 |
+
}
|
310 |
+
|
311 |
+
if(charSettings.keyMap[j].close == left.charAt(i)){
|
312 |
+
levels--;
|
313 |
+
}
|
314 |
+
}
|
315 |
+
}
|
316 |
+
}
|
317 |
+
|
318 |
+
var toDecrement = 0,
|
319 |
+
quoteMap = ["'", "\""];
|
320 |
+
for(i=0; i<charSettings.keyMap.length; i++) {
|
321 |
+
if(charSettings.keyMap[i].canBreak){
|
322 |
+
for(j in quoteMap){
|
323 |
+
toDecrement += left.split(quoteMap[j]).filter(utils.isEven).join('').split(charSettings.keyMap[i].open).length - 1;
|
324 |
+
}
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
var finalLevels = levels - toDecrement;
|
329 |
+
|
330 |
+
return finalLevels >=0 ? finalLevels : 0;
|
331 |
+
},
|
332 |
+
deepExtend: function(destination, source) {
|
333 |
+
for (var property in source) {
|
334 |
+
if (source[property] && source[property].constructor &&
|
335 |
+
source[property].constructor === Object) {
|
336 |
+
destination[property] = destination[property] || {};
|
337 |
+
utils.deepExtend(destination[property], source[property]);
|
338 |
+
} else {
|
339 |
+
destination[property] = source[property];
|
340 |
+
}
|
341 |
+
}
|
342 |
+
return destination;
|
343 |
+
},
|
344 |
+
addEvent: function addEvent(element, eventName, func) {
|
345 |
+
if (element.addEventListener){
|
346 |
+
element.addEventListener(eventName,func,false);
|
347 |
+
} else if (element.attachEvent) {
|
348 |
+
element.attachEvent("on"+eventName, func);
|
349 |
+
}
|
350 |
+
},
|
351 |
+
removeEvent: function addEvent(element, eventName, func){
|
352 |
+
if (element.addEventListener){
|
353 |
+
element.removeEventListener(eventName,func,false);
|
354 |
+
} else if (element.attachEvent) {
|
355 |
+
element.detachEvent("on"+eventName, func);
|
356 |
+
}
|
357 |
+
},
|
358 |
+
|
359 |
+
preventDefaultEvent: function(e){
|
360 |
+
if(e.preventDefault){
|
361 |
+
e.preventDefault();
|
362 |
+
} else {
|
363 |
+
e.returnValue = false;
|
364 |
+
}
|
365 |
+
}
|
366 |
+
},
|
367 |
+
intercept = {
|
368 |
+
tabKey: function (e) {
|
369 |
+
|
370 |
+
if(!utils.fenceRange()){ return; }
|
371 |
+
|
372 |
+
if (e.keyCode == 9) {
|
373 |
+
utils.preventDefaultEvent(e);
|
374 |
+
|
375 |
+
var toReturn = true;
|
376 |
+
utils._callHook('tab:before');
|
377 |
+
|
378 |
+
var selection = utils.cursor.selection(),
|
379 |
+
pos = utils.cursor.get(),
|
380 |
+
val = utils.editor.get();
|
381 |
+
|
382 |
+
if(selection){
|
383 |
+
|
384 |
+
var tempStart = selection.start;
|
385 |
+
while(tempStart--){
|
386 |
+
if(val.charAt(tempStart)=="\n"){
|
387 |
+
selection.start = tempStart + 1;
|
388 |
+
break;
|
389 |
+
}
|
390 |
+
}
|
391 |
+
|
392 |
+
var toIndent = val.substring(selection.start, selection.end),
|
393 |
+
lines = toIndent.split("\n"),
|
394 |
+
i;
|
395 |
+
|
396 |
+
if(e.shiftKey){
|
397 |
+
for(i = 0; i<lines.length; i++){
|
398 |
+
if(lines[i].substring(0,tab.length) == tab){
|
399 |
+
lines[i] = lines[i].substring(tab.length);
|
400 |
+
}
|
401 |
+
}
|
402 |
+
toIndent = lines.join("\n");
|
403 |
+
|
404 |
+
utils.editor.set( val.substring(0,selection.start) + toIndent + val.substring(selection.end) );
|
405 |
+
utils.cursor.set(selection.start, selection.start+toIndent.length);
|
406 |
+
|
407 |
+
} else {
|
408 |
+
for(i in lines){
|
409 |
+
lines[i] = tab + lines[i];
|
410 |
+
}
|
411 |
+
toIndent = lines.join("\n");
|
412 |
+
|
413 |
+
utils.editor.set( val.substring(0,selection.start) + toIndent + val.substring(selection.end) );
|
414 |
+
utils.cursor.set(selection.start, selection.start+toIndent.length);
|
415 |
+
}
|
416 |
+
} else {
|
417 |
+
var left = val.substring(0, pos),
|
418 |
+
right = val.substring(pos),
|
419 |
+
edited = left + tab + right;
|
420 |
+
|
421 |
+
if(e.shiftKey){
|
422 |
+
if(val.substring(pos-tab.length, pos) == tab){
|
423 |
+
edited = val.substring(0, pos-tab.length) + right;
|
424 |
+
utils.editor.set(edited);
|
425 |
+
utils.cursor.set(pos-tab.length);
|
426 |
+
}
|
427 |
+
} else {
|
428 |
+
utils.editor.set(edited);
|
429 |
+
utils.cursor.set(pos + tab.length);
|
430 |
+
toReturn = false;
|
431 |
+
}
|
432 |
+
}
|
433 |
+
utils._callHook('tab:after');
|
434 |
+
}
|
435 |
+
return toReturn;
|
436 |
+
},
|
437 |
+
enterKey: function (e) {
|
438 |
+
|
439 |
+
if(!utils.fenceRange()){ return; }
|
440 |
+
|
441 |
+
if (e.keyCode == 13) {
|
442 |
+
|
443 |
+
utils.preventDefaultEvent(e);
|
444 |
+
utils._callHook('enter:before');
|
445 |
+
|
446 |
+
var pos = utils.cursor.get(),
|
447 |
+
val = utils.editor.get(),
|
448 |
+
left = val.substring(0, pos),
|
449 |
+
right = val.substring(pos),
|
450 |
+
leftChar = left.charAt(left.length - 1),
|
451 |
+
rightChar = right.charAt(0),
|
452 |
+
numTabs = utils.levelsDeep(),
|
453 |
+
ourIndent = "",
|
454 |
+
closingBreak = "",
|
455 |
+
finalCursorPos,
|
456 |
+
i;
|
457 |
+
if(!numTabs){
|
458 |
+
finalCursorPos = 1;
|
459 |
+
} else {
|
460 |
+
while(numTabs--){
|
461 |
+
ourIndent+=tab;
|
462 |
+
}
|
463 |
+
ourIndent = ourIndent;
|
464 |
+
finalCursorPos = ourIndent.length + 1;
|
465 |
+
|
466 |
+
for(i=0; i<charSettings.keyMap.length; i++) {
|
467 |
+
if (charSettings.keyMap[i].open == leftChar && charSettings.keyMap[i].close == rightChar){
|
468 |
+
closingBreak = newLine;
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
}
|
473 |
+
|
474 |
+
var edited = left + newLine + ourIndent + closingBreak + (ourIndent.substring(0, ourIndent.length-tab.length) ) + right;
|
475 |
+
utils.editor.set(edited);
|
476 |
+
utils.cursor.set(pos + finalCursorPos);
|
477 |
+
utils._callHook('enter:after');
|
478 |
+
}
|
479 |
+
},
|
480 |
+
deleteKey: function (e) {
|
481 |
+
|
482 |
+
if(!utils.fenceRange()){ return; }
|
483 |
+
|
484 |
+
if(e.keyCode == 8){
|
485 |
+
utils.preventDefaultEvent(e);
|
486 |
+
|
487 |
+
utils._callHook('delete:before');
|
488 |
+
|
489 |
+
var pos = utils.cursor.get(),
|
490 |
+
val = utils.editor.get(),
|
491 |
+
left = val.substring(0, pos),
|
492 |
+
right = val.substring(pos),
|
493 |
+
leftChar = left.charAt(left.length - 1),
|
494 |
+
rightChar = right.charAt(0),
|
495 |
+
i;
|
496 |
+
|
497 |
+
if( utils.cursor.selection() === false ){
|
498 |
+
for(i=0; i<charSettings.keyMap.length; i++) {
|
499 |
+
if (charSettings.keyMap[i].open == leftChar && charSettings.keyMap[i].close == rightChar) {
|
500 |
+
var edited = val.substring(0,pos-1) + val.substring(pos+1);
|
501 |
+
utils.editor.set(edited);
|
502 |
+
utils.cursor.set(pos - 1);
|
503 |
+
return;
|
504 |
+
}
|
505 |
+
}
|
506 |
+
var edited = val.substring(0,pos-1) + val.substring(pos);
|
507 |
+
utils.editor.set(edited);
|
508 |
+
utils.cursor.set(pos - 1);
|
509 |
+
} else {
|
510 |
+
var sel = utils.cursor.selection(),
|
511 |
+
edited = val.substring(0,sel.start) + val.substring(sel.end);
|
512 |
+
utils.editor.set(edited);
|
513 |
+
utils.cursor.set(pos);
|
514 |
+
}
|
515 |
+
|
516 |
+
utils._callHook('delete:after');
|
517 |
+
|
518 |
+
}
|
519 |
+
}
|
520 |
+
},
|
521 |
+
charFuncs = {
|
522 |
+
openedChar: function (_char, e) {
|
523 |
+
utils.preventDefaultEvent(e);
|
524 |
+
utils._callHook('openChar:before');
|
525 |
+
var pos = utils.cursor.get(),
|
526 |
+
val = utils.editor.get(),
|
527 |
+
left = val.substring(0, pos),
|
528 |
+
right = val.substring(pos),
|
529 |
+
edited = left + _char.open + _char.close + right;
|
530 |
+
|
531 |
+
defaults.textarea.value = edited;
|
532 |
+
utils.cursor.set(pos + 1);
|
533 |
+
utils._callHook('openChar:after');
|
534 |
+
},
|
535 |
+
closedChar: function (_char, e) {
|
536 |
+
var pos = utils.cursor.get(),
|
537 |
+
val = utils.editor.get(),
|
538 |
+
toOverwrite = val.substring(pos, pos + 1);
|
539 |
+
if (toOverwrite == _char.close) {
|
540 |
+
utils.preventDefaultEvent(e);
|
541 |
+
utils._callHook('closeChar:before');
|
542 |
+
utils.cursor.set(utils.cursor.get() + 1);
|
543 |
+
utils._callHook('closeChar:after');
|
544 |
+
return true;
|
545 |
+
}
|
546 |
+
return false;
|
547 |
+
}
|
548 |
+
},
|
549 |
+
action = {
|
550 |
+
filter: function (e) {
|
551 |
+
|
552 |
+
if(!utils.fenceRange()){ return; }
|
553 |
+
|
554 |
+
var theCode = e.which || e.keyCode;
|
555 |
+
|
556 |
+
if(theCode == 39 || theCode == 40 && e.which===0){ return; }
|
557 |
+
|
558 |
+
var _char = String.fromCharCode(theCode),
|
559 |
+
i;
|
560 |
+
|
561 |
+
for(i=0; i<charSettings.keyMap.length; i++) {
|
562 |
+
|
563 |
+
if (charSettings.keyMap[i].close == _char) {
|
564 |
+
var didClose = defaults.overwrite && charFuncs.closedChar(charSettings.keyMap[i], e);
|
565 |
+
|
566 |
+
if (!didClose && charSettings.keyMap[i].open == _char && defaults.autoOpen) {
|
567 |
+
charFuncs.openedChar(charSettings.keyMap[i], e);
|
568 |
+
}
|
569 |
+
} else if (charSettings.keyMap[i].open == _char && defaults.autoOpen) {
|
570 |
+
charFuncs.openedChar(charSettings.keyMap[i], e);
|
571 |
+
}
|
572 |
+
}
|
573 |
+
},
|
574 |
+
listen: function () {
|
575 |
+
|
576 |
+
if(defaults.replaceTab){ utils.addEvent(defaults.textarea, 'keydown', intercept.tabKey); }
|
577 |
+
if(defaults.autoIndent){ utils.addEvent(defaults.textarea, 'keydown', intercept.enterKey); }
|
578 |
+
if(defaults.autoStrip){ utils.addEvent(defaults.textarea, 'keydown', intercept.deleteKey); }
|
579 |
+
|
580 |
+
utils.addEvent(defaults.textarea, 'keypress', action.filter);
|
581 |
+
|
582 |
+
utils.addEvent(defaults.textarea, 'keydown', function(){ utils._callHook('keydown'); });
|
583 |
+
utils.addEvent(defaults.textarea, 'keyup', function(){ utils._callHook('keyup'); });
|
584 |
+
}
|
585 |
+
},
|
586 |
+
init = function (opts) {
|
587 |
+
|
588 |
+
if(opts.textarea){
|
589 |
+
utils._callHook('init:before', false);
|
590 |
+
utils.deepExtend(defaults, opts);
|
591 |
+
utils.defineNewLine();
|
592 |
+
|
593 |
+
if (defaults.softTabs) {
|
594 |
+
tab = " ".repeat(defaults.tabSize);
|
595 |
+
} else {
|
596 |
+
tab = "\t";
|
597 |
+
|
598 |
+
utils.defineTabSize(defaults.tabSize);
|
599 |
+
}
|
600 |
+
|
601 |
+
action.listen();
|
602 |
+
utils._callHook('init:after', false);
|
603 |
+
}
|
604 |
+
|
605 |
+
};
|
606 |
+
|
607 |
+
this.destroy = function(){
|
608 |
+
utils.removeEvent(defaults.textarea, 'keydown', intercept.tabKey);
|
609 |
+
utils.removeEvent(defaults.textarea, 'keydown', intercept.enterKey);
|
610 |
+
utils.removeEvent(defaults.textarea, 'keydown', intercept.deleteKey);
|
611 |
+
utils.removeEvent(defaults.textarea, 'keypress', action.filter);
|
612 |
+
};
|
613 |
+
|
614 |
+
init(userOpts);
|
615 |
+
|
616 |
+
};
|
617 |
+
|
618 |
+
if (typeof module !== 'undefined' && module.exports) {
|
619 |
+
module.exports = Behave;
|
620 |
+
}
|
621 |
+
|
622 |
+
if (typeof ender === 'undefined') {
|
623 |
+
this.Behave = Behave;
|
624 |
+
this.BehaveHooks = BehaveHooks;
|
625 |
+
}
|
626 |
+
|
627 |
+
if (typeof define === "function" && define.amd) {
|
628 |
+
define("behave", [], function () {
|
629 |
+
return Behave;
|
630 |
+
});
|
631 |
+
}
|
632 |
|
633 |
}).call(this);
|
634 |
|
635 |
+
/* global jQuery, soWidgets */
|
636 |
|
637 |
( function( $ ) {
|
638 |
|
639 |
+
$(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-code', function(e) {
|
640 |
+
var $$ = $( this );
|
641 |
+
new Behave({
|
642 |
+
textarea: $$.find( '.siteorigin-widget-code-input' ).get( 0 ),
|
643 |
+
});
|
644 |
+
} );
|
645 |
|
646 |
} )( jQuery );
|
base/inc/fields/js/date-range-field.js
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global jQuery, soWidgets */
|
2 |
+
|
3 |
+
(function( $ ) {
|
4 |
+
$( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-date-range', function ( e ) {
|
5 |
+
|
6 |
+
var valField = $( this ).find( 'input[type="hidden"][class="siteorigin-widget-input"]' );
|
7 |
+
|
8 |
+
if ( $( this ).find( '[class*="sowb-specific-date"]' ).length > 0 ) {
|
9 |
+
var createPikadayInput = function ( inputName, initVal ) {
|
10 |
+
var $field = $( this ).find( '.' + inputName + '-picker' );
|
11 |
+
var picker = new Pikaday( {
|
12 |
+
field: $field[ 0 ],
|
13 |
+
blurFieldOnSelect: false,
|
14 |
+
onSelect: function ( date ) {
|
15 |
+
var curVal = valField.val() === '' ? {} : JSON.parse( valField.val() );
|
16 |
+
curVal[ inputName ] = date.toLocaleDateString( {}, {
|
17 |
+
year: 'numeric',
|
18 |
+
month: '2-digit',
|
19 |
+
day: '2-digit'
|
20 |
+
} );
|
21 |
+
$field.val( curVal[ inputName ] );
|
22 |
+
valField.val( JSON.stringify( curVal ) );
|
23 |
+
valField.trigger( 'change', { silent: true } );
|
24 |
+
},
|
25 |
+
} );
|
26 |
+
|
27 |
+
// We trigger the change event on the hidden value field, so prevent 'change' from individual date inputs.
|
28 |
+
$field.change( function ( event ) {
|
29 |
+
event.preventDefault();
|
30 |
+
return false;
|
31 |
+
} );
|
32 |
+
|
33 |
+
if ( initVal ) {
|
34 |
+
$field.val( initVal );
|
35 |
+
}
|
36 |
+
return picker;
|
37 |
+
}.bind( this );
|
38 |
+
|
39 |
+
var initRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
|
40 |
+
var afterPicker = createPikadayInput( 'after', initRange.after );
|
41 |
+
var beforePicker = createPikadayInput( 'before', initRange.before );
|
42 |
+
|
43 |
+
valField.change( function ( event, data ) {
|
44 |
+
if ( ! ( data && data.silent ) ) {
|
45 |
+
var newRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
|
46 |
+
afterPicker.setDate( newRange.after );
|
47 |
+
beforePicker.setDate( newRange.before );
|
48 |
+
}
|
49 |
+
} );
|
50 |
+
} else if ( $( this ).find( '.sowb-relative-date' ).length > 0 ) {
|
51 |
+
|
52 |
+
$( this ).find( '.sowb-relative-date' ).each( function () {
|
53 |
+
var $name = $( this ).data( 'name' );
|
54 |
+
|
55 |
+
$( this ).change( function () {
|
56 |
+
var range = valField.val() === '' ? {} : JSON.parse( valField.val() );
|
57 |
+
|
58 |
+
if ( ! range.hasOwnProperty( $name ) ) {
|
59 |
+
range[ $name ] = {};
|
60 |
+
}
|
61 |
+
|
62 |
+
range[ $name ][ 'value' ] = $( this ).find( '> input' ).val();
|
63 |
+
range[ $name ][ 'unit' ] = $( this ).find( '> select' ).val();
|
64 |
+
|
65 |
+
valField.val( JSON.stringify( range ) );
|
66 |
+
valField.trigger( 'change', { silent: true } );
|
67 |
+
}.bind( this ) );
|
68 |
+
|
69 |
+
valField.change( function ( event, data ) {
|
70 |
+
if ( ! ( data && data.silent ) ) {
|
71 |
+
var range = valField.val() === '' ? { from: {}, to: {} } : JSON.parse( valField.val() );
|
72 |
+
|
73 |
+
if ( range.hasOwnProperty( $name ) ) {
|
74 |
+
$( this ).find( '> input' ).val( range[ $name ][ 'value' ] );
|
75 |
+
$( this ).find( '> select' ).val( range[ $name ][ 'unit' ] );
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}.bind( this ) );
|
79 |
+
|
80 |
+
} );
|
81 |
+
}
|
82 |
+
} );
|
83 |
+
})( jQuery );
|
base/inc/fields/js/date-range-field.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",function(t){var i=e(this).find('input[type="hidden"][class="siteorigin-widget-input"]');if(e(this).find('[class*="sowb-specific-date"]').length>0){var a=function(t,a){var n=e(this).find("."+t+"-picker"),r=new Pikaday({field:n[0],blurFieldOnSelect:!1,onSelect:function(e){var a=""===i.val()?{}:JSON.parse(i.val());a[t]=e.toLocaleDateString({},{year:"numeric",month:"2-digit",day:"2-digit"}),n.val(a[t]),i.val(JSON.stringify(a)),i.trigger("change",{silent:!0})}});return n.change(function(e){return e.preventDefault(),!1}),a&&n.val(a),r}.bind(this),n=""===i.val()?{after:"",before:""}:JSON.parse(i.val()),r=a("after",n.after),s=a("before",n.before);i.change(function(e,t){if(!t||!t.silent){var a=""===i.val()?{after:"",before:""}:JSON.parse(i.val());r.setDate(a.after),s.setDate(a.before)}})}else e(this).find(".sowb-relative-date").length>0&&e(this).find(".sowb-relative-date").each(function(){var t=e(this).data("name");e(this).change(function(){var a=""===i.val()?{}:JSON.parse(i.val());a.hasOwnProperty(t)||(a[t]={}),a[t].value=e(this).find("> input").val(),a[t].unit=e(this).find("> select").val(),i.val(JSON.stringify(a)),i.trigger("change",{silent:!0})}.bind(this)),i.change(function(a,n){if(!n||!n.silent){var r=""===i.val()?{from:{},to:{}}:JSON.parse(i.val());r.hasOwnProperty(t)&&(e(this).find("> input").val(r[t].value),e(this).find("> select").val(r[t].unit))}}.bind(this))})})}(jQuery);
|
base/inc/fields/js/icon-field.js
CHANGED
@@ -1,168 +1,177 @@
|
|
|
|
|
|
1 |
( function( $ ) {
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
} )( jQuery );
|
1 |
+
/* global jQuery, soWidgets */
|
2 |
+
|
3 |
( function( $ ) {
|
4 |
|
5 |
+
var iconWidgetCache = {};
|
6 |
+
|
7 |
+
$(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-icon', function(e) {
|
8 |
+
var $$ = $(this),
|
9 |
+
$is = $$.find('.siteorigin-widget-icon-selector'),
|
10 |
+
$v = $is.find('.siteorigin-widget-icon-icon'),
|
11 |
+
$b = $$.find('.siteorigin-widget-icon-selector-current'),
|
12 |
+
$remove = $$.find( '.so-icon-remove' ),
|
13 |
+
$search = $$.find( '.siteorigin-widget-icon-search' );
|
14 |
+
|
15 |
+
// Clicking on the button should display the icon selector
|
16 |
+
$b.click( function(){
|
17 |
+
$is.slideToggle();
|
18 |
+
$search.val( '' );
|
19 |
+
searchIcons();
|
20 |
+
} );
|
21 |
+
|
22 |
+
// Clicking on the remove button
|
23 |
+
$remove.click( function( e ){
|
24 |
+
e.preventDefault();
|
25 |
+
|
26 |
+
// Trigger a click on the existing icon to remove it.
|
27 |
+
$$.find('.siteorigin-widget-active').click();
|
28 |
+
} );
|
29 |
+
|
30 |
+
var searchIcons = function(){
|
31 |
+
var q = $search.val().toLowerCase();
|
32 |
+
if( q === '' ) {
|
33 |
+
$is.find('.siteorigin-widget-icon-icons-icon').show();
|
34 |
+
}
|
35 |
+
else {
|
36 |
+
$is.find('.siteorigin-widget-icon-icons-icon').each( function(){
|
37 |
+
var $$ = $( this ),
|
38 |
+
value = $$.attr( 'data-value' );
|
39 |
+
|
40 |
+
value = value.replace( /-/, ' ' );
|
41 |
+
if( value.indexOf( q ) === -1 ) {
|
42 |
+
$$.hide();
|
43 |
+
}
|
44 |
+
else {
|
45 |
+
$$.show();
|
46 |
+
}
|
47 |
+
} );
|
48 |
+
}
|
49 |
+
};
|
50 |
+
|
51 |
+
$search.keyup( searchIcons ).change( searchIcons );
|
52 |
+
|
53 |
+
var rerenderIcons = function() {
|
54 |
+
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
55 |
+
var container = $is.find('.siteorigin-widget-icon-icons');
|
56 |
+
|
57 |
+
if(typeof iconWidgetCache[family] === 'undefined') {
|
58 |
+
return;
|
59 |
+
}
|
60 |
+
|
61 |
+
container.empty();
|
62 |
+
|
63 |
+
if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
|
64 |
+
|
65 |
+
$("<link rel='stylesheet' type='text/css'>")
|
66 |
+
.attr('id', 'siteorigin-widget-font-' + family)
|
67 |
+
.attr('href', iconWidgetCache[family].style_uri)
|
68 |
+
.appendTo('head');
|
69 |
+
}
|
70 |
+
|
71 |
+
for ( var i in iconWidgetCache[family].icons ) {
|
72 |
+
|
73 |
+
var icon = $('<div data-sow-icon="' + iconWidgetCache[family].icons[i] + '"/>')
|
74 |
+
.attr('data-value', family + '-' + i)
|
75 |
+
.addClass( 'sow-icon-' + family )
|
76 |
+
.addClass( 'siteorigin-widget-icon-icons-icon' )
|
77 |
+
.click(function(){
|
78 |
+
var $$ = $(this);
|
79 |
+
|
80 |
+
if( $$.hasClass('siteorigin-widget-active') ) {
|
81 |
+
// This is being unselected
|
82 |
+
$$.removeClass('siteorigin-widget-active');
|
83 |
+
$v.val( '' );
|
84 |
+
|
85 |
+
// Hide the button icon
|
86 |
+
$b.find('span').hide();
|
87 |
+
|
88 |
+
$remove.hide();
|
89 |
+
}
|
90 |
+
else {
|
91 |
+
// This is being selected
|
92 |
+
container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
|
93 |
+
$$.addClass('siteorigin-widget-active');
|
94 |
+
$v.val( $$.data('value') );
|
95 |
+
|
96 |
+
// Also add this to the button
|
97 |
+
$b.find('span')
|
98 |
+
.show()
|
99 |
+
.attr( 'data-sow-icon', $$.attr('data-sow-icon') )
|
100 |
+
.attr( 'class', '' )
|
101 |
+
.addClass( 'sow-icon-' + family );
|
102 |
+
|
103 |
+
$remove.show();
|
104 |
+
}
|
105 |
+
|
106 |
+
$v.trigger( 'change', { isRendering: true });
|
107 |
+
|
108 |
+
// Hide the icon selector
|
109 |
+
$is.slideUp();
|
110 |
+
});
|
111 |
+
|
112 |
+
container.append(icon);
|
113 |
+
|
114 |
+
if( $v.val() === family + '-' + i ) {
|
115 |
+
// Add selected icon to the button.
|
116 |
+
$b.find('span')
|
117 |
+
.show()
|
118 |
+
.attr( 'data-sow-icon', icon.attr('data-sow-icon') )
|
119 |
+
.attr( 'class', '' )
|
120 |
+
.addClass( 'sow-icon-' + family );
|
121 |
+
icon.addClass('siteorigin-widget-active');
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
// Move a selected item to the first position
|
126 |
+
container.prepend( container.find('.siteorigin-widget-active') );
|
127 |
+
|
128 |
+
searchIcons();
|
129 |
+
};
|
130 |
+
|
131 |
+
// Create the function for changing the icon family and call it once
|
132 |
+
var changeIconFamily = function(){
|
133 |
+
// Fetch the family icons from the server
|
134 |
+
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
135 |
+
|
136 |
+
var dataIcons = $is.find('select.siteorigin-widget-icon-family option:selected' ).data('icons');
|
137 |
+
if( dataIcons !== null ) {
|
138 |
+
iconWidgetCache[family] = dataIcons;
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
if(typeof family === 'undefined' || family === '') {
|
143 |
+
return;
|
144 |
+
}
|
145 |
+
|
146 |
+
if(typeof iconWidgetCache[family] === 'undefined') {
|
147 |
+
$.getJSON(
|
148 |
+
soWidgets.ajaxurl,
|
149 |
+
{
|
150 |
+
'action' : 'siteorigin_widgets_get_icons',
|
151 |
+
'family' : $is.find('select.siteorigin-widget-icon-family').val()
|
152 |
+
},
|
153 |
+
function(data) {
|
154 |
+
iconWidgetCache[family] = data;
|
155 |
+
rerenderIcons();
|
156 |
+
}
|
157 |
+
);
|
158 |
+
}
|
159 |
+
else {
|
160 |
+
rerenderIcons();
|
161 |
+
}
|
162 |
+
};
|
163 |
+
changeIconFamily();
|
164 |
+
|
165 |
+
$is.find('select.siteorigin-widget-icon-family').change(function(){
|
166 |
+
$is.find('.siteorigin-widget-icon-icons').empty();
|
167 |
+
changeIconFamily();
|
168 |
+
});
|
169 |
+
|
170 |
+
$v.change( function ( event, data ) {
|
171 |
+
if ( ! ( data && data.isRendering ) ) {
|
172 |
+
rerenderIcons();
|
173 |
+
}
|
174 |
+
} );
|
175 |
+
} );
|
176 |
|
177 |
} )( jQuery );
|
base/inc/fields/js/icon-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(
|
1 |
+
!function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(n){var t=i(this),o=t.find(".siteorigin-widget-icon-selector"),s=o.find(".siteorigin-widget-icon-icon"),a=t.find(".siteorigin-widget-icon-selector-current"),d=t.find(".so-icon-remove"),c=t.find(".siteorigin-widget-icon-search");a.click(function(){o.slideToggle(),c.val(""),r()}),d.click(function(i){i.preventDefault(),t.find(".siteorigin-widget-active").click()});var r=function(){var e=c.val().toLowerCase();""===e?o.find(".siteorigin-widget-icon-icons-icon").show():o.find(".siteorigin-widget-icon-icons-icon").each(function(){var n=i(this),t=n.attr("data-value");t=t.replace(/-/," "),t.indexOf(e)===-1?n.hide():n.show()})};c.keyup(r).change(r);var g=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find(".siteorigin-widget-icon-icons");if("undefined"!=typeof e[n]){t.empty(),0===i("#siteorigin-widget-font-"+n).length&&i("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+n).attr("href",e[n].style_uri).appendTo("head");for(var c in e[n].icons){var g=i('<div data-sow-icon="'+e[n].icons[c]+'"/>').attr("data-value",n+"-"+c).addClass("sow-icon-"+n).addClass("siteorigin-widget-icon-icons-icon").click(function(){var e=i(this);e.hasClass("siteorigin-widget-active")?(e.removeClass("siteorigin-widget-active"),s.val(""),a.find("span").hide(),d.hide()):(t.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),e.addClass("siteorigin-widget-active"),s.val(e.data("value")),a.find("span").show().attr("data-sow-icon",e.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),d.show()),s.trigger("change",{isRendering:!0}),o.slideUp()});t.append(g),s.val()===n+"-"+c&&(a.find("span").show().attr("data-sow-icon",g.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),g.addClass("siteorigin-widget-active"))}t.prepend(t.find(".siteorigin-widget-active")),r()}},l=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==t&&(e[n]=t),"undefined"!=typeof n&&""!==n&&("undefined"==typeof e[n]?i.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:o.find("select.siteorigin-widget-icon-family").val()},function(i){e[n]=i,g()}):g())};l(),o.find("select.siteorigin-widget-icon-family").change(function(){o.find(".siteorigin-widget-icon-icons").empty(),l()}),s.change(function(i,e){e&&e.isRendering||g()})})}(jQuery);
|
base/inc/fields/js/lib/pikaday/pikaday.css
ADDED
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "UTF-8";
|
2 |
+
|
3 |
+
/*!
|
4 |
+
* Pikaday
|
5 |
+
* Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
|
6 |
+
*/
|
7 |
+
|
8 |
+
.pika-single {
|
9 |
+
z-index: 9999;
|
10 |
+
display: block;
|
11 |
+
position: relative;
|
12 |
+
color: #333;
|
13 |
+
background: #fff;
|
14 |
+
border: 1px solid #ccc;
|
15 |
+
border-bottom-color: #bbb;
|
16 |
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
17 |
+
}
|
18 |
+
|
19 |
+
/*
|
20 |
+
clear child float (pika-lendar), using the famous micro clearfix hack
|
21 |
+
http://nicolasgallagher.com/micro-clearfix-hack/
|
22 |
+
*/
|
23 |
+
.pika-single:before,
|
24 |
+
.pika-single:after {
|
25 |
+
content: " ";
|
26 |
+
display: table;
|
27 |
+
}
|
28 |
+
.pika-single:after { clear: both }
|
29 |
+
.pika-single { *zoom: 1 }
|
30 |
+
|
31 |
+
.pika-single.is-hidden {
|
32 |
+
display: none;
|
33 |
+
}
|
34 |
+
|
35 |
+
.pika-single.is-bound {
|
36 |
+
position: absolute;
|
37 |
+
box-shadow: 0 5px 15px -5px rgba(0,0,0,.5);
|
38 |
+
}
|
39 |
+
|
40 |
+
.pika-lendar {
|
41 |
+
float: left;
|
42 |
+
width: 240px;
|
43 |
+
margin: 8px;
|
44 |
+
}
|
45 |
+
|
46 |
+
.pika-title {
|
47 |
+
position: relative;
|
48 |
+
text-align: center;
|
49 |
+
}
|
50 |
+
|
51 |
+
.pika-label {
|
52 |
+
display: inline-block;
|
53 |
+
*display: inline;
|
54 |
+
position: relative;
|
55 |
+
z-index: 9999;
|
56 |
+
overflow: hidden;
|
57 |
+
margin: 0;
|
58 |
+
padding: 5px 3px;
|
59 |
+
font-size: 14px;
|
60 |
+
line-height: 20px;
|
61 |
+
font-weight: bold;
|
62 |
+
background-color: #fff;
|
63 |
+
}
|
64 |
+
.pika-title select {
|
65 |
+
cursor: pointer;
|
66 |
+
position: absolute;
|
67 |
+
z-index: 9998;
|
68 |
+
margin: 0;
|
69 |
+
left: 0;
|
70 |
+
top: 5px;
|
71 |
+
filter: alpha(opacity=0);
|
72 |
+
opacity: 0;
|
73 |
+
}
|
74 |
+
|
75 |
+
.pika-prev,
|
76 |
+
.pika-next {
|
77 |
+
display: block;
|
78 |
+
cursor: pointer;
|
79 |
+
position: relative;
|
80 |
+
outline: none;
|
81 |
+
border: 0;
|
82 |
+
padding: 0;
|
83 |
+
width: 20px;
|
84 |
+
height: 30px;
|
85 |
+
/* hide text using text-indent trick, using width value (it's enough) */
|
86 |
+
text-indent: 20px;
|
87 |
+
white-space: nowrap;
|
88 |
+
overflow: hidden;
|
89 |
+
background-color: transparent;
|
90 |
+
background-position: center center;
|
91 |
+
background-repeat: no-repeat;
|
92 |
+
background-size: 75% 75%;
|
93 |
+
opacity: .5;
|
94 |
+
*position: absolute;
|
95 |
+
*top: 0;
|
96 |
+
}
|
97 |
+
|
98 |
+
.pika-prev:hover,
|
99 |
+
.pika-next:hover {
|
100 |
+
opacity: 1;
|
101 |
+
}
|
102 |
+
|
103 |
+
.pika-prev,
|
104 |
+
.is-rtl .pika-next {
|
105 |
+
float: left;
|
106 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==');
|
107 |
+
*left: 0;
|
108 |
+
}
|
109 |
+
|
110 |
+
.pika-next,
|
111 |
+
.is-rtl .pika-prev {
|
112 |
+
float: right;
|
113 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=');
|
114 |
+
*right: 0;
|
115 |
+
}
|
116 |
+
|
117 |
+
.pika-prev.is-disabled,
|
118 |
+
.pika-next.is-disabled {
|
119 |
+
cursor: default;
|
120 |
+
opacity: .2;
|
121 |
+
}
|
122 |
+
|
123 |
+
.pika-select {
|
124 |
+
display: inline-block;
|
125 |
+
*display: inline;
|
126 |
+
}
|
127 |
+
|
128 |
+
.pika-table {
|
129 |
+
width: 100%;
|
130 |
+
border-collapse: collapse;
|
131 |
+
border-spacing: 0;
|
132 |
+
border: 0;
|
133 |
+
}
|
134 |
+
|
135 |
+
.pika-table th,
|
136 |
+
.pika-table td {
|
137 |
+
width: 14.285714285714286%;
|
138 |
+
padding: 0;
|
139 |
+
}
|
140 |
+
|
141 |
+
.pika-table th {
|
142 |
+
color: #999;
|
143 |
+
font-size: 12px;
|
144 |
+
line-height: 25px;
|
145 |
+
font-weight: bold;
|
146 |
+
text-align: center;
|
147 |
+
}
|
148 |
+
|
149 |
+
.pika-button {
|
150 |
+
cursor: pointer;
|
151 |
+
display: block;
|
152 |
+
box-sizing: border-box;
|
153 |
+
-moz-box-sizing: border-box;
|
154 |
+
outline: none;
|
155 |
+
border: 0;
|
156 |
+
margin: 0;
|
157 |
+
width: 100%;
|
158 |
+
padding: 5px;
|
159 |
+
color: #666;
|
160 |
+
font-size: 12px;
|
161 |
+
line-height: 15px;
|
162 |
+
text-align: right;
|
163 |
+
background: #f5f5f5;
|
164 |
+
}
|
165 |
+
|
166 |
+
.pika-week {
|
167 |
+
font-size: 11px;
|
168 |
+
color: #999;
|
169 |
+
}
|
170 |
+
|
171 |
+
.is-today .pika-button {
|
172 |
+
color: #33aaff;
|
173 |
+
font-weight: bold;
|
174 |
+
}
|
175 |
+
|
176 |
+
.is-selected .pika-button {
|
177 |
+
color: #fff;
|
178 |
+
font-weight: bold;
|
179 |
+
background: #33aaff;
|
180 |
+
box-shadow: inset 0 1px 3px #178fe5;
|
181 |
+
border-radius: 3px;
|
182 |
+
}
|
183 |
+
|
184 |
+
.is-inrange .pika-button {
|
185 |
+
background: #D5E9F7;
|
186 |
+
}
|
187 |
+
|
188 |
+
.is-startrange .pika-button {
|
189 |
+
color: #fff;
|
190 |
+
background: #6CB31D;
|
191 |
+
box-shadow: none;
|
192 |
+
border-radius: 3px;
|
193 |
+
}
|
194 |
+
|
195 |
+
.is-endrange .pika-button {
|
196 |
+
color: #fff;
|
197 |
+
background: #33aaff;
|
198 |
+
box-shadow: none;
|
199 |
+
border-radius: 3px;
|
200 |
+
}
|
201 |
+
|
202 |
+
.is-disabled .pika-button,
|
203 |
+
.is-outside-current-month .pika-button {
|
204 |
+
pointer-events: none;
|
205 |
+
cursor: default;
|
206 |
+
color: #999;
|
207 |
+
opacity: .3;
|
208 |
+
}
|
209 |
+
|
210 |
+
.pika-button:hover {
|
211 |
+
color: #fff;
|
212 |
+
background: #ff8000;
|
213 |
+
box-shadow: none;
|
214 |
+
border-radius: 3px;
|
215 |
+
}
|
216 |
+
|
217 |
+
/* styling for abbr */
|
218 |
+
.pika-table abbr {
|
219 |
+
border-bottom: none;
|
220 |
+
cursor: help;
|
221 |
+
}
|
222 |
+
|
base/inc/fields/js/lib/pikaday/pikaday.js
ADDED
@@ -0,0 +1,1193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Pikaday
|
3 |
+
*
|
4 |
+
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
|
5 |
+
*/
|
6 |
+
|
7 |
+
(function (root, factory)
|
8 |
+
{
|
9 |
+
'use strict';
|
10 |
+
|
11 |
+
var moment;
|
12 |
+
if (typeof exports === 'object') {
|
13 |
+
// CommonJS module
|
14 |
+
// Load moment.js as an optional dependency
|
15 |
+
try { moment = require('moment'); } catch (e) {}
|
16 |
+
module.exports = factory(moment);
|
17 |
+
} else if (typeof define === 'function' && define.amd) {
|
18 |
+
// AMD. Register as an anonymous module.
|
19 |
+
define(function (req)
|
20 |
+
{
|
21 |
+
// Load moment.js as an optional dependency
|
22 |
+
var id = 'moment';
|
23 |
+
try { moment = req(id); } catch (e) {}
|
24 |
+
return factory(moment);
|
25 |
+
});
|
26 |
+
} else {
|
27 |
+
root.Pikaday = factory(root.moment);
|
28 |
+
}
|
29 |
+
}(this, function (moment)
|
30 |
+
{
|
31 |
+
'use strict';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* feature detection and helper functions
|
35 |
+
*/
|
36 |
+
var hasMoment = typeof moment === 'function',
|
37 |
+
|
38 |
+
hasEventListeners = !!window.addEventListener,
|
39 |
+
|
40 |
+
document = window.document,
|
41 |
+
|
42 |
+
sto = window.setTimeout,
|
43 |
+
|
44 |
+
addEvent = function(el, e, callback, capture)
|
45 |
+
{
|
46 |
+
if (hasEventListeners) {
|
47 |
+
el.addEventListener(e, callback, !!capture);
|
48 |
+
} else {
|
49 |
+
el.attachEvent('on' + e, callback);
|
50 |
+
}
|
51 |
+
},
|
52 |
+
|
53 |
+
removeEvent = function(el, e, callback, capture)
|
54 |
+
{
|
55 |
+
if (hasEventListeners) {
|
56 |
+
el.removeEventListener(e, callback, !!capture);
|
57 |
+
} else {
|
58 |
+
el.detachEvent('on' + e, callback);
|
59 |
+
}
|
60 |
+
},
|
61 |
+
|
62 |
+
fireEvent = function(el, eventName, data)
|
63 |
+
{
|
64 |
+
var ev;
|
65 |
+
|
66 |
+
if (document.createEvent) {
|
67 |
+
ev = document.createEvent('HTMLEvents');
|
68 |
+
ev.initEvent(eventName, true, false);
|
69 |
+
ev = extend(ev, data);
|
70 |
+
el.dispatchEvent(ev);
|
71 |
+
} else if (document.createEventObject) {
|
72 |
+
ev = document.createEventObject();
|
73 |
+
ev = extend(ev, data);
|
74 |
+
el.fireEvent('on' + eventName, ev);
|
75 |
+
}
|
76 |
+
},
|
77 |
+
|
78 |
+
trim = function(str)
|
79 |
+
{
|
80 |
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
|
81 |
+
},
|
82 |
+
|
83 |
+
hasClass = function(el, cn)
|
84 |
+
{
|
85 |
+
return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
|
86 |
+
},
|
87 |
+
|
88 |
+
addClass = function(el, cn)
|
89 |
+
{
|
90 |
+
if (!hasClass(el, cn)) {
|
91 |
+
el.className = (el.className === '') ? cn : el.className + ' ' + cn;
|
92 |
+
}
|
93 |
+
},
|
94 |
+
|
95 |
+
removeClass = function(el, cn)
|
96 |
+
{
|
97 |
+
el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
|
98 |
+
},
|
99 |
+
|
100 |
+
isArray = function(obj)
|
101 |
+
{
|
102 |
+
return (/Array/).test(Object.prototype.toString.call(obj));
|
103 |
+
},
|
104 |
+
|
105 |
+
isDate = function(obj)
|
106 |
+
{
|
107 |
+
return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
|
108 |
+
},
|
109 |
+
|
110 |
+
isWeekend = function(date)
|
111 |
+
{
|
112 |
+
var day = date.getDay();
|
113 |
+
return day === 0 || day === 6;
|
114 |
+
},
|
115 |
+
|
116 |
+
isLeapYear = function(year)
|
117 |
+
{
|
118 |
+
// solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
|
119 |
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
120 |
+
},
|
121 |
+
|
122 |
+
getDaysInMonth = function(year, month)
|
123 |
+
{
|
124 |
+
return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
|
125 |
+
},
|
126 |
+
|
127 |
+
setToStartOfDay = function(date)
|
128 |
+
{
|
129 |
+
if (isDate(date)) date.setHours(0,0,0,0);
|
130 |
+
},
|
131 |
+
|
132 |
+
compareDates = function(a,b)
|
133 |
+
{
|
134 |
+
// weak date comparison (use setToStartOfDay(date) to ensure correct result)
|
135 |
+
return a.getTime() === b.getTime();
|
136 |
+
},
|
137 |
+
|
138 |
+
extend = function(to, from, overwrite)
|
139 |
+
{
|
140 |
+
var prop, hasProp;
|
141 |
+
for (prop in from) {
|
142 |
+
hasProp = to[prop] !== undefined;
|
143 |
+
if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) {
|
144 |
+
if (isDate(from[prop])) {
|
145 |
+
if (overwrite) {
|
146 |
+
to[prop] = new Date(from[prop].getTime());
|
147 |
+
}
|
148 |
+
}
|
149 |
+
else if (isArray(from[prop])) {
|
150 |
+
if (overwrite) {
|
151 |
+
to[prop] = from[prop].slice(0);
|
152 |
+
}
|
153 |
+
} else {
|
154 |
+
to[prop] = extend({}, from[prop], overwrite);
|
155 |
+
}
|
156 |
+
} else if (overwrite || !hasProp) {
|
157 |
+
to[prop] = from[prop];
|
158 |
+
}
|
159 |
+
}
|
160 |
+
return to;
|
161 |
+
},
|
162 |
+
|
163 |
+
adjustCalendar = function(calendar) {
|
164 |
+
if (calendar.month < 0) {
|
165 |
+
calendar.year -= Math.ceil(Math.abs(calendar.month)/12);
|
166 |
+
calendar.month += 12;
|
167 |
+
}
|
168 |
+
if (calendar.month > 11) {
|
169 |
+
calendar.year += Math.floor(Math.abs(calendar.month)/12);
|
170 |
+
calendar.month -= 12;
|
171 |
+
}
|
172 |
+
return calendar;
|
173 |
+
},
|
174 |
+
|
175 |
+
/**
|
176 |
+
* defaults and localisation
|
177 |
+
*/
|
178 |
+
defaults = {
|
179 |
+
|
180 |
+
// bind the picker to a form field
|
181 |
+
field: null,
|
182 |
+
|
183 |
+
// automatically show/hide the picker on `field` focus (default `true` if `field` is set)
|
184 |
+
bound: undefined,
|
185 |
+
|
186 |
+
// position of the datepicker, relative to the field (default to bottom & left)
|
187 |
+
// ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
|
188 |
+
position: 'bottom left',
|
189 |
+
|
190 |
+
// automatically fit in the viewport even if it means repositioning from the position option
|
191 |
+
reposition: true,
|
192 |
+
|
193 |
+
// the default output format for `.toString()` and `field` value
|
194 |
+
format: 'YYYY-MM-DD',
|
195 |
+
|
196 |
+
// the initial date to view when first opened
|
197 |
+
defaultDate: null,
|
198 |
+
|
199 |
+
// make the `defaultDate` the initial selected value
|
200 |
+
setDefaultDate: false,
|
201 |
+
|
202 |
+
// first day of week (0: Sunday, 1: Monday etc)
|
203 |
+
firstDay: 0,
|
204 |
+
|
205 |
+
// the default flag for moment's strict date parsing
|
206 |
+
formatStrict: false,
|
207 |
+
|
208 |
+
// the minimum/earliest date that can be selected
|
209 |
+
minDate: null,
|
210 |
+
// the maximum/latest date that can be selected
|
211 |
+
maxDate: null,
|
212 |
+
|
213 |
+
// number of years either side, or array of upper/lower range
|
214 |
+
yearRange: 10,
|
215 |
+
|
216 |
+
// show week numbers at head of row
|
217 |
+
showWeekNumber: false,
|
218 |
+
|
219 |
+
// used internally (don't config outside)
|
220 |
+
minYear: 0,
|
221 |
+
maxYear: 9999,
|
222 |
+
minMonth: undefined,
|
223 |
+
maxMonth: undefined,
|
224 |
+
|
225 |
+
startRange: null,
|
226 |
+
endRange: null,
|
227 |
+
|
228 |
+
isRTL: false,
|
229 |
+
|
230 |
+
// Additional text to append to the year in the calendar title
|
231 |
+
yearSuffix: '',
|
232 |
+
|
233 |
+
// Render the month after year in the calendar title
|
234 |
+
showMonthAfterYear: false,
|
235 |
+
|
236 |
+
// Render days of the calendar grid that fall in the next or previous month
|
237 |
+
showDaysInNextAndPreviousMonths: false,
|
238 |
+
|
239 |
+
// how many months are visible
|
240 |
+
numberOfMonths: 1,
|
241 |
+
|
242 |
+
// when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)
|
243 |
+
// only used for the first display or when a selected date is not visible
|
244 |
+
mainCalendar: 'left',
|
245 |
+
|
246 |
+
// Specify a DOM element to render the calendar in
|
247 |
+
container: undefined,
|
248 |
+
|
249 |
+
// internationalization
|
250 |
+
i18n: {
|
251 |
+
previousMonth : 'Previous Month',
|
252 |
+
nextMonth : 'Next Month',
|
253 |
+
months : ['January','February','March','April','May','June','July','August','September','October','November','December'],
|
254 |
+
weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
|
255 |
+
weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
|
256 |
+
},
|
257 |
+
|
258 |
+
// Theme Classname
|
259 |
+
theme: null,
|
260 |
+
|
261 |
+
// callback function
|
262 |
+
onSelect: null,
|
263 |
+
onOpen: null,
|
264 |
+
onClose: null,
|
265 |
+
onDraw: null
|
266 |
+
},
|
267 |
+
|
268 |
+
|
269 |
+
/**
|
270 |
+
* templating functions to abstract HTML rendering
|
271 |
+
*/
|
272 |
+
renderDayName = function(opts, day, abbr)
|
273 |
+
{
|
274 |
+
day += opts.firstDay;
|
275 |
+
while (day >= 7) {
|
276 |
+
day -= 7;
|
277 |
+
}
|
278 |
+
return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
|
279 |
+
},
|
280 |
+
|
281 |
+
renderDay = function(opts)
|
282 |
+
{
|
283 |
+
var arr = [];
|
284 |
+
var ariaSelected = 'false';
|
285 |
+
if (opts.isEmpty) {
|
286 |
+
if (opts.showDaysInNextAndPreviousMonths) {
|
287 |
+
arr.push('is-outside-current-month');
|
288 |
+
} else {
|
289 |
+
return '<td class="is-empty"></td>';
|
290 |
+
}
|
291 |
+
}
|
292 |
+
if (opts.isDisabled) {
|
293 |
+
arr.push('is-disabled');
|
294 |
+
}
|
295 |
+
if (opts.isToday) {
|
296 |
+
arr.push('is-today');
|
297 |
+
}
|
298 |
+
if (opts.isSelected) {
|
299 |
+
arr.push('is-selected');
|
300 |
+
ariaSelected = 'true';
|
301 |
+
}
|
302 |
+
if (opts.isInRange) {
|
303 |
+
arr.push('is-inrange');
|
304 |
+
}
|
305 |
+
if (opts.isStartRange) {
|
306 |
+
arr.push('is-startrange');
|
307 |
+
}
|
308 |
+
if (opts.isEndRange) {
|
309 |
+
arr.push('is-endrange');
|
310 |
+
}
|
311 |
+
return '<td data-day="' + opts.day + '" class="' + arr.join(' ') + '" aria-selected="' + ariaSelected + '">' +
|
312 |
+
'<button class="pika-button pika-day" type="button" ' +
|
313 |
+
'data-pika-year="' + opts.year + '" data-pika-month="' + opts.month + '" data-pika-day="' + opts.day + '">' +
|
314 |
+
opts.day +
|
315 |
+
'</button>' +
|
316 |
+
'</td>';
|
317 |
+
},
|
318 |
+
|
319 |
+
renderWeek = function (d, m, y) {
|
320 |
+
// Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.
|
321 |
+
var onejan = new Date(y, 0, 1),
|
322 |
+
weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7);
|
323 |
+
return '<td class="pika-week">' + weekNum + '</td>';
|
324 |
+
},
|
325 |
+
|
326 |
+
renderRow = function(days, isRTL)
|
327 |
+
{
|
328 |
+
return '<tr>' + (isRTL ? days.reverse() : days).join('') + '</tr>';
|
329 |
+
},
|
330 |
+
|
331 |
+
renderBody = function(rows)
|
332 |
+
{
|
333 |
+
return '<tbody>' + rows.join('') + '</tbody>';
|
334 |
+
},
|
335 |
+
|
336 |
+
renderHead = function(opts)
|
337 |
+
{
|
338 |
+
var i, arr = [];
|
339 |
+
if (opts.showWeekNumber) {
|
340 |
+
arr.push('<th></th>');
|
341 |
+
}
|
342 |
+
for (i = 0; i < 7; i++) {
|
343 |
+
arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
|
344 |
+
}
|
345 |
+
return '<thead><tr>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</tr></thead>';
|
346 |
+
},
|
347 |
+
|
348 |
+
renderTitle = function(instance, c, year, month, refYear, randId)
|
349 |
+
{
|
350 |
+
var i, j, arr,
|
351 |
+
opts = instance._o,
|
352 |
+
isMinYear = year === opts.minYear,
|
353 |
+
isMaxYear = year === opts.maxYear,
|
354 |
+
html = '<div id="' + randId + '" class="pika-title" role="heading" aria-live="assertive">',
|
355 |
+
monthHtml,
|
356 |
+
yearHtml,
|
357 |
+
prev = true,
|
358 |
+
next = true;
|
359 |
+
|
360 |
+
for (arr = [], i = 0; i < 12; i++) {
|
361 |
+
arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' +
|
362 |
+
(i === month ? ' selected="selected"': '') +
|
363 |
+
((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled="disabled"' : '') + '>' +
|
364 |
+
opts.i18n.months[i] + '</option>');
|
365 |
+
}
|
366 |
+
|
367 |
+
monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month" tabindex="-1">' + arr.join('') + '</select></div>';
|
368 |
+
|
369 |
+
if (isArray(opts.yearRange)) {
|
370 |
+
i = opts.yearRange[0];
|
371 |
+
j = opts.yearRange[1] + 1;
|
372 |
+
} else {
|
373 |
+
i = year - opts.yearRange;
|
374 |
+
j = 1 + year + opts.yearRange;
|
375 |
+
}
|
376 |
+
|
377 |
+
for (arr = []; i < j && i <= opts.maxYear; i++) {
|
378 |
+
if (i >= opts.minYear) {
|
379 |
+
arr.push('<option value="' + i + '"' + (i === year ? ' selected="selected"': '') + '>' + (i) + '</option>');
|
380 |
+
}
|
381 |
+
}
|
382 |
+
yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + arr.join('') + '</select></div>';
|
383 |
+
|
384 |
+
if (opts.showMonthAfterYear) {
|
385 |
+
html += yearHtml + monthHtml;
|
386 |
+
} else {
|
387 |
+
html += monthHtml + yearHtml;
|
388 |
+
}
|
389 |
+
|
390 |
+
if (isMinYear && (month === 0 || opts.minMonth >= month)) {
|
391 |
+
prev = false;
|
392 |
+
}
|
393 |
+
|
394 |
+
if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
|
395 |
+
next = false;
|
396 |
+
}
|
397 |
+
|
398 |
+
if (c === 0) {
|
399 |
+
html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
|
400 |
+
}
|
401 |
+
if (c === (instance._o.numberOfMonths - 1) ) {
|
402 |
+
html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
|
403 |
+
}
|
404 |
+
|
405 |
+
return html += '</div>';
|
406 |
+
},
|
407 |
+
|
408 |
+
renderTable = function(opts, data, randId)
|
409 |
+
{
|
410 |
+
return '<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="' + randId + '">' + renderHead(opts) + renderBody(data) + '</table>';
|
411 |
+
},
|
412 |
+
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Pikaday constructor
|
416 |
+
*/
|
417 |
+
Pikaday = function(options)
|
418 |
+
{
|
419 |
+
var self = this,
|
420 |
+
opts = self.config(options);
|
421 |
+
|
422 |
+
self._onMouseDown = function(e)
|
423 |
+
{
|
424 |
+
if (!self._v) {
|
425 |
+
return;
|
426 |
+
}
|
427 |
+
e = e || window.event;
|
428 |
+
var target = e.target || e.srcElement;
|
429 |
+
if (!target) {
|
430 |
+
return;
|
431 |
+
}
|
432 |
+
|
433 |
+
if (!hasClass(target, 'is-disabled')) {
|
434 |
+
if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty') && !hasClass(target.parentNode, 'is-disabled')) {
|
435 |
+
self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));
|
436 |
+
if (opts.bound) {
|
437 |
+
sto(function() {
|
438 |
+
self.hide();
|
439 |
+
if (opts.field) {
|
440 |
+
opts.field.blur();
|
441 |
+
}
|
442 |
+
}, 100);
|
443 |
+
}
|
444 |
+
}
|
445 |
+
else if (hasClass(target, 'pika-prev')) {
|
446 |
+
self.prevMonth();
|
447 |
+
}
|
448 |
+
else if (hasClass(target, 'pika-next')) {
|
449 |
+
self.nextMonth();
|
450 |
+
}
|
451 |
+
}
|
452 |
+
if (!hasClass(target, 'pika-select')) {
|
453 |
+
// if this is touch event prevent mouse events emulation
|
454 |
+
if (e.preventDefault) {
|
455 |
+
e.preventDefault();
|
456 |
+
} else {
|
457 |
+
e.returnValue = false;
|
458 |
+
return false;
|
459 |
+
}
|
460 |
+
} else {
|
461 |
+
self._c = true;
|
462 |
+
}
|
463 |
+
};
|
464 |
+
|
465 |
+
self._onChange = function(e)
|
466 |
+
{
|
467 |
+
e = e || window.event;
|
468 |
+
var target = e.target || e.srcElement;
|
469 |
+
if (!target) {
|
470 |
+
return;
|
471 |
+
}
|
472 |
+
if (hasClass(target, 'pika-select-month')) {
|
473 |
+
self.gotoMonth(target.value);
|
474 |
+
}
|
475 |
+
else if (hasClass(target, 'pika-select-year')) {
|
476 |
+
self.gotoYear(target.value);
|
477 |
+
}
|
478 |
+
};
|
479 |
+
|
480 |
+
self._onKeyChange = function(e)
|
481 |
+
{
|
482 |
+
e = e || window.event;
|
483 |
+
|
484 |
+
if (self.isVisible()) {
|
485 |
+
|
486 |
+
switch(e.keyCode){
|
487 |
+
case 13:
|
488 |
+
case 27:
|
489 |
+
opts.field.blur();
|
490 |
+
break;
|
491 |
+
case 37:
|
492 |
+
e.preventDefault();
|
493 |
+
self.adjustDate('subtract', 1);
|
494 |
+
break;
|
495 |
+
case 38:
|
496 |
+
self.adjustDate('subtract', 7);
|
497 |
+
break;
|
498 |
+
case 39:
|
499 |
+
self.adjustDate('add', 1);
|
500 |
+
break;
|
501 |
+
case 40:
|
502 |
+
self.adjustDate('add', 7);
|
503 |
+
break;
|
504 |
+
}
|
505 |
+
}
|
506 |
+
};
|
507 |
+
|
508 |
+
self._onInputChange = function(e)
|
509 |
+
{
|
510 |
+
var date;
|
511 |
+
|
512 |
+
if (e.firedBy === self) {
|
513 |
+
return;
|
514 |
+
}
|
515 |
+
if (hasMoment) {
|
516 |
+
date = moment(opts.field.value, opts.format, opts.formatStrict);
|
517 |
+
date = (date && date.isValid()) ? date.toDate() : null;
|
518 |
+
}
|
519 |
+
else {
|
520 |
+
date = new Date(Date.parse(opts.field.value));
|
521 |
+
}
|
522 |
+
if (isDate(date)) {
|
523 |
+
self.setDate(date);
|
524 |
+
}
|
525 |
+
if (!self._v) {
|
526 |
+
self.show();
|
527 |
+
}
|
528 |
+
};
|
529 |
+
|
530 |
+
self._onInputFocus = function()
|
531 |
+
{
|
532 |
+
self.show();
|
533 |
+
};
|
534 |
+
|
535 |
+
self._onInputClick = function()
|
536 |
+
{
|
537 |
+
self.show();
|
538 |
+
};
|
539 |
+
|
540 |
+
self._onInputBlur = function()
|
541 |
+
{
|
542 |
+
// IE allows pika div to gain focus; catch blur the input field
|
543 |
+
var pEl = document.activeElement;
|
544 |
+
do {
|
545 |
+
if (hasClass(pEl, 'pika-single')) {
|
546 |
+
return;
|
547 |
+
}
|
548 |
+
}
|
549 |
+
while ((pEl = pEl.parentNode));
|
550 |
+
|
551 |
+
if (!self._c) {
|
552 |
+
self._b = sto(function() {
|
553 |
+
self.hide();
|
554 |
+
}, 50);
|
555 |
+
}
|
556 |
+
self._c = false;
|
557 |
+
};
|
558 |
+
|
559 |
+
self._onClick = function(e)
|
560 |
+
{
|
561 |
+
e = e || window.event;
|
562 |
+
var target = e.target || e.srcElement,
|
563 |
+
pEl = target;
|
564 |
+
if (!target) {
|
565 |
+
return;
|
566 |
+
}
|
567 |
+
if (!hasEventListeners && hasClass(target, 'pika-select')) {
|
568 |
+
if (!target.onchange) {
|
569 |
+
target.setAttribute('onchange', 'return;');
|
570 |
+
addEvent(target, 'change', self._onChange);
|
571 |
+
}
|
572 |
+
}
|
573 |
+
do {
|
574 |
+
if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) {
|
575 |
+
return;
|
576 |
+
}
|
577 |
+
}
|
578 |
+
while ((pEl = pEl.parentNode));
|
579 |
+
if (self._v && target !== opts.trigger && pEl !== opts.trigger) {
|
580 |
+
self.hide();
|
581 |
+
}
|
582 |
+
};
|
583 |
+
|
584 |
+
self.el = document.createElement('div');
|
585 |
+
self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');
|
586 |
+
|
587 |
+
addEvent(self.el, 'mousedown', self._onMouseDown, true);
|
588 |
+
addEvent(self.el, 'touchend', self._onMouseDown, true);
|
589 |
+
addEvent(self.el, 'change', self._onChange);
|
590 |
+
addEvent(document, 'keydown', self._onKeyChange);
|
591 |
+
|
592 |
+
if (opts.field) {
|
593 |
+
if (opts.container) {
|
594 |
+
opts.container.appendChild(self.el);
|
595 |
+
} else if (opts.bound) {
|
596 |
+
document.body.appendChild(self.el);
|
597 |
+
} else {
|
598 |
+
opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
|
599 |
+
}
|
600 |
+
addEvent(opts.field, 'change', self._onInputChange);
|
601 |
+
|
602 |
+
if (!opts.defaultDate) {
|
603 |
+
if (hasMoment && opts.field.value) {
|
604 |
+
opts.defaultDate = moment(opts.field.value, opts.format).toDate();
|
605 |
+
} else {
|
606 |
+
opts.defaultDate = new Date(Date.parse(opts.field.value));
|
607 |
+
}
|
608 |
+
opts.setDefaultDate = true;
|
609 |
+
}
|
610 |
+
}
|
611 |
+
|
612 |
+
var defDate = opts.defaultDate;
|
613 |
+
|
614 |
+
if (isDate(defDate)) {
|
615 |
+
if (opts.setDefaultDate) {
|
616 |
+
self.setDate(defDate, true);
|
617 |
+
} else {
|
618 |
+
self.gotoDate(defDate);
|
619 |
+
}
|
620 |
+
} else {
|
621 |
+
self.gotoDate(new Date());
|
622 |
+
}
|
623 |
+
|
624 |
+
if (opts.bound) {
|
625 |
+
this.hide();
|
626 |
+
self.el.className += ' is-bound';
|
627 |
+
addEvent(opts.trigger, 'click', self._onInputClick);
|
628 |
+
addEvent(opts.trigger, 'focus', self._onInputFocus);
|
629 |
+
addEvent(opts.trigger, 'blur', self._onInputBlur);
|
630 |
+
} else {
|
631 |
+
this.show();
|
632 |
+
}
|
633 |
+
};
|
634 |
+
|
635 |
+
|
636 |
+
/**
|
637 |
+
* public Pikaday API
|
638 |
+
*/
|
639 |
+
Pikaday.prototype = {
|
640 |
+
|
641 |
+
|
642 |
+
/**
|
643 |
+
* configure functionality
|
644 |
+
*/
|
645 |
+
config: function(options)
|
646 |
+
{
|
647 |
+
if (!this._o) {
|
648 |
+
this._o = extend({}, defaults, true);
|
649 |
+
}
|
650 |
+
|
651 |
+
var opts = extend(this._o, options, true);
|
652 |
+
|
653 |
+
opts.isRTL = !!opts.isRTL;
|
654 |
+
|
655 |
+
opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;
|
656 |
+
|
657 |
+
opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null;
|
658 |
+
|
659 |
+
opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);
|
660 |
+
|
661 |
+
opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;
|
662 |
+
|
663 |
+
opts.disableWeekends = !!opts.disableWeekends;
|
664 |
+
|
665 |
+
opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null;
|
666 |
+
|
667 |
+
var nom = parseInt(opts.numberOfMonths, 10) || 1;
|
668 |
+
opts.numberOfMonths = nom > 4 ? 4 : nom;
|
669 |
+
|
670 |
+
if (!isDate(opts.minDate)) {
|
671 |
+
opts.minDate = false;
|
672 |
+
}
|
673 |
+
if (!isDate(opts.maxDate)) {
|
674 |
+
opts.maxDate = false;
|
675 |
+
}
|
676 |
+
if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
|
677 |
+
opts.maxDate = opts.minDate = false;
|
678 |
+
}
|
679 |
+
if (opts.minDate) {
|
680 |
+
this.setMinDate(opts.minDate);
|
681 |
+
}
|
682 |
+
if (opts.maxDate) {
|
683 |
+
this.setMaxDate(opts.maxDate);
|
684 |
+
}
|
685 |
+
|
686 |
+
if (isArray(opts.yearRange)) {
|
687 |
+
var fallback = new Date().getFullYear() - 10;
|
688 |
+
opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
|
689 |
+
opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
|
690 |
+
} else {
|
691 |
+
opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
|
692 |
+
if (opts.yearRange > 100) {
|
693 |
+
opts.yearRange = 100;
|
694 |
+
}
|
695 |
+
}
|
696 |
+
|
697 |
+
return opts;
|
698 |
+
},
|
699 |
+
|
700 |
+
/**
|
701 |
+
* return a formatted string of the current selection (using Moment.js if available)
|
702 |
+
*/
|
703 |
+
toString: function(format)
|
704 |
+
{
|
705 |
+
return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
|
706 |
+
},
|
707 |
+
|
708 |
+
/**
|
709 |
+
* return a Moment.js object of the current selection (if available)
|
710 |
+
*/
|
711 |
+
getMoment: function()
|
712 |
+
{
|
713 |
+
return hasMoment ? moment(this._d) : null;
|
714 |
+
},
|
715 |
+
|
716 |
+
/**
|
717 |
+
* set the current selection from a Moment.js object (if available)
|
718 |
+
*/
|
719 |
+
setMoment: function(date, preventOnSelect)
|
720 |
+
{
|
721 |
+
if (hasMoment && moment.isMoment(date)) {
|
722 |
+
this.setDate(date.toDate(), preventOnSelect);
|
723 |
+
}
|
724 |
+
},
|
725 |
+
|
726 |
+
/**
|
727 |
+
* return a Date object of the current selection with fallback for the current date
|
728 |
+
*/
|
729 |
+
getDate: function()
|
730 |
+
{
|
731 |
+
return isDate(this._d) ? new Date(this._d.getTime()) : new Date();
|
732 |
+
},
|
733 |
+
|
734 |
+
/**
|
735 |
+
* set the current selection
|
736 |
+
*/
|
737 |
+
setDate: function(date, preventOnSelect)
|
738 |
+
{
|
739 |
+
if (!date) {
|
740 |
+
this._d = null;
|
741 |
+
|
742 |
+
if (this._o.field) {
|
743 |
+
this._o.field.value = '';
|
744 |
+
fireEvent(this._o.field, 'change', { firedBy: this });
|
745 |
+
}
|
746 |
+
|
747 |
+
return this.draw();
|
748 |
+
}
|
749 |
+
if (typeof date === 'string') {
|
750 |
+
date = new Date(Date.parse(date));
|
751 |
+
}
|
752 |
+
if (!isDate(date)) {
|
753 |
+
return;
|
754 |
+
}
|
755 |
+
|
756 |
+
var min = this._o.minDate,
|
757 |
+
max = this._o.maxDate;
|
758 |
+
|
759 |
+
if (isDate(min) && date < min) {
|
760 |
+
date = min;
|
761 |
+
} else if (isDate(max) && date > max) {
|
762 |
+
date = max;
|
763 |
+
}
|
764 |
+
|
765 |
+
this._d = new Date(date.getTime());
|
766 |
+
setToStartOfDay(this._d);
|
767 |
+
this.gotoDate(this._d);
|
768 |
+
|
769 |
+
if (this._o.field) {
|
770 |
+
this._o.field.value = this.toString();
|
771 |
+
fireEvent(this._o.field, 'change', { firedBy: this });
|
772 |
+
}
|
773 |
+
if (!preventOnSelect && typeof this._o.onSelect === 'function') {
|
774 |
+
this._o.onSelect.call(this, this.getDate());
|
775 |
+
}
|
776 |
+
},
|
777 |
+
|
778 |
+
/**
|
779 |
+
* change view to a specific date
|
780 |
+
*/
|
781 |
+
gotoDate: function(date)
|
782 |
+
{
|
783 |
+
var newCalendar = true;
|
784 |
+
|
785 |
+
if (!isDate(date)) {
|
786 |
+
return;
|
787 |
+
}
|
788 |
+
|
789 |
+
if (this.calendars) {
|
790 |
+
var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),
|
791 |
+
lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),
|
792 |
+
visibleDate = date.getTime();
|
793 |
+
// get the end of the month
|
794 |
+
lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);
|
795 |
+
lastVisibleDate.setDate(lastVisibleDate.getDate()-1);
|
796 |
+
newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);
|
797 |
+
}
|
798 |
+
|
799 |
+
if (newCalendar) {
|
800 |
+
this.calendars = [{
|
801 |
+
month: date.getMonth(),
|
802 |
+
year: date.getFullYear()
|
803 |
+
}];
|
804 |
+
if (this._o.mainCalendar === 'right') {
|
805 |
+
this.calendars[0].month += 1 - this._o.numberOfMonths;
|
806 |
+
}
|
807 |
+
}
|
808 |
+
|
809 |
+
this.adjustCalendars();
|
810 |
+
},
|
811 |
+
|
812 |
+
adjustDate: function(sign, days) {
|
813 |
+
|
814 |
+
var day = this.getDate();
|
815 |
+
var difference = parseInt(days)*24*60*60*1000;
|
816 |
+
|
817 |
+
var newDay;
|
818 |
+
|
819 |
+
if (sign === 'add') {
|
820 |
+
newDay = new Date(day.valueOf() + difference);
|
821 |
+
} else if (sign === 'subtract') {
|
822 |
+
newDay = new Date(day.valueOf() - difference);
|
823 |
+
}
|
824 |
+
|
825 |
+
if (hasMoment) {
|
826 |
+
if (sign === 'add') {
|
827 |
+
newDay = moment(day).add(days, "days").toDate();
|
828 |
+
} else if (sign === 'subtract') {
|
829 |
+
newDay = moment(day).subtract(days, "days").toDate();
|
830 |
+
}
|
831 |
+
}
|
832 |
+
|
833 |
+
this.setDate(newDay);
|
834 |
+
},
|
835 |
+
|
836 |
+
adjustCalendars: function() {
|
837 |
+
this.calendars[0] = adjustCalendar(this.calendars[0]);
|
838 |
+
for (var c = 1; c < this._o.numberOfMonths; c++) {
|
839 |
+
this.calendars[c] = adjustCalendar({
|
840 |
+
month: this.calendars[0].month + c,
|
841 |
+
year: this.calendars[0].year
|
842 |
+
});
|
843 |
+
}
|
844 |
+
this.draw();
|
845 |
+
},
|
846 |
+
|
847 |
+
gotoToday: function()
|
848 |
+
{
|
849 |
+
this.gotoDate(new Date());
|
850 |
+
},
|
851 |
+
|
852 |
+
/**
|
853 |
+
* change view to a specific month (zero-index, e.g. 0: January)
|
854 |
+
*/
|
855 |
+
gotoMonth: function(month)
|
856 |
+
{
|
857 |
+
if (!isNaN(month)) {
|
858 |
+
this.calendars[0].month = parseInt(month, 10);
|
859 |
+
this.adjustCalendars();
|
860 |
+
}
|
861 |
+
},
|
862 |
+
|
863 |
+
nextMonth: function()
|
864 |
+
{
|
865 |
+
this.calendars[0].month++;
|
866 |
+
this.adjustCalendars();
|
867 |
+
},
|
868 |
+
|
869 |
+
prevMonth: function()
|
870 |
+
{
|
871 |
+
this.calendars[0].month--;
|
872 |
+
this.adjustCalendars();
|
873 |
+
},
|
874 |
+
|
875 |
+
/**
|
876 |
+
* change view to a specific full year (e.g. "2012")
|
877 |
+
*/
|
878 |
+
gotoYear: function(year)
|
879 |
+
{
|
880 |
+
if (!isNaN(year)) {
|
881 |
+
this.calendars[0].year = parseInt(year, 10);
|
882 |
+
this.adjustCalendars();
|
883 |
+
}
|
884 |
+
},
|
885 |
+
|
886 |
+
/**
|
887 |
+
* change the minDate
|
888 |
+
*/
|
889 |
+
setMinDate: function(value)
|
890 |
+
{
|
891 |
+
if(value instanceof Date) {
|
892 |
+
setToStartOfDay(value);
|
893 |
+
this._o.minDate = value;
|
894 |
+
this._o.minYear = value.getFullYear();
|
895 |
+
this._o.minMonth = value.getMonth();
|
896 |
+
} else {
|
897 |
+
this._o.minDate = defaults.minDate;
|
898 |
+
this._o.minYear = defaults.minYear;
|
899 |
+
this._o.minMonth = defaults.minMonth;
|
900 |
+
this._o.startRange = defaults.startRange;
|
901 |
+
}
|
902 |
+
|
903 |
+
this.draw();
|
904 |
+
},
|
905 |
+
|
906 |
+
/**
|
907 |
+
* change the maxDate
|
908 |
+
*/
|
909 |
+
setMaxDate: function(value)
|
910 |
+
{
|
911 |
+
if(value instanceof Date) {
|
912 |
+
setToStartOfDay(value);
|
913 |
+
this._o.maxDate = value;
|
914 |
+
this._o.maxYear = value.getFullYear();
|
915 |
+
this._o.maxMonth = value.getMonth();
|
916 |
+
} else {
|
917 |
+
this._o.maxDate = defaults.maxDate;
|
918 |
+
this._o.maxYear = defaults.maxYear;
|
919 |
+
this._o.maxMonth = defaults.maxMonth;
|
920 |
+
this._o.endRange = defaults.endRange;
|
921 |
+
}
|
922 |
+
|
923 |
+
this.draw();
|
924 |
+
},
|
925 |
+
|
926 |
+
setStartRange: function(value)
|
927 |
+
{
|
928 |
+
this._o.startRange = value;
|
929 |
+
},
|
930 |
+
|
931 |
+
setEndRange: function(value)
|
932 |
+
{
|
933 |
+
this._o.endRange = value;
|
934 |
+
},
|
935 |
+
|
936 |
+
/**
|
937 |
+
* refresh the HTML
|
938 |
+
*/
|
939 |
+
draw: function(force)
|
940 |
+
{
|
941 |
+
if (!this._v && !force) {
|
942 |
+
return;
|
943 |
+
}
|
944 |
+
var opts = this._o,
|
945 |
+
minYear = opts.minYear,
|
946 |
+
maxYear = opts.maxYear,
|
947 |
+
minMonth = opts.minMonth,
|
948 |
+
maxMonth = opts.maxMonth,
|
949 |
+
html = '',
|
950 |
+
randId;
|
951 |
+
|
952 |
+
if (this._y <= minYear) {
|
953 |
+
this._y = minYear;
|
954 |
+
if (!isNaN(minMonth) && this._m < minMonth) {
|
955 |
+
this._m = minMonth;
|
956 |
+
}
|
957 |
+
}
|
958 |
+
if (this._y >= maxYear) {
|
959 |
+
this._y = maxYear;
|
960 |
+
if (!isNaN(maxMonth) && this._m > maxMonth) {
|
961 |
+
this._m = maxMonth;
|
962 |
+
}
|
963 |
+
}
|
964 |
+
|
965 |
+
randId = 'pika-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2);
|
966 |
+
|
967 |
+
for (var c = 0; c < opts.numberOfMonths; c++) {
|
968 |
+
html += '<div class="pika-lendar">' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId) + '</div>';
|
969 |
+
}
|
970 |
+
|
971 |
+
this.el.innerHTML = html;
|
972 |
+
|
973 |
+
if (opts.bound) {
|
974 |
+
if(opts.field.type !== 'hidden') {
|
975 |
+
sto(function() {
|
976 |
+
opts.trigger.focus();
|
977 |
+
}, 1);
|
978 |
+
}
|
979 |
+
}
|
980 |
+
|
981 |
+
if (typeof this._o.onDraw === 'function') {
|
982 |
+
this._o.onDraw(this);
|
983 |
+
}
|
984 |
+
|
985 |
+
if (opts.bound) {
|
986 |
+
// let the screen reader user know to use arrow keys
|
987 |
+
opts.field.setAttribute('aria-label', 'Use the arrow keys to pick a date');
|
988 |
+
}
|
989 |
+
},
|
990 |
+
|
991 |
+
adjustPosition: function()
|
992 |
+
{
|
993 |
+
var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect;
|
994 |
+
|
995 |
+
if (this._o.container) return;
|
996 |
+
|
997 |
+
this.el.style.position = 'absolute';
|
998 |
+
|
999 |
+
field = this._o.trigger;
|
1000 |
+
pEl = field;
|
1001 |
+
width = this.el.offsetWidth;
|
1002 |
+
height = this.el.offsetHeight;
|
1003 |
+
viewportWidth = window.innerWidth || document.documentElement.clientWidth;
|
1004 |
+
viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
1005 |
+
scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
|
1006 |
+
|
1007 |
+
if (typeof field.getBoundingClientRect === 'function') {
|
1008 |
+
clientRect = field.getBoundingClientRect();
|
1009 |
+
left = clientRect.left + window.pageXOffset;
|
1010 |
+
top = clientRect.bottom + window.pageYOffset;
|
1011 |
+
} else {
|
1012 |
+
left = pEl.offsetLeft;
|
1013 |
+
top = pEl.offsetTop + pEl.offsetHeight;
|
1014 |
+
while((pEl = pEl.offsetParent)) {
|
1015 |
+
left += pEl.offsetLeft;
|
1016 |
+
top += pEl.offsetTop;
|
1017 |
+
}
|
1018 |
+
}
|
1019 |
+
|
1020 |
+
// default position is bottom & left
|
1021 |
+
if ((this._o.reposition && left + width > viewportWidth) ||
|
1022 |
+
(
|
1023 |
+
this._o.position.indexOf('right') > -1 &&
|
1024 |
+
left - width + field.offsetWidth > 0
|
1025 |
+
)
|
1026 |
+
) {
|
1027 |
+
left = left - width + field.offsetWidth;
|
1028 |
+
}
|
1029 |
+
if ((this._o.reposition && top + height > viewportHeight + scrollTop) ||
|
1030 |
+
(
|
1031 |
+
this._o.position.indexOf('top') > -1 &&
|
1032 |
+
top - height - field.offsetHeight > 0
|
1033 |
+
)
|
1034 |
+
) {
|
1035 |
+
top = top - height - field.offsetHeight;
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
this.el.style.left = left + 'px';
|
1039 |
+
this.el.style.top = top + 'px';
|
1040 |
+
},
|
1041 |
+
|
1042 |
+
/**
|
1043 |
+
* render HTML for a particular month
|
1044 |
+
*/
|
1045 |
+
render: function(year, month, randId)
|
1046 |
+
{
|
1047 |
+
var opts = this._o,
|
1048 |
+
now = new Date(),
|
1049 |
+
days = getDaysInMonth(year, month),
|
1050 |
+
before = new Date(year, month, 1).getDay(),
|
1051 |
+
data = [],
|
1052 |
+
row = [];
|
1053 |
+
setToStartOfDay(now);
|
1054 |
+
if (opts.firstDay > 0) {
|
1055 |
+
before -= opts.firstDay;
|
1056 |
+
if (before < 0) {
|
1057 |
+
before += 7;
|
1058 |
+
}
|
1059 |
+
}
|
1060 |
+
var previousMonth = month === 0 ? 11 : month - 1,
|
1061 |
+
nextMonth = month === 11 ? 0 : month + 1,
|
1062 |
+
yearOfPreviousMonth = month === 0 ? year - 1 : year,
|
1063 |
+
yearOfNextMonth = month === 11 ? year + 1 : year,
|
1064 |
+
daysInPreviousMonth = getDaysInMonth(yearOfPreviousMonth, previousMonth);
|
1065 |
+
var cells = days + before,
|
1066 |
+
after = cells;
|
1067 |
+
while(after > 7) {
|
1068 |
+
after -= 7;
|
1069 |
+
}
|
1070 |
+
cells += 7 - after;
|
1071 |
+
for (var i = 0, r = 0; i < cells; i++)
|
1072 |
+
{
|
1073 |
+
var day = new Date(year, month, 1 + (i - before)),
|
1074 |
+
isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
|
1075 |
+
isToday = compareDates(day, now),
|
1076 |
+
isEmpty = i < before || i >= (days + before),
|
1077 |
+
dayNumber = 1 + (i - before),
|
1078 |
+
monthNumber = month,
|
1079 |
+
yearNumber = year,
|
1080 |
+
isStartRange = opts.startRange && compareDates(opts.startRange, day),
|
1081 |
+
isEndRange = opts.endRange && compareDates(opts.endRange, day),
|
1082 |
+
isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange,
|
1083 |
+
isDisabled = (opts.minDate && day < opts.minDate) ||
|
1084 |
+
(opts.maxDate && day > opts.maxDate) ||
|
1085 |
+
(opts.disableWeekends && isWeekend(day)) ||
|
1086 |
+
(opts.disableDayFn && opts.disableDayFn(day));
|
1087 |
+
|
1088 |
+
if (isEmpty) {
|
1089 |
+
if (i < before) {
|
1090 |
+
dayNumber = daysInPreviousMonth + dayNumber;
|
1091 |
+
monthNumber = previousMonth;
|
1092 |
+
yearNumber = yearOfPreviousMonth;
|
1093 |
+
} else {
|
1094 |
+
dayNumber = dayNumber - days;
|
1095 |
+
monthNumber = nextMonth;
|
1096 |
+
yearNumber = yearOfNextMonth;
|
1097 |
+
}
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
var dayConfig = {
|
1101 |
+
day: dayNumber,
|
1102 |
+
month: monthNumber,
|
1103 |
+
year: yearNumber,
|
1104 |
+
isSelected: isSelected,
|
1105 |
+
isToday: isToday,
|
1106 |
+
isDisabled: isDisabled,
|
1107 |
+
isEmpty: isEmpty,
|
1108 |
+
isStartRange: isStartRange,
|
1109 |
+
isEndRange: isEndRange,
|
1110 |
+
isInRange: isInRange,
|
1111 |
+
showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths
|
1112 |
+
};
|
1113 |
+
|
1114 |
+
row.push(renderDay(dayConfig));
|
1115 |
+
|
1116 |
+
if (++r === 7) {
|
1117 |
+
if (opts.showWeekNumber) {
|
1118 |
+
row.unshift(renderWeek(i - before, month, year));
|
1119 |
+
}
|
1120 |
+
data.push(renderRow(row, opts.isRTL));
|
1121 |
+
row = [];
|
1122 |
+
r = 0;
|
1123 |
+
}
|
1124 |
+
}
|
1125 |
+
return renderTable(opts, data, randId);
|
1126 |
+
},
|
1127 |
+
|
1128 |
+
isVisible: function()
|
1129 |
+
{
|
1130 |
+
return this._v;
|
1131 |
+
},
|
1132 |
+
|
1133 |
+
show: function()
|
1134 |
+
{
|
1135 |
+
if (!this.isVisible()) {
|
1136 |
+
removeClass(this.el, 'is-hidden');
|
1137 |
+
this._v = true;
|
1138 |
+
this.draw();
|
1139 |
+
if (this._o.bound) {
|
1140 |
+
addEvent(document, 'click', this._onClick);
|
1141 |
+
this.adjustPosition();
|
1142 |
+
}
|
1143 |
+
if (typeof this._o.onOpen === 'function') {
|
1144 |
+
this._o.onOpen.call(this);
|
1145 |
+
}
|
1146 |
+
}
|
1147 |
+
},
|
1148 |
+
|
1149 |
+
hide: function()
|
1150 |
+
{
|
1151 |
+
var v = this._v;
|
1152 |
+
if (v !== false) {
|
1153 |
+
if (this._o.bound) {
|
1154 |
+
removeEvent(document, 'click', this._onClick);
|
1155 |
+
}
|
1156 |
+
this.el.style.position = 'static'; // reset
|
1157 |
+
this.el.style.left = 'auto';
|
1158 |
+
this.el.style.top = 'auto';
|
1159 |
+
addClass(this.el, 'is-hidden');
|
1160 |
+
this._v = false;
|
1161 |
+
if (v !== undefined && typeof this._o.onClose === 'function') {
|
1162 |
+
this._o.onClose.call(this);
|
1163 |
+
}
|
1164 |
+
}
|
1165 |
+
},
|
1166 |
+
|
1167 |
+
/**
|
1168 |
+
* GAME OVER
|
1169 |
+
*/
|
1170 |
+
destroy: function()
|
1171 |
+
{
|
1172 |
+
this.hide();
|
1173 |
+
removeEvent(this.el, 'mousedown', this._onMouseDown, true);
|
1174 |
+
removeEvent(this.el, 'touchend', this._onMouseDown, true);
|
1175 |
+
removeEvent(this.el, 'change', this._onChange);
|
1176 |
+
if (this._o.field) {
|
1177 |
+
removeEvent(this._o.field, 'change', this._onInputChange);
|
1178 |
+
if (this._o.bound) {
|
1179 |
+
removeEvent(this._o.trigger, 'click', this._onInputClick);
|
1180 |
+
removeEvent(this._o.trigger, 'focus', this._onInputFocus);
|
1181 |
+
removeEvent(this._o.trigger, 'blur', this._onInputBlur);
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
if (this.el.parentNode) {
|
1185 |
+
this.el.parentNode.removeChild(this.el);
|
1186 |
+
}
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
};
|
1190 |
+
|
1191 |
+
return Pikaday;
|
1192 |
+
|
1193 |
+
}));
|
base/inc/fields/js/lib/pikaday/pikaday.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e,t){"use strict";var n;if("object"==typeof exports){try{n=require("moment")}catch(a){}module.exports=t(n)}else"function"==typeof define&&define.amd?define(function(e){var a="moment";try{n=e(a)}catch(i){}return t(n)}):e.Pikaday=t(e.moment)}(this,function(e){"use strict";var t="function"==typeof e,n=!!window.addEventListener,a=window.document,i=window.setTimeout,s=function(e,t,a,i){n?e.addEventListener(t,a,!!i):e.attachEvent("on"+t,a)},o=function(e,t,a,i){n?e.removeEventListener(t,a,!!i):e.detachEvent("on"+t,a)},r=function(e,t,n){var i;a.createEvent?(i=a.createEvent("HTMLEvents"),i.initEvent(t,!0,!1),i=_(i,n),e.dispatchEvent(i)):a.createEventObject&&(i=a.createEventObject(),i=_(i,n),e.fireEvent("on"+t,i))},h=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},l=function(e,t){return(" "+e.className+" ").indexOf(" "+t+" ")!==-1},d=function(e,t){l(e,t)||(e.className=""===e.className?t:e.className+" "+t)},u=function(e,t){e.className=h((" "+e.className+" ").replace(" "+t+" "," "))},c=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},m=function(e){var t=e.getDay();return 0===t||6===t},g=function(e){return e%4===0&&e%100!==0||e%400===0},p=function(e,t){return[31,g(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},y=function(e){f(e)&&e.setHours(0,0,0,0)},D=function(e,t){return e.getTime()===t.getTime()},_=function(e,t,n){var a,i;for(a in t)i=void 0!==e[a],i&&"object"==typeof t[a]&&null!==t[a]&&void 0===t[a].nodeName?f(t[a])?n&&(e[a]=new Date(t[a].getTime())):c(t[a])?n&&(e[a]=t[a].slice(0)):e[a]=_({},t[a],n):!n&&i||(e[a]=t[a]);return e},v=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},b={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},w=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},M=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},k=function(e,t,n){var a=new Date(n,0,1),i=Math.ceil(((new Date(n,t,e)-a)/864e5+a.getDay()+1)/7);return'<td class="pika-week">'+i+"</td>"},x=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},R=function(e){return"<tbody>"+e.join("")+"</tbody>"},N=function(e){var t,n=[];for(e.showWeekNumber&&n.push("<th></th>"),t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+w(e,t)+'">'+w(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"},C=function(e,t,n,a,i,s){var o,r,h,l,d,u=e._o,f=n===u.minYear,m=n===u.maxYear,g='<div id="'+s+'" class="pika-title" role="heading" aria-live="assertive">',p=!0,y=!0;for(h=[],o=0;o<12;o++)h.push('<option value="'+(n===i?o-t:12+o-t)+'"'+(o===a?' selected="selected"':"")+(f&&o<u.minMonth||m&&o>u.maxMonth?'disabled="disabled"':"")+">"+u.i18n.months[o]+"</option>");for(l='<div class="pika-label">'+u.i18n.months[a]+'<select class="pika-select pika-select-month" tabindex="-1">'+h.join("")+"</select></div>",c(u.yearRange)?(o=u.yearRange[0],r=u.yearRange[1]+1):(o=n-u.yearRange,r=1+n+u.yearRange),h=[];o<r&&o<=u.maxYear;o++)o>=u.minYear&&h.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return d='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+h.join("")+"</select></div>",g+=u.showMonthAfterYear?d+l:l+d,f&&(0===a||u.minMonth>=a)&&(p=!1),m&&(11===a||u.maxMonth<=a)&&(y=!1),0===t&&(g+='<button class="pika-prev'+(p?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(g+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),g+="</div>"},T=function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+N(e)+R(t)+"</table>"},Y=function(o){var r=this,h=r.config(o);r._onMouseDown=function(e){if(r._v){e=e||window.event;var t=e.target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?r.prevMonth():l(t,"pika-next")&&r.nextMonth():(r.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),h.bound&&i(function(){r.hide(),h.field&&h.field.blur()},100))),l(t,"pika-select"))r._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},r._onChange=function(e){e=e||window.event;var t=e.target||e.srcElement;t&&(l(t,"pika-select-month")?r.gotoMonth(t.value):l(t,"pika-select-year")&&r.gotoYear(t.value))},r._onKeyChange=function(e){if(e=e||window.event,r.isVisible())switch(e.keyCode){case 13:case 27:h.field.blur();break;case 37:e.preventDefault(),r.adjustDate("subtract",1);break;case 38:r.adjustDate("subtract",7);break;case 39:r.adjustDate("add",1);break;case 40:r.adjustDate("add",7)}},r._onInputChange=function(n){var a;n.firedBy!==r&&(t?(a=e(h.field.value,h.format,h.formatStrict),a=a&&a.isValid()?a.toDate():null):a=new Date(Date.parse(h.field.value)),f(a)&&r.setDate(a),r._v||r.show())},r._onInputFocus=function(){r.show()},r._onInputClick=function(){r.show()},r._onInputBlur=function(){var e=a.activeElement;do if(l(e,"pika-single"))return;while(e=e.parentNode);r._c||(r._b=i(function(){r.hide()},50)),r._c=!1},r._onClick=function(e){e=e||window.event;var t=e.target||e.srcElement,a=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),s(t,"change",r._onChange)));do if(l(a,"pika-single")||a===h.trigger)return;while(a=a.parentNode);r._v&&t!==h.trigger&&a!==h.trigger&&r.hide()}},r.el=a.createElement("div"),r.el.className="pika-single"+(h.isRTL?" is-rtl":"")+(h.theme?" "+h.theme:""),s(r.el,"mousedown",r._onMouseDown,!0),s(r.el,"touchend",r._onMouseDown,!0),s(r.el,"change",r._onChange),s(a,"keydown",r._onKeyChange),h.field&&(h.container?h.container.appendChild(r.el):h.bound?a.body.appendChild(r.el):h.field.parentNode.insertBefore(r.el,h.field.nextSibling),s(h.field,"change",r._onInputChange),h.defaultDate||(t&&h.field.value?h.defaultDate=e(h.field.value,h.format).toDate():h.defaultDate=new Date(Date.parse(h.field.value)),h.setDefaultDate=!0));var d=h.defaultDate;f(d)?h.setDefaultDate?r.setDate(d,!0):r.gotoDate(d):r.gotoDate(new Date),h.bound?(this.hide(),r.el.className+=" is-bound",s(h.trigger,"click",r._onInputClick),s(h.trigger,"focus",r._onInputFocus),s(h.trigger,"blur",r._onInputBlur)):this.show()};return Y.prototype={config:function(e){this._o||(this._o=_({},b,!0));var t=_(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),c(t.yearRange)){var a=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||a,t.yearRange[1]=parseInt(t.yearRange[1],10)||a}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||b.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return f(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,a){t&&e.isMoment(n)&&this.setDate(n.toDate(),a)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):new Date},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",r(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,a=this._o.maxDate;f(n)&&e<n?e=n:f(a)&&e>a&&(e=a),this._d=new Date(e.getTime()),y(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),r(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),a=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=e.getTime();a.setMonth(a.getMonth()+1),a.setDate(a.getDate()-1),t=i<n.getTime()||a.getTime()<i}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,a){var i,s=this.getDate(),o=24*parseInt(a)*60*60*1e3;"add"===n?i=new Date(s.valueOf()+o):"subtract"===n&&(i=new Date(s.valueOf()-o)),t&&("add"===n?i=e(s).add(a,"days").toDate():"subtract"===n&&(i=e(s).subtract(a,"days").toDate())),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=v(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=v({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(y(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=b.minDate,this._o.minYear=b.minYear,this._o.minMonth=b.minMonth,this._o.startRange=b.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(y(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=b.maxDate,this._o.maxYear=b.maxYear,this._o.maxMonth=b.maxMonth,this._o.endRange=b.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,a=n.minYear,s=n.maxYear,o=n.minMonth,r=n.maxMonth,h="";this._y<=a&&(this._y=a,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=s&&(this._y=s,!isNaN(r)&&this._m>r&&(this._m=r)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var l=0;l<n.numberOfMonths;l++)h+='<div class="pika-lendar">'+C(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,t)+this.render(this.calendars[l].year,this.calendars[l].month,t)+"</div>";this.el.innerHTML=h,n.bound&&"hidden"!==n.field.type&&i(function(){n.trigger.focus()},1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var e,t,n,i,s,o,r,h,l,d;if(!this._o.container){if(this.el.style.position="absolute",e=this._o.trigger,t=e,n=this.el.offsetWidth,i=this.el.offsetHeight,s=window.innerWidth||a.documentElement.clientWidth,o=window.innerHeight||a.documentElement.clientHeight,r=window.pageYOffset||a.body.scrollTop||a.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)d=e.getBoundingClientRect(),h=d.left+window.pageXOffset,l=d.bottom+window.pageYOffset;else for(h=t.offsetLeft,l=t.offsetTop+t.offsetHeight;t=t.offsetParent;)h+=t.offsetLeft,l+=t.offsetTop;(this._o.reposition&&h+n>s||this._o.position.indexOf("right")>-1&&h-n+e.offsetWidth>0)&&(h=h-n+e.offsetWidth),(this._o.reposition&&l+i>o+r||this._o.position.indexOf("top")>-1&&l-i-e.offsetHeight>0)&&(l=l-i-e.offsetHeight),this.el.style.left=h+"px",this.el.style.top=l+"px"}},render:function(e,t,n){var a=this._o,i=new Date,s=p(e,t),o=new Date(e,t,1).getDay(),r=[],h=[];y(i),a.firstDay>0&&(o-=a.firstDay,o<0&&(o+=7));for(var l=0===t?11:t-1,d=11===t?0:t+1,u=0===t?e-1:e,c=11===t?e+1:e,g=p(u,l),_=s+o,v=_;v>7;)v-=7;_+=7-v;for(var b=0,w=0;b<_;b++){var R=new Date(e,t,1+(b-o)),N=!!f(this._d)&&D(R,this._d),C=D(R,i),Y=b<o||b>=s+o,E=1+(b-o),S=t,j=e,I=a.startRange&&D(a.startRange,R),O=a.endRange&&D(a.endRange,R),F=a.startRange&&a.endRange&&a.startRange<R&&R<a.endRange,A=a.minDate&&R<a.minDate||a.maxDate&&R>a.maxDate||a.disableWeekends&&m(R)||a.disableDayFn&&a.disableDayFn(R);Y&&(b<o?(E=g+E,S=l,j=u):(E-=s,S=d,j=c));var L={day:E,month:S,year:j,isSelected:N,isToday:C,isDisabled:A,isEmpty:Y,isStartRange:I,isEndRange:O,isInRange:F,showDaysInNextAndPreviousMonths:a.showDaysInNextAndPreviousMonths};h.push(M(L)),7===++w&&(a.showWeekNumber&&h.unshift(k(b-o,t,e)),r.push(x(h,a.isRTL)),h=[],w=0)}return T(a,r,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(u(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(s(a,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;e!==!1&&(this._o.bound&&o(a,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",d(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},Y});
|
base/inc/fields/js/media-field.js
CHANGED
@@ -1,373 +1,403 @@
|
|
|
|
|
|
1 |
( function( $ ) {
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global jQuery, soWidgets */
|
2 |
+
|
3 |
( function( $ ) {
|
4 |
|
5 |
+
$(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-media', function(e) {
|
6 |
+
var $field = $( this );
|
7 |
+
var $media = $field.find('> .media-field-wrapper');
|
8 |
+
var $inputField = $field.find( '.siteorigin-widget-input' );
|
9 |
+
|
10 |
+
// Handle the media uploader
|
11 |
+
$media.find( '.media-upload-button' ).click(function(e){
|
12 |
+
e.preventDefault();
|
13 |
+
if( typeof wp.media === 'undefined' ) {
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
|
17 |
+
var $$ = $(this);
|
18 |
+
var frame = $(this ).data('frame');
|
19 |
+
|
20 |
+
// If the media frame already exists, reopen it.
|
21 |
+
if ( frame ) {
|
22 |
+
frame.open();
|
23 |
+
return false;
|
24 |
+
}
|
25 |
+
|
26 |
+
// Create the media frame.
|
27 |
+
frame = wp.media( {
|
28 |
+
// Set the title of the modal.
|
29 |
+
title: $$.data('choose'),
|
30 |
+
|
31 |
+
// Tell the modal to show only images.
|
32 |
+
library: {
|
33 |
+
type: $$.data('library').split(',').map(function(v){ return v.trim(); })
|
34 |
+
},
|
35 |
+
|
36 |
+
// Customize the submit button.
|
37 |
+
button: {
|
38 |
+
// Set the text of the button.
|
39 |
+
text: $$.data('update'),
|
40 |
+
// Tell the button not to close the modal, since we're
|
41 |
+
// going to refresh the page when the image is selected.
|
42 |
+
close: false
|
43 |
+
}
|
44 |
+
} );
|
45 |
+
|
46 |
+
// Store the frame
|
47 |
+
$$.data('frame', frame);
|
48 |
+
|
49 |
+
// When an image is selected, run a callback.
|
50 |
+
frame.on( 'select', function() {
|
51 |
+
// Grab the selected attachment.
|
52 |
+
var attachment = frame.state().get('selection').first().attributes;
|
53 |
+
|
54 |
+
$field.find('.current .title' ).html(attachment.title);
|
55 |
+
$inputField.val(attachment.id);
|
56 |
+
$inputField.trigger( 'change', { silent: true } );
|
57 |
+
|
58 |
+
var $thumbnail = $field.find( '.current .thumbnail' );
|
59 |
+
|
60 |
+
if(typeof attachment.sizes !== 'undefined'){
|
61 |
+
if(typeof attachment.sizes.thumbnail !== 'undefined'){
|
62 |
+
$thumbnail.attr('src', attachment.sizes.thumbnail.url).fadeIn();
|
63 |
+
}
|
64 |
+
else {
|
65 |
+
$thumbnail.attr('src', attachment.sizes.full.url).fadeIn();
|
66 |
+
}
|
67 |
+
}
|
68 |
+
else{
|
69 |
+
$thumbnail.attr('src', attachment.icon).fadeIn();
|
70 |
+
}
|
71 |
+
|
72 |
+
$field.find('.media-remove-button').removeClass('remove-hide');
|
73 |
+
|
74 |
+
frame.close();
|
75 |
+
} );
|
76 |
+
|
77 |
+
// Finally, open the modal.
|
78 |
+
frame.open();
|
79 |
+
});
|
80 |
+
|
81 |
+
$media.find('.current' )
|
82 |
+
.mouseenter(function(){
|
83 |
+
var t = $(this ).find('.title' );
|
84 |
+
if( t.html() !== ''){
|
85 |
+
t.fadeIn('fast');
|
86 |
+
}
|
87 |
+
})
|
88 |
+
.mouseleave(function(){
|
89 |
+
$(this ).find('.title' ).clearQueue().fadeOut('fast');
|
90 |
+
});
|
91 |
+
|
92 |
+
$field.find('a.media-remove-button' )
|
93 |
+
.click( function( e ){
|
94 |
+
e.preventDefault();
|
95 |
+
$field.find('.current .title' ).html('');
|
96 |
+
$inputField.val('');
|
97 |
+
$field.find('.current .thumbnail' ).fadeOut('fast');
|
98 |
+
$(this).addClass('remove-hide');
|
99 |
+
} );
|
100 |
+
|
101 |
+
// Everything for the dialog
|
102 |
+
var dialog = false;
|
103 |
+
|
104 |
+
var reflowDialog = function() {
|
105 |
+
if( ! dialog ) return;
|
106 |
+
|
107 |
+
var results = dialog.find('.so-widgets-image-results');
|
108 |
+
if( results.length === 0 ) return;
|
109 |
+
|
110 |
+
var width = results.width(),
|
111 |
+
perRow = Math.floor( width / 276 ),
|
112 |
+
spare = ( width - perRow * 276 ),
|
113 |
+
resultWidth = spare / perRow + 260;
|
114 |
+
|
115 |
+
results.find( '.so-widgets-result-image' ).css( {
|
116 |
+
'width' : resultWidth,
|
117 |
+
'height' : resultWidth / 1.4
|
118 |
+
} );
|
119 |
+
};
|
120 |
+
$(window).resize( reflowDialog );
|
121 |
+
|
122 |
+
var setupDialog = function(){
|
123 |
+
if( ! dialog ) {
|
124 |
+
// Create the dialog
|
125 |
+
dialog = $( $('#so-widgets-bundle-tpl-image-search-dialog').html().trim() ).appendTo( 'body' );
|
126 |
+
dialog.find( '.close' ).click( function(){
|
127 |
+
dialog.hide();
|
128 |
+
} );
|
129 |
+
|
130 |
+
var results = dialog.find( '.so-widgets-image-results' );
|
131 |
+
|
132 |
+
var fetchImages = function( query, page ){
|
133 |
+
dialog.find( '.so-widgets-results-loading' ).fadeIn('fast');
|
134 |
+
dialog.find( '.so-widgets-results-loading strong' ).html(
|
135 |
+
dialog.find( '.so-widgets-results-loading strong' ).data( 'loading' )
|
136 |
+
);
|
137 |
+
dialog.find( '.so-widgets-results-more' ).hide();
|
138 |
+
|
139 |
+
$.get(
|
140 |
+
ajaxurl,
|
141 |
+
{
|
142 |
+
'action' : 'so_widgets_image_search',
|
143 |
+
'q' : query,
|
144 |
+
'page' : page,
|
145 |
+
'_sononce' : dialog.find('input[name="_sononce"]').val()
|
146 |
+
},
|
147 |
+
function( response ){
|
148 |
+
if( response.error ) {
|
149 |
+
alert( response.message );
|
150 |
+
return;
|
151 |
+
}
|
152 |
+
|
153 |
+
results.removeClass( 'so-loading' );
|
154 |
+
$.each( response.items, function( i, r ){
|
155 |
+
var result = $( $('#so-widgets-bundle-tpl-image-search-result').html().trim() )
|
156 |
+
.appendTo( results )
|
157 |
+
.addClass( 'source-' + r.source );
|
158 |
+
var img = result.find('.so-widgets-result-image');
|
159 |
+
|
160 |
+
// Preload the image
|
161 |
+
img.css( 'background-image', 'url(' + r.thumbnail + ')' );
|
162 |
+
img.data( 'thumbnail', r.thumbnail );
|
163 |
+
img.data( 'preview', r.preview );
|
164 |
+
|
165 |
+
if( r.url ) {
|
166 |
+
img.attr( {
|
167 |
+
'href': r.url,
|
168 |
+
'target': '_blank'
|
169 |
+
} );
|
170 |
+
}
|
171 |
+
|
172 |
+
if( r.full_url ) {
|
173 |
+
img.data( {
|
174 |
+
'full_url' : r.full_url,
|
175 |
+
'import_signature' : r.import_signature
|
176 |
+
} );
|
177 |
+
img.attr( 'href', r.full_url );
|
178 |
+
}
|
179 |
+
|
180 |
+
if( r.source === 'shutterstock' ) {
|
181 |
+
img.append( $('#so-widgets-bundle-tpl-image-search-result-sponsored').html() );
|
182 |
+
}
|
183 |
+
} );
|
184 |
+
|
185 |
+
if( page === 1 ) {
|
186 |
+
dialog.find('#so-widgets-image-search-suggestions ul').empty();
|
187 |
+
$.each( response.keywords, function( i, r ){
|
188 |
+
dialog.find('#so-widgets-image-search-suggestions').show();
|
189 |
+
dialog.find('#so-widgets-image-search-suggestions ul').append(
|
190 |
+
$('<li></li>') . append( $('<a href="#"></a>').html( r ).data( 'keyword', r ) )
|
191 |
+
);
|
192 |
+
} );
|
193 |
+
}
|
194 |
+
|
195 |
+
dialog.find( '.so-widgets-results-loading' ).fadeOut('fast');
|
196 |
+
|
197 |
+
reflowDialog();
|
198 |
+
dialog
|
199 |
+
.find( '.so-widgets-results-more' ).show()
|
200 |
+
.find( 'button' ).data( { 'query': query, 'page' : page+1 } );
|
201 |
+
}
|
202 |
+
);
|
203 |
+
|
204 |
+
};
|
205 |
+
|
206 |
+
// Setup the search
|
207 |
+
dialog.find('#so-widgets-image-search-form').submit( function( e ){
|
208 |
+
e.preventDefault();
|
209 |
+
|
210 |
+
// Perform the search
|
211 |
+
var q = dialog.find('.so-widgets-search-input').val();
|
212 |
+
results.empty();
|
213 |
+
|
214 |
+
if( q !== '' ) {
|
215 |
+
// Send the query to the server
|
216 |
+
fetchImages( q, 1 );
|
217 |
+
}
|
218 |
+
} );
|
219 |
+
|
220 |
+
// Clicking on the related search buttons
|
221 |
+
dialog.on( 'click', '.so-keywords-list a', function( e ){
|
222 |
+
e.preventDefault();
|
223 |
+
var $$ = $(this).blur();
|
224 |
+
dialog.find('.so-widgets-search-input').val( $$.data( 'keyword' ) );
|
225 |
+
dialog.find('#so-widgets-image-search-form').submit();
|
226 |
+
} );
|
227 |
+
|
228 |
+
// Clicking on the more button
|
229 |
+
dialog.find('.so-widgets-results-more button').click( function(){
|
230 |
+
var $$ = $(this);
|
231 |
+
fetchImages( $$.data( 'query' ), $$.data( 'page' ) );
|
232 |
+
} );
|
233 |
+
|
234 |
+
var hoverTimeout;
|
235 |
+
|
236 |
+
// Clicking on an image to import it
|
237 |
+
dialog.on( 'click', '.so-widgets-result-image', function( e ){
|
238 |
+
var $$ = $(this);
|
239 |
+
if( ! $$.data( 'full_url' ) ) {
|
240 |
+
return;
|
241 |
+
}
|
242 |
+
|
243 |
+
e.preventDefault();
|
244 |
+
|
245 |
+
if( confirm( dialog.data('confirm-import') ) ) {
|
246 |
+
dialog.addClass( 'so-widgets-importing' );
|
247 |
+
|
248 |
+
var postId = $( '#post_ID' ).val();
|
249 |
+
if( postId === null ) {
|
250 |
+
postId = '';
|
251 |
+
}
|
252 |
+
|
253 |
+
// Send the message to import the URL
|
254 |
+
$.get(
|
255 |
+
ajaxurl,
|
256 |
+
{
|
257 |
+
'action' : 'so_widgets_image_import',
|
258 |
+
'full_url' : $$.data( 'full_url' ),
|
259 |
+
'import_signature' : $$.data( 'import_signature' ),
|
260 |
+
'post_id' : postId,
|
261 |
+
'_sononce' : dialog.find('input[name="_sononce"]').val()
|
262 |
+
},
|
263 |
+
function( response ) {
|
264 |
+
dialog.find('#so-widgets-image-search-frame').removeClass( 'so-widgets-importing' );
|
265 |
+
|
266 |
+
if( response.error === false ) {
|
267 |
+
// This was a success
|
268 |
+
dialog.hide();
|
269 |
+
dialog.find( '.so-widgets-results-loading' ).hide();
|
270 |
+
$inputField.val( response.attachment_id ).trigger('change', { silent: true } );
|
271 |
+
$field.find('.current .thumbnail' ).attr('src', response.thumb ).fadeIn();
|
272 |
+
|
273 |
+
$field.find('.media-remove-button').removeClass('remove-hide');
|
274 |
+
}
|
275 |
+
else {
|
276 |
+
alert( response.message );
|
277 |
+
dialog.find( '.so-widgets-results-loading' ).hide();
|
278 |
+
}
|
279 |
+
}
|
280 |
+
);
|
281 |
+
|
282 |
+
// Clear the dialog
|
283 |
+
dialog.find( '.so-widgets-results-loading' ).fadeIn('fast');
|
284 |
+
dialog.find( '.so-widgets-results-loading strong' ).html(
|
285 |
+
dialog.find( '.so-widgets-results-loading strong' ).data( 'importing' )
|
286 |
+
);
|
287 |
+
dialog.find( '.so-widgets-results-more' ).hide();
|
288 |
+
dialog.find('#so-widgets-image-search-frame').addClass( 'so-widgets-importing' );
|
289 |
+
}
|
290 |
+
} );
|
291 |
+
|
292 |
+
// Hovering over an image to preview it
|
293 |
+
var previewWindow = dialog.find('.so-widgets-preview-window');
|
294 |
+
dialog
|
295 |
+
.on( 'mouseenter', '.so-widgets-result-image', function(){
|
296 |
+
var $$ = $(this),
|
297 |
+
preview = $$.data('preview');
|
298 |
+
|
299 |
+
clearTimeout( hoverTimeout );
|
300 |
+
|
301 |
+
hoverTimeout = setTimeout( function(){
|
302 |
+
// Scale the preview sizes
|
303 |
+
var scalePreviewX = 1, scalePreviewY = 1;
|
304 |
+
if( preview[1] > $( window ).outerWidth() *0.33 ) {
|
305 |
+
scalePreviewX = $( window ).outerWidth() *0.33 / preview[1];
|
306 |
+
}
|
307 |
+
if( preview[2] > $( window ).outerHeight() *0.5 ) {
|
308 |
+
scalePreviewY = $( window ).outerHeight() *0.5 / preview[2];
|
309 |
+
}
|
310 |
+
var scalePreview = Math.min( scalePreviewX, scalePreviewY );
|
311 |
+
// Never upscale
|
312 |
+
if( scalePreview > 1 ) {
|
313 |
+
scalePreview = 1;
|
314 |
+
}
|
315 |
+
|
316 |
+
previewWindow.show()
|
317 |
+
.find('.so-widgets-preview-window-inside')
|
318 |
+
.css( {
|
319 |
+
'background-image' : 'url(' + $$.data('thumbnail') + ')',
|
320 |
+
'width' : preview[1] * scalePreview,
|
321 |
+
'height' : preview[2] * scalePreview
|
322 |
+
} )
|
323 |
+
.append( $( '<img />' ).attr( 'src', preview[0] ) );
|
324 |
+
|
325 |
+
dialog.trigger('mousemove');
|
326 |
+
}, 1000 );
|
327 |
+
|
328 |
+
} )
|
329 |
+
.on( 'mouseleave', '.so-widgets-result-image', function(){
|
330 |
+
previewWindow.hide().find('img').remove();
|
331 |
+
clearTimeout( hoverTimeout );
|
332 |
+
} );
|
333 |
+
|
334 |
+
var lastX, lastY;
|
335 |
+
dialog.on( 'mousemove', function( e ){
|
336 |
+
if( e.clientX ) lastX = e.clientX;
|
337 |
+
if( e.clientY ) lastY = e.clientY;
|
338 |
+
|
339 |
+
if( previewWindow.is( ':visible' ) ) {
|
340 |
+
var ph = previewWindow.outerHeight(),
|
341 |
+
pw = previewWindow.outerWidth(),
|
342 |
+
wh = $( window ).outerHeight(),
|
343 |
+
ww = $( window ).outerWidth();
|
344 |
+
|
345 |
+
|
346 |
+
// Calculate the top position
|
347 |
+
var top = lastY - ph/2;
|
348 |
+
top = Math.max( top, 10 );
|
349 |
+
top = Math.min( top, wh - 10 - ph );
|
350 |
+
|
351 |
+
// Calculate the left position
|
352 |
+
var left = (lastX < ww/2) ? lastX + 15 : lastX - 15 - pw;
|
353 |
+
|
354 |
+
// Figure out where the preview needs to go
|
355 |
+
previewWindow.css({
|
356 |
+
'top': top,
|
357 |
+
'left': left
|
358 |
+
});
|
359 |
+
|
360 |
+
}
|
361 |
+
} );
|
362 |
+
}
|
363 |
+
|
364 |
+
dialog.show();
|
365 |
+
dialog.find( '.so-widgets-search-input' ).focus();
|
366 |
+
};
|
367 |
+
|
368 |
+
// Handle displaying the image search dialog
|
369 |
+
$media.find( '.find-image-button' ).click( function(e){
|
370 |
+
e.preventDefault();
|
371 |
+
setupDialog();
|
372 |
+
} );
|
373 |
+
|
374 |
+
$inputField.change( function ( event, data ) {
|
375 |
+
if ( ! ( data && data.silent ) ) {
|
376 |
+
var newVal = $inputField.val();
|
377 |
+
if ( newVal) {
|
378 |
+
var $thumbnail = $field.find( '.current .thumbnail' );
|
379 |
+
var attachment = wp.media.attachment( newVal );
|
380 |
+
attachment.fetch().done( function () {
|
381 |
+
if ( attachment.has( 'sizes' ) ) {
|
382 |
+
var sizes = attachment.get( 'sizes' );
|
383 |
+
if ( typeof sizes.thumbnail !== 'undefined' ) {
|
384 |
+
$thumbnail.attr( 'src', sizes.thumbnail.url ).fadeIn();
|
385 |
+
}
|
386 |
+
else {
|
387 |
+
$thumbnail.attr( 'src', sizes.full.url ).fadeIn();
|
388 |
+
}
|
389 |
+
}
|
390 |
+
else {
|
391 |
+
$thumbnail.attr( 'src', attachment.get('icon') ).fadeIn();
|
392 |
+
}
|
393 |
+
$field.find('.media-remove-button').removeClass('remove-hide');
|
394 |
+
} );
|
395 |
+
} else {
|
396 |
+
$field.find( 'a.media-remove-button' ).click();
|
397 |
+
}
|
398 |
+
}
|
399 |
+
} );
|
400 |
+
|
401 |
+
});
|
402 |
+
|
403 |
+
} )( jQuery );
|
base/inc/fields/js/media-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",function(t){var i=e(this).find("> .media-field-wrapper"),
|
1 |
+
!function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",function(t){var i=e(this),s=i.find("> .media-field-wrapper"),n=i.find(".siteorigin-widget-input");s.find(".media-upload-button").click(function(t){if(t.preventDefault(),"undefined"!=typeof wp.media){var s=e(this),a=e(this).data("frame");if(a)return a.open(),!1;a=wp.media({title:s.data("choose"),library:{type:s.data("library").split(",").map(function(e){return e.trim()})},button:{text:s.data("update"),close:!1}}),s.data("frame",a),a.on("select",function(){var e=a.state().get("selection").first().attributes;i.find(".current .title").html(e.title),n.val(e.id),n.trigger("change",{silent:!0});var t=i.find(".current .thumbnail");"undefined"!=typeof e.sizes?"undefined"!=typeof e.sizes.thumbnail?t.attr("src",e.sizes.thumbnail.url).fadeIn():t.attr("src",e.sizes.full.url).fadeIn():t.attr("src",e.icon).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide"),a.close()}),a.open()}}),s.find(".current").mouseenter(function(){var t=e(this).find(".title");""!==t.html()&&t.fadeIn("fast")}).mouseleave(function(){e(this).find(".title").clearQueue().fadeOut("fast")}),i.find("a.media-remove-button").click(function(t){t.preventDefault(),i.find(".current .title").html(""),n.val(""),i.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")});var a=!1,r=function(){if(a){var e=a.find(".so-widgets-image-results");if(0!==e.length){var t=e.width(),i=Math.floor(t/276),s=t-276*i,n=s/i+260;e.find(".so-widgets-result-image").css({width:n,height:n/1.4})}}};e(window).resize(r);var o=function(){if(!a){a=e(e("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body"),a.find(".close").click(function(){a.hide()});var t=a.find(".so-widgets-image-results"),s=function(i,s){a.find(".so-widgets-results-loading").fadeIn("fast"),a.find(".so-widgets-results-loading strong").html(a.find(".so-widgets-results-loading strong").data("loading")),a.find(".so-widgets-results-more").hide(),e.get(ajaxurl,{action:"so_widgets_image_search",q:i,page:s,_sononce:a.find('input[name="_sononce"]').val()},function(n){return n.error?void alert(n.message):(t.removeClass("so-loading"),e.each(n.items,function(i,s){var n=e(e("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(t).addClass("source-"+s.source),a=n.find(".so-widgets-result-image");a.css("background-image","url("+s.thumbnail+")"),a.data("thumbnail",s.thumbnail),a.data("preview",s.preview),s.url&&a.attr({href:s.url,target:"_blank"}),s.full_url&&(a.data({full_url:s.full_url,import_signature:s.import_signature}),a.attr("href",s.full_url)),"shutterstock"===s.source&&a.append(e("#so-widgets-bundle-tpl-image-search-result-sponsored").html())}),1===s&&(a.find("#so-widgets-image-search-suggestions ul").empty(),e.each(n.keywords,function(t,i){a.find("#so-widgets-image-search-suggestions").show(),a.find("#so-widgets-image-search-suggestions ul").append(e("<li></li>").append(e('<a href="#"></a>').html(i).data("keyword",i)))})),a.find(".so-widgets-results-loading").fadeOut("fast"),r(),void a.find(".so-widgets-results-more").show().find("button").data({query:i,page:s+1}))})};a.find("#so-widgets-image-search-form").submit(function(e){e.preventDefault();var i=a.find(".so-widgets-search-input").val();t.empty(),""!==i&&s(i,1)}),a.on("click",".so-keywords-list a",function(t){t.preventDefault();var i=e(this).blur();a.find(".so-widgets-search-input").val(i.data("keyword")),a.find("#so-widgets-image-search-form").submit()}),a.find(".so-widgets-results-more button").click(function(){var t=e(this);s(t.data("query"),t.data("page"))});var o;a.on("click",".so-widgets-result-image",function(t){var s=e(this);if(s.data("full_url")&&(t.preventDefault(),confirm(a.data("confirm-import")))){a.addClass("so-widgets-importing");var r=e("#post_ID").val();null===r&&(r=""),e.get(ajaxurl,{action:"so_widgets_image_import",full_url:s.data("full_url"),import_signature:s.data("import_signature"),post_id:r,_sononce:a.find('input[name="_sononce"]').val()},function(e){a.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),e.error===!1?(a.hide(),a.find(".so-widgets-results-loading").hide(),n.val(e.attachment_id).trigger("change",{silent:!0}),i.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),a.find(".so-widgets-results-loading").hide())}),a.find(".so-widgets-results-loading").fadeIn("fast"),a.find(".so-widgets-results-loading strong").html(a.find(".so-widgets-results-loading strong").data("importing")),a.find(".so-widgets-results-more").hide(),a.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}});var d=a.find(".so-widgets-preview-window");a.on("mouseenter",".so-widgets-result-image",function(){var t=e(this),i=t.data("preview");clearTimeout(o),o=setTimeout(function(){var s=1,n=1;i[1]>.33*e(window).outerWidth()&&(s=.33*e(window).outerWidth()/i[1]),i[2]>.5*e(window).outerHeight()&&(n=.5*e(window).outerHeight()/i[2]);var r=Math.min(s,n);r>1&&(r=1),d.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+t.data("thumbnail")+")",width:i[1]*r,height:i[2]*r}).append(e("<img />").attr("src",i[0])),a.trigger("mousemove")},1e3)}).on("mouseleave",".so-widgets-result-image",function(){d.hide().find("img").remove(),clearTimeout(o)});var u,l;a.on("mousemove",function(t){if(t.clientX&&(u=t.clientX),t.clientY&&(l=t.clientY),d.is(":visible")){var i=d.outerHeight(),s=d.outerWidth(),n=e(window).outerHeight(),a=e(window).outerWidth(),r=l-i/2;r=Math.max(r,10),r=Math.min(r,n-10-i);var o=u<a/2?u+15:u-15-s;d.css({top:r,left:o})}})}a.show(),a.find(".so-widgets-search-input").focus()};s.find(".find-image-button").click(function(e){e.preventDefault(),o()}),n.change(function(e,t){if(!t||!t.silent){var s=n.val();if(s){var a=i.find(".current .thumbnail"),r=wp.media.attachment(s);r.fetch().done(function(){if(r.has("sizes")){var e=r.get("sizes");"undefined"!=typeof e.thumbnail?a.attr("src",e.thumbnail.url).fadeIn():a.attr("src",e.full.url).fadeIn()}else a.attr("src",r.get("icon")).fadeIn();i.find(".media-remove-button").removeClass("remove-hide")})}else i.find("a.media-remove-button").click()}})})}(jQuery);
|
base/inc/fields/js/order-field.js
CHANGED
@@ -1,22 +1,35 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
4 |
-
var $form = $(e.target);
|
5 |
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
21 |
|
22 |
-
}( jQuery ) );
|
1 |
+
/* global jQuery, soWidgets */
|
2 |
|
3 |
+
( function($){
|
|
|
4 |
|
5 |
+
$(document).on( 'sowsetupform', function(e) {
|
6 |
+
var $form = $(e.target);
|
7 |
|
8 |
+
$form.find( '.siteorigin-widget-field-type-order' ).each( function(){
|
9 |
+
var $$ = $( this );
|
10 |
+
var $valField = $$.find( '.siteorigin-widget-input' );
|
11 |
+
var $items = $$.find( '.siteorigin-widget-order-items' );
|
12 |
+
$items.sortable( {
|
13 |
+
stop: function(){
|
14 |
+
var val = $( this ).sortable( 'toArray', { attribute: 'data-value' } );
|
15 |
+
$valField.val( val.join(',') );
|
16 |
+
$valField.trigger( 'change', { silent: true } );
|
17 |
+
}
|
18 |
+
} );
|
19 |
|
20 |
+
$$.change( function ( event, params ) {
|
21 |
+
if ( ! ( params && params.silent ) ) {
|
22 |
+
var values = $valField.val() === '' ? [] : $valField.val().split(',');
|
23 |
+
if ( values.length ) {
|
24 |
+
for ( var i = 0; i < values.length; i++) {
|
25 |
+
var val = values[ i ];
|
26 |
+
var $item = $$.find( '.siteorigin-widget-order-item[data-value=' + val + ']' );
|
27 |
+
$items.append( $item );
|
28 |
+
}
|
29 |
+
}
|
30 |
+
}
|
31 |
+
} );
|
32 |
+
} );
|
33 |
+
});
|
34 |
|
35 |
+
}( jQuery ) );
|
base/inc/fields/js/order-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(i){i(document).on("sowsetupform",function(t){var e=i(t.target);e.find(".siteorigin-widget-field-type-order").each(function(){var t=i(this)
|
1 |
+
!function(i){i(document).on("sowsetupform",function(t){var e=i(t.target);e.find(".siteorigin-widget-field-type-order").each(function(){var t=i(this),e=t.find(".siteorigin-widget-input"),n=t.find(".siteorigin-widget-order-items");n.sortable({stop:function(){var t=i(this).sortable("toArray",{attribute:"data-value"});e.val(t.join(",")),e.trigger("change",{silent:!0})}}),t.change(function(i,r){if(!r||!r.silent){var a=""===e.val()?[]:e.val().split(",");if(a.length)for(var o=0;o<a.length;o++){var d=a[o],g=t.find(".siteorigin-widget-order-item[data-value="+d+"]");n.append(g)}}})})})}(jQuery);
|
base/inc/fields/js/posts-field.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global jQuery, soWidgets */
|
2 |
+
|
3 |
+
(function( $ ) {
|
4 |
+
|
5 |
+
$( document ).on( 'sowsetupform', '.siteorigin-widget-field-type-posts', function ( e ) {
|
6 |
+
var $postsField = $( this );
|
7 |
+
$postsField.change( function ( event ) {
|
8 |
+
var queryVars = $postsField.find( ':input' ).serializeArray();
|
9 |
+
var queryObj = {};
|
10 |
+
queryVars.forEach( function ( queryInput ) {
|
11 |
+
if ( queryInput.value !== null && queryInput.value !== '' ) {
|
12 |
+
var nameMatch = queryInput.name.match( /\[([^\[\]]+)\]$/ );
|
13 |
+
if ( nameMatch !== null ) {
|
14 |
+
var name = nameMatch[ 1 ];
|
15 |
+
if ( queryObj.hasOwnProperty( name ) ) {
|
16 |
+
queryObj[ name ] += ',' + queryInput.value;
|
17 |
+
} else {
|
18 |
+
queryObj[ name ] = queryInput.value;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
} );
|
23 |
+
|
24 |
+
var query = '';
|
25 |
+
for ( var key in queryObj ) {
|
26 |
+
if ( query !== '' ) {
|
27 |
+
query += '&';
|
28 |
+
}
|
29 |
+
query += key + '=' + queryObj[ key ];
|
30 |
+
}
|
31 |
+
|
32 |
+
$.post(
|
33 |
+
soWidgets.ajaxurl,
|
34 |
+
{ action: 'sow_get_posts_count', query: query },
|
35 |
+
function(data){
|
36 |
+
$postsField.find( '.sow-current-count' ).text( data.posts_count );
|
37 |
+
|
38 |
+
}
|
39 |
+
);
|
40 |
+
} );
|
41 |
+
} );
|
42 |
+
|
43 |
+
})( jQuery );
|
base/inc/fields/js/posts-field.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(n){n(document).on("sowsetupform",".siteorigin-widget-field-type-posts",function(t){var o=n(this);o.change(function(t){var e=o.find(":input").serializeArray(),i={};e.forEach(function(n){if(null!==n.value&&""!==n.value){var t=n.name.match(/\[([^\[\]]+)\]$/);if(null!==t){var o=t[1];i.hasOwnProperty(o)?i[o]+=","+n.value:i[o]=n.value}}});var u="";for(var a in i)""!==u&&(u+="&"),u+=a+"="+i[a];n.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:u},function(n){o.find(".sow-current-count").text(n.posts_count)})})})}(jQuery);
|
base/inc/fields/js/tinymce-field.js
CHANGED
@@ -1,85 +1,88 @@
|
|
1 |
/* global tinyMCEPreInit, quicktags, QTags, tinymce */
|
2 |
|
3 |
(function( $ ) {
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
|
83 |
if ( mode == 'tmce') {
|
84 |
// Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
|
85 |
var editor = tinymce.get(id);
|
@@ -94,49 +97,49 @@
|
|
94 |
editor.setContent(window.switchEditors.wpautop(content));
|
95 |
}
|
96 |
}
|
97 |
-
|
98 |
-
$(this).find('+ .siteorigin-widget-tinymce-selected-editor').val(mode);
|
99 |
-
}
|
100 |
-
});
|
101 |
-
});
|
102 |
-
QTags._buttonsInit();
|
103 |
-
}
|
104 |
-
else {
|
105 |
-
setTimeout(function(){
|
106 |
-
setup(widgetForm);
|
107 |
-
}, 500);
|
108 |
-
}
|
109 |
-
};
|
110 |
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
|
142 |
})( jQuery );
|
1 |
/* global tinyMCEPreInit, quicktags, QTags, tinymce */
|
2 |
|
3 |
(function( $ ) {
|
4 |
+
var setup = function(widgetForm) {
|
5 |
+
if(typeof tinyMCEPreInit !== 'undefined') {
|
6 |
+
//BS TinyMCE widget sometimes adds 'undefined' as an id when opening PB, which causes a JS error when using repeaters.
|
7 |
+
if (tinyMCEPreInit.mceInit.hasOwnProperty('undefined')) {
|
8 |
+
delete tinyMCEPreInit.mceInit['undefined'];
|
9 |
+
}
|
10 |
+
if (tinyMCEPreInit.qtInit.hasOwnProperty('undefined')) {
|
11 |
+
delete tinyMCEPreInit.qtInit['undefined'];
|
12 |
+
}
|
13 |
+
if (QTags.instances.hasOwnProperty('undefined')) {
|
14 |
+
delete QTags.instances['undefined'];
|
15 |
+
}
|
16 |
+
$(widgetForm).find('> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container').each(function (index, element) {
|
17 |
+
var $container = $(element);
|
18 |
+
var $textarea = $container.find('textarea');
|
19 |
+
var id = $textarea.attr('id');
|
20 |
+
if( typeof tinymce !== 'undefined') {
|
21 |
+
if (id.indexOf('__i__') > -1) return;
|
22 |
+
var mceSettings = $container.data('mceSettings');
|
23 |
+
var widgetIdBase = $container.data('widgetIdBase');
|
24 |
+
var name = $textarea.attr('name').replace(/\[\d*\]/g, '');
|
25 |
+
var fieldName = /[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(name)[1];
|
26 |
+
var idPattern = new RegExp('widget-' + widgetIdBase + '-?.*-' + fieldName.replace(/\]\[/g, '-') + '[-\d]*');
|
27 |
+
for (var initId in tinyMCEPreInit.mceInit) {
|
28 |
+
if (initId.match(idPattern)) {
|
29 |
+
mceSettings = $.extend({}, tinyMCEPreInit.mceInit[initId], mceSettings);
|
30 |
+
}
|
31 |
+
}
|
32 |
+
var content;
|
33 |
+
var curEd = tinymce.get(id);
|
34 |
+
if ( curEd !== null ) {
|
35 |
+
// Only keep content when we're not in Visual Composer.
|
36 |
+
if ( typeof vc === 'undefined' && $container.closest('.vc_active').length === 0 ) {
|
37 |
+
content = curEd.getContent();
|
38 |
+
}
|
39 |
+
curEd.remove();
|
40 |
+
}
|
41 |
+
var setupEditor = function (editor) {
|
42 |
+
editor.on('change',
|
43 |
+
function () {
|
44 |
+
tinymce.get(id).save();
|
45 |
+
$textarea.trigger('change');
|
46 |
+
$textarea.val(window.switchEditors.pre_wpautop(editor.getContent()));
|
47 |
+
}
|
48 |
+
);
|
49 |
+
editor.on('init',
|
50 |
+
function () {
|
51 |
+
if (content) {
|
52 |
+
editor.setContent(content);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
);
|
56 |
+
};
|
57 |
+
mceSettings = $.extend({}, mceSettings, {selector: '#' + id, setup: setupEditor});
|
58 |
+
tinyMCEPreInit.mceInit[id] = mceSettings;
|
59 |
+
var wrapDiv = $container.find('div#wp-' + id + '-wrap');
|
60 |
+
if (wrapDiv.hasClass('tmce-active')) {
|
61 |
+
// Add a small timeout to make sure everything is ready - mainly for customizer and widgets interface
|
62 |
+
if ($('#' + id).is(':visible')) {
|
63 |
+
tinymce.init(tinyMCEPreInit.mceInit[id]);
|
64 |
+
}
|
65 |
+
else {
|
66 |
+
var intervalId = setInterval(function () {
|
67 |
+
if ($('#' + id).is(':visible')) {
|
68 |
+
tinymce.init(tinyMCEPreInit.mceInit[id]);
|
69 |
+
clearInterval(intervalId);
|
70 |
+
}
|
71 |
+
}, 500);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
var qtSettings = $container.data('qtSettings');
|
76 |
+
qtSettings = $.extend({}, tinyMCEPreInit.qtInit['siteorigin-widget-input-tinymce-field'], qtSettings, {id: id});
|
77 |
+
tinyMCEPreInit.qtInit[id] = qtSettings;
|
78 |
+
$container.find('.quicktags-toolbar').remove();
|
79 |
+
quicktags(tinyMCEPreInit.qtInit[id]);
|
80 |
|
81 |
+
$(this).on( 'click', function(event) {
|
82 |
+
|
83 |
+
var $target = $(event.target);
|
84 |
+
if ( $target.hasClass( 'wp-switch-editor' ) ) {
|
85 |
+
var mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
|
86 |
if ( mode == 'tmce') {
|
87 |
// Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
|
88 |
var editor = tinymce.get(id);
|
97 |
editor.setContent(window.switchEditors.wpautop(content));
|
98 |
}
|
99 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
+
$(this).find('+ .siteorigin-widget-tinymce-selected-editor').val(mode);
|
102 |
+
}
|
103 |
+
});
|
104 |
+
});
|
105 |
+
QTags._buttonsInit();
|
106 |
+
}
|
107 |
+
else {
|
108 |
+
setTimeout(function(){
|
109 |
+
setup(widgetForm);
|
110 |
+
}, 500);
|
111 |
+
}
|
112 |
+
};
|
113 |
+
|
114 |
+
$(document).on( 'sowsetupform', function(e) {
|
115 |
+
var $f = $(e.target);
|
116 |
|
117 |
+
if($f.is('.siteorigin-widget-field-repeater-item-form')){
|
118 |
+
if($f.is(':visible')) {
|
119 |
+
setup( $f );
|
120 |
+
}
|
121 |
+
else {
|
122 |
+
$f.on('slideToggleOpenComplete', function onSlideToggleComplete() {
|
123 |
+
if( $f.is(':visible') ){
|
124 |
+
setup($f);
|
125 |
+
$f.off('slideToggleOpenComplete');
|
126 |
+
}
|
127 |
+
});
|
128 |
+
}
|
129 |
+
}
|
130 |
+
else {
|
131 |
+
setup($f);
|
132 |
+
}
|
133 |
+
});
|
134 |
+
$(document).on('sortstop', function (event, ui) {
|
135 |
+
if(ui.item.is('.siteorigin-widget-field-repeater-item')) {
|
136 |
+
ui.item.find('> .siteorigin-widget-field-repeater-item-form').each(function(){
|
137 |
+
setup( $(this) );
|
138 |
+
});
|
139 |
+
}
|
140 |
+
else {
|
141 |
+
setup(ui.item.find('.siteorigin-widget-form'));
|
142 |
+
}
|
143 |
+
});
|
144 |
|
145 |
})( jQuery );
|
base/inc/fields/js/tinymce-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),a=r.attr("id");if("undefined"!=typeof tinymce){if(a.indexOf("__i__")>-1)return;var
|
1 |
+
!function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),a=r.attr("id");if("undefined"!=typeof tinymce){if(a.indexOf("__i__")>-1)return;var s=n.data("mceSettings"),o=n.data("widgetIdBase"),c=r.attr("name").replace(/\[\d*\]/g,""),d=/[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(c)[1],f=new RegExp("widget-"+o+"-?.*-"+d.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(s=e.extend({},tinyMCEPreInit.mceInit[g],s));var l,m=tinymce.get(a);null!==m&&("undefined"==typeof vc&&0===n.closest(".vc_active").length&&(l=m.getContent()),m.remove());var u=function(e){e.on("change",function(){tinymce.get(a).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){l&&e.setContent(l)})};s=e.extend({},s,{selector:"#"+a,setup:u}),tinyMCEPreInit.mceInit[a]=s;var v=n.find("div#wp-"+a+"-wrap");if(v.hasClass("tmce-active"))if(e("#"+a).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[a]);else var y=setInterval(function(){e("#"+a).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[a]),clearInterval(y))},500)}var p=n.data("qtSettings");p=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],p,{id:a}),tinyMCEPreInit.qtInit[a]=p,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[a]),e(this).on("click",function(t){var i=e(t.target);if(i.hasClass("wp-switch-editor")){var n=i.hasClass("switch-tmce")?"tmce":"html";if("tmce"==n){var s=tinymce.get(a);if(null!=s){var o=r.val();o.search("<")!=-1&&o.search(">")==-1&&(o=o.replace(/</g,""),r.val(o)),s.setContent(window.switchEditors.wpautop(o))}}e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(n)}})}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
|
base/inc/fields/number.class.php
CHANGED
@@ -5,6 +5,12 @@
|
|
5 |
*/
|
6 |
class SiteOrigin_Widget_Field_Number extends SiteOrigin_Widget_Field_Text_Input_Base {
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
protected function get_input_classes() {
|
9 |
$input_classes = parent::get_input_classes();
|
10 |
$input_classes[] = 'siteorigin-widget-input-number';
|
@@ -14,4 +20,4 @@ class SiteOrigin_Widget_Field_Number extends SiteOrigin_Widget_Field_Text_Input_
|
|
14 |
protected function sanitize_field_input( $value, $instance ) {
|
15 |
return ( $value === '' ) ? false : (float) $value;
|
16 |
}
|
17 |
-
}
|
5 |
*/
|
6 |
class SiteOrigin_Widget_Field_Number extends SiteOrigin_Widget_Field_Text_Input_Base {
|
7 |
|
8 |
+
protected function get_default_options() {
|
9 |
+
return array(
|
10 |
+
'input_type' => 'number',
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
protected function get_input_classes() {
|
15 |
$input_classes = parent::get_input_classes();
|
16 |
$input_classes[] = 'siteorigin-widget-input-number';
|
20 |
protected function sanitize_field_input( $value, $instance ) {
|
21 |
return ( $value === '' ) ? false : (float) $value;
|
22 |
}
|
23 |
+
}
|
base/inc/fields/posts.class.php
CHANGED
@@ -3,15 +3,174 @@
|
|
3 |
/**
|
4 |
* Class SiteOrigin_Widget_Field_Posts
|
5 |
*/
|
6 |
-
class SiteOrigin_Widget_Field_Posts extends
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
protected function render_field( $value, $instance ) {
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
protected function sanitize_field_input( $value, $instance ) {
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
-
}
|
3 |
/**
|
4 |
* Class SiteOrigin_Widget_Field_Posts
|
5 |
*/
|
6 |
+
class SiteOrigin_Widget_Field_Posts extends SiteOrigin_Widget_Field_Container_Base {
|
7 |
+
|
8 |
+
public function __construct( $base_name, $element_id, $element_name, $field_options, SiteOrigin_Widget $for_widget, $parent_container = array() ) {
|
9 |
+
parent::__construct( $base_name, $element_id, $element_name, $field_options, $for_widget, $parent_container );
|
10 |
+
|
11 |
+
$types = get_post_types( array( 'public' => true ), 'objects' );
|
12 |
+
$type_options = array( '_all' => __( 'All', 'so-widgets-bundle' ) );
|
13 |
+
|
14 |
+
foreach ( $types as $id => $type ) {
|
15 |
+
$type_options[ $id ] = $type->labels->name;
|
16 |
+
}
|
17 |
+
|
18 |
+
$this->fields = array(
|
19 |
+
|
20 |
+
'post_type' => array(
|
21 |
+
'type' => 'select',
|
22 |
+
'label' => __( 'Post type', 'so-widgets-bundle' ),
|
23 |
+
'multiple' => true,
|
24 |
+
'options' => $type_options,
|
25 |
+
'default' => 'post'
|
26 |
+
),
|
27 |
+
|
28 |
+
'post__in' => array(
|
29 |
+
'type' => 'autocomplete',
|
30 |
+
'label' => __( 'Post in', 'so-widgets-bundle' ),
|
31 |
+
'source' => 'posts',
|
32 |
+
),
|
33 |
+
|
34 |
+
'tax_query' => array(
|
35 |
+
'type' => 'autocomplete',
|
36 |
+
'label' => __( 'Taxonomies', 'so-widgets-bundle' ),
|
37 |
+
'source' => 'terms',
|
38 |
+
),
|
39 |
+
|
40 |
+
'date_type' => array(
|
41 |
+
'type' => 'radio',
|
42 |
+
'label' => __( 'Date selection type', 'so-widgets-bundle' ),
|
43 |
+
'options' => array(
|
44 |
+
'specific' => __( 'Specific', 'so-widgets-bundle' ),
|
45 |
+
'relative' => __( 'Relative', 'so-widgets-bundle' ),
|
46 |
+
),
|
47 |
+
'description' => __( 'Select a range between specific dates or relative to the current date.', 'so-widgets-bundle' ),
|
48 |
+
'default' => 'specific',
|
49 |
+
'state_emitter' => array(
|
50 |
+
'callback' => 'select',
|
51 |
+
'args' => array( 'date_type' )
|
52 |
+
),
|
53 |
+
),
|
54 |
+
|
55 |
+
'date_query' => array(
|
56 |
+
'type' => 'date-range',
|
57 |
+
'label' => __( 'Dates', 'so-widgets-bundle' ),
|
58 |
+
'date_type' => 'specific',
|
59 |
+
'state_handler' => array(
|
60 |
+
'date_type[specific]' => array('show'),
|
61 |
+
'_else[date_type]' => array('hide'),
|
62 |
+
),
|
63 |
+
),
|
64 |
+
|
65 |
+
'date_query_relative' => array(
|
66 |
+
'type' => 'date-range',
|
67 |
+
'label' => __( 'Dates', 'so-widgets-bundle' ),
|
68 |
+
'date_type' => 'relative',
|
69 |
+
'state_handler' => array(
|
70 |
+
'date_type[relative]' => array('show'),
|
71 |
+
'_else[date_type]' => array('hide'),
|
72 |
+
),
|
73 |
+
),
|
74 |
+
|
75 |
+
'orderby' => array(
|
76 |
+
'type' => 'select',
|
77 |
+
'label' => __( 'Order by', 'so-widgets-bundle' ),
|
78 |
+
'options' => array(
|
79 |
+
'none' => __( 'No order', 'so-widgets-bundle' ),
|
80 |
+
'ID' => __( 'Post ID', 'so-widgets-bundle' ),
|
81 |
+
'author' => __( 'Author', 'so-widgets-bundle' ),
|
82 |
+
'title' => __( 'Title', 'so-widgets-bundle' ),
|
83 |
+
'date' => __( 'Published date', 'so-widgets-bundle' ),
|
84 |
+
'modified' => __( 'Modified date', 'so-widgets-bundle' ),
|
85 |
+
'parent' => __( 'By parent', 'so-widgets-bundle' ),
|
86 |
+
'rand' => __( 'Random order', 'so-widgets-bundle' ),
|
87 |
+
'comment_count' => __( 'Comment count', 'so-widgets-bundle' ),
|
88 |
+
'menu_order' => __( 'Menu order', 'so-widgets-bundle' ),
|
89 |
+
'meta_value' => __( 'By meta value', 'so-widgets-bundle' ),
|
90 |
+
'meta_value_num' => __( 'By numeric meta value', 'so-widgets-bundle' ),
|
91 |
+
'post__in' => __( 'By include order', 'so-widgets-bundle' ),
|
92 |
+
),
|
93 |
+
'default' => 'date',
|
94 |
+
),
|
95 |
+
|
96 |
+
'order' => array(
|
97 |
+
'type' => 'radio',
|
98 |
+
'label' => __( 'Order direction', 'so-widgets-bundle' ),
|
99 |
+
'options' => array(
|
100 |
+
'ASC' => __( 'Ascending', 'so-widgets-bundle' ),
|
101 |
+
'DESC' => __( 'Descending', 'so-widgets-bundle' ),
|
102 |
+
),
|
103 |
+
'default' => 'DESC',
|
104 |
+
),
|
105 |
+
|
106 |
+
'posts_per_page' => array(
|
107 |
+
'type' => 'number',
|
108 |
+
'label' => __( 'Posts per page', 'so-widgets-bundle' ),
|
109 |
+
),
|
110 |
+
|
111 |
+
'sticky' => array(
|
112 |
+
'type' => 'select',
|
113 |
+
'label' => __( 'Sticky posts', 'so-widgets-bundle' ),
|
114 |
+
'options' => array(
|
115 |
+
'' => __( 'Default', 'so-widgets-bundle' ),
|
116 |
+
'ignore' => __( 'Ignore sticky', 'so-widgets-bundle' ),
|
117 |
+
'exclude' => __( 'Exclude sticky', 'so-widgets-bundle' ),
|
118 |
+
'only' => __( 'Only sticky', 'so-widgets-bundle' ),
|
119 |
+
),
|
120 |
+
),
|
121 |
+
|
122 |
+
'additional' => array(
|
123 |
+
'type' => 'text',
|
124 |
+
'label' => __( 'Additional', 'so-widgets-bundle' ),
|
125 |
+
'description' => __( 'Additional query arguments. See <a href="http://codex.wordpress.org/Function_Reference/query_posts" target="_blank">query_posts</a>.', 'so-widgets-bundle' )
|
126 |
+
),
|
127 |
+
);
|
128 |
+
}
|
129 |
+
|
130 |
+
protected function render_field_label( $value, $instance ) {
|
131 |
+
?><div class="posts-container-label-wrapper<?php if ( $this->state == 'open' ) {
|
132 |
+
echo ' siteorigin-widget-section-visible';
|
133 |
+
} ?>"><?php
|
134 |
+
parent::render_field_label( $value, $instance );
|
135 |
+
?><span class="sow-current-count"><?php echo esc_html( siteorigin_widget_post_selector_count_posts( $value ) )?></span>
|
136 |
+
</div><?php
|
137 |
+
}
|
138 |
|
139 |
protected function render_field( $value, $instance ) {
|
140 |
+
$value = wp_parse_args( $value );
|
141 |
+
if ( $this->collapsible ) {
|
142 |
+
?><div class="siteorigin-widget-section <?php if ( $this->state == 'closed' ) {
|
143 |
+
echo 'siteorigin-widget-section-hide';
|
144 |
+
} ?>"><?php
|
145 |
+
}
|
146 |
+
|
147 |
+
$this->create_and_render_sub_fields( $value, array( 'name' => $this->base_name, 'type' => 'composite' ) );
|
148 |
+
|
149 |
+
if ( $this->collapsible ) {
|
150 |
+
?></div><?php
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
public function enqueue_scripts() {
|
155 |
+
wp_enqueue_script(
|
156 |
+
'so-posts-selector-field',
|
157 |
+
plugin_dir_url( __FILE__ ) . 'js/posts-field' . SOW_BUNDLE_JS_SUFFIX . '.js',
|
158 |
+
array( 'jquery' ),
|
159 |
+
SOW_BUNDLE_VERSION,
|
160 |
+
true
|
161 |
+
);
|
162 |
}
|
163 |
|
164 |
protected function sanitize_field_input( $value, $instance ) {
|
165 |
+
$value = parent::sanitize_field_input( $value, $instance );
|
166 |
+
$result = '';
|
167 |
+
foreach ( $value as $key => $item ) {
|
168 |
+
if ( ! empty( $item ) ) {
|
169 |
+
$result .= ( empty( $result ) ? '' : '&' ) . $key . '=' . $item;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
return $result;
|
174 |
}
|
175 |
|
176 |
+
}
|
base/inc/fields/select.class.php
CHANGED
@@ -31,7 +31,8 @@ class SiteOrigin_Widget_Field_Select extends SiteOrigin_Widget_Field_Base {
|
|
31 |
protected function render_field( $value, $instance ) {
|
32 |
?>
|
33 |
<select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
|
34 |
-
class="siteorigin-widget-input
|
|
|
35 |
<?php if ( empty( $this->multiple ) && isset( $this->prompt ) ) : ?>
|
36 |
<option value="default" disabled="disabled" selected="selected"><?php echo esc_html( $this->prompt ) ?></option>
|
37 |
<?php endif; ?>
|
@@ -68,4 +69,4 @@ class SiteOrigin_Widget_Field_Select extends SiteOrigin_Widget_Field_Base {
|
|
68 |
return count( $sanitized_value ) == 1 ? $sanitized_value[0] : $sanitized_value;
|
69 |
}
|
70 |
|
71 |
-
}
|
31 |
protected function render_field( $value, $instance ) {
|
32 |
?>
|
33 |
<select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
|
34 |
+
class="siteorigin-widget-input<?php if ( ! empty( $this->input_css_classes ) ) echo ' ' . implode( ' ', $this->input_css_classes ) ?>"
|
35 |
+
<?php if( ! empty( $this->multiple ) ) echo 'multiple' ?>>
|
36 |
<?php if ( empty( $this->multiple ) && isset( $this->prompt ) ) : ?>
|
37 |
<option value="default" disabled="disabled" selected="selected"><?php echo esc_html( $this->prompt ) ?></option>
|
38 |
<?php endif; ?>
|
69 |
return count( $sanitized_value ) == 1 ? $sanitized_value[0] : $sanitized_value;
|
70 |
}
|
71 |
|
72 |
+
}
|
base/inc/fields/text-input-base.class.php
CHANGED
@@ -15,6 +15,7 @@ abstract class SiteOrigin_Widget_Field_Text_Input_Base extends SiteOrigin_Widget
|
|
15 |
* @var string
|
16 |
*/
|
17 |
protected $placeholder;
|
|
|
18 |
/**
|
19 |
* If true, this field will not be editable.
|
20 |
*
|
@@ -23,6 +24,14 @@ abstract class SiteOrigin_Widget_Field_Text_Input_Base extends SiteOrigin_Widget
|
|
23 |
*/
|
24 |
protected $readonly;
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
/**
|
27 |
* The CSS classes to be applied to the rendered text input.
|
28 |
*/
|
@@ -37,6 +46,12 @@ abstract class SiteOrigin_Widget_Field_Text_Input_Base extends SiteOrigin_Widget
|
|
37 |
return array();
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
protected function render_data_attributes( $data_attributes ) {
|
41 |
$attr_string = '';
|
42 |
foreach ( $data_attributes as $name => $value ) {
|
@@ -47,7 +62,9 @@ abstract class SiteOrigin_Widget_Field_Text_Input_Base extends SiteOrigin_Widget
|
|
47 |
|
48 |
protected function render_field( $value, $instance ) {
|
49 |
?>
|
50 |
-
<input type="
|
|
|
|
|
51 |
value="<?php echo esc_attr( $value ) ?>"
|
52 |
<?php $this->render_data_attributes( $this->get_input_data_attributes() ) ?>
|
53 |
<?php $this->render_CSS_classes( $this->get_input_classes() ) ?>
|
@@ -61,4 +78,4 @@ abstract class SiteOrigin_Widget_Field_Text_Input_Base extends SiteOrigin_Widget
|
|
61 |
$sanitized_value = balanceTags( $sanitized_value , true );
|
62 |
return $sanitized_value;
|
63 |
}
|
64 |
-
}
|
15 |
* @var string
|
16 |
*/
|
17 |
protected $placeholder;
|
18 |
+
|
19 |
/**
|
20 |
* If true, this field will not be editable.
|
21 |
*
|
24 |
*/
|
25 |
protected $readonly;
|
26 |
|
27 |
+
/**
|
28 |
+
* The type of this input.
|
29 |
+
*
|
30 |
+
* @access protected
|
31 |
+
* @var string
|
32 |
+
*/
|
33 |
+
protected $input_type;
|
34 |
+
|
35 |
/**
|
36 |
* The CSS classes to be applied to the rendered text input.
|
37 |
*/
|
46 |
return array();
|
47 |
}
|
48 |
|
49 |
+
protected function get_default_options() {
|
50 |
+
return array(
|
51 |
+
'input_type' => 'text',
|
52 |
+
);
|
53 |
+
}
|
54 |
+
|
55 |
protected function render_data_attributes( $data_attributes ) {
|
56 |
$attr_string = '';
|
57 |
foreach ( $data_attributes as $name => $value ) {
|
62 |
|
63 |
protected function render_field( $value, $instance ) {
|
64 |
?>
|
65 |
+
<input type="<?php echo esc_attr( $this->input_type ) ?>"
|
66 |
+
name="<?php echo esc_attr( $this->element_name ) ?>"
|
67 |
+
id="<?php echo esc_attr( $this->element_id ) ?>"
|
68 |
value="<?php echo esc_attr( $value ) ?>"
|
69 |
<?php $this->render_data_attributes( $this->get_input_data_attributes() ) ?>
|
70 |
<?php $this->render_CSS_classes( $this->get_input_classes() ) ?>
|
78 |
$sanitized_value = balanceTags( $sanitized_value , true );
|
79 |
return $sanitized_value;
|
80 |
}
|
81 |
+
}
|
base/inc/lessc.inc.php
CHANGED
@@ -1,3675 +1,276 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
-
* lessphp
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
* Copyright 2012, Leaf Corcoran <leafot@gmail.com>
|
10 |
-
* Licensed under MIT or GPLv3, see LICENSE
|
11 |
*/
|
12 |
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
/**
|
15 |
-
* The less compiler and parser.
|
16 |
-
*
|
17 |
-
* Converting LESS to CSS is a three stage process. The incoming file is parsed
|
18 |
-
* by `lessc_parser` into a syntax tree, then it is compiled into another tree
|
19 |
-
* representing the CSS structure by `lessc`. The CSS tree is fed into a
|
20 |
-
* formatter, like `lessc_formatter` which then outputs CSS as a string.
|
21 |
-
*
|
22 |
-
* During the first compile, all values are *reduced*, which means that their
|
23 |
-
* types are brought to the lowest form before being dump as strings. This
|
24 |
-
* handles math equations, variable dereferences, and the like.
|
25 |
-
*
|
26 |
-
* The `parse` function of `lessc` is the entry point.
|
27 |
-
*
|
28 |
-
* In summary:
|
29 |
-
*
|
30 |
-
* The `lessc` class creates an intstance of the parser, feeds it LESS code,
|
31 |
-
* then transforms the resulting tree to a CSS tree. This class also holds the
|
32 |
-
* evaluation context, such as all available mixins and variables at any given
|
33 |
-
* time.
|
34 |
-
*
|
35 |
-
* The `lessc_parser` class is only concerned with parsing its input.
|
36 |
-
*
|
37 |
-
* The `lessc_formatter` takes a CSS tree, and dumps it to a formatted string,
|
38 |
-
* handling things like indentation.
|
39 |
-
*/
|
40 |
class lessc {
|
41 |
-
static public $VERSION = "v0.4.0";
|
42 |
-
static protected $TRUE = array("keyword", "true");
|
43 |
-
static protected $FALSE = array("keyword", "false");
|
44 |
-
|
45 |
-
protected $libFunctions = array();
|
46 |
-
protected $registeredVars = array();
|
47 |
-
protected $preserveComments = false;
|
48 |
-
|
49 |
-
public $vPrefix = '@'; // prefix of abstract properties
|
50 |
-
public $mPrefix = '$'; // prefix of abstract blocks
|
51 |
-
public $parentSelector = '&';
|
52 |
|
53 |
-
public $
|
54 |
-
public $importDir = array();
|
55 |
-
|
56 |
-
protected $numberPrecision = null;
|
57 |
|
|
|
58 |
protected $allParsedFiles = array();
|
|
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
// so we know how to create error messages
|
62 |
-
protected $sourceParser = null;
|
63 |
-
protected $sourceLoc = null;
|
64 |
-
|
65 |
-
static public $defaultValue = array("keyword", "");
|
66 |
-
|
67 |
-
static protected $nextImportId = 0; // uniquely identify imports
|
68 |
-
|
69 |
-
// attempts to find the path of an import url, returns null for css files
|
70 |
-
protected function findImport($url) {
|
71 |
-
foreach ((array)$this->importDir as $dir) {
|
72 |
-
$full = $dir.(substr($dir, -1) != '/' ? '/' : '').$url;
|
73 |
-
if ($this->fileExists($file = $full.'.less') || $this->fileExists($file = $full)) {
|
74 |
-
return $file;
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
return null;
|
79 |
-
}
|
80 |
|
81 |
-
|
82 |
-
|
83 |
}
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
}
|
89 |
|
90 |
-
|
91 |
-
|
92 |
}
|
93 |
|
94 |
-
|
95 |
-
if ($importPath[0] == "function" && $importPath[1] == "url") {
|
96 |
-
$importPath = $this->flattenList($importPath[2]);
|
97 |
-
}
|
98 |
-
|
99 |
-
$str = $this->coerceString($importPath);
|
100 |
-
if ($str === null) return false;
|
101 |
-
|
102 |
-
$url = $this->compileValue($this->lib_e($str));
|
103 |
-
|
104 |
-
// don't import if it ends in css
|
105 |
-
if (substr_compare($url, '.css', -4, 4) === 0) return false;
|
106 |
-
|
107 |
-
$realPath = $this->findImport($url);
|
108 |
-
|
109 |
-
if ($realPath === null) return false;
|
110 |
-
|
111 |
-
if ($this->importDisabled) {
|
112 |
-
return array(false, "/* import disabled */");
|
113 |
-
}
|
114 |
-
|
115 |
-
if (isset($this->allParsedFiles[realpath($realPath)])) {
|
116 |
-
return array(false, null);
|
117 |
-
}
|
118 |
-
|
119 |
-
$this->addParsedFile($realPath);
|
120 |
-
$parser = $this->makeParser($realPath);
|
121 |
-
$root = $parser->parse(file_get_contents($realPath));
|
122 |
-
|
123 |
-
// set the parents of all the block props
|
124 |
-
foreach ($root->props as $prop) {
|
125 |
-
if ($prop[0] == "block") {
|
126 |
-
$prop[1]->parent = $parentBlock;
|
127 |
-
}
|
128 |
-
}
|
129 |
-
|
130 |
-
// copy mixins into scope, set their parents
|
131 |
-
// bring blocks from import into current block
|
132 |
-
// TODO: need to mark the source parser these came from this file
|
133 |
-
foreach ($root->children as $childName => $child) {
|
134 |
-
if (isset($parentBlock->children[$childName])) {
|
135 |
-
$parentBlock->children[$childName] = array_merge(
|
136 |
-
$parentBlock->children[$childName],
|
137 |
-
$child);
|
138 |
-
} else {
|
139 |
-
$parentBlock->children[$childName] = $child;
|
140 |
-
}
|
141 |
-
}
|
142 |
-
|
143 |
-
$pi = pathinfo($realPath);
|
144 |
-
$dir = $pi["dirname"];
|
145 |
|
146 |
-
|
147 |
-
$this->
|
148 |
-
|
149 |
-
return array(true, $bottom, $parser, $dir);
|
150 |
}
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
$oldImport = $this->importDir;
|
156 |
-
|
157 |
-
// TODO: this is because the importDir api is stupid
|
158 |
-
$this->importDir = (array)$this->importDir;
|
159 |
-
array_unshift($this->importDir, $importDir);
|
160 |
-
|
161 |
-
foreach ($props as $prop) {
|
162 |
-
$this->compileProp($prop, $block, $out);
|
163 |
-
}
|
164 |
-
|
165 |
-
$this->importDir = $oldImport;
|
166 |
-
$this->sourceParser = $oldSourceParser;
|
167 |
}
|
168 |
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
* A block is analogous to a CSS block in most cases. A single LESS document
|
173 |
-
* is encapsulated in a block when parsed, but it does not have parent tags
|
174 |
-
* so all of it's children appear on the root level when compiled.
|
175 |
-
*
|
176 |
-
* Blocks are made up of props and children.
|
177 |
-
*
|
178 |
-
* Props are property instructions, array tuples which describe an action
|
179 |
-
* to be taken, eg. write a property, set a variable, mixin a block.
|
180 |
-
*
|
181 |
-
* The children of a block are just all the blocks that are defined within.
|
182 |
-
* This is used to look up mixins when performing a mixin.
|
183 |
-
*
|
184 |
-
* Compiling the block involves pushing a fresh environment on the stack,
|
185 |
-
* and iterating through the props, compiling each one.
|
186 |
-
*
|
187 |
-
* See lessc::compileProp()
|
188 |
-
*
|
189 |
-
*/
|
190 |
-
protected function compileBlock($block) {
|
191 |
-
switch ($block->type) {
|
192 |
-
case "root":
|
193 |
-
$this->compileRoot($block);
|
194 |
-
break;
|
195 |
-
case null:
|
196 |
-
$this->compileCSSBlock($block);
|
197 |
-
break;
|
198 |
-
case "media":
|
199 |
-
$this->compileMedia($block);
|
200 |
-
break;
|
201 |
-
case "directive":
|
202 |
-
$name = "@" . $block->name;
|
203 |
-
if (!empty($block->value)) {
|
204 |
-
$name .= " " . $this->compileValue($this->reduce($block->value));
|
205 |
-
}
|
206 |
-
|
207 |
-
$this->compileNestedBlock($block, array($name));
|
208 |
-
break;
|
209 |
-
default:
|
210 |
-
$this->throwError("unknown block type: $block->type\n");
|
211 |
}
|
212 |
}
|
213 |
|
214 |
-
|
215 |
-
$
|
216 |
-
|
217 |
-
$selectors = $this->compileSelectors($block->tags);
|
218 |
-
$env->selectors = $this->multiplySelectors($selectors);
|
219 |
-
$out = $this->makeOutputBlock(null, $env->selectors);
|
220 |
-
|
221 |
-
$this->scope->children[] = $out;
|
222 |
-
$this->compileProps($block, $out);
|
223 |
-
|
224 |
-
$block->scope = $env; // mixins carry scope with them!
|
225 |
-
$this->popEnv();
|
226 |
}
|
227 |
|
228 |
-
|
229 |
-
|
230 |
-
$parentScope = $this->mediaParent($this->scope);
|
231 |
-
|
232 |
-
$query = $this->compileMediaQuery($this->multiplyMedia($env));
|
233 |
-
|
234 |
-
$this->scope = $this->makeOutputBlock($media->type, array($query));
|
235 |
-
$parentScope->children[] = $this->scope;
|
236 |
-
|
237 |
-
$this->compileProps($media, $this->scope);
|
238 |
-
|
239 |
-
if (count($this->scope->lines) > 0) {
|
240 |
-
$orphanSelelectors = $this->findClosestSelectors();
|
241 |
-
if (!is_null($orphanSelelectors)) {
|
242 |
-
$orphan = $this->makeOutputBlock(null, $orphanSelelectors);
|
243 |
-
$orphan->lines = $this->scope->lines;
|
244 |
-
array_unshift($this->scope->children, $orphan);
|
245 |
-
$this->scope->lines = array();
|
246 |
-
}
|
247 |
-
}
|
248 |
-
|
249 |
-
$this->scope = $this->scope->parent;
|
250 |
-
$this->popEnv();
|
251 |
}
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
break;
|
257 |
-
}
|
258 |
-
$scope = $scope->parent;
|
259 |
}
|
260 |
-
|
261 |
-
return $scope;
|
262 |
}
|
263 |
|
264 |
-
|
265 |
-
$this->
|
266 |
-
$this->scope = $this->makeOutputBlock($block->type, $selectors);
|
267 |
-
$this->scope->parent->children[] = $this->scope;
|
268 |
-
|
269 |
-
$this->compileProps($block, $this->scope);
|
270 |
-
|
271 |
-
$this->scope = $this->scope->parent;
|
272 |
-
$this->popEnv();
|
273 |
}
|
274 |
|
275 |
-
|
276 |
-
|
277 |
-
$this->
|
278 |
-
$this->compileProps($root, $this->scope);
|
279 |
-
$this->popEnv();
|
280 |
-
}
|
281 |
|
282 |
-
|
283 |
-
|
284 |
-
|
|
|
|
|
|
|
|
|
|
|
285 |
}
|
286 |
|
287 |
-
$
|
288 |
}
|
289 |
|
290 |
-
protected function
|
291 |
-
$
|
292 |
-
$
|
293 |
-
|
294 |
-
|
295 |
-
foreach ($props as $prop) {
|
296 |
-
switch ($prop[0]) {
|
297 |
-
case "assign":
|
298 |
-
if (isset($prop[1][0]) && $prop[1][0] == $this->vPrefix) {
|
299 |
-
$vars[] = $prop;
|
300 |
-
} else {
|
301 |
-
$other[] = $prop;
|
302 |
-
}
|
303 |
-
break;
|
304 |
-
case "import":
|
305 |
-
$id = self::$nextImportId++;
|
306 |
-
$prop[] = $id;
|
307 |
-
$imports[] = $prop;
|
308 |
-
$other[] = array("import_mixin", $id);
|
309 |
break;
|
310 |
-
default:
|
311 |
-
$other[] = $prop;
|
312 |
-
}
|
313 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
|
|
319 |
}
|
|
|
320 |
}
|
321 |
|
322 |
-
|
323 |
-
$compiledQueries = array();
|
324 |
-
foreach ($queries as $query) {
|
325 |
-
$parts = array();
|
326 |
-
foreach ($query as $q) {
|
327 |
-
switch ($q[0]) {
|
328 |
-
case "mediaType":
|
329 |
-
$parts[] = implode(" ", array_slice($q, 1));
|
330 |
-
break;
|
331 |
-
case "mediaExp":
|
332 |
-
if (isset($q[2])) {
|
333 |
-
$parts[] = "($q[1]: " .
|
334 |
-
$this->compileValue($this->reduce($q[2])) . ")";
|
335 |
-
} else {
|
336 |
-
$parts[] = "($q[1])";
|
337 |
-
}
|
338 |
-
break;
|
339 |
-
case "variable":
|
340 |
-
$parts[] = $this->compileValue($this->reduce($q));
|
341 |
-
break;
|
342 |
-
}
|
343 |
-
}
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
}
|
348 |
-
}
|
349 |
|
350 |
-
$
|
351 |
-
if (!empty($parts)) {
|
352 |
-
$out .= " " .
|
353 |
-
implode($this->formatter->selectorSeparator, $compiledQueries);
|
354 |
-
}
|
355 |
-
return $out;
|
356 |
-
}
|
357 |
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
return $childQueries;
|
363 |
}
|
364 |
-
|
365 |
-
|
366 |
-
if (empty($env->block->type)) {
|
367 |
-
return $this->multiplyMedia($env->parent, $childQueries);
|
368 |
}
|
|
|
|
|
369 |
|
370 |
-
$
|
371 |
-
$
|
372 |
-
|
373 |
-
$out = $queries;
|
374 |
-
} else {
|
375 |
-
foreach ($queries as $parent) {
|
376 |
-
foreach ($childQueries as $child) {
|
377 |
-
$out[] = array_merge($parent, $child);
|
378 |
-
}
|
379 |
-
}
|
380 |
}
|
381 |
|
382 |
-
|
383 |
-
}
|
384 |
|
385 |
-
|
386 |
-
$parts = explode("$&$", $tag);
|
387 |
-
$count = 0;
|
388 |
-
foreach ($parts as &$part) {
|
389 |
-
$part = str_replace($this->parentSelector, $replace, $part, $c);
|
390 |
-
$count += $c;
|
391 |
-
}
|
392 |
-
$tag = implode($this->parentSelector, $parts);
|
393 |
-
return $count;
|
394 |
}
|
395 |
|
396 |
-
|
397 |
-
$
|
398 |
-
|
399 |
-
while ($env !== null) {
|
400 |
-
if (isset($env->selectors)) {
|
401 |
-
$selectors = $env->selectors;
|
402 |
-
break;
|
403 |
-
}
|
404 |
-
$env = $env->parent;
|
405 |
}
|
406 |
|
407 |
-
|
408 |
-
}
|
409 |
|
|
|
410 |
|
411 |
-
|
412 |
-
|
413 |
-
// find parent selectors
|
414 |
|
415 |
-
$
|
416 |
-
|
417 |
-
// kill parent reference in top level selector
|
418 |
-
foreach ($selectors as &$s) {
|
419 |
-
$this->expandParentSelectors($s, "");
|
420 |
-
}
|
421 |
|
422 |
-
|
|
|
|
|
|
|
423 |
}
|
424 |
-
|
425 |
-
|
426 |
-
foreach ($parentSelectors as $parent) {
|
427 |
-
foreach ($selectors as $child) {
|
428 |
-
$count = $this->expandParentSelectors($child, $parent);
|
429 |
-
|
430 |
-
// don't prepend the parent tag if & was used
|
431 |
-
if ($count > 0) {
|
432 |
-
$out[] = trim($child);
|
433 |
-
} else {
|
434 |
-
$out[] = trim($parent . ' ' . $child);
|
435 |
-
}
|
436 |
-
}
|
437 |
}
|
|
|
|
|
438 |
|
439 |
-
|
440 |
-
|
|
|
|
|
441 |
|
442 |
-
|
443 |
-
protected function compileSelectors($selectors) {
|
444 |
-
$out = array();
|
445 |
|
446 |
-
|
447 |
-
|
448 |
-
list(, $value) = $s;
|
449 |
-
$out[] = trim($this->compileValue($this->reduce($value)));
|
450 |
-
} else {
|
451 |
-
$out[] = $s;
|
452 |
-
}
|
453 |
}
|
454 |
|
455 |
return $out;
|
456 |
}
|
457 |
|
458 |
-
|
459 |
-
|
|
|
|
|
|
|
|
|
460 |
}
|
461 |
|
462 |
-
protected function patternMatch($block, $orderedArgs, $keywordArgs) {
|
463 |
-
// match the guards if it has them
|
464 |
-
// any one of the groups must have all its guards pass for a match
|
465 |
-
if (!empty($block->guards)) {
|
466 |
-
$groupPassed = false;
|
467 |
-
foreach ($block->guards as $guardGroup) {
|
468 |
-
foreach ($guardGroup as $guard) {
|
469 |
-
$this->pushEnv();
|
470 |
-
$this->zipSetArgs($block->args, $orderedArgs, $keywordArgs);
|
471 |
-
|
472 |
-
$negate = false;
|
473 |
-
if ($guard[0] == "negate") {
|
474 |
-
$guard = $guard[1];
|
475 |
-
$negate = true;
|
476 |
-
}
|
477 |
-
|
478 |
-
$passed = $this->reduce($guard) == self::$TRUE;
|
479 |
-
if ($negate) $passed = !$passed;
|
480 |
|
481 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
break;
|
488 |
}
|
489 |
}
|
490 |
-
|
491 |
-
if ($groupPassed) break;
|
492 |
-
}
|
493 |
-
|
494 |
-
if (!$groupPassed) {
|
495 |
-
return false;
|
496 |
-
}
|
497 |
-
}
|
498 |
-
|
499 |
-
if (empty($block->args)) {
|
500 |
-
return $block->isVararg || empty($orderedArgs) && empty($keywordArgs);
|
501 |
-
}
|
502 |
-
|
503 |
-
$remainingArgs = $block->args;
|
504 |
-
if ($keywordArgs) {
|
505 |
-
$remainingArgs = array();
|
506 |
-
foreach ($block->args as $arg) {
|
507 |
-
if ($arg[0] == "arg" && isset($keywordArgs[$arg[1]])) {
|
508 |
-
continue;
|
509 |
-
}
|
510 |
-
|
511 |
-
$remainingArgs[] = $arg;
|
512 |
-
}
|
513 |
-
}
|
514 |
-
|
515 |
-
$i = -1; // no args
|
516 |
-
// try to match by arity or by argument literal
|
517 |
-
foreach ($remainingArgs as $i => $arg) {
|
518 |
-
switch ($arg[0]) {
|
519 |
-
case "lit":
|
520 |
-
if (empty($orderedArgs[$i]) || !$this->eq($arg[1], $orderedArgs[$i])) {
|
521 |
-
return false;
|
522 |
-
}
|
523 |
-
break;
|
524 |
-
case "arg":
|
525 |
-
// no arg and no default value
|
526 |
-
if (!isset($orderedArgs[$i]) && !isset($arg[2])) {
|
527 |
-
return false;
|
528 |
-
}
|
529 |
-
break;
|
530 |
-
case "rest":
|
531 |
-
$i--; // rest can be empty
|
532 |
-
break 2;
|
533 |
}
|
|
|
|
|
|
|
|
|
534 |
}
|
535 |
|
536 |
-
if ($
|
537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
} else {
|
539 |
-
|
540 |
-
//
|
541 |
-
return $
|
542 |
}
|
543 |
}
|
544 |
|
545 |
-
|
546 |
-
$
|
547 |
-
|
548 |
-
// skip seen blocks that don't have arguments
|
549 |
-
if (isset($skip[$block->id]) && !isset($block->args)) {
|
550 |
-
continue;
|
551 |
-
}
|
552 |
-
|
553 |
-
if ($this->patternMatch($block, $orderedArgs, $keywordArgs)) {
|
554 |
-
$matches[] = $block;
|
555 |
-
}
|
556 |
}
|
557 |
-
|
558 |
-
return $matches;
|
559 |
}
|
560 |
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
if (isset($seen[$searchIn->id])) return null;
|
565 |
-
$seen[$searchIn->id] = true;
|
566 |
-
|
567 |
-
$name = $path[0];
|
568 |
-
|
569 |
-
if (isset($searchIn->children[$name])) {
|
570 |
-
$blocks = $searchIn->children[$name];
|
571 |
-
if (count($path) == 1) {
|
572 |
-
$matches = $this->patternMatchAll($blocks, $orderedArgs, $keywordArgs, $seen);
|
573 |
-
if (!empty($matches)) {
|
574 |
-
// This will return all blocks that match in the closest
|
575 |
-
// scope that has any matching block, like lessjs
|
576 |
-
return $matches;
|
577 |
-
}
|
578 |
-
} else {
|
579 |
-
$matches = array();
|
580 |
-
foreach ($blocks as $subBlock) {
|
581 |
-
$subMatches = $this->findBlocks($subBlock,
|
582 |
-
array_slice($path, 1), $orderedArgs, $keywordArgs, $seen);
|
583 |
-
|
584 |
-
if (!is_null($subMatches)) {
|
585 |
-
foreach ($subMatches as $sm) {
|
586 |
-
$matches[] = $sm;
|
587 |
-
}
|
588 |
-
}
|
589 |
-
}
|
590 |
-
|
591 |
-
return count($matches) > 0 ? $matches : null;
|
592 |
-
}
|
593 |
}
|
594 |
-
|
595 |
-
return $this->findBlocks($searchIn->parent, $path, $orderedArgs, $keywordArgs, $seen);
|
596 |
}
|
597 |
|
598 |
-
|
599 |
-
|
600 |
-
protected function zipSetArgs($args, $orderedValues, $keywordValues) {
|
601 |
-
$assignedValues = array();
|
602 |
-
|
603 |
-
$i = 0;
|
604 |
-
foreach ($args as $a) {
|
605 |
-
if ($a[0] == "arg") {
|
606 |
-
if (isset($keywordValues[$a[1]])) {
|
607 |
-
// has keyword arg
|
608 |
-
$value = $keywordValues[$a[1]];
|
609 |
-
} elseif (isset($orderedValues[$i])) {
|
610 |
-
// has ordered arg
|
611 |
-
$value = $orderedValues[$i];
|
612 |
-
$i++;
|
613 |
-
} elseif (isset($a[2])) {
|
614 |
-
// has default value
|
615 |
-
$value = $a[2];
|
616 |
-
} else {
|
617 |
-
$this->throwError("Failed to assign arg " . $a[1]);
|
618 |
-
$value = null; // :(
|
619 |
-
}
|
620 |
-
|
621 |
-
$value = $this->reduce($value);
|
622 |
-
$this->set($a[1], $value);
|
623 |
-
$assignedValues[] = $value;
|
624 |
-
} else {
|
625 |
-
// a lit
|
626 |
-
$i++;
|
627 |
-
}
|
628 |
-
}
|
629 |
-
|
630 |
-
// check for a rest
|
631 |
-
$last = end($args);
|
632 |
-
if ($last[0] == "rest") {
|
633 |
-
$rest = array_slice($orderedValues, count($args) - 1);
|
634 |
-
$this->set($last[1], $this->reduce(array("list", " ", $rest)));
|
635 |
-
}
|
636 |
-
|
637 |
-
// wow is this the only true use of PHP's + operator for arrays?
|
638 |
-
$this->env->arguments = $assignedValues + $orderedValues;
|
639 |
}
|
640 |
|
641 |
-
|
642 |
-
|
643 |
-
// set error position context
|
644 |
-
$this->sourceLoc = isset($prop[-1]) ? $prop[-1] : -1;
|
645 |
-
|
646 |
-
switch ($prop[0]) {
|
647 |
-
case 'assign':
|
648 |
-
list(, $name, $value) = $prop;
|
649 |
-
if ($name[0] == $this->vPrefix) {
|
650 |
-
$this->set($name, $value);
|
651 |
-
} else {
|
652 |
-
$out->lines[] = $this->formatter->property($name,
|
653 |
-
$this->compileValue($this->reduce($value)));
|
654 |
-
}
|
655 |
-
break;
|
656 |
-
case 'block':
|
657 |
-
list(, $child) = $prop;
|
658 |
-
$this->compileBlock($child);
|
659 |
-
break;
|
660 |
-
case 'mixin':
|
661 |
-
list(, $path, $args, $suffix) = $prop;
|
662 |
-
|
663 |
-
$orderedArgs = array();
|
664 |
-
$keywordArgs = array();
|
665 |
-
foreach ((array)$args as $arg) {
|
666 |
-
$argval = null;
|
667 |
-
switch ($arg[0]) {
|
668 |
-
case "arg":
|
669 |
-
if (!isset($arg[2])) {
|
670 |
-
$orderedArgs[] = $this->reduce(array("variable", $arg[1]));
|
671 |
-
} else {
|
672 |
-
$keywordArgs[$arg[1]] = $this->reduce($arg[2]);
|
673 |
-
}
|
674 |
-
break;
|
675 |
-
|
676 |
-
case "lit":
|
677 |
-
$orderedArgs[] = $this->reduce($arg[1]);
|
678 |
-
break;
|
679 |
-
default:
|
680 |
-
$this->throwError("Unknown arg type: " . $arg[0]);
|
681 |
-
}
|
682 |
-
}
|
683 |
-
|
684 |
-
$mixins = $this->findBlocks($block, $path, $orderedArgs, $keywordArgs);
|
685 |
-
|
686 |
-
if ($mixins === null) {
|
687 |
-
// fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n");
|
688 |
-
break; // throw error here??
|
689 |
-
}
|
690 |
-
|
691 |
-
foreach ($mixins as $mixin) {
|
692 |
-
if ($mixin === $block && !$orderedArgs) {
|
693 |
-
continue;
|
694 |
-
}
|
695 |
-
|
696 |
-
$haveScope = false;
|
697 |
-
if (isset($mixin->parent->scope)) {
|
698 |
-
$haveScope = true;
|
699 |
-
$mixinParentEnv = $this->pushEnv();
|
700 |
-
$mixinParentEnv->storeParent = $mixin->parent->scope;
|
701 |
-
}
|
702 |
-
|
703 |
-
$haveArgs = false;
|
704 |
-
if (isset($mixin->args)) {
|
705 |
-
$haveArgs = true;
|
706 |
-
$this->pushEnv();
|
707 |
-
$this->zipSetArgs($mixin->args, $orderedArgs, $keywordArgs);
|
708 |
-
}
|
709 |
-
|
710 |
-
$oldParent = $mixin->parent;
|
711 |
-
if ($mixin != $block) $mixin->parent = $block;
|
712 |
-
|
713 |
-
foreach ($this->sortProps($mixin->props) as $subProp) {
|
714 |
-
if ($suffix !== null &&
|
715 |
-
$subProp[0] == "assign" &&
|
716 |
-
is_string($subProp[1]) &&
|
717 |
-
$subProp[1]{0} != $this->vPrefix)
|
718 |
-
{
|
719 |
-
$subProp[2] = array(
|
720 |
-
'list', ' ',
|
721 |
-
array($subProp[2], array('keyword', $suffix))
|
722 |
-
);
|
723 |
-
}
|
724 |
-
|
725 |
-
$this->compileProp($subProp, $mixin, $out);
|
726 |
-
}
|
727 |
-
|
728 |
-
$mixin->parent = $oldParent;
|
729 |
-
|
730 |
-
if ($haveArgs) $this->popEnv();
|
731 |
-
if ($haveScope) $this->popEnv();
|
732 |
-
}
|
733 |
-
|
734 |
-
break;
|
735 |
-
case 'raw':
|
736 |
-
$out->lines[] = $prop[1];
|
737 |
-
break;
|
738 |
-
case "directive":
|
739 |
-
list(, $name, $value) = $prop;
|
740 |
-
$out->lines[] = "@$name " . $this->compileValue($this->reduce($value)).';';
|
741 |
-
break;
|
742 |
-
case "comment":
|
743 |
-
$out->lines[] = $prop[1];
|
744 |
-
break;
|
745 |
-
case "import";
|
746 |
-
list(, $importPath, $importId) = $prop;
|
747 |
-
$importPath = $this->reduce($importPath);
|
748 |
-
|
749 |
-
if (!isset($this->env->imports)) {
|
750 |
-
$this->env->imports = array();
|
751 |
-
}
|
752 |
-
|
753 |
-
$result = $this->tryImport($importPath, $block, $out);
|
754 |
-
|
755 |
-
$this->env->imports[$importId] = $result === false ?
|
756 |
-
array(false, "@import " . $this->compileValue($importPath).";") :
|
757 |
-
$result;
|
758 |
-
|
759 |
-
break;
|
760 |
-
case "import_mixin":
|
761 |
-
list(,$importId) = $prop;
|
762 |
-
$import = $this->env->imports[$importId];
|
763 |
-
if ($import[0] === false) {
|
764 |
-
if (isset($import[1])) {
|
765 |
-
$out->lines[] = $import[1];
|
766 |
-
}
|
767 |
-
} else {
|
768 |
-
list(, $bottom, $parser, $importDir) = $import;
|
769 |
-
$this->compileImportedProps($bottom, $block, $out, $parser, $importDir);
|
770 |
-
}
|
771 |
-
|
772 |
-
break;
|
773 |
-
default:
|
774 |
-
$this->throwError("unknown op: {$prop[0]}\n");
|
775 |
-
}
|
776 |
-
}
|
777 |
-
|
778 |
-
|
779 |
-
/**
|
780 |
-
* Compiles a primitive value into a CSS property value.
|
781 |
-
*
|
782 |
-
* Values in lessphp are typed by being wrapped in arrays, their format is
|
783 |
-
* typically:
|
784 |
-
*
|
785 |
-
* array(type, contents [, additional_contents]*)
|
786 |
-
*
|
787 |
-
* The input is expected to be reduced. This function will not work on
|
788 |
-
* things like expressions and variables.
|
789 |
-
*/
|
790 |
-
protected function compileValue($value) {
|
791 |
-
switch ($value[0]) {
|
792 |
-
case 'list':
|
793 |
-
// [1] - delimiter
|
794 |
-
// [2] - array of values
|
795 |
-
return implode($value[1], array_map(array($this, 'compileValue'), $value[2]));
|
796 |
-
case 'raw_color':
|
797 |
-
if (!empty($this->formatter->compressColors)) {
|
798 |
-
return $this->compileValue($this->coerceColor($value));
|
799 |
-
}
|
800 |
-
return $value[1];
|
801 |
-
case 'keyword':
|
802 |
-
// [1] - the keyword
|
803 |
-
return $value[1];
|
804 |
-
case 'number':
|
805 |
-
list(, $num, $unit) = $value;
|
806 |
-
// [1] - the number
|
807 |
-
// [2] - the unit
|
808 |
-
if ($this->numberPrecision !== null) {
|
809 |
-
$num = round($num, $this->numberPrecision);
|
810 |
-
}
|
811 |
-
return $num . $unit;
|
812 |
-
case 'string':
|
813 |
-
// [1] - contents of string (includes quotes)
|
814 |
-
list(, $delim, $content) = $value;
|
815 |
-
foreach ($content as &$part) {
|
816 |
-
if (is_array($part)) {
|
817 |
-
$part = $this->compileValue($part);
|
818 |
-
}
|
819 |
-
}
|
820 |
-
return $delim . implode($content) . $delim;
|
821 |
-
case 'color':
|
822 |
-
// [1] - red component (either number or a %)
|
823 |
-
// [2] - green component
|
824 |
-
// [3] - blue component
|
825 |
-
// [4] - optional alpha component
|
826 |
-
list(, $r, $g, $b) = $value;
|
827 |
-
$r = round($r);
|
828 |
-
$g = round($g);
|
829 |
-
$b = round($b);
|
830 |
-
|
831 |
-
if (count($value) == 5 && $value[4] != 1) { // rgba
|
832 |
-
return 'rgba('.$r.','.$g.','.$b.','.$value[4].')';
|
833 |
-
}
|
834 |
-
|
835 |
-
$h = sprintf("#%02x%02x%02x", $r, $g, $b);
|
836 |
-
|
837 |
-
if (!empty($this->formatter->compressColors)) {
|
838 |
-
// Converting hex color to short notation (e.g. #003399 to #039)
|
839 |
-
if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) {
|
840 |
-
$h = '#' . $h[1] . $h[3] . $h[5];
|
841 |
-
}
|
842 |
-
}
|
843 |
-
|
844 |
-
return $h;
|
845 |
-
|
846 |
-
case 'function':
|
847 |
-
list(, $name, $args) = $value;
|
848 |
-
return $name.'('.$this->compileValue($args).')';
|
849 |
-
default: // assumed to be unit
|
850 |
-
$this->throwError("unknown value type: $value[0]");
|
851 |
-
}
|
852 |
-
}
|
853 |
-
|
854 |
-
protected function lib_pow($args) {
|
855 |
-
list($base, $exp) = $this->assertArgs($args, 2, "pow");
|
856 |
-
return pow($this->assertNumber($base), $this->assertNumber($exp));
|
857 |
-
}
|
858 |
-
|
859 |
-
protected function lib_pi() {
|
860 |
-
return pi();
|
861 |
-
}
|
862 |
-
|
863 |
-
protected function lib_mod($args) {
|
864 |
-
list($a, $b) = $this->assertArgs($args, 2, "mod");
|
865 |
-
return $this->assertNumber($a) % $this->assertNumber($b);
|
866 |
-
}
|
867 |
-
|
868 |
-
protected function lib_tan($num) {
|
869 |
-
return tan($this->assertNumber($num));
|
870 |
-
}
|
871 |
-
|
872 |
-
protected function lib_sin($num) {
|
873 |
-
return sin($this->assertNumber($num));
|
874 |
-
}
|
875 |
-
|
876 |
-
protected function lib_cos($num) {
|
877 |
-
return cos($this->assertNumber($num));
|
878 |
-
}
|
879 |
-
|
880 |
-
protected function lib_atan($num) {
|
881 |
-
$num = atan($this->assertNumber($num));
|
882 |
-
return array("number", $num, "rad");
|
883 |
-
}
|
884 |
-
|
885 |
-
protected function lib_asin($num) {
|
886 |
-
$num = asin($this->assertNumber($num));
|
887 |
-
return array("number", $num, "rad");
|
888 |
-
}
|
889 |
-
|
890 |
-
protected function lib_acos($num) {
|
891 |
-
$num = acos($this->assertNumber($num));
|
892 |
-
return array("number", $num, "rad");
|
893 |
-
}
|
894 |
-
|
895 |
-
protected function lib_sqrt($num) {
|
896 |
-
return sqrt($this->assertNumber($num));
|
897 |
-
}
|
898 |
-
|
899 |
-
protected function lib_extract($value) {
|
900 |
-
list($list, $idx) = $this->assertArgs($value, 2, "extract");
|
901 |
-
$idx = $this->assertNumber($idx);
|
902 |
-
// 1 indexed
|
903 |
-
if ($list[0] == "list" && isset($list[2][$idx - 1])) {
|
904 |
-
return $list[2][$idx - 1];
|
905 |
-
}
|
906 |
-
}
|
907 |
-
|
908 |
-
protected function lib_isnumber($value) {
|
909 |
-
return $this->toBool($value[0] == "number");
|
910 |
-
}
|
911 |
-
|
912 |
-
protected function lib_isstring($value) {
|
913 |
-
return $this->toBool($value[0] == "string");
|
914 |
-
}
|
915 |
-
|
916 |
-
protected function lib_iscolor($value) {
|
917 |
-
return $this->toBool($this->coerceColor($value));
|
918 |
-
}
|
919 |
-
|
920 |
-
protected function lib_iskeyword($value) {
|
921 |
-
return $this->toBool($value[0] == "keyword");
|
922 |
-
}
|
923 |
-
|
924 |
-
protected function lib_ispixel($value) {
|
925 |
-
return $this->toBool($value[0] == "number" && $value[2] == "px");
|
926 |
-
}
|
927 |
-
|
928 |
-
protected function lib_ispercentage($value) {
|
929 |
-
return $this->toBool($value[0] == "number" && $value[2] == "%");
|
930 |
-
}
|
931 |
-
|
932 |
-
protected function lib_isem($value) {
|
933 |
-
return $this->toBool($value[0] == "number" && $value[2] == "em");
|
934 |
-
}
|
935 |
-
|
936 |
-
protected function lib_isrem($value) {
|
937 |
-
return $this->toBool($value[0] == "number" && $value[2] == "rem");
|
938 |
-
}
|
939 |
-
|
940 |
-
protected function lib_rgbahex($color) {
|
941 |
-
$color = $this->coerceColor($color);
|
942 |
-
if (is_null($color))
|
943 |
-
$this->throwError("color expected for rgbahex");
|
944 |
-
|
945 |
-
return sprintf("#%02x%02x%02x%02x",
|
946 |
-
isset($color[4]) ? $color[4]*255 : 255,
|
947 |
-
$color[1],$color[2], $color[3]);
|
948 |
-
}
|
949 |
-
|
950 |
-
protected function lib_argb($color){
|
951 |
-
return $this->lib_rgbahex($color);
|
952 |
-
}
|
953 |
-
|
954 |
-
// utility func to unquote a string
|
955 |
-
protected function lib_e($arg) {
|
956 |
-
switch ($arg[0]) {
|
957 |
-
case "list":
|
958 |
-
$items = $arg[2];
|
959 |
-
if (isset($items[0])) {
|
960 |
-
return $this->lib_e($items[0]);
|
961 |
-
}
|
962 |
-
return self::$defaultValue;
|
963 |
-
case "string":
|
964 |
-
$arg[1] = "";
|
965 |
-
return $arg;
|
966 |
-
case "keyword":
|
967 |
-
return $arg;
|
968 |
-
default:
|
969 |
-
return array("keyword", $this->compileValue($arg));
|
970 |
-
}
|
971 |
-
}
|
972 |
-
|
973 |
-
protected function lib__sprintf($args) {
|
974 |
-
if ($args[0] != "list") return $args;
|
975 |
-
$values = $args[2];
|
976 |
-
$string = array_shift($values);
|
977 |
-
$template = $this->compileValue($this->lib_e($string));
|
978 |
-
|
979 |
-
$i = 0;
|
980 |
-
if (preg_match_all('/%[dsa]/', $template, $m)) {
|
981 |
-
foreach ($m[0] as $match) {
|
982 |
-
$val = isset($values[$i]) ?
|
983 |
-
$this->reduce($values[$i]) : array('keyword', '');
|
984 |
-
|
985 |
-
// lessjs compat, renders fully expanded color, not raw color
|
986 |
-
if ($color = $this->coerceColor($val)) {
|
987 |
-
$val = $color;
|
988 |
-
}
|
989 |
-
|
990 |
-
$i++;
|
991 |
-
$rep = $this->compileValue($this->lib_e($val));
|
992 |
-
$template = preg_replace('/'.self::preg_quote($match).'/',
|
993 |
-
$rep, $template, 1);
|
994 |
-
}
|
995 |
-
}
|
996 |
-
|
997 |
-
$d = $string[0] == "string" ? $string[1] : '"';
|
998 |
-
return array("string", $d, array($template));
|
999 |
-
}
|
1000 |
-
|
1001 |
-
protected function lib_floor($arg) {
|
1002 |
-
$value = $this->assertNumber($arg);
|
1003 |
-
return array("number", floor($value), $arg[2]);
|
1004 |
-
}
|
1005 |
-
|
1006 |
-
protected function lib_ceil($arg) {
|
1007 |
-
$value = $this->assertNumber($arg);
|
1008 |
-
return array("number", ceil($value), $arg[2]);
|
1009 |
-
}
|
1010 |
-
|
1011 |
-
protected function lib_round($arg) {
|
1012 |
-
$value = $this->assertNumber($arg);
|
1013 |
-
return array("number", round($value), $arg[2]);
|
1014 |
-
}
|
1015 |
-
|
1016 |
-
protected function lib_unit($arg) {
|
1017 |
-
if ($arg[0] == "list") {
|
1018 |
-
list($number, $newUnit) = $arg[2];
|
1019 |
-
return array("number", $this->assertNumber($number),
|
1020 |
-
$this->compileValue($this->lib_e($newUnit)));
|
1021 |
-
} else {
|
1022 |
-
return array("number", $this->assertNumber($arg), "");
|
1023 |
-
}
|
1024 |
-
}
|
1025 |
-
|
1026 |
-
/**
|
1027 |
-
* Helper function to get arguments for color manipulation functions.
|
1028 |
-
* takes a list that contains a color like thing and a percentage
|
1029 |
-
*/
|
1030 |
-
protected function colorArgs($args) {
|
1031 |
-
if ($args[0] != 'list' || count($args[2]) < 2) {
|
1032 |
-
return array(array('color', 0, 0, 0), 0);
|
1033 |
-
}
|
1034 |
-
list($color, $delta) = $args[2];
|
1035 |
-
$color = $this->assertColor($color);
|
1036 |
-
$delta = floatval($delta[1]);
|
1037 |
-
|
1038 |
-
return array($color, $delta);
|
1039 |
-
}
|
1040 |
-
|
1041 |
-
protected function lib_darken($args) {
|
1042 |
-
list($color, $delta) = $this->colorArgs($args);
|
1043 |
-
|
1044 |
-
$hsl = $this->toHSL($color);
|
1045 |
-
$hsl[3] = $this->clamp($hsl[3] - $delta, 100);
|
1046 |
-
return $this->toRGB($hsl);
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
protected function lib_lighten($args) {
|
1050 |
-
list($color, $delta) = $this->colorArgs($args);
|
1051 |
-
|
1052 |
-
$hsl = $this->toHSL($color);
|
1053 |
-
$hsl[3] = $this->clamp($hsl[3] + $delta, 100);
|
1054 |
-
return $this->toRGB($hsl);
|
1055 |
-
}
|
1056 |
-
|
1057 |
-
protected function lib_saturate($args) {
|
1058 |
-
list($color, $delta) = $this->colorArgs($args);
|
1059 |
-
|
1060 |
-
$hsl = $this->toHSL($color);
|
1061 |
-
$hsl[2] = $this->clamp($hsl[2] + $delta, 100);
|
1062 |
-
return $this->toRGB($hsl);
|
1063 |
-
}
|
1064 |
-
|
1065 |
-
protected function lib_desaturate($args) {
|
1066 |
-
list($color, $delta) = $this->colorArgs($args);
|
1067 |
-
|
1068 |
-
$hsl = $this->toHSL($color);
|
1069 |
-
$hsl[2] = $this->clamp($hsl[2] - $delta, 100);
|
1070 |
-
return $this->toRGB($hsl);
|
1071 |
-
}
|
1072 |
-
|
1073 |
-
protected function lib_spin($args) {
|
1074 |
-
list($color, $delta) = $this->colorArgs($args);
|
1075 |
-
|
1076 |
-
$hsl = $this->toHSL($color);
|
1077 |
-
|
1078 |
-
$hsl[1] = $hsl[1] + $delta % 360;
|
1079 |
-
if ($hsl[1] < 0) $hsl[1] += 360;
|
1080 |
-
|
1081 |
-
return $this->toRGB($hsl);
|
1082 |
-
}
|
1083 |
-
|
1084 |
-
protected function lib_fadeout($args) {
|
1085 |
-
list($color, $delta) = $this->colorArgs($args);
|
1086 |
-
$color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) - $delta/100);
|
1087 |
-
return $color;
|
1088 |
-
}
|
1089 |
-
|
1090 |
-
protected function lib_fadein($args) {
|
1091 |
-
list($color, $delta) = $this->colorArgs($args);
|
1092 |
-
$color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) + $delta/100);
|
1093 |
-
return $color;
|
1094 |
-
}
|
1095 |
-
|
1096 |
-
protected function lib_hue($color) {
|
1097 |
-
$hsl = $this->toHSL($this->assertColor($color));
|
1098 |
-
return round($hsl[1]);
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
protected function lib_saturation($color) {
|
1102 |
-
$hsl = $this->toHSL($this->assertColor($color));
|
1103 |
-
return round($hsl[2]);
|
1104 |
-
}
|
1105 |
-
|
1106 |
-
protected function lib_lightness($color) {
|
1107 |
-
$hsl = $this->toHSL($this->assertColor($color));
|
1108 |
-
return round($hsl[3]);
|
1109 |
-
}
|
1110 |
-
|
1111 |
-
// get the alpha of a color
|
1112 |
-
// defaults to 1 for non-colors or colors without an alpha
|
1113 |
-
protected function lib_alpha($value) {
|
1114 |
-
if (!is_null($color = $this->coerceColor($value))) {
|
1115 |
-
return isset($color[4]) ? $color[4] : 1;
|
1116 |
-
}
|
1117 |
-
}
|
1118 |
-
|
1119 |
-
// set the alpha of the color
|
1120 |
-
protected function lib_fade($args) {
|
1121 |
-
list($color, $alpha) = $this->colorArgs($args);
|
1122 |
-
$color[4] = $this->clamp($alpha / 100.0);
|
1123 |
-
return $color;
|
1124 |
-
}
|
1125 |
-
|
1126 |
-
protected function lib_percentage($arg) {
|
1127 |
-
$num = $this->assertNumber($arg);
|
1128 |
-
return array("number", $num*100, "%");
|
1129 |
-
}
|
1130 |
-
|
1131 |
-
// mixes two colors by weight
|
1132 |
-
// mix(@color1, @color2, [@weight: 50%]);
|
1133 |
-
// http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method
|
1134 |
-
protected function lib_mix($args) {
|
1135 |
-
if ($args[0] != "list" || count($args[2]) < 2)
|
1136 |
-
$this->throwError("mix expects (color1, color2, weight)");
|
1137 |
-
|
1138 |
-
list($first, $second) = $args[2];
|
1139 |
-
$first = $this->assertColor($first);
|
1140 |
-
$second = $this->assertColor($second);
|
1141 |
-
|
1142 |
-
$first_a = $this->lib_alpha($first);
|
1143 |
-
$second_a = $this->lib_alpha($second);
|
1144 |
-
|
1145 |
-
if (isset($args[2][2])) {
|
1146 |
-
$weight = $args[2][2][1] / 100.0;
|
1147 |
-
} else {
|
1148 |
-
$weight = 0.5;
|
1149 |
-
}
|
1150 |
-
|
1151 |
-
$w = $weight * 2 - 1;
|
1152 |
-
$a = $first_a - $second_a;
|
1153 |
-
|
1154 |
-
$w1 = (($w * $a == -1 ? $w : ($w + $a)/(1 + $w * $a)) + 1) / 2.0;
|
1155 |
-
$w2 = 1.0 - $w1;
|
1156 |
-
|
1157 |
-
$new = array('color',
|
1158 |
-
$w1 * $first[1] + $w2 * $second[1],
|
1159 |
-
$w1 * $first[2] + $w2 * $second[2],
|
1160 |
-
$w1 * $first[3] + $w2 * $second[3],
|
1161 |
-
);
|
1162 |
-
|
1163 |
-
if ($first_a != 1.0 || $second_a != 1.0) {
|
1164 |
-
$new[] = $first_a * $weight + $second_a * ($weight - 1);
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
return $this->fixColor($new);
|
1168 |
-
}
|
1169 |
-
|
1170 |
-
protected function lib_contrast($args) {
|
1171 |
-
if ($args[0] != 'list' || count($args[2]) < 3) {
|
1172 |
-
return array(array('color', 0, 0, 0), 0);
|
1173 |
-
}
|
1174 |
-
|
1175 |
-
list($inputColor, $darkColor, $lightColor) = $args[2];
|
1176 |
-
|
1177 |
-
$inputColor = $this->assertColor($inputColor);
|
1178 |
-
$darkColor = $this->assertColor($darkColor);
|
1179 |
-
$lightColor = $this->assertColor($lightColor);
|
1180 |
-
$hsl = $this->toHSL($inputColor);
|
1181 |
-
|
1182 |
-
if ($hsl[3] > 50) {
|
1183 |
-
return $darkColor;
|
1184 |
-
}
|
1185 |
-
|
1186 |
-
return $lightColor;
|
1187 |
-
}
|
1188 |
-
|
1189 |
-
protected function assertColor($value, $error = "expected color value") {
|
1190 |
-
$color = $this->coerceColor($value);
|
1191 |
-
if (is_null($color)) $this->throwError($error);
|
1192 |
-
return $color;
|
1193 |
-
}
|
1194 |
-
|
1195 |
-
protected function assertNumber($value, $error = "expecting number") {
|
1196 |
-
if ($value[0] == "number") return $value[1];
|
1197 |
-
$this->throwError($error);
|
1198 |
-
}
|
1199 |
-
|
1200 |
-
protected function assertArgs($value, $expectedArgs, $name="") {
|
1201 |
-
if ($expectedArgs == 1) {
|
1202 |
-
return $value;
|
1203 |
-
} else {
|
1204 |
-
if ($value[0] !== "list" || $value[1] != ",") $this->throwError("expecting list");
|
1205 |
-
$values = $value[2];
|
1206 |
-
$numValues = count($values);
|
1207 |
-
if ($expectedArgs != $numValues) {
|
1208 |
-
if ($name) {
|
1209 |
-
$name = $name . ": ";
|
1210 |
-
}
|
1211 |
-
|
1212 |
-
$this->throwError("${name}expecting $expectedArgs arguments, got $numValues");
|
1213 |
-
}
|
1214 |
-
|
1215 |
-
return $values;
|
1216 |
-
}
|
1217 |
-
}
|
1218 |
-
|
1219 |
-
protected function toHSL($color) {
|
1220 |
-
if ($color[0] == 'hsl') return $color;
|
1221 |
-
|
1222 |
-
$r = $color[1] / 255;
|
1223 |
-
$g = $color[2] / 255;
|
1224 |
-
$b = $color[3] / 255;
|
1225 |
-
|
1226 |
-
$min = min($r, $g, $b);
|
1227 |
-
$max = max($r, $g, $b);
|
1228 |
-
|
1229 |
-
$L = ($min + $max) / 2;
|
1230 |
-
if ($min == $max) {
|
1231 |
-
$S = $H = 0;
|
1232 |
-
} else {
|
1233 |
-
if ($L < 0.5)
|
1234 |
-
$S = ($max - $min)/($max + $min);
|
1235 |
-
else
|
1236 |
-
$S = ($max - $min)/(2.0 - $max - $min);
|
1237 |
-
|
1238 |
-
if ($r == $max) $H = ($g - $b)/($max - $min);
|
1239 |
-
elseif ($g == $max) $H = 2.0 + ($b - $r)/($max - $min);
|
1240 |
-
elseif ($b == $max) $H = 4.0 + ($r - $g)/($max - $min);
|
1241 |
-
|
1242 |
-
}
|
1243 |
-
|
1244 |
-
$out = array('hsl',
|
1245 |
-
($H < 0 ? $H + 6 : $H)*60,
|
1246 |
-
$S*100,
|
1247 |
-
$L*100,
|
1248 |
-
);
|
1249 |
-
|
1250 |
-
if (count($color) > 4) $out[] = $color[4]; // copy alpha
|
1251 |
-
return $out;
|
1252 |
-
}
|
1253 |
-
|
1254 |
-
protected function toRGB_helper($comp, $temp1, $temp2) {
|
1255 |
-
if ($comp < 0) $comp += 1.0;
|
1256 |
-
elseif ($comp > 1) $comp -= 1.0;
|
1257 |
-
|
1258 |
-
if (6 * $comp < 1) return $temp1 + ($temp2 - $temp1) * 6 * $comp;
|
1259 |
-
if (2 * $comp < 1) return $temp2;
|
1260 |
-
if (3 * $comp < 2) return $temp1 + ($temp2 - $temp1)*((2/3) - $comp) * 6;
|
1261 |
-
|
1262 |
-
return $temp1;
|
1263 |
-
}
|
1264 |
-
|
1265 |
-
/**
|
1266 |
-
* Converts a hsl array into a color value in rgb.
|
1267 |
-
* Expects H to be in range of 0 to 360, S and L in 0 to 100
|
1268 |
-
*/
|
1269 |
-
protected function toRGB($color) {
|
1270 |
-
if ($color[0] == 'color') return $color;
|
1271 |
-
|
1272 |
-
$H = $color[1] / 360;
|
1273 |
-
$S = $color[2] / 100;
|
1274 |
-
$L = $color[3] / 100;
|
1275 |
-
|
1276 |
-
if ($S == 0) {
|
1277 |
-
$r = $g = $b = $L;
|
1278 |
-
} else {
|
1279 |
-
$temp2 = $L < 0.5 ?
|
1280 |
-
$L*(1.0 + $S) :
|
1281 |
-
$L + $S - $L * $S;
|
1282 |
-
|
1283 |
-
$temp1 = 2.0 * $L - $temp2;
|
1284 |
-
|
1285 |
-
$r = $this->toRGB_helper($H + 1/3, $temp1, $temp2);
|
1286 |
-
$g = $this->toRGB_helper($H, $temp1, $temp2);
|
1287 |
-
$b = $this->toRGB_helper($H - 1/3, $temp1, $temp2);
|
1288 |
-
}
|
1289 |
-
|
1290 |
-
// $out = array('color', round($r*255), round($g*255), round($b*255));
|
1291 |
-
$out = array('color', $r*255, $g*255, $b*255);
|
1292 |
-
if (count($color) > 4) $out[] = $color[4]; // copy alpha
|
1293 |
-
return $out;
|
1294 |
-
}
|
1295 |
-
|
1296 |
-
protected function clamp($v, $max = 1, $min = 0) {
|
1297 |
-
return min($max, max($min, $v));
|
1298 |
-
}
|
1299 |
-
|
1300 |
-
/**
|
1301 |
-
* Convert the rgb, rgba, hsl color literals of function type
|
1302 |
-
* as returned by the parser into values of color type.
|
1303 |
-
*/
|
1304 |
-
protected function funcToColor($func) {
|
1305 |
-
$fname = $func[1];
|
1306 |
-
if ($func[2][0] != 'list') return false; // need a list of arguments
|
1307 |
-
$rawComponents = $func[2][2];
|
1308 |
-
|
1309 |
-
if ($fname == 'hsl' || $fname == 'hsla') {
|
1310 |
-
$hsl = array('hsl');
|
1311 |
-
$i = 0;
|
1312 |
-
foreach ($rawComponents as $c) {
|
1313 |
-
$val = $this->reduce($c);
|
1314 |
-
$val = isset($val[1]) ? floatval($val[1]) : 0;
|
1315 |
-
|
1316 |
-
if ($i == 0) $clamp = 360;
|
1317 |
-
elseif ($i < 3) $clamp = 100;
|
1318 |
-
else $clamp = 1;
|
1319 |
-
|
1320 |
-
$hsl[] = $this->clamp($val, $clamp);
|
1321 |
-
$i++;
|
1322 |
-
}
|
1323 |
-
|
1324 |
-
while (count($hsl) < 4) $hsl[] = 0;
|
1325 |
-
return $this->toRGB($hsl);
|
1326 |
-
|
1327 |
-
} elseif ($fname == 'rgb' || $fname == 'rgba') {
|
1328 |
-
$components = array();
|
1329 |
-
$i = 1;
|
1330 |
-
foreach ($rawComponents as $c) {
|
1331 |
-
$c = $this->reduce($c);
|
1332 |
-
if ($i < 4) {
|
1333 |
-
if ($c[0] == "number" && $c[2] == "%") {
|
1334 |
-
$components[] = 255 * ($c[1] / 100);
|
1335 |
-
} else {
|
1336 |
-
$components[] = floatval($c[1]);
|
1337 |
-
}
|
1338 |
-
} elseif ($i == 4) {
|
1339 |
-
if ($c[0] == "number" && $c[2] == "%") {
|
1340 |
-
$components[] = 1.0 * ($c[1] / 100);
|
1341 |
-
} else {
|
1342 |
-
$components[] = floatval($c[1]);
|
1343 |
-
}
|
1344 |
-
} else break;
|
1345 |
-
|
1346 |
-
$i++;
|
1347 |
-
}
|
1348 |
-
while (count($components) < 3) $components[] = 0;
|
1349 |
-
array_unshift($components, 'color');
|
1350 |
-
return $this->fixColor($components);
|
1351 |
-
}
|
1352 |
-
|
1353 |
-
return false;
|
1354 |
-
}
|
1355 |
-
|
1356 |
-
protected function reduce($value, $forExpression = false) {
|
1357 |
-
switch ($value[0]) {
|
1358 |
-
case "interpolate":
|
1359 |
-
$reduced = $this->reduce($value[1]);
|
1360 |
-
$var = $this->compileValue($reduced);
|
1361 |
-
$res = $this->reduce(array("variable", $this->vPrefix . $var));
|
1362 |
-
|
1363 |
-
if ($res[0] == "raw_color") {
|
1364 |
-
$res = $this->coerceColor($res);
|
1365 |
-
}
|
1366 |
-
|
1367 |
-
if (empty($value[2])) $res = $this->lib_e($res);
|
1368 |
-
|
1369 |
-
return $res;
|
1370 |
-
case "variable":
|
1371 |
-
$key = $value[1];
|
1372 |
-
if (is_array($key)) {
|
1373 |
-
$key = $this->reduce($key);
|
1374 |
-
$key = $this->vPrefix . $this->compileValue($this->lib_e($key));
|
1375 |
-
}
|
1376 |
-
|
1377 |
-
$seen =& $this->env->seenNames;
|
1378 |
-
|
1379 |
-
if (!empty($seen[$key])) {
|
1380 |
-
$this->throwError("infinite loop detected: $key");
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
$seen[$key] = true;
|
1384 |
-
$out = $this->reduce($this->get($key, self::$defaultValue));
|
1385 |
-
$seen[$key] = false;
|
1386 |
-
return $out;
|
1387 |
-
case "list":
|
1388 |
-
foreach ($value[2] as &$item) {
|
1389 |
-
$item = $this->reduce($item, $forExpression);
|
1390 |
-
}
|
1391 |
-
return $value;
|
1392 |
-
case "expression":
|
1393 |
-
return $this->evaluate($value);
|
1394 |
-
case "string":
|
1395 |
-
foreach ($value[2] as &$part) {
|
1396 |
-
if (is_array($part)) {
|
1397 |
-
$strip = $part[0] == "variable";
|
1398 |
-
$part = $this->reduce($part);
|
1399 |
-
if ($strip) $part = $this->lib_e($part);
|
1400 |
-
}
|
1401 |
-
}
|
1402 |
-
return $value;
|
1403 |
-
case "escape":
|
1404 |
-
list(,$inner) = $value;
|
1405 |
-
return $this->lib_e($this->reduce($inner));
|
1406 |
-
case "function":
|
1407 |
-
$color = $this->funcToColor($value);
|
1408 |
-
if ($color) return $color;
|
1409 |
-
|
1410 |
-
list(, $name, $args) = $value;
|
1411 |
-
if ($name == "%") $name = "_sprintf";
|
1412 |
-
$f = isset($this->libFunctions[$name]) ?
|
1413 |
-
$this->libFunctions[$name] : array($this, 'lib_'.$name);
|
1414 |
-
|
1415 |
-
if (is_callable($f)) {
|
1416 |
-
if ($args[0] == 'list')
|
1417 |
-
$args = self::compressList($args[2], $args[1]);
|
1418 |
-
|
1419 |
-
$ret = call_user_func($f, $this->reduce($args, true), $this);
|
1420 |
-
|
1421 |
-
if (is_null($ret)) {
|
1422 |
-
return array("string", "", array(
|
1423 |
-
$name, "(", $args, ")"
|
1424 |
-
));
|
1425 |
-
}
|
1426 |
-
|
1427 |
-
// convert to a typed value if the result is a php primitive
|
1428 |
-
if (is_numeric($ret)) $ret = array('number', $ret, "");
|
1429 |
-
elseif (!is_array($ret)) $ret = array('keyword', $ret);
|
1430 |
-
|
1431 |
-
return $ret;
|
1432 |
-
}
|
1433 |
-
|
1434 |
-
// plain function, reduce args
|
1435 |
-
$value[2] = $this->reduce($value[2]);
|
1436 |
-
return $value;
|
1437 |
-
case "unary":
|
1438 |
-
list(, $op, $exp) = $value;
|
1439 |
-
$exp = $this->reduce($exp);
|
1440 |
-
|
1441 |
-
if ($exp[0] == "number") {
|
1442 |
-
switch ($op) {
|
1443 |
-
case "+":
|
1444 |
-
return $exp;
|
1445 |
-
case "-":
|
1446 |
-
$exp[1] *= -1;
|
1447 |
-
return $exp;
|
1448 |
-
}
|
1449 |
-
}
|
1450 |
-
return array("string", "", array($op, $exp));
|
1451 |
-
}
|
1452 |
-
|
1453 |
-
if ($forExpression) {
|
1454 |
-
switch ($value[0]) {
|
1455 |
-
case "keyword":
|
1456 |
-
if ($color = $this->coerceColor($value)) {
|
1457 |
-
return $color;
|
1458 |
-
}
|
1459 |
-
break;
|
1460 |
-
case "raw_color":
|
1461 |
-
return $this->coerceColor($value);
|
1462 |
-
}
|
1463 |
-
}
|
1464 |
-
|
1465 |
-
return $value;
|
1466 |
-
}
|
1467 |
-
|
1468 |
-
|
1469 |
-
// coerce a value for use in color operation
|
1470 |
-
protected function coerceColor($value) {
|
1471 |
-
switch($value[0]) {
|
1472 |
-
case 'color': return $value;
|
1473 |
-
case 'raw_color':
|
1474 |
-
$c = array("color", 0, 0, 0);
|
1475 |
-
$colorStr = substr($value[1], 1);
|
1476 |
-
$num = hexdec($colorStr);
|
1477 |
-
$width = strlen($colorStr) == 3 ? 16 : 256;
|
1478 |
-
|
1479 |
-
for ($i = 3; $i > 0; $i--) { // 3 2 1
|
1480 |
-
$t = $num % $width;
|
1481 |
-
$num /= $width;
|
1482 |
-
|
1483 |
-
$c[$i] = $t * (256/$width) + $t * floor(16/$width);
|
1484 |
-
}
|
1485 |
-
|
1486 |
-
return $c;
|
1487 |
-
case 'keyword':
|
1488 |
-
$name = $value[1];
|
1489 |
-
if (isset(self::$cssColors[$name])) {
|
1490 |
-
$rgba = explode(',', self::$cssColors[$name]);
|
1491 |
-
|
1492 |
-
if(isset($rgba[3]))
|
1493 |
-
return array('color', $rgba[0], $rgba[1], $rgba[2], $rgba[3]);
|
1494 |
-
|
1495 |
-
return array('color', $rgba[0], $rgba[1], $rgba[2]);
|
1496 |
-
}
|
1497 |
-
return null;
|
1498 |
-
}
|
1499 |
-
}
|
1500 |
-
|
1501 |
-
// make something string like into a string
|
1502 |
-
protected function coerceString($value) {
|
1503 |
-
switch ($value[0]) {
|
1504 |
-
case "string":
|
1505 |
-
return $value;
|
1506 |
-
case "keyword":
|
1507 |
-
return array("string", "", array($value[1]));
|
1508 |
-
}
|
1509 |
-
return null;
|
1510 |
-
}
|
1511 |
-
|
1512 |
-
// turn list of length 1 into value type
|
1513 |
-
protected function flattenList($value) {
|
1514 |
-
if ($value[0] == "list" && count($value[2]) == 1) {
|
1515 |
-
return $this->flattenList($value[2][0]);
|
1516 |
-
}
|
1517 |
-
return $value;
|
1518 |
-
}
|
1519 |
-
|
1520 |
-
protected function toBool($a) {
|
1521 |
-
if ($a) return self::$TRUE;
|
1522 |
-
else return self::$FALSE;
|
1523 |
-
}
|
1524 |
-
|
1525 |
-
// evaluate an expression
|
1526 |
-
protected function evaluate($exp) {
|
1527 |
-
list(, $op, $left, $right, $whiteBefore, $whiteAfter) = $exp;
|
1528 |
-
|
1529 |
-
$left = $this->reduce($left, true);
|
1530 |
-
$right = $this->reduce($right, true);
|
1531 |
-
|
1532 |
-
if ($leftColor = $this->coerceColor($left)) {
|
1533 |
-
$left = $leftColor;
|
1534 |
-
}
|
1535 |
-
|
1536 |
-
if ($rightColor = $this->coerceColor($right)) {
|
1537 |
-
$right = $rightColor;
|
1538 |
-
}
|
1539 |
-
|
1540 |
-
$ltype = $left[0];
|
1541 |
-
$rtype = $right[0];
|
1542 |
-
|
1543 |
-
// operators that work on all types
|
1544 |
-
if ($op == "and") {
|
1545 |
-
return $this->toBool($left == self::$TRUE && $right == self::$TRUE);
|
1546 |
-
}
|
1547 |
-
|
1548 |
-
if ($op == "=") {
|
1549 |
-
return $this->toBool($this->eq($left, $right) );
|
1550 |
-
}
|
1551 |
-
|
1552 |
-
if ($op == "+" && !is_null($str = $this->stringConcatenate($left, $right))) {
|
1553 |
-
return $str;
|
1554 |
-
}
|
1555 |
-
|
1556 |
-
// type based operators
|
1557 |
-
$fname = "op_${ltype}_${rtype}";
|
1558 |
-
if (is_callable(array($this, $fname))) {
|
1559 |
-
$out = $this->$fname($op, $left, $right);
|
1560 |
-
if (!is_null($out)) return $out;
|
1561 |
-
}
|
1562 |
-
|
1563 |
-
// make the expression look it did before being parsed
|
1564 |
-
$paddedOp = $op;
|
1565 |
-
if ($whiteBefore) $paddedOp = " " . $paddedOp;
|
1566 |
-
if ($whiteAfter) $paddedOp .= " ";
|
1567 |
-
|
1568 |
-
return array("string", "", array($left, $paddedOp, $right));
|
1569 |
-
}
|
1570 |
-
|
1571 |
-
protected function stringConcatenate($left, $right) {
|
1572 |
-
if ($strLeft = $this->coerceString($left)) {
|
1573 |
-
if ($right[0] == "string") {
|
1574 |
-
$right[1] = "";
|
1575 |
-
}
|
1576 |
-
$strLeft[2][] = $right;
|
1577 |
-
return $strLeft;
|
1578 |
-
}
|
1579 |
-
|
1580 |
-
if ($strRight = $this->coerceString($right)) {
|
1581 |
-
array_unshift($strRight[2], $left);
|
1582 |
-
return $strRight;
|
1583 |
-
}
|
1584 |
-
}
|
1585 |
-
|
1586 |
-
|
1587 |
-
// make sure a color's components don't go out of bounds
|
1588 |
-
protected function fixColor($c) {
|
1589 |
-
foreach (range(1, 3) as $i) {
|
1590 |
-
if ($c[$i] < 0) $c[$i] = 0;
|
1591 |
-
if ($c[$i] > 255) $c[$i] = 255;
|
1592 |
-
}
|
1593 |
-
|
1594 |
-
return $c;
|
1595 |
-
}
|
1596 |
-
|
1597 |
-
protected function op_number_color($op, $lft, $rgt) {
|
1598 |
-
if ($op == '+' || $op == '*') {
|
1599 |
-
return $this->op_color_number($op, $rgt, $lft);
|
1600 |
-
}
|
1601 |
-
}
|
1602 |
-
|
1603 |
-
protected function op_color_number($op, $lft, $rgt) {
|
1604 |
-
if ($rgt[0] == '%') $rgt[1] /= 100;
|
1605 |
-
|
1606 |
-
return $this->op_color_color($op, $lft,
|
1607 |
-
array_fill(1, count($lft) - 1, $rgt[1]));
|
1608 |
-
}
|
1609 |
-
|
1610 |
-
protected function op_color_color($op, $left, $right) {
|
1611 |
-
$out = array('color');
|
1612 |
-
$max = count($left) > count($right) ? count($left) : count($right);
|
1613 |
-
foreach (range(1, $max - 1) as $i) {
|
1614 |
-
$lval = isset($left[$i]) ? $left[$i] : 0;
|
1615 |
-
$rval = isset($right[$i]) ? $right[$i] : 0;
|
1616 |
-
switch ($op) {
|
1617 |
-
case '+':
|
1618 |
-
$out[] = $lval + $rval;
|
1619 |
-
break;
|
1620 |
-
case '-':
|
1621 |
-
$out[] = $lval - $rval;
|
1622 |
-
break;
|
1623 |
-
case '*':
|
1624 |
-
$out[] = $lval * $rval;
|
1625 |
-
break;
|
1626 |
-
case '%':
|
1627 |
-
$out[] = $lval % $rval;
|
1628 |
-
break;
|
1629 |
-
case '/':
|
1630 |
-
if ($rval == 0) $this->throwError("evaluate error: can't divide by zero");
|
1631 |
-
$out[] = $lval / $rval;
|
1632 |
-
break;
|
1633 |
-
default:
|
1634 |
-
$this->throwError('evaluate error: color op number failed on op '.$op);
|
1635 |
-
}
|
1636 |
-
}
|
1637 |
-
return $this->fixColor($out);
|
1638 |
-
}
|
1639 |
-
|
1640 |
-
function lib_red($color){
|
1641 |
-
$color = $this->coerceColor($color);
|
1642 |
-
if (is_null($color)) {
|
1643 |
-
$this->throwError('color expected for red()');
|
1644 |
-
}
|
1645 |
-
|
1646 |
-
return $color[1];
|
1647 |
-
}
|
1648 |
-
|
1649 |
-
function lib_green($color){
|
1650 |
-
$color = $this->coerceColor($color);
|
1651 |
-
if (is_null($color)) {
|
1652 |
-
$this->throwError('color expected for green()');
|
1653 |
-
}
|
1654 |
-
|
1655 |
-
return $color[2];
|
1656 |
-
}
|
1657 |
-
|
1658 |
-
function lib_blue($color){
|
1659 |
-
$color = $this->coerceColor($color);
|
1660 |
-
if (is_null($color)) {
|
1661 |
-
$this->throwError('color expected for blue()');
|
1662 |
-
}
|
1663 |
-
|
1664 |
-
return $color[3];
|
1665 |
-
}
|
1666 |
-
|
1667 |
-
|
1668 |
-
// operator on two numbers
|
1669 |
-
protected function op_number_number($op, $left, $right) {
|
1670 |
-
$unit = empty($left[2]) ? $right[2] : $left[2];
|
1671 |
-
|
1672 |
-
$value = 0;
|
1673 |
-
switch ($op) {
|
1674 |
-
case '+':
|
1675 |
-
$value = $left[1] + $right[1];
|
1676 |
-
break;
|
1677 |
-
case '*':
|
1678 |
-
$value = $left[1] * $right[1];
|
1679 |
-
break;
|
1680 |
-
case '-':
|
1681 |
-
$value = $left[1] - $right[1];
|
1682 |
-
break;
|
1683 |
-
case '%':
|
1684 |
-
$value = $left[1] % $right[1];
|
1685 |
-
break;
|
1686 |
-
case '/':
|
1687 |
-
if ($right[1] == 0) $this->throwError('parse error: divide by zero');
|
1688 |
-
$value = $left[1] / $right[1];
|
1689 |
-
break;
|
1690 |
-
case '<':
|
1691 |
-
return $this->toBool($left[1] < $right[1]);
|
1692 |
-
case '>':
|
1693 |
-
return $this->toBool($left[1] > $right[1]);
|
1694 |
-
case '>=':
|
1695 |
-
return $this->toBool($left[1] >= $right[1]);
|
1696 |
-
case '=<':
|
1697 |
-
return $this->toBool($left[1] <= $right[1]);
|
1698 |
-
default:
|
1699 |
-
$this->throwError('parse error: unknown number operator: '.$op);
|
1700 |
-
}
|
1701 |
-
|
1702 |
-
return array("number", $value, $unit);
|
1703 |
-
}
|
1704 |
-
|
1705 |
-
|
1706 |
-
/* environment functions */
|
1707 |
-
|
1708 |
-
protected function makeOutputBlock($type, $selectors = null) {
|
1709 |
-
$b = new stdclass;
|
1710 |
-
$b->lines = array();
|
1711 |
-
$b->children = array();
|
1712 |
-
$b->selectors = $selectors;
|
1713 |
-
$b->type = $type;
|
1714 |
-
$b->parent = $this->scope;
|
1715 |
-
return $b;
|
1716 |
-
}
|
1717 |
-
|
1718 |
-
// the state of execution
|
1719 |
-
protected function pushEnv($block = null) {
|
1720 |
-
$e = new stdclass;
|
1721 |
-
$e->parent = $this->env;
|
1722 |
-
$e->store = array();
|
1723 |
-
$e->block = $block;
|
1724 |
-
|
1725 |
-
$this->env = $e;
|
1726 |
-
return $e;
|
1727 |
-
}
|
1728 |
-
|
1729 |
-
// pop something off the stack
|
1730 |
-
protected function popEnv() {
|
1731 |
-
$old = $this->env;
|
1732 |
-
$this->env = $this->env->parent;
|
1733 |
-
return $old;
|
1734 |
-
}
|
1735 |
-
|
1736 |
-
// set something in the current env
|
1737 |
-
protected function set($name, $value) {
|
1738 |
-
$this->env->store[$name] = $value;
|
1739 |
-
}
|
1740 |
-
|
1741 |
-
|
1742 |
-
// get the highest occurrence entry for a name
|
1743 |
-
protected function get($name, $default=null) {
|
1744 |
-
$current = $this->env;
|
1745 |
-
|
1746 |
-
$isArguments = $name == $this->vPrefix . 'arguments';
|
1747 |
-
while ($current) {
|
1748 |
-
if ($isArguments && isset($current->arguments)) {
|
1749 |
-
return array('list', ' ', $current->arguments);
|
1750 |
-
}
|
1751 |
-
|
1752 |
-
if (isset($current->store[$name]))
|
1753 |
-
return $current->store[$name];
|
1754 |
-
else {
|
1755 |
-
$current = isset($current->storeParent) ?
|
1756 |
-
$current->storeParent : $current->parent;
|
1757 |
-
}
|
1758 |
-
}
|
1759 |
-
|
1760 |
-
return $default;
|
1761 |
-
}
|
1762 |
-
|
1763 |
-
// inject array of unparsed strings into environment as variables
|
1764 |
-
protected function injectVariables($args) {
|
1765 |
-
$this->pushEnv();
|
1766 |
-
$parser = new lessc_parser($this, __METHOD__);
|
1767 |
-
foreach ($args as $name => $strValue) {
|
1768 |
-
if ($name{0} != '@') $name = '@'.$name;
|
1769 |
-
$parser->count = 0;
|
1770 |
-
$parser->buffer = (string)$strValue;
|
1771 |
-
if (!$parser->propertyValue($value)) {
|
1772 |
-
throw new Exception("failed to parse passed in variable $name: $strValue");
|
1773 |
-
}
|
1774 |
-
|
1775 |
-
$this->set($name, $value);
|
1776 |
-
}
|
1777 |
-
}
|
1778 |
-
|
1779 |
-
/**
|
1780 |
-
* Initialize any static state, can initialize parser for a file
|
1781 |
-
* $opts isn't used yet
|
1782 |
-
*/
|
1783 |
-
public function __construct($fname = null) {
|
1784 |
-
if ($fname !== null) {
|
1785 |
-
// used for deprecated parse method
|
1786 |
-
$this->_parseFile = $fname;
|
1787 |
-
}
|
1788 |
-
}
|
1789 |
-
|
1790 |
-
public function compile($string, $name = null) {
|
1791 |
-
$locale = setlocale(LC_NUMERIC, 0);
|
1792 |
-
setlocale(LC_NUMERIC, "C");
|
1793 |
-
|
1794 |
-
$this->parser = $this->makeParser($name);
|
1795 |
-
$root = $this->parser->parse($string);
|
1796 |
-
|
1797 |
-
$this->env = null;
|
1798 |
-
$this->scope = null;
|
1799 |
-
|
1800 |
-
$this->formatter = $this->newFormatter();
|
1801 |
-
|
1802 |
-
if (!empty($this->registeredVars)) {
|
1803 |
-
$this->injectVariables($this->registeredVars);
|
1804 |
-
}
|
1805 |
-
|
1806 |
-
$this->sourceParser = $this->parser; // used for error messages
|
1807 |
-
$this->compileBlock($root);
|
1808 |
-
|
1809 |
-
ob_start();
|
1810 |
-
$this->formatter->block($this->scope);
|
1811 |
-
$out = ob_get_clean();
|
1812 |
-
setlocale(LC_NUMERIC, $locale);
|
1813 |
-
return $out;
|
1814 |
-
}
|
1815 |
-
|
1816 |
-
public function compileFile($fname, $outFname = null) {
|
1817 |
-
if (!is_readable($fname)) {
|
1818 |
-
throw new Exception('load error: failed to find '.$fname);
|
1819 |
-
}
|
1820 |
-
|
1821 |
-
$pi = pathinfo($fname);
|
1822 |
-
|
1823 |
-
$oldImport = $this->importDir;
|
1824 |
-
|
1825 |
-
$this->importDir = (array)$this->importDir;
|
1826 |
-
$this->importDir[] = $pi['dirname'].'/';
|
1827 |
-
|
1828 |
-
$this->addParsedFile($fname);
|
1829 |
-
|
1830 |
-
$out = $this->compile(file_get_contents($fname), $fname);
|
1831 |
-
|
1832 |
-
$this->importDir = $oldImport;
|
1833 |
-
|
1834 |
-
if ($outFname !== null) {
|
1835 |
-
return file_put_contents($outFname, $out);
|
1836 |
-
}
|
1837 |
-
|
1838 |
-
return $out;
|
1839 |
-
}
|
1840 |
-
|
1841 |
-
// compile only if changed input has changed or output doesn't exist
|
1842 |
-
public function checkedCompile($in, $out) {
|
1843 |
-
if (!is_file($out) || filemtime($in) > filemtime($out)) {
|
1844 |
-
$this->compileFile($in, $out);
|
1845 |
-
return true;
|
1846 |
-
}
|
1847 |
-
return false;
|
1848 |
-
}
|
1849 |
-
|
1850 |
-
/**
|
1851 |
-
* Execute lessphp on a .less file or a lessphp cache structure
|
1852 |
-
*
|
1853 |
-
* The lessphp cache structure contains information about a specific
|
1854 |
-
* less file having been parsed. It can be used as a hint for future
|
1855 |
-
* calls to determine whether or not a rebuild is required.
|
1856 |
-
*
|
1857 |
-
* The cache structure contains two important keys that may be used
|
1858 |
-
* externally:
|
1859 |
-
*
|
1860 |
-
* compiled: The final compiled CSS
|
1861 |
-
* updated: The time (in seconds) the CSS was last compiled
|
1862 |
-
*
|
1863 |
-
* The cache structure is a plain-ol' PHP associative array and can
|
1864 |
-
* be serialized and unserialized without a hitch.
|
1865 |
-
*
|
1866 |
-
* @param mixed $in Input
|
1867 |
-
* @param bool $force Force rebuild?
|
1868 |
-
* @return array lessphp cache structure
|
1869 |
-
*/
|
1870 |
-
public function cachedCompile($in, $force = false) {
|
1871 |
-
// assume no root
|
1872 |
-
$root = null;
|
1873 |
-
|
1874 |
-
if (is_string($in)) {
|
1875 |
-
$root = $in;
|
1876 |
-
} elseif (is_array($in) and isset($in['root'])) {
|
1877 |
-
if ($force or ! isset($in['files'])) {
|
1878 |
-
// If we are forcing a recompile or if for some reason the
|
1879 |
-
// structure does not contain any file information we should
|
1880 |
-
// specify the root to trigger a rebuild.
|
1881 |
-
$root = $in['root'];
|
1882 |
-
} elseif (isset($in['files']) and is_array($in['files'])) {
|
1883 |
-
foreach ($in['files'] as $fname => $ftime ) {
|
1884 |
-
if (!file_exists($fname) or filemtime($fname) > $ftime) {
|
1885 |
-
// One of the files we knew about previously has changed
|
1886 |
-
// so we should look at our incoming root again.
|
1887 |
-
$root = $in['root'];
|
1888 |
-
break;
|
1889 |
-
}
|
1890 |
-
}
|
1891 |
-
}
|
1892 |
-
} else {
|
1893 |
-
// TODO: Throw an exception? We got neither a string nor something
|
1894 |
-
// that looks like a compatible lessphp cache structure.
|
1895 |
-
return null;
|
1896 |
-
}
|
1897 |
-
|
1898 |
-
if ($root !== null) {
|
1899 |
-
// If we have a root value which means we should rebuild.
|
1900 |
-
$out = array();
|
1901 |
-
$out['root'] = $root;
|
1902 |
-
$out['compiled'] = $this->compileFile($root);
|
1903 |
-
$out['files'] = $this->allParsedFiles();
|
1904 |
-
$out['updated'] = time();
|
1905 |
-
return $out;
|
1906 |
-
} else {
|
1907 |
-
// No changes, pass back the structure
|
1908 |
-
// we were given initially.
|
1909 |
-
return $in;
|
1910 |
-
}
|
1911 |
-
|
1912 |
-
}
|
1913 |
-
|
1914 |
-
// parse and compile buffer
|
1915 |
-
// This is deprecated
|
1916 |
-
public function parse($str = null, $initialVariables = null) {
|
1917 |
-
if (is_array($str)) {
|
1918 |
-
$initialVariables = $str;
|
1919 |
-
$str = null;
|
1920 |
-
}
|
1921 |
-
|
1922 |
-
$oldVars = $this->registeredVars;
|
1923 |
-
if ($initialVariables !== null) {
|
1924 |
-
$this->setVariables($initialVariables);
|
1925 |
-
}
|
1926 |
-
|
1927 |
-
if ($str == null) {
|
1928 |
-
if (empty($this->_parseFile)) {
|
1929 |
-
throw new exception("nothing to parse");
|
1930 |
-
}
|
1931 |
-
|
1932 |
-
$out = $this->compileFile($this->_parseFile);
|
1933 |
-
} else {
|
1934 |
-
$out = $this->compile($str);
|
1935 |
-
}
|
1936 |
-
|
1937 |
-
$this->registeredVars = $oldVars;
|
1938 |
-
return $out;
|
1939 |
-
}
|
1940 |
-
|
1941 |
-
protected function makeParser($name) {
|
1942 |
-
$parser = new lessc_parser($this, $name);
|
1943 |
-
$parser->writeComments = $this->preserveComments;
|
1944 |
-
|
1945 |
-
return $parser;
|
1946 |
-
}
|
1947 |
-
|
1948 |
-
public function setFormatter($name) {
|
1949 |
-
$this->formatterName = $name;
|
1950 |
-
}
|
1951 |
-
|
1952 |
-
protected function newFormatter() {
|
1953 |
-
$className = "lessc_formatter_lessjs";
|
1954 |
-
if (!empty($this->formatterName)) {
|
1955 |
-
if (!is_string($this->formatterName))
|
1956 |
-
return $this->formatterName;
|
1957 |
-
$className = "lessc_formatter_$this->formatterName";
|
1958 |
-
}
|
1959 |
-
|
1960 |
-
return new $className;
|
1961 |
-
}
|
1962 |
-
|
1963 |
-
public function setPreserveComments($preserve) {
|
1964 |
-
$this->preserveComments = $preserve;
|
1965 |
-
}
|
1966 |
-
|
1967 |
-
public function registerFunction($name, $func) {
|
1968 |
-
$this->libFunctions[$name] = $func;
|
1969 |
-
}
|
1970 |
-
|
1971 |
-
public function unregisterFunction($name) {
|
1972 |
-
unset($this->libFunctions[$name]);
|
1973 |
-
}
|
1974 |
-
|
1975 |
-
public function setVariables($variables) {
|
1976 |
-
$this->registeredVars = array_merge($this->registeredVars, $variables);
|
1977 |
-
}
|
1978 |
-
|
1979 |
-
public function unsetVariable($name) {
|
1980 |
-
unset($this->registeredVars[$name]);
|
1981 |
-
}
|
1982 |
-
|
1983 |
-
public function setImportDir($dirs) {
|
1984 |
-
$this->importDir = (array)$dirs;
|
1985 |
-
}
|
1986 |
-
|
1987 |
-
public function addImportDir($dir) {
|
1988 |
-
$this->importDir = (array)$this->importDir;
|
1989 |
-
$this->importDir[] = $dir;
|
1990 |
-
}
|
1991 |
-
|
1992 |
-
public function allParsedFiles() {
|
1993 |
-
return $this->allParsedFiles;
|
1994 |
-
}
|
1995 |
-
|
1996 |
-
protected function addParsedFile($file) {
|
1997 |
-
$this->allParsedFiles[realpath($file)] = filemtime($file);
|
1998 |
-
}
|
1999 |
-
|
2000 |
-
/**
|
2001 |
-
* Uses the current value of $this->count to show line and line number
|
2002 |
-
*/
|
2003 |
-
protected function throwError($msg = null) {
|
2004 |
-
if ($this->sourceLoc >= 0) {
|
2005 |
-
$this->sourceParser->throwError($msg, $this->sourceLoc);
|
2006 |
-
}
|
2007 |
-
throw new exception($msg);
|
2008 |
-
}
|
2009 |
-
|
2010 |
-
// compile file $in to file $out if $in is newer than $out
|
2011 |
-
// returns true when it compiles, false otherwise
|
2012 |
-
public static function ccompile($in, $out, $less = null) {
|
2013 |
-
if ($less === null) {
|
2014 |
-
$less = new self;
|
2015 |
-
}
|
2016 |
-
return $less->checkedCompile($in, $out);
|
2017 |
-
}
|
2018 |
-
|
2019 |
-
public static function cexecute($in, $force = false, $less = null) {
|
2020 |
-
if ($less === null) {
|
2021 |
-
$less = new self;
|
2022 |
-
}
|
2023 |
-
return $less->cachedCompile($in, $force);
|
2024 |
-
}
|
2025 |
-
|
2026 |
-
static protected $cssColors = array(
|
2027 |
-
'aliceblue' => '240,248,255',
|
2028 |
-
'antiquewhite' => '250,235,215',
|
2029 |
-
'aqua' => '0,255,255',
|
2030 |
-
'aquamarine' => '127,255,212',
|
2031 |
-
'azure' => '240,255,255',
|
2032 |
-
'beige' => '245,245,220',
|
2033 |
-
'bisque' => '255,228,196',
|
2034 |
-
'black' => '0,0,0',
|
2035 |
-
'blanchedalmond' => '255,235,205',
|
2036 |
-
'blue' => '0,0,255',
|
2037 |
-
'blueviolet' => '138,43,226',
|
2038 |
-
'brown' => '165,42,42',
|
2039 |
-
'burlywood' => '222,184,135',
|
2040 |
-
'cadetblue' => '95,158,160',
|
2041 |
-
'chartreuse' => '127,255,0',
|
2042 |
-
'chocolate' => '210,105,30',
|
2043 |
-
'coral' => '255,127,80',
|
2044 |
-
'cornflowerblue' => '100,149,237',
|
2045 |
-
'cornsilk' => '255,248,220',
|
2046 |
-
'crimson' => '220,20,60',
|
2047 |
-
'cyan' => '0,255,255',
|
2048 |
-
'darkblue' => '0,0,139',
|
2049 |
-
'darkcyan' => '0,139,139',
|
2050 |
-
'darkgoldenrod' => '184,134,11',
|
2051 |
-
'darkgray' => '169,169,169',
|
2052 |
-
'darkgreen' => '0,100,0',
|
2053 |
-
'darkgrey' => '169,169,169',
|
2054 |
-
'darkkhaki' => '189,183,107',
|
2055 |
-
'darkmagenta' => '139,0,139',
|
2056 |
-
'darkolivegreen' => '85,107,47',
|
2057 |
-
'darkorange' => '255,140,0',
|
2058 |
-
'darkorchid' => '153,50,204',
|
2059 |
-
'darkred' => '139,0,0',
|
2060 |
-
'darksalmon' => '233,150,122',
|
2061 |
-
'darkseagreen' => '143,188,143',
|
2062 |
-
'darkslateblue' => '72,61,139',
|
2063 |
-
'darkslategray' => '47,79,79',
|
2064 |
-
'darkslategrey' => '47,79,79',
|
2065 |
-
'darkturquoise' => '0,206,209',
|
2066 |
-
'darkviolet' => '148,0,211',
|
2067 |
-
'deeppink' => '255,20,147',
|
2068 |
-
'deepskyblue' => '0,191,255',
|
2069 |
-
'dimgray' => '105,105,105',
|
2070 |
-
'dimgrey' => '105,105,105',
|
2071 |
-
'dodgerblue' => '30,144,255',
|
2072 |
-
'firebrick' => '178,34,34',
|
2073 |
-
'floralwhite' => '255,250,240',
|
2074 |
-
'forestgreen' => '34,139,34',
|
2075 |
-
'fuchsia' => '255,0,255',
|
2076 |
-
'gainsboro' => '220,220,220',
|
2077 |
-
'ghostwhite' => '248,248,255',
|
2078 |
-
'gold' => '255,215,0',
|
2079 |
-
'goldenrod' => '218,165,32',
|
2080 |
-
'gray' => '128,128,128',
|
2081 |
-
'green' => '0,128,0',
|
2082 |
-
'greenyellow' => '173,255,47',
|
2083 |
-
'grey' => '128,128,128',
|
2084 |
-
'honeydew' => '240,255,240',
|
2085 |
-
'hotpink' => '255,105,180',
|
2086 |
-
'indianred' => '205,92,92',
|
2087 |
-
'indigo' => '75,0,130',
|
2088 |
-
'ivory' => '255,255,240',
|
2089 |
-
'khaki' => '240,230,140',
|
2090 |
-
'lavender' => '230,230,250',
|
2091 |
-
'lavenderblush' => '255,240,245',
|
2092 |
-
'lawngreen' => '124,252,0',
|
2093 |
-
'lemonchiffon' => '255,250,205',
|
2094 |
-
'lightblue' => '173,216,230',
|
2095 |
-
'lightcoral' => '240,128,128',
|
2096 |
-
'lightcyan' => '224,255,255',
|
2097 |
-
'lightgoldenrodyellow' => '250,250,210',
|
2098 |
-
'lightgray' => '211,211,211',
|
2099 |
-
'lightgreen' => '144,238,144',
|
2100 |
-
'lightgrey' => '211,211,211',
|
2101 |
-
'lightpink' => '255,182,193',
|
2102 |
-
'lightsalmon' => '255,160,122',
|
2103 |
-
'lightseagreen' => '32,178,170',
|
2104 |
-
'lightskyblue' => '135,206,250',
|
2105 |
-
'lightslategray' => '119,136,153',
|
2106 |
-
'lightslategrey' => '119,136,153',
|
2107 |
-
'lightsteelblue' => '176,196,222',
|
2108 |
-
'lightyellow' => '255,255,224',
|
2109 |
-
'lime' => '0,255,0',
|
2110 |
-
'limegreen' => '50,205,50',
|
2111 |
-
'linen' => '250,240,230',
|
2112 |
-
'magenta' => '255,0,255',
|
2113 |
-
'maroon' => '128,0,0',
|
2114 |
-
'mediumaquamarine' => '102,205,170',
|
2115 |
-
'mediumblue' => '0,0,205',
|
2116 |
-
'mediumorchid' => '186,85,211',
|
2117 |
-
'mediumpurple' => '147,112,219',
|
2118 |
-
'mediumseagreen' => '60,179,113',
|
2119 |
-
'mediumslateblue' => '123,104,238',
|
2120 |
-
'mediumspringgreen' => '0,250,154',
|
2121 |
-
'mediumturquoise' => '72,209,204',
|
2122 |
-
'mediumvioletred' => '199,21,133',
|
2123 |
-
'midnightblue' => '25,25,112',
|
2124 |
-
'mintcream' => '245,255,250',
|
2125 |
-
'mistyrose' => '255,228,225',
|
2126 |
-
'moccasin' => '255,228,181',
|
2127 |
-
'navajowhite' => '255,222,173',
|
2128 |
-
'navy' => '0,0,128',
|
2129 |
-
'oldlace' => '253,245,230',
|
2130 |
-
'olive' => '128,128,0',
|
2131 |
-
'olivedrab' => '107,142,35',
|
2132 |
-
'orange' => '255,165,0',
|
2133 |
-
'orangered' => '255,69,0',
|
2134 |
-
'orchid' => '218,112,214',
|
2135 |
-
'palegoldenrod' => '238,232,170',
|
2136 |
-
'palegreen' => '152,251,152',
|
2137 |
-
'paleturquoise' => '175,238,238',
|
2138 |
-
'palevioletred' => '219,112,147',
|
2139 |
-
'papayawhip' => '255,239,213',
|
2140 |
-
'peachpuff' => '255,218,185',
|
2141 |
-
'peru' => '205,133,63',
|
2142 |
-
'pink' => '255,192,203',
|
2143 |
-
'plum' => '221,160,221',
|
2144 |
-
'powderblue' => '176,224,230',
|
2145 |
-
'purple' => '128,0,128',
|
2146 |
-
'red' => '255,0,0',
|
2147 |
-
'rosybrown' => '188,143,143',
|
2148 |
-
'royalblue' => '65,105,225',
|
2149 |
-
'saddlebrown' => '139,69,19',
|
2150 |
-
'salmon' => '250,128,114',
|
2151 |
-
'sandybrown' => '244,164,96',
|
2152 |
-
'seagreen' => '46,139,87',
|
2153 |
-
'seashell' => '255,245,238',
|
2154 |
-
'sienna' => '160,82,45',
|
2155 |
-
'silver' => '192,192,192',
|
2156 |
-
'skyblue' => '135,206,235',
|
2157 |
-
'slateblue' => '106,90,205',
|
2158 |
-
'slategray' => '112,128,144',
|
2159 |
-
'slategrey' => '112,128,144',
|
2160 |
-
'snow' => '255,250,250',
|
2161 |
-
'springgreen' => '0,255,127',
|
2162 |
-
'steelblue' => '70,130,180',
|
2163 |
-
'tan' => '210,180,140',
|
2164 |
-
'teal' => '0,128,128',
|
2165 |
-
'thistle' => '216,191,216',
|
2166 |
-
'tomato' => '255,99,71',
|
2167 |
-
'transparent' => '0,0,0,0',
|
2168 |
-
'turquoise' => '64,224,208',
|
2169 |
-
'violet' => '238,130,238',
|
2170 |
-
'wheat' => '245,222,179',
|
2171 |
-
'white' => '255,255,255',
|
2172 |
-
'whitesmoke' => '245,245,245',
|
2173 |
-
'yellow' => '255,255,0',
|
2174 |
-
'yellowgreen' => '154,205,50'
|
2175 |
-
);
|
2176 |
-
}
|
2177 |
-
|
2178 |
-
// responsible for taking a string of LESS code and converting it into a
|
2179 |
-
// syntax tree
|
2180 |
-
class lessc_parser {
|
2181 |
-
static protected $nextBlockId = 0; // used to uniquely identify blocks
|
2182 |
-
|
2183 |
-
static protected $precedence = array(
|
2184 |
-
'=<' => 0,
|
2185 |
-
'>=' => 0,
|
2186 |
-
'=' => 0,
|
2187 |
-
'<' => 0,
|
2188 |
-
'>' => 0,
|
2189 |
-
|
2190 |
-
'+' => 1,
|
2191 |
-
'-' => 1,
|
2192 |
-
'*' => 2,
|
2193 |
-
'/' => 2,
|
2194 |
-
'%' => 2,
|
2195 |
-
);
|
2196 |
-
|
2197 |
-
static protected $whitePattern;
|
2198 |
-
static protected $commentMulti;
|
2199 |
-
|
2200 |
-
static protected $commentSingle = "//";
|
2201 |
-
static protected $commentMultiLeft = "/*";
|
2202 |
-
static protected $commentMultiRight = "*/";
|
2203 |
-
|
2204 |
-
// regex string to match any of the operators
|
2205 |
-
static protected $operatorString;
|
2206 |
-
|
2207 |
-
// these properties will supress division unless it's inside parenthases
|
2208 |
-
static protected $supressDivisionProps =
|
2209 |
-
array('/border-radius$/i', '/^font$/i');
|
2210 |
-
|
2211 |
-
protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document", "viewport", "-moz-viewport", "-o-viewport", "-ms-viewport");
|
2212 |
-
protected $lineDirectives = array("charset");
|
2213 |
-
|
2214 |
-
/**
|
2215 |
-
* if we are in parens we can be more liberal with whitespace around
|
2216 |
-
* operators because it must evaluate to a single value and thus is less
|
2217 |
-
* ambiguous.
|
2218 |
-
*
|
2219 |
-
* Consider:
|
2220 |
-
* property1: 10 -5; // is two numbers, 10 and -5
|
2221 |
-
* property2: (10 -5); // should evaluate to 5
|
2222 |
-
*/
|
2223 |
-
protected $inParens = false;
|
2224 |
-
|
2225 |
-
// caches preg escaped literals
|
2226 |
-
static protected $literalCache = array();
|
2227 |
-
|
2228 |
-
public function __construct($lessc, $sourceName = null) {
|
2229 |
-
$this->eatWhiteDefault = true;
|
2230 |
-
// reference to less needed for vPrefix, mPrefix, and parentSelector
|
2231 |
-
$this->lessc = $lessc;
|
2232 |
-
|
2233 |
-
$this->sourceName = $sourceName; // name used for error messages
|
2234 |
-
|
2235 |
-
$this->writeComments = false;
|
2236 |
-
|
2237 |
-
if (!self::$operatorString) {
|
2238 |
-
self::$operatorString =
|
2239 |
-
'('.implode('|', array_map(array('lessc', 'preg_quote'),
|
2240 |
-
array_keys(self::$precedence))).')';
|
2241 |
-
|
2242 |
-
$commentSingle = lessc::preg_quote(self::$commentSingle);
|
2243 |
-
$commentMultiLeft = lessc::preg_quote(self::$commentMultiLeft);
|
2244 |
-
$commentMultiRight = lessc::preg_quote(self::$commentMultiRight);
|
2245 |
-
|
2246 |
-
self::$commentMulti = $commentMultiLeft.'.*?'.$commentMultiRight;
|
2247 |
-
self::$whitePattern = '/'.$commentSingle.'[^\n]*\s*|('.self::$commentMulti.')\s*|\s+/Ais';
|
2248 |
-
}
|
2249 |
-
}
|
2250 |
-
|
2251 |
-
public function parse($buffer) {
|
2252 |
-
$this->count = 0;
|
2253 |
-
$this->line = 1;
|
2254 |
-
|
2255 |
-
$this->env = null; // block stack
|
2256 |
-
$this->buffer = $this->writeComments ? $buffer : $this->removeComments($buffer);
|
2257 |
-
$this->pushSpecialBlock("root");
|
2258 |
-
$this->eatWhiteDefault = true;
|
2259 |
-
$this->seenComments = array();
|
2260 |
-
|
2261 |
-
// trim whitespace on head
|
2262 |
-
// if (preg_match('/^\s+/', $this->buffer, $m)) {
|
2263 |
-
// $this->line += substr_count($m[0], "\n");
|
2264 |
-
// $this->buffer = ltrim($this->buffer);
|
2265 |
-
// }
|
2266 |
-
$this->whitespace();
|
2267 |
-
|
2268 |
-
// parse the entire file
|
2269 |
-
$lastCount = $this->count;
|
2270 |
-
while (false !== $this->parseChunk());
|
2271 |
-
|
2272 |
-
if ($this->count != strlen($this->buffer))
|
2273 |
-
$this->throwError();
|
2274 |
-
|
2275 |
-
// TODO report where the block was opened
|
2276 |
-
if (!is_null($this->env->parent))
|
2277 |
-
throw new exception('parse error: unclosed block');
|
2278 |
-
|
2279 |
-
return $this->env;
|
2280 |
-
}
|
2281 |
-
|
2282 |
-
/**
|
2283 |
-
* Parse a single chunk off the head of the buffer and append it to the
|
2284 |
-
* current parse environment.
|
2285 |
-
* Returns false when the buffer is empty, or when there is an error.
|
2286 |
-
*
|
2287 |
-
* This function is called repeatedly until the entire document is
|
2288 |
-
* parsed.
|
2289 |
-
*
|
2290 |
-
* This parser is most similar to a recursive descent parser. Single
|
2291 |
-
* functions represent discrete grammatical rules for the language, and
|
2292 |
-
* they are able to capture the text that represents those rules.
|
2293 |
-
*
|
2294 |
-
* Consider the function lessc::keyword(). (all parse functions are
|
2295 |
-
* structured the same)
|
2296 |
-
*
|
2297 |
-
* The function takes a single reference argument. When calling the
|
2298 |
-
* function it will attempt to match a keyword on the head of the buffer.
|
2299 |
-
* If it is successful, it will place the keyword in the referenced
|
2300 |
-
* argument, advance the position in the buffer, and return true. If it
|
2301 |
-
* fails then it won't advance the buffer and it will return false.
|
2302 |
-
*
|
2303 |
-
* All of these parse functions are powered by lessc::match(), which behaves
|
2304 |
-
* the same way, but takes a literal regular expression. Sometimes it is
|
2305 |
-
* more convenient to use match instead of creating a new function.
|
2306 |
-
*
|
2307 |
-
* Because of the format of the functions, to parse an entire string of
|
2308 |
-
* grammatical rules, you can chain them together using &&.
|
2309 |
-
*
|
2310 |
-
* But, if some of the rules in the chain succeed before one fails, then
|
2311 |
-
* the buffer position will be left at an invalid state. In order to
|
2312 |
-
* avoid this, lessc::seek() is used to remember and set buffer positions.
|
2313 |
-
*
|
2314 |
-
* Before parsing a chain, use $s = $this->seek() to remember the current
|
2315 |
-
* position into $s. Then if a chain fails, use $this->seek($s) to
|
2316 |
-
* go back where we started.
|
2317 |
-
*/
|
2318 |
-
protected function parseChunk() {
|
2319 |
-
if (empty($this->buffer)) return false;
|
2320 |
-
$s = $this->seek();
|
2321 |
-
|
2322 |
-
// setting a property
|
2323 |
-
if ($this->keyword($key) && $this->assign() &&
|
2324 |
-
$this->propertyValue($value, $key) && $this->end())
|
2325 |
-
{
|
2326 |
-
$this->append(array('assign', $key, $value), $s);
|
2327 |
-
return true;
|
2328 |
-
} else {
|
2329 |
-
$this->seek($s);
|
2330 |
-
}
|
2331 |
-
|
2332 |
-
|
2333 |
-
// look for special css blocks
|
2334 |
-
if ($this->literal('@', false)) {
|
2335 |
-
$this->count--;
|
2336 |
-
|
2337 |
-
// media
|
2338 |
-
if ($this->literal('@media')) {
|
2339 |
-
if (($this->mediaQueryList($mediaQueries) || true)
|
2340 |
-
&& $this->literal('{'))
|
2341 |
-
{
|
2342 |
-
$media = $this->pushSpecialBlock("media");
|
2343 |
-
$media->queries = is_null($mediaQueries) ? array() : $mediaQueries;
|
2344 |
-
return true;
|
2345 |
-
} else {
|
2346 |
-
$this->seek($s);
|
2347 |
-
return false;
|
2348 |
-
}
|
2349 |
-
}
|
2350 |
-
|
2351 |
-
if ($this->literal("@", false) && $this->keyword($dirName)) {
|
2352 |
-
if ($this->isDirective($dirName, $this->blockDirectives)) {
|
2353 |
-
if (($this->openString("{", $dirValue, null, array(";")) || true) &&
|
2354 |
-
$this->literal("{"))
|
2355 |
-
{
|
2356 |
-
$dir = $this->pushSpecialBlock("directive");
|
2357 |
-
$dir->name = $dirName;
|
2358 |
-
if (isset($dirValue)) $dir->value = $dirValue;
|
2359 |
-
return true;
|
2360 |
-
}
|
2361 |
-
} elseif ($this->isDirective($dirName, $this->lineDirectives)) {
|
2362 |
-
if ($this->propertyValue($dirValue) && $this->end()) {
|
2363 |
-
$this->append(array("directive", $dirName, $dirValue));
|
2364 |
-
return true;
|
2365 |
-
}
|
2366 |
-
}
|
2367 |
-
}
|
2368 |
-
|
2369 |
-
$this->seek($s);
|
2370 |
-
}
|
2371 |
-
|
2372 |
-
// setting a variable
|
2373 |
-
if ($this->variable($var) && $this->assign() &&
|
2374 |
-
$this->propertyValue($value) && $this->end())
|
2375 |
-
{
|
2376 |
-
$this->append(array('assign', $var, $value), $s);
|
2377 |
-
return true;
|
2378 |
-
} else {
|
2379 |
-
$this->seek($s);
|
2380 |
-
}
|
2381 |
-
|
2382 |
-
if ($this->import($importValue)) {
|
2383 |
-
$this->append($importValue, $s);
|
2384 |
-
return true;
|
2385 |
-
}
|
2386 |
-
|
2387 |
-
// opening parametric mixin
|
2388 |
-
if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) &&
|
2389 |
-
($this->guards($guards) || true) &&
|
2390 |
-
$this->literal('{'))
|
2391 |
-
{
|
2392 |
-
$block = $this->pushBlock($this->fixTags(array($tag)));
|
2393 |
-
$block->args = $args;
|
2394 |
-
$block->isVararg = $isVararg;
|
2395 |
-
if (!empty($guards)) $block->guards = $guards;
|
2396 |
-
return true;
|
2397 |
-
} else {
|
2398 |
-
$this->seek($s);
|
2399 |
-
}
|
2400 |
-
|
2401 |
-
// opening a simple block
|
2402 |
-
if ($this->tags($tags) && $this->literal('{')) {
|
2403 |
-
$tags = $this->fixTags($tags);
|
2404 |
-
$this->pushBlock($tags);
|
2405 |
-
return true;
|
2406 |
-
} else {
|
2407 |
-
$this->seek($s);
|
2408 |
-
}
|
2409 |
-
|
2410 |
-
// closing a block
|
2411 |
-
if ($this->literal('}', false)) {
|
2412 |
-
try {
|
2413 |
-
$block = $this->pop();
|
2414 |
-
} catch (exception $e) {
|
2415 |
-
$this->seek($s);
|
2416 |
-
$this->throwError($e->getMessage());
|
2417 |
-
}
|
2418 |
-
|
2419 |
-
$hidden = false;
|
2420 |
-
if (is_null($block->type)) {
|
2421 |
-
$hidden = true;
|
2422 |
-
if (!isset($block->args)) {
|
2423 |
-
foreach ($block->tags as $tag) {
|
2424 |
-
if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) {
|
2425 |
-
$hidden = false;
|
2426 |
-
break;
|
2427 |
-
}
|
2428 |
-
}
|
2429 |
-
}
|
2430 |
-
|
2431 |
-
foreach ($block->tags as $tag) {
|
2432 |
-
if (is_string($tag)) {
|
2433 |
-
$this->env->children[$tag][] = $block;
|
2434 |
-
}
|
2435 |
-
}
|
2436 |
-
}
|
2437 |
-
|
2438 |
-
if (!$hidden) {
|
2439 |
-
$this->append(array('block', $block), $s);
|
2440 |
-
}
|
2441 |
-
|
2442 |
-
// this is done here so comments aren't bundled into he block that
|
2443 |
-
// was just closed
|
2444 |
-
$this->whitespace();
|
2445 |
-
return true;
|
2446 |
-
}
|
2447 |
-
|
2448 |
-
// mixin
|
2449 |
-
if ($this->mixinTags($tags) &&
|
2450 |
-
($this->argumentDef($argv, $isVararg) || true) &&
|
2451 |
-
($this->keyword($suffix) || true) && $this->end())
|
2452 |
-
{
|
2453 |
-
$tags = $this->fixTags($tags);
|
2454 |
-
$this->append(array('mixin', $tags, $argv, $suffix), $s);
|
2455 |
-
return true;
|
2456 |
-
} else {
|
2457 |
-
$this->seek($s);
|
2458 |
-
}
|
2459 |
-
|
2460 |
-
// spare ;
|
2461 |
-
if ($this->literal(';')) return true;
|
2462 |
-
|
2463 |
-
return false; // got nothing, throw error
|
2464 |
-
}
|
2465 |
-
|
2466 |
-
protected function isDirective($dirname, $directives) {
|
2467 |
-
// TODO: cache pattern in parser
|
2468 |
-
$pattern = implode("|",
|
2469 |
-
array_map(array("lessc", "preg_quote"), $directives));
|
2470 |
-
$pattern = '/^(-[a-z-]+-)?(' . $pattern . ')$/i';
|
2471 |
-
|
2472 |
-
return preg_match($pattern, $dirname);
|
2473 |
-
}
|
2474 |
-
|
2475 |
-
protected function fixTags($tags) {
|
2476 |
-
// move @ tags out of variable namespace
|
2477 |
-
foreach ($tags as &$tag) {
|
2478 |
-
if ($tag{0} == $this->lessc->vPrefix)
|
2479 |
-
$tag[0] = $this->lessc->mPrefix;
|
2480 |
-
}
|
2481 |
-
return $tags;
|
2482 |
-
}
|
2483 |
-
|
2484 |
-
// a list of expressions
|
2485 |
-
protected function expressionList(&$exps) {
|
2486 |
-
$values = array();
|
2487 |
-
|
2488 |
-
while ($this->expression($exp)) {
|
2489 |
-
$values[] = $exp;
|
2490 |
-
}
|
2491 |
-
|
2492 |
-
if (count($values) == 0) return false;
|
2493 |
-
|
2494 |
-
$exps = lessc::compressList($values, ' ');
|
2495 |
-
return true;
|
2496 |
-
}
|
2497 |
-
|
2498 |
-
/**
|
2499 |
-
* Attempt to consume an expression.
|
2500 |
-
* @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code
|
2501 |
-
*/
|
2502 |
-
protected function expression(&$out) {
|
2503 |
-
if ($this->value($lhs)) {
|
2504 |
-
$out = $this->expHelper($lhs, 0);
|
2505 |
-
|
2506 |
-
// look for / shorthand
|
2507 |
-
if (!empty($this->env->supressedDivision)) {
|
2508 |
-
unset($this->env->supressedDivision);
|
2509 |
-
$s = $this->seek();
|
2510 |
-
if ($this->literal("/") && $this->value($rhs)) {
|
2511 |
-
$out = array("list", "",
|
2512 |
-
array($out, array("keyword", "/"), $rhs));
|
2513 |
-
} else {
|
2514 |
-
$this->seek($s);
|
2515 |
-
}
|
2516 |
-
}
|
2517 |
-
|
2518 |
-
return true;
|
2519 |
-
}
|
2520 |
-
return false;
|
2521 |
-
}
|
2522 |
-
|
2523 |
-
/**
|
2524 |
-
* recursively parse infix equation with $lhs at precedence $minP
|
2525 |
-
*/
|
2526 |
-
protected function expHelper($lhs, $minP) {
|
2527 |
-
$this->inExp = true;
|
2528 |
-
$ss = $this->seek();
|
2529 |
-
|
2530 |
-
while (true) {
|
2531 |
-
$whiteBefore = isset($this->buffer[$this->count - 1]) &&
|
2532 |
-
ctype_space($this->buffer[$this->count - 1]);
|
2533 |
-
|
2534 |
-
// If there is whitespace before the operator, then we require
|
2535 |
-
// whitespace after the operator for it to be an expression
|
2536 |
-
$needWhite = $whiteBefore && !$this->inParens;
|
2537 |
-
|
2538 |
-
if ($this->match(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) {
|
2539 |
-
if (!$this->inParens && isset($this->env->currentProperty) && $m[1] == "/" && empty($this->env->supressedDivision)) {
|
2540 |
-
foreach (self::$supressDivisionProps as $pattern) {
|
2541 |
-
if (preg_match($pattern, $this->env->currentProperty)) {
|
2542 |
-
$this->env->supressedDivision = true;
|
2543 |
-
break 2;
|
2544 |
-
}
|
2545 |
-
}
|
2546 |
-
}
|
2547 |
-
|
2548 |
-
|
2549 |
-
$whiteAfter = isset($this->buffer[$this->count - 1]) &&
|
2550 |
-
ctype_space($this->buffer[$this->count - 1]);
|
2551 |
-
|
2552 |
-
if (!$this->value($rhs)) break;
|
2553 |
-
|
2554 |
-
// peek for next operator to see what to do with rhs
|
2555 |
-
if ($this->peek(self::$operatorString, $next) && self::$precedence[$next[1]] > self::$precedence[$m[1]]) {
|
2556 |
-
$rhs = $this->expHelper($rhs, self::$precedence[$next[1]]);
|
2557 |
-
}
|
2558 |
-
|
2559 |
-
$lhs = array('expression', $m[1], $lhs, $rhs, $whiteBefore, $whiteAfter);
|
2560 |
-
$ss = $this->seek();
|
2561 |
-
|
2562 |
-
continue;
|
2563 |
-
}
|
2564 |
-
|
2565 |
-
break;
|
2566 |
-
}
|
2567 |
-
|
2568 |
-
$this->seek($ss);
|
2569 |
-
|
2570 |
-
return $lhs;
|
2571 |
-
}
|
2572 |
-
|
2573 |
-
// consume a list of values for a property
|
2574 |
-
public function propertyValue(&$value, $keyName = null) {
|
2575 |
-
$values = array();
|
2576 |
-
|
2577 |
-
if ($keyName !== null) $this->env->currentProperty = $keyName;
|
2578 |
-
|
2579 |
-
$s = null;
|
2580 |
-
while ($this->expressionList($v)) {
|
2581 |
-
$values[] = $v;
|
2582 |
-
$s = $this->seek();
|
2583 |
-
if (!$this->literal(',')) break;
|
2584 |
-
}
|
2585 |
-
|
2586 |
-
if ($s) $this->seek($s);
|
2587 |
-
|
2588 |
-
if ($keyName !== null) unset($this->env->currentProperty);
|
2589 |
-
|
2590 |
-
if (count($values) == 0) return false;
|
2591 |
-
|
2592 |
-
$value = lessc::compressList($values, ', ');
|
2593 |
-
return true;
|
2594 |
-
}
|
2595 |
-
|
2596 |
-
protected function parenValue(&$out) {
|
2597 |
-
$s = $this->seek();
|
2598 |
-
|
2599 |
-
// speed shortcut
|
2600 |
-
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "(") {
|
2601 |
-
return false;
|
2602 |
-
}
|
2603 |
-
|
2604 |
-
$inParens = $this->inParens;
|
2605 |
-
if ($this->literal("(") &&
|
2606 |
-
($this->inParens = true) && $this->expression($exp) &&
|
2607 |
-
$this->literal(")"))
|
2608 |
-
{
|
2609 |
-
$out = $exp;
|
2610 |
-
$this->inParens = $inParens;
|
2611 |
-
return true;
|
2612 |
-
} else {
|
2613 |
-
$this->inParens = $inParens;
|
2614 |
-
$this->seek($s);
|
2615 |
-
}
|
2616 |
-
|
2617 |
-
return false;
|
2618 |
-
}
|
2619 |
-
|
2620 |
-
// a single value
|
2621 |
-
protected function value(&$value) {
|
2622 |
-
$s = $this->seek();
|
2623 |
-
|
2624 |
-
// speed shortcut
|
2625 |
-
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "-") {
|
2626 |
-
// negation
|
2627 |
-
if ($this->literal("-", false) &&
|
2628 |
-
(($this->variable($inner) && $inner = array("variable", $inner)) ||
|
2629 |
-
$this->unit($inner) ||
|
2630 |
-
$this->parenValue($inner)))
|
2631 |
-
{
|
2632 |
-
$value = array("unary", "-", $inner);
|
2633 |
-
return true;
|
2634 |
-
} else {
|
2635 |
-
$this->seek($s);
|
2636 |
-
}
|
2637 |
-
}
|
2638 |
-
|
2639 |
-
if ($this->parenValue($value)) return true;
|
2640 |
-
if ($this->unit($value)) return true;
|
2641 |
-
if ($this->color($value)) return true;
|
2642 |
-
if ($this->func($value)) return true;
|
2643 |
-
if ($this->_string($value)) return true;
|
2644 |
-
|
2645 |
-
if ($this->keyword($word)) {
|
2646 |
-
$value = array('keyword', $word);
|
2647 |
-
return true;
|
2648 |
-
}
|
2649 |
-
|
2650 |
-
// try a variable
|
2651 |
-
if ($this->variable($var)) {
|
2652 |
-
$value = array('variable', $var);
|
2653 |
-
return true;
|
2654 |
-
}
|
2655 |
-
|
2656 |
-
// unquote string (should this work on any type?
|
2657 |
-
if ($this->literal("~") && $this->_string($str)) {
|
2658 |
-
$value = array("escape", $str);
|
2659 |
-
return true;
|
2660 |
-
} else {
|
2661 |
-
$this->seek($s);
|
2662 |
-
}
|
2663 |
-
|
2664 |
-
// css hack: \0
|
2665 |
-
if ($this->literal('\\') && $this->match('([0-9]+)', $m)) {
|
2666 |
-
$value = array('keyword', '\\'.$m[1]);
|
2667 |
-
return true;
|
2668 |
-
} else {
|
2669 |
-
$this->seek($s);
|
2670 |
-
}
|
2671 |
-
|
2672 |
-
return false;
|
2673 |
-
}
|
2674 |
-
|
2675 |
-
// an import statement
|
2676 |
-
protected function import(&$out) {
|
2677 |
-
$s = $this->seek();
|
2678 |
-
if (!$this->literal('@import')) return false;
|
2679 |
-
|
2680 |
-
// @import "something.css" media;
|
2681 |
-
// @import url("something.css") media;
|
2682 |
-
// @import url(something.css) media;
|
2683 |
-
|
2684 |
-
if ($this->propertyValue($value)) {
|
2685 |
-
$out = array("import", $value);
|
2686 |
-
return true;
|
2687 |
-
}
|
2688 |
-
}
|
2689 |
-
|
2690 |
-
protected function mediaQueryList(&$out) {
|
2691 |
-
if ($this->genericList($list, "mediaQuery", ",", false)) {
|
2692 |
-
$out = $list[2];
|
2693 |
-
return true;
|
2694 |
-
}
|
2695 |
-
return false;
|
2696 |
-
}
|
2697 |
-
|
2698 |
-
protected function mediaQuery(&$out) {
|
2699 |
-
$s = $this->seek();
|
2700 |
-
|
2701 |
-
$expressions = null;
|
2702 |
-
$parts = array();
|
2703 |
-
|
2704 |
-
if (($this->literal("only") && ($only = true) || $this->literal("not") && ($not = true) || true) && $this->keyword($mediaType)) {
|
2705 |
-
$prop = array("mediaType");
|
2706 |
-
if (isset($only)) $prop[] = "only";
|
2707 |
-
if (isset($not)) $prop[] = "not";
|
2708 |
-
$prop[] = $mediaType;
|
2709 |
-
$parts[] = $prop;
|
2710 |
-
} else {
|
2711 |
-
$this->seek($s);
|
2712 |
-
}
|
2713 |
-
|
2714 |
-
|
2715 |
-
if (!empty($mediaType) && !$this->literal("and")) {
|
2716 |
-
// ~
|
2717 |
-
} else {
|
2718 |
-
$this->genericList($expressions, "mediaExpression", "and", false);
|
2719 |
-
if (is_array($expressions)) $parts = array_merge($parts, $expressions[2]);
|
2720 |
-
}
|
2721 |
-
|
2722 |
-
if (count($parts) == 0) {
|
2723 |
-
$this->seek($s);
|
2724 |
-
return false;
|
2725 |
-
}
|
2726 |
-
|
2727 |
-
$out = $parts;
|
2728 |
-
return true;
|
2729 |
-
}
|
2730 |
-
|
2731 |
-
protected function mediaExpression(&$out) {
|
2732 |
-
$s = $this->seek();
|
2733 |
-
$value = null;
|
2734 |
-
if ($this->literal("(") &&
|
2735 |
-
$this->keyword($feature) &&
|
2736 |
-
($this->literal(":") && $this->expression($value) || true) &&
|
2737 |
-
$this->literal(")"))
|
2738 |
-
{
|
2739 |
-
$out = array("mediaExp", $feature);
|
2740 |
-
if ($value) $out[] = $value;
|
2741 |
-
return true;
|
2742 |
-
} elseif ($this->variable($variable)) {
|
2743 |
-
$out = array('variable', $variable);
|
2744 |
-
return true;
|
2745 |
-
}
|
2746 |
-
|
2747 |
-
$this->seek($s);
|
2748 |
-
return false;
|
2749 |
-
}
|
2750 |
-
|
2751 |
-
// an unbounded string stopped by $end
|
2752 |
-
protected function openString($end, &$out, $nestingOpen=null, $rejectStrs = null) {
|
2753 |
-
$oldWhite = $this->eatWhiteDefault;
|
2754 |
-
$this->eatWhiteDefault = false;
|
2755 |
-
|
2756 |
-
$stop = array("'", '"', "@{", $end);
|
2757 |
-
$stop = array_map(array("lessc", "preg_quote"), $stop);
|
2758 |
-
// $stop[] = self::$commentMulti;
|
2759 |
-
|
2760 |
-
if (!is_null($rejectStrs)) {
|
2761 |
-
$stop = array_merge($stop, $rejectStrs);
|
2762 |
-
}
|
2763 |
-
|
2764 |
-
$patt = '(.*?)('.implode("|", $stop).')';
|
2765 |
-
|
2766 |
-
$nestingLevel = 0;
|
2767 |
-
|
2768 |
-
$content = array();
|
2769 |
-
while ($this->match($patt, $m, false)) {
|
2770 |
-
if (!empty($m[1])) {
|
2771 |
-
$content[] = $m[1];
|
2772 |
-
if ($nestingOpen) {
|
2773 |
-
$nestingLevel += substr_count($m[1], $nestingOpen);
|
2774 |
-
}
|
2775 |
-
}
|
2776 |
-
|
2777 |
-
$tok = $m[2];
|
2778 |
-
|
2779 |
-
$this->count-= strlen($tok);
|
2780 |
-
if ($tok == $end) {
|
2781 |
-
if ($nestingLevel == 0) {
|
2782 |
-
break;
|
2783 |
-
} else {
|
2784 |
-
$nestingLevel--;
|
2785 |
-
}
|
2786 |
-
}
|
2787 |
-
|
2788 |
-
if (($tok == "'" || $tok == '"') && $this->_string($str)) {
|
2789 |
-
$content[] = $str;
|
2790 |
-
continue;
|
2791 |
-
}
|
2792 |
-
|
2793 |
-
if ($tok == "@{" && $this->interpolation($inter)) {
|
2794 |
-
$content[] = $inter;
|
2795 |
-
continue;
|
2796 |
-
}
|
2797 |
-
|
2798 |
-
if (!empty($rejectStrs) && in_array($tok, $rejectStrs)) {
|
2799 |
-
break;
|
2800 |
-
}
|
2801 |
-
|
2802 |
-
$content[] = $tok;
|
2803 |
-
$this->count+= strlen($tok);
|
2804 |
-
}
|
2805 |
-
|
2806 |
-
$this->eatWhiteDefault = $oldWhite;
|
2807 |
-
|
2808 |
-
if (count($content) == 0) return false;
|
2809 |
-
|
2810 |
-
// trim the end
|
2811 |
-
if (is_string(end($content))) {
|
2812 |
-
$content[count($content) - 1] = rtrim(end($content));
|
2813 |
-
}
|
2814 |
-
|
2815 |
-
$out = array("string", "", $content);
|
2816 |
-
return true;
|
2817 |
-
}
|
2818 |
-
|
2819 |
-
protected function _string(&$out) {
|
2820 |
-
$s = $this->seek();
|
2821 |
-
if ($this->literal('"', false)) {
|
2822 |
-
$delim = '"';
|
2823 |
-
} elseif ($this->literal("'", false)) {
|
2824 |
-
$delim = "'";
|
2825 |
-
} else {
|
2826 |
-
return false;
|
2827 |
-
}
|
2828 |
-
|
2829 |
-
$content = array();
|
2830 |
-
|
2831 |
-
// look for either ending delim , escape, or string interpolation
|
2832 |
-
$patt = '([^\n]*?)(@\{|\\\\|' .
|
2833 |
-
lessc::preg_quote($delim).')';
|
2834 |
-
|
2835 |
-
$oldWhite = $this->eatWhiteDefault;
|
2836 |
-
$this->eatWhiteDefault = false;
|
2837 |
-
|
2838 |
-
while ($this->match($patt, $m, false)) {
|
2839 |
-
$content[] = $m[1];
|
2840 |
-
if ($m[2] == "@{") {
|
2841 |
-
$this->count -= strlen($m[2]);
|
2842 |
-
if ($this->interpolation($inter, false)) {
|
2843 |
-
$content[] = $inter;
|
2844 |
-
} else {
|
2845 |
-
$this->count += strlen($m[2]);
|
2846 |
-
$content[] = "@{"; // ignore it
|
2847 |
-
}
|
2848 |
-
} elseif ($m[2] == '\\') {
|
2849 |
-
$content[] = $m[2];
|
2850 |
-
if ($this->literal($delim, false)) {
|
2851 |
-
$content[] = $delim;
|
2852 |
-
}
|
2853 |
-
} else {
|
2854 |
-
$this->count -= strlen($delim);
|
2855 |
-
break; // delim
|
2856 |
-
}
|
2857 |
-
}
|
2858 |
-
|
2859 |
-
$this->eatWhiteDefault = $oldWhite;
|
2860 |
-
|
2861 |
-
if ($this->literal($delim)) {
|
2862 |
-
$out = array("string", $delim, $content);
|
2863 |
-
return true;
|
2864 |
-
}
|
2865 |
-
|
2866 |
-
$this->seek($s);
|
2867 |
-
return false;
|
2868 |
-
}
|
2869 |
-
|
2870 |
-
protected function interpolation(&$out) {
|
2871 |
-
$oldWhite = $this->eatWhiteDefault;
|
2872 |
-
$this->eatWhiteDefault = true;
|
2873 |
-
|
2874 |
-
$s = $this->seek();
|
2875 |
-
if ($this->literal("@{") &&
|
2876 |
-
$this->openString("}", $interp, null, array("'", '"', ";")) &&
|
2877 |
-
$this->literal("}", false))
|
2878 |
-
{
|
2879 |
-
$out = array("interpolate", $interp);
|
2880 |
-
$this->eatWhiteDefault = $oldWhite;
|
2881 |
-
if ($this->eatWhiteDefault) $this->whitespace();
|
2882 |
-
return true;
|
2883 |
-
}
|
2884 |
-
|
2885 |
-
$this->eatWhiteDefault = $oldWhite;
|
2886 |
-
$this->seek($s);
|
2887 |
-
return false;
|
2888 |
-
}
|
2889 |
-
|
2890 |
-
protected function unit(&$unit) {
|
2891 |
-
// speed shortcut
|
2892 |
-
if (isset($this->buffer[$this->count])) {
|
2893 |
-
$char = $this->buffer[$this->count];
|
2894 |
-
if (!ctype_digit($char) && $char != ".") return false;
|
2895 |
-
}
|
2896 |
-
|
2897 |
-
if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) {
|
2898 |
-
$unit = array("number", $m[1], empty($m[2]) ? "" : $m[2]);
|
2899 |
-
return true;
|
2900 |
-
}
|
2901 |
-
return false;
|
2902 |
-
}
|
2903 |
-
|
2904 |
-
// a # color
|
2905 |
-
protected function color(&$out) {
|
2906 |
-
if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) {
|
2907 |
-
if (strlen($m[1]) > 7) {
|
2908 |
-
$out = array("string", "", array($m[1]));
|
2909 |
-
} else {
|
2910 |
-
$out = array("raw_color", $m[1]);
|
2911 |
-
}
|
2912 |
-
return true;
|
2913 |
-
}
|
2914 |
-
|
2915 |
-
return false;
|
2916 |
-
}
|
2917 |
-
|
2918 |
-
// consume an argument definition list surrounded by ()
|
2919 |
-
// each argument is a variable name with optional value
|
2920 |
-
// or at the end a ... or a variable named followed by ...
|
2921 |
-
// arguments are separated by , unless a ; is in the list, then ; is the
|
2922 |
-
// delimiter.
|
2923 |
-
protected function argumentDef(&$args, &$isVararg) {
|
2924 |
-
$s = $this->seek();
|
2925 |
-
if (!$this->literal('(')) return false;
|
2926 |
-
|
2927 |
-
$values = array();
|
2928 |
-
$delim = ",";
|
2929 |
-
$method = "expressionList";
|
2930 |
-
|
2931 |
-
$isVararg = false;
|
2932 |
-
while (true) {
|
2933 |
-
if ($this->literal("...")) {
|
2934 |
-
$isVararg = true;
|
2935 |
-
break;
|
2936 |
-
}
|
2937 |
-
|
2938 |
-
if ($this->$method($value)) {
|
2939 |
-
if ($value[0] == "variable") {
|
2940 |
-
$arg = array("arg", $value[1]);
|
2941 |
-
$ss = $this->seek();
|
2942 |
-
|
2943 |
-
if ($this->assign() && $this->$method($rhs)) {
|
2944 |
-
$arg[] = $rhs;
|
2945 |
-
} else {
|
2946 |
-
$this->seek($ss);
|
2947 |
-
if ($this->literal("...")) {
|
2948 |
-
$arg[0] = "rest";
|
2949 |
-
$isVararg = true;
|
2950 |
-
}
|
2951 |
-
}
|
2952 |
-
|
2953 |
-
$values[] = $arg;
|
2954 |
-
if ($isVararg) break;
|
2955 |
-
continue;
|
2956 |
-
} else {
|
2957 |
-
$values[] = array("lit", $value);
|
2958 |
-
}
|
2959 |
-
}
|
2960 |
-
|
2961 |
-
|
2962 |
-
if (!$this->literal($delim)) {
|
2963 |
-
if ($delim == "," && $this->literal(";")) {
|
2964 |
-
// found new delim, convert existing args
|
2965 |
-
$delim = ";";
|
2966 |
-
$method = "propertyValue";
|
2967 |
-
|
2968 |
-
// transform arg list
|
2969 |
-
if (isset($values[1])) { // 2 items
|
2970 |
-
$newList = array();
|
2971 |
-
foreach ($values as $i => $arg) {
|
2972 |
-
switch($arg[0]) {
|
2973 |
-
case "arg":
|
2974 |
-
if ($i) {
|
2975 |
-
$this->throwError("Cannot mix ; and , as delimiter types");
|
2976 |
-
}
|
2977 |
-
$newList[] = $arg[2];
|
2978 |
-
break;
|
2979 |
-
case "lit":
|
2980 |
-
$newList[] = $arg[1];
|
2981 |
-
break;
|
2982 |
-
case "rest":
|
2983 |
-
$this->throwError("Unexpected rest before semicolon");
|
2984 |
-
}
|
2985 |
-
}
|
2986 |
-
|
2987 |
-
$newList = array("list", ", ", $newList);
|
2988 |
-
|
2989 |
-
switch ($values[0][0]) {
|
2990 |
-
case "arg":
|
2991 |
-
$newArg = array("arg", $values[0][1], $newList);
|
2992 |
-
break;
|
2993 |
-
case "lit":
|
2994 |
-
$newArg = array("lit", $newList);
|
2995 |
-
break;
|
2996 |
-
}
|
2997 |
-
|
2998 |
-
} elseif ($values) { // 1 item
|
2999 |
-
$newArg = $values[0];
|
3000 |
-
}
|
3001 |
-
|
3002 |
-
if ($newArg) {
|
3003 |
-
$values = array($newArg);
|
3004 |
-
}
|
3005 |
-
} else {
|
3006 |
-
break;
|
3007 |
-
}
|
3008 |
-
}
|
3009 |
-
}
|
3010 |
-
|
3011 |
-
if (!$this->literal(')')) {
|
3012 |
-
$this->seek($s);
|
3013 |
-
return false;
|
3014 |
-
}
|
3015 |
-
|
3016 |
-
$args = $values;
|
3017 |
-
|
3018 |
-
return true;
|
3019 |
-
}
|
3020 |
-
|
3021 |
-
// consume a list of tags
|
3022 |
-
// this accepts a hanging delimiter
|
3023 |
-
protected function tags(&$tags, $simple = false, $delim = ',') {
|
3024 |
-
$tags = array();
|
3025 |
-
while ($this->tag($tt, $simple)) {
|
3026 |
-
$tags[] = $tt;
|
3027 |
-
if (!$this->literal($delim)) break;
|
3028 |
-
}
|
3029 |
-
if (count($tags) == 0) return false;
|
3030 |
-
|
3031 |
-
return true;
|
3032 |
-
}
|
3033 |
-
|
3034 |
-
// list of tags of specifying mixin path
|
3035 |
-
// optionally separated by > (lazy, accepts extra >)
|
3036 |
-
protected function mixinTags(&$tags) {
|
3037 |
-
$s = $this->seek();
|
3038 |
-
$tags = array();
|
3039 |
-
while ($this->tag($tt, true)) {
|
3040 |
-
$tags[] = $tt;
|
3041 |
-
$this->literal(">");
|
3042 |
-
}
|
3043 |
-
|
3044 |
-
if (count($tags) == 0) return false;
|
3045 |
-
|
3046 |
-
return true;
|
3047 |
-
}
|
3048 |
-
|
3049 |
-
// a bracketed value (contained within in a tag definition)
|
3050 |
-
protected function tagBracket(&$parts, &$hasExpression) {
|
3051 |
-
// speed shortcut
|
3052 |
-
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") {
|
3053 |
-
return false;
|
3054 |
-
}
|
3055 |
-
|
3056 |
-
$s = $this->seek();
|
3057 |
-
|
3058 |
-
$hasInterpolation = false;
|
3059 |
-
|
3060 |
-
if ($this->literal("[", false)) {
|
3061 |
-
$attrParts = array("[");
|
3062 |
-
// keyword, string, operator
|
3063 |
-
while (true) {
|
3064 |
-
if ($this->literal("]", false)) {
|
3065 |
-
$this->count--;
|
3066 |
-
break; // get out early
|
3067 |
-
}
|
3068 |
-
|
3069 |
-
if ($this->match('\s+', $m)) {
|
3070 |
-
$attrParts[] = " ";
|
3071 |
-
continue;
|
3072 |
-
}
|
3073 |
-
if ($this->_string($str)) {
|
3074 |
-
// escape parent selector, (yuck)
|
3075 |
-
foreach ($str[2] as &$chunk) {
|
3076 |
-
$chunk = str_replace($this->lessc->parentSelector, "$&$", $chunk);
|
3077 |
-
}
|
3078 |
-
|
3079 |
-
$attrParts[] = $str;
|
3080 |
-
$hasInterpolation = true;
|
3081 |
-
continue;
|
3082 |
-
}
|
3083 |
-
|
3084 |
-
if ($this->keyword($word)) {
|
3085 |
-
$attrParts[] = $word;
|
3086 |
-
continue;
|
3087 |
-
}
|
3088 |
-
|
3089 |
-
if ($this->interpolation($inter, false)) {
|
3090 |
-
$attrParts[] = $inter;
|
3091 |
-
$hasInterpolation = true;
|
3092 |
-
continue;
|
3093 |
-
}
|
3094 |
-
|
3095 |
-
// operator, handles attr namespace too
|
3096 |
-
if ($this->match('[|-~\$\*\^=]+', $m)) {
|
3097 |
-
$attrParts[] = $m[0];
|
3098 |
-
continue;
|
3099 |
-
}
|
3100 |
-
|
3101 |
-
break;
|
3102 |
-
}
|
3103 |
-
|
3104 |
-
if ($this->literal("]", false)) {
|
3105 |
-
$attrParts[] = "]";
|
3106 |
-
foreach ($attrParts as $part) {
|
3107 |
-
$parts[] = $part;
|
3108 |
-
}
|
3109 |
-
$hasExpression = $hasExpression || $hasInterpolation;
|
3110 |
-
return true;
|
3111 |
-
}
|
3112 |
-
$this->seek($s);
|
3113 |
-
}
|
3114 |
-
|
3115 |
-
$this->seek($s);
|
3116 |
-
return false;
|
3117 |
-
}
|
3118 |
-
|
3119 |
-
// a space separated list of selectors
|
3120 |
-
protected function tag(&$tag, $simple = false) {
|
3121 |
-
if ($simple)
|
3122 |
-
$chars = '^@,:;{}\][>\(\) "\'';
|
3123 |
-
else
|
3124 |
-
$chars = '^@,;{}["\'';
|
3125 |
-
|
3126 |
-
$s = $this->seek();
|
3127 |
-
|
3128 |
-
$hasExpression = false;
|
3129 |
-
$parts = array();
|
3130 |
-
while ($this->tagBracket($parts, $hasExpression));
|
3131 |
-
|
3132 |
-
$oldWhite = $this->eatWhiteDefault;
|
3133 |
-
$this->eatWhiteDefault = false;
|
3134 |
-
|
3135 |
-
while (true) {
|
3136 |
-
if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) {
|
3137 |
-
$parts[] = $m[1];
|
3138 |
-
if ($simple) break;
|
3139 |
-
|
3140 |
-
while ($this->tagBracket($parts, $hasExpression));
|
3141 |
-
continue;
|
3142 |
-
}
|
3143 |
-
|
3144 |
-
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "@") {
|
3145 |
-
if ($this->interpolation($interp)) {
|
3146 |
-
$hasExpression = true;
|
3147 |
-
$interp[2] = true; // don't unescape
|
3148 |
-
$parts[] = $interp;
|
3149 |
-
continue;
|
3150 |
-
}
|
3151 |
-
|
3152 |
-
if ($this->literal("@")) {
|
3153 |
-
$parts[] = "@";
|
3154 |
-
continue;
|
3155 |
-
}
|
3156 |
-
}
|
3157 |
-
|
3158 |
-
if ($this->unit($unit)) { // for keyframes
|
3159 |
-
$parts[] = $unit[1];
|
3160 |
-
$parts[] = $unit[2];
|
3161 |
-
continue;
|
3162 |
-
}
|
3163 |
-
|
3164 |
-
break;
|
3165 |
-
}
|
3166 |
-
|
3167 |
-
$this->eatWhiteDefault = $oldWhite;
|
3168 |
-
if (!$parts) {
|
3169 |
-
$this->seek($s);
|
3170 |
-
return false;
|
3171 |
-
}
|
3172 |
-
|
3173 |
-
if ($hasExpression) {
|
3174 |
-
$tag = array("exp", array("string", "", $parts));
|
3175 |
-
} else {
|
3176 |
-
$tag = trim(implode($parts));
|
3177 |
-
}
|
3178 |
-
|
3179 |
-
$this->whitespace();
|
3180 |
-
return true;
|
3181 |
-
}
|
3182 |
-
|
3183 |
-
// a css function
|
3184 |
-
protected function func(&$func) {
|
3185 |
-
$s = $this->seek();
|
3186 |
-
|
3187 |
-
if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) {
|
3188 |
-
$fname = $m[1];
|
3189 |
-
|
3190 |
-
$sPreArgs = $this->seek();
|
3191 |
-
|
3192 |
-
$args = array();
|
3193 |
-
while (true) {
|
3194 |
-
$ss = $this->seek();
|
3195 |
-
// this ugly nonsense is for ie filter properties
|
3196 |
-
if ($this->keyword($name) && $this->literal('=') && $this->expressionList($value)) {
|
3197 |
-
$args[] = array("string", "", array($name, "=", $value));
|
3198 |
-
} else {
|
3199 |
-
$this->seek($ss);
|
3200 |
-
if ($this->expressionList($value)) {
|
3201 |
-
$args[] = $value;
|
3202 |
-
}
|
3203 |
-
}
|
3204 |
-
|
3205 |
-
if (!$this->literal(',')) break;
|
3206 |
-
}
|
3207 |
-
$args = array('list', ',', $args);
|
3208 |
-
|
3209 |
-
if ($this->literal(')')) {
|
3210 |
-
$func = array('function', $fname, $args);
|
3211 |
-
return true;
|
3212 |
-
} elseif ($fname == 'url') {
|
3213 |
-
// couldn't parse and in url? treat as string
|
3214 |
-
$this->seek($sPreArgs);
|
3215 |
-
if ($this->openString(")", $string) && $this->literal(")")) {
|
3216 |
-
$func = array('function', $fname, $string);
|
3217 |
-
return true;
|
3218 |
-
}
|
3219 |
-
}
|
3220 |
-
}
|
3221 |
-
|
3222 |
-
$this->seek($s);
|
3223 |
-
return false;
|
3224 |
-
}
|
3225 |
-
|
3226 |
-
// consume a less variable
|
3227 |
-
protected function variable(&$name) {
|
3228 |
-
$s = $this->seek();
|
3229 |
-
if ($this->literal($this->lessc->vPrefix, false) &&
|
3230 |
-
($this->variable($sub) || $this->keyword($name)))
|
3231 |
-
{
|
3232 |
-
if (!empty($sub)) {
|
3233 |
-
$name = array('variable', $sub);
|
3234 |
-
} else {
|
3235 |
-
$name = $this->lessc->vPrefix.$name;
|
3236 |
-
}
|
3237 |
-
return true;
|
3238 |
-
}
|
3239 |
-
|
3240 |
-
$name = null;
|
3241 |
-
$this->seek($s);
|
3242 |
-
return false;
|
3243 |
-
}
|
3244 |
-
|
3245 |
-
/**
|
3246 |
-
* Consume an assignment operator
|
3247 |
-
* Can optionally take a name that will be set to the current property name
|
3248 |
-
*/
|
3249 |
-
protected function assign($name = null) {
|
3250 |
-
if ($name) $this->currentProperty = $name;
|
3251 |
-
return $this->literal(':') || $this->literal('=');
|
3252 |
-
}
|
3253 |
-
|
3254 |
-
// consume a keyword
|
3255 |
-
protected function keyword(&$word) {
|
3256 |
-
if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) {
|
3257 |
-
$word = $m[1];
|
3258 |
-
return true;
|
3259 |
-
}
|
3260 |
-
return false;
|
3261 |
-
}
|
3262 |
-
|
3263 |
-
// consume an end of statement delimiter
|
3264 |
-
protected function end() {
|
3265 |
-
if ($this->literal(';')) {
|
3266 |
-
return true;
|
3267 |
-
} elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') {
|
3268 |
-
// if there is end of file or a closing block next then we don't need a ;
|
3269 |
-
return true;
|
3270 |
-
}
|
3271 |
-
return false;
|
3272 |
-
}
|
3273 |
-
|
3274 |
-
protected function guards(&$guards) {
|
3275 |
-
$s = $this->seek();
|
3276 |
-
|
3277 |
-
if (!$this->literal("when")) {
|
3278 |
-
$this->seek($s);
|
3279 |
-
return false;
|
3280 |
-
}
|
3281 |
-
|
3282 |
-
$guards = array();
|
3283 |
-
|
3284 |
-
while ($this->guardGroup($g)) {
|
3285 |
-
$guards[] = $g;
|
3286 |
-
if (!$this->literal(",")) break;
|
3287 |
-
}
|
3288 |
-
|
3289 |
-
if (count($guards) == 0) {
|
3290 |
-
$guards = null;
|
3291 |
-
$this->seek($s);
|
3292 |
-
return false;
|
3293 |
-
}
|
3294 |
-
|
3295 |
-
return true;
|
3296 |
-
}
|
3297 |
-
|
3298 |
-
// a bunch of guards that are and'd together
|
3299 |
-
// TODO rename to guardGroup
|
3300 |
-
protected function guardGroup(&$guardGroup) {
|
3301 |
-
$s = $this->seek();
|
3302 |
-
$guardGroup = array();
|
3303 |
-
while ($this->guard($guard)) {
|
3304 |
-
$guardGroup[] = $guard;
|
3305 |
-
if (!$this->literal("and")) break;
|
3306 |
-
}
|
3307 |
-
|
3308 |
-
if (count($guardGroup) == 0) {
|
3309 |
-
$guardGroup = null;
|
3310 |
-
$this->seek($s);
|
3311 |
-
return false;
|
3312 |
-
}
|
3313 |
-
|
3314 |
-
return true;
|
3315 |
-
}
|
3316 |
-
|
3317 |
-
protected function guard(&$guard) {
|
3318 |
-
$s = $this->seek();
|
3319 |
-
$negate = $this->literal("not");
|
3320 |
-
|
3321 |
-
if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) {
|
3322 |
-
$guard = $exp;
|
3323 |
-
if ($negate) $guard = array("negate", $guard);
|
3324 |
-
return true;
|
3325 |
-
}
|
3326 |
-
|
3327 |
-
$this->seek($s);
|
3328 |
-
return false;
|
3329 |
-
}
|
3330 |
-
|
3331 |
-
/* raw parsing functions */
|
3332 |
-
|
3333 |
-
protected function literal($what, $eatWhitespace = null) {
|
3334 |
-
if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault;
|
3335 |
-
|
3336 |
-
// shortcut on single letter
|
3337 |
-
if (!isset($what[1]) && isset($this->buffer[$this->count])) {
|
3338 |
-
if ($this->buffer[$this->count] == $what) {
|
3339 |
-
if (!$eatWhitespace) {
|
3340 |
-
$this->count++;
|
3341 |
-
return true;
|
3342 |
-
}
|
3343 |
-
// goes below...
|
3344 |
-
} else {
|
3345 |
-
return false;
|
3346 |
-
}
|
3347 |
-
}
|
3348 |
-
|
3349 |
-
if (!isset(self::$literalCache[$what])) {
|
3350 |
-
self::$literalCache[$what] = lessc::preg_quote($what);
|
3351 |
-
}
|
3352 |
-
|
3353 |
-
return $this->match(self::$literalCache[$what], $m, $eatWhitespace);
|
3354 |
-
}
|
3355 |
-
|
3356 |
-
protected function genericList(&$out, $parseItem, $delim="", $flatten=true) {
|
3357 |
-
$s = $this->seek();
|
3358 |
-
$items = array();
|
3359 |
-
while ($this->$parseItem($value)) {
|
3360 |
-
$items[] = $value;
|
3361 |
-
if ($delim) {
|
3362 |
-
if (!$this->literal($delim)) break;
|
3363 |
-
}
|
3364 |
-
}
|
3365 |
-
|
3366 |
-
if (count($items) == 0) {
|
3367 |
-
$this->seek($s);
|
3368 |
-
return false;
|
3369 |
-
}
|
3370 |
-
|
3371 |
-
if ($flatten && count($items) == 1) {
|
3372 |
-
$out = $items[0];
|
3373 |
-
} else {
|
3374 |
-
$out = array("list", $delim, $items);
|
3375 |
-
}
|
3376 |
-
|
3377 |
-
return true;
|
3378 |
-
}
|
3379 |
-
|
3380 |
-
|
3381 |
-
// advance counter to next occurrence of $what
|
3382 |
-
// $until - don't include $what in advance
|
3383 |
-
// $allowNewline, if string, will be used as valid char set
|
3384 |
-
protected function to($what, &$out, $until = false, $allowNewline = false) {
|
3385 |
-
if (is_string($allowNewline)) {
|
3386 |
-
$validChars = $allowNewline;
|
3387 |
-
} else {
|
3388 |
-
$validChars = $allowNewline ? "." : "[^\n]";
|
3389 |
-
}
|
3390 |
-
if (!$this->match('('.$validChars.'*?)'.lessc::preg_quote($what), $m, !$until)) return false;
|
3391 |
-
if ($until) $this->count -= strlen($what); // give back $what
|
3392 |
-
$out = $m[1];
|
3393 |
-
return true;
|
3394 |
-
}
|
3395 |
-
|
3396 |
-
// try to match something on head of buffer
|
3397 |
-
protected function match($regex, &$out, $eatWhitespace = null) {
|
3398 |
-
if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault;
|
3399 |
-
|
3400 |
-
$r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais';
|
3401 |
-
if (preg_match($r, $this->buffer, $out, null, $this->count)) {
|
3402 |
-
$this->count += strlen($out[0]);
|
3403 |
-
if ($eatWhitespace && $this->writeComments) $this->whitespace();
|
3404 |
-
return true;
|
3405 |
-
}
|
3406 |
-
return false;
|
3407 |
-
}
|
3408 |
-
|
3409 |
-
// match some whitespace
|
3410 |
-
protected function whitespace() {
|
3411 |
-
if ($this->writeComments) {
|
3412 |
-
$gotWhite = false;
|
3413 |
-
while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) {
|
3414 |
-
if (isset($m[1]) && empty($this->commentsSeen[$this->count])) {
|
3415 |
-
$this->append(array("comment", $m[1]));
|
3416 |
-
$this->commentsSeen[$this->count] = true;
|
3417 |
-
}
|
3418 |
-
$this->count += strlen($m[0]);
|
3419 |
-
$gotWhite = true;
|
3420 |
-
}
|
3421 |
-
return $gotWhite;
|
3422 |
-
} else {
|
3423 |
-
$this->match("", $m);
|
3424 |
-
return strlen($m[0]) > 0;
|
3425 |
-
}
|
3426 |
-
}
|
3427 |
-
|
3428 |
-
// match something without consuming it
|
3429 |
-
protected function peek($regex, &$out = null, $from=null) {
|
3430 |
-
if (is_null($from)) $from = $this->count;
|
3431 |
-
$r = '/'.$regex.'/Ais';
|
3432 |
-
$result = preg_match($r, $this->buffer, $out, null, $from);
|
3433 |
-
|
3434 |
-
return $result;
|
3435 |
-
}
|
3436 |
-
|
3437 |
-
// seek to a spot in the buffer or return where we are on no argument
|
3438 |
-
protected function seek($where = null) {
|
3439 |
-
if ($where === null) return $this->count;
|
3440 |
-
else $this->count = $where;
|
3441 |
-
return true;
|
3442 |
-
}
|
3443 |
-
|
3444 |
-
/* misc functions */
|
3445 |
-
|
3446 |
-
public function throwError($msg = "parse error", $count = null) {
|
3447 |
-
$count = is_null($count) ? $this->count : $count;
|
3448 |
-
|
3449 |
-
$line = $this->line +
|
3450 |
-
substr_count(substr($this->buffer, 0, $count), "\n");
|
3451 |
-
|
3452 |
-
if (!empty($this->sourceName)) {
|
3453 |
-
$loc = "$this->sourceName on line $line";
|
3454 |
-
} else {
|
3455 |
-
$loc = "line: $line";
|
3456 |
-
}
|
3457 |
-
|
3458 |
-
// TODO this depends on $this->count
|
3459 |
-
if ($this->peek("(.*?)(\n|$)", $m, $count)) {
|
3460 |
-
throw new exception("$msg: failed at `$m[1]` $loc");
|
3461 |
-
} else {
|
3462 |
-
throw new exception("$msg: $loc");
|
3463 |
-
}
|
3464 |
-
}
|
3465 |
-
|
3466 |
-
protected function pushBlock($selectors=null, $type=null) {
|
3467 |
-
$b = new stdclass;
|
3468 |
-
$b->parent = $this->env;
|
3469 |
-
|
3470 |
-
$b->type = $type;
|
3471 |
-
$b->id = self::$nextBlockId++;
|
3472 |
-
|
3473 |
-
$b->isVararg = false; // TODO: kill me from here
|
3474 |
-
$b->tags = $selectors;
|
3475 |
-
|
3476 |
-
$b->props = array();
|
3477 |
-
$b->children = array();
|
3478 |
-
|
3479 |
-
$this->env = $b;
|
3480 |
-
return $b;
|
3481 |
-
}
|
3482 |
-
|
3483 |
-
// push a block that doesn't multiply tags
|
3484 |
-
protected function pushSpecialBlock($type) {
|
3485 |
-
return $this->pushBlock(null, $type);
|
3486 |
-
}
|
3487 |
-
|
3488 |
-
// append a property to the current block
|
3489 |
-
protected function append($prop, $pos = null) {
|
3490 |
-
if ($pos !== null) $prop[-1] = $pos;
|
3491 |
-
$this->env->props[] = $prop;
|
3492 |
-
}
|
3493 |
-
|
3494 |
-
// pop something off the stack
|
3495 |
-
protected function pop() {
|
3496 |
-
$old = $this->env;
|
3497 |
-
$this->env = $this->env->parent;
|
3498 |
-
return $old;
|
3499 |
-
}
|
3500 |
-
|
3501 |
-
// remove comments from $text
|
3502 |
-
// todo: make it work for all functions, not just url
|
3503 |
-
protected function removeComments($text) {
|
3504 |
-
$look = array(
|
3505 |
-
'url(', '//', '/*', '"', "'"
|
3506 |
-
);
|
3507 |
-
|
3508 |
-
$out = '';
|
3509 |
-
$min = null;
|
3510 |
-
while (true) {
|
3511 |
-
// find the next item
|
3512 |
-
foreach ($look as $token) {
|
3513 |
-
$pos = strpos($text, $token);
|
3514 |
-
if ($pos !== false) {
|
3515 |
-
if (!isset($min) || $pos < $min[1]) $min = array($token, $pos);
|
3516 |
-
}
|
3517 |
-
}
|
3518 |
-
|
3519 |
-
if (is_null($min)) break;
|
3520 |
-
|
3521 |
-
$count = $min[1];
|
3522 |
-
$skip = 0;
|
3523 |
-
$newlines = 0;
|
3524 |
-
switch ($min[0]) {
|
3525 |
-
case 'url(':
|
3526 |
-
if (preg_match('/url\(.*?\)/', $text, $m, 0, $count))
|
3527 |
-
$count += strlen($m[0]) - strlen($min[0]);
|
3528 |
-
break;
|
3529 |
-
case '"':
|
3530 |
-
case "'":
|
3531 |
-
if (preg_match('/'.$min[0].'.*?(?<!\\\\)'.$min[0].'/', $text, $m, 0, $count))
|
3532 |
-
$count += strlen($m[0]) - 1;
|
3533 |
-
break;
|
3534 |
-
case '//':
|
3535 |
-
$skip = strpos($text, "\n", $count);
|
3536 |
-
if ($skip === false) $skip = strlen($text) - $count;
|
3537 |
-
else $skip -= $count;
|
3538 |
-
break;
|
3539 |
-
case '/*':
|
3540 |
-
if (preg_match('/\/\*.*?\*\//s', $text, $m, 0, $count)) {
|
3541 |
-
$skip = strlen($m[0]);
|
3542 |
-
$newlines = substr_count($m[0], "\n");
|
3543 |
-
}
|
3544 |
-
break;
|
3545 |
-
}
|
3546 |
-
|
3547 |
-
if ($skip == 0) $count += strlen($min[0]);
|
3548 |
-
|
3549 |
-
$out .= substr($text, 0, $count).str_repeat("\n", $newlines);
|
3550 |
-
$text = substr($text, $count + $skip);
|
3551 |
-
|
3552 |
-
$min = null;
|
3553 |
-
}
|
3554 |
-
|
3555 |
-
return $out.$text;
|
3556 |
-
}
|
3557 |
-
|
3558 |
-
}
|
3559 |
-
|
3560 |
-
class lessc_formatter_classic {
|
3561 |
-
public $indentChar = " ";
|
3562 |
-
|
3563 |
-
public $break = "\n";
|
3564 |
-
public $open = " {";
|
3565 |
-
public $close = "}";
|
3566 |
-
public $selectorSeparator = ", ";
|
3567 |
-
public $assignSeparator = ":";
|
3568 |
-
|
3569 |
-
public $openSingle = " { ";
|
3570 |
-
public $closeSingle = " }";
|
3571 |
-
|
3572 |
-
public $disableSingle = false;
|
3573 |
-
public $breakSelectors = false;
|
3574 |
-
|
3575 |
-
public $compressColors = false;
|
3576 |
-
|
3577 |
-
public function __construct() {
|
3578 |
-
$this->indentLevel = 0;
|
3579 |
-
}
|
3580 |
-
|
3581 |
-
public function indentStr($n = 0) {
|
3582 |
-
return str_repeat($this->indentChar, max($this->indentLevel + $n, 0));
|
3583 |
-
}
|
3584 |
-
|
3585 |
-
public function property($name, $value) {
|
3586 |
-
return $name . $this->assignSeparator . $value . ";";
|
3587 |
-
}
|
3588 |
-
|
3589 |
-
protected function isEmpty($block) {
|
3590 |
-
if (empty($block->lines)) {
|
3591 |
-
foreach ($block->children as $child) {
|
3592 |
-
if (!$this->isEmpty($child)) return false;
|
3593 |
-
}
|
3594 |
-
|
3595 |
-
return true;
|
3596 |
-
}
|
3597 |
-
return false;
|
3598 |
-
}
|
3599 |
-
|
3600 |
-
public function block($block) {
|
3601 |
-
if ($this->isEmpty($block)) return;
|
3602 |
-
|
3603 |
-
$inner = $pre = $this->indentStr();
|
3604 |
-
|
3605 |
-
$isSingle = !$this->disableSingle &&
|
3606 |
-
is_null($block->type) && count($block->lines) == 1;
|
3607 |
-
|
3608 |
-
if (!empty($block->selectors)) {
|
3609 |
-
$this->indentLevel++;
|
3610 |
-
|
3611 |
-
if ($this->breakSelectors) {
|
3612 |
-
$selectorSeparator = $this->selectorSeparator . $this->break . $pre;
|
3613 |
-
} else {
|
3614 |
-
$selectorSeparator = $this->selectorSeparator;
|
3615 |
-
}
|
3616 |
-
|
3617 |
-
echo $pre .
|
3618 |
-
implode($selectorSeparator, $block->selectors);
|
3619 |
-
if ($isSingle) {
|
3620 |
-
echo $this->openSingle;
|
3621 |
-
$inner = "";
|
3622 |
-
} else {
|
3623 |
-
echo $this->open . $this->break;
|
3624 |
-
$inner = $this->indentStr();
|
3625 |
-
}
|
3626 |
-
|
3627 |
-
}
|
3628 |
-
|
3629 |
-
if (!empty($block->lines)) {
|
3630 |
-
$glue = $this->break.$inner;
|
3631 |
-
echo $inner . implode($glue, $block->lines);
|
3632 |
-
if (!$isSingle && !empty($block->children)) {
|
3633 |
-
echo $this->break;
|
3634 |
-
}
|
3635 |
-
}
|
3636 |
-
|
3637 |
-
foreach ($block->children as $child) {
|
3638 |
-
$this->block($child);
|
3639 |
-
}
|
3640 |
-
|
3641 |
-
if (!empty($block->selectors)) {
|
3642 |
-
if (!$isSingle && empty($block->children)) echo $this->break;
|
3643 |
-
|
3644 |
-
if ($isSingle) {
|
3645 |
-
echo $this->closeSingle . $this->break;
|
3646 |
-
} else {
|
3647 |
-
echo $pre . $this->close . $this->break;
|
3648 |
-
}
|
3649 |
-
|
3650 |
-
$this->indentLevel--;
|
3651 |
-
}
|
3652 |
}
|
3653 |
}
|
3654 |
-
|
3655 |
-
class lessc_formatter_compressed extends lessc_formatter_classic {
|
3656 |
-
public $disableSingle = true;
|
3657 |
-
public $open = "{";
|
3658 |
-
public $selectorSeparator = ",";
|
3659 |
-
public $assignSeparator = ":";
|
3660 |
-
public $break = "";
|
3661 |
-
public $compressColors = true;
|
3662 |
-
|
3663 |
-
public function indentStr($n = 0) {
|
3664 |
-
return "";
|
3665 |
-
}
|
3666 |
-
}
|
3667 |
-
|
3668 |
-
class lessc_formatter_lessjs extends lessc_formatter_classic {
|
3669 |
-
public $disableSingle = true;
|
3670 |
-
public $breakSelectors = true;
|
3671 |
-
public $assignSeparator = ": ";
|
3672 |
-
public $selectorSeparator = ",";
|
3673 |
-
}
|
3674 |
-
|
3675 |
-
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
+
* This file provides the part of lessphp API (https://github.com/leafo/lessphp)
|
4 |
+
* to be a drop-in replacement for following products:
|
5 |
+
* - Drupal 7, by the less module v3.0+ (https://drupal.org/project/less)
|
6 |
+
* - Symfony 2
|
|
|
|
|
|
|
7 |
*/
|
8 |
|
9 |
+
// Register autoloader for non-composer installations
|
10 |
+
if ( !class_exists( 'Less_Parser' ) ) {
|
11 |
+
require_once dirname( __FILE__ ) . '/lib/Less/Autoloader.php';
|
12 |
+
Less_Autoloader::register();
|
13 |
+
}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
class lessc {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
+
static public $VERSION = Less_Version::less_version;
|
|
|
|
|
|
|
18 |
|
19 |
+
public $importDir = '';
|
20 |
protected $allParsedFiles = array();
|
21 |
+
protected $libFunctions = array();
|
22 |
+
protected $registeredVars = array();
|
23 |
+
private $formatterName;
|
24 |
+
private $options = array();
|
25 |
|
26 |
+
public function __construct( $lessc=null, $sourceName=null ) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
public function setImportDir( $dirs ) {
|
29 |
+
$this->importDir = (array)$dirs;
|
30 |
}
|
31 |
|
32 |
+
public function addImportDir( $dir ) {
|
33 |
+
$this->importDir = (array)$this->importDir;
|
34 |
+
$this->importDir[] = $dir;
|
35 |
}
|
36 |
|
37 |
+
public function setFormatter( $name ) {
|
38 |
+
$this->formatterName = $name;
|
39 |
}
|
40 |
|
41 |
+
public function setPreserveComments( $preserve ) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
public function registerFunction( $name, $func ) {
|
44 |
+
$this->libFunctions[$name] = $func;
|
|
|
|
|
45 |
}
|
46 |
|
47 |
+
public function unregisterFunction( $name ) {
|
48 |
+
unset( $this->libFunctions[$name] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
+
public function setVariables( $variables ){
|
52 |
+
foreach ( $variables as $name => $value ) {
|
53 |
+
$this->setVariable( $name, $value );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
55 |
}
|
56 |
|
57 |
+
public function setVariable( $name, $value ) {
|
58 |
+
$this->registeredVars[$name] = $value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
+
public function unsetVariable( $name ) {
|
62 |
+
unset( $this->registeredVars[$name] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
+
public function setOptions( $options ) {
|
66 |
+
foreach ( $options as $name => $value ) {
|
67 |
+
$this->setOption( $name, $value);
|
|
|
|
|
|
|
68 |
}
|
|
|
|
|
69 |
}
|
70 |
|
71 |
+
public function setOption( $name, $value ) {
|
72 |
+
$this->options[$name] = $value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
|
75 |
+
public function parse( $buffer, $presets = array() ) {
|
76 |
+
|
77 |
+
$this->setVariables( $presets );
|
|
|
|
|
|
|
78 |
|
79 |
+
$parser = new Less_Parser( $this->getOptions() );
|
80 |
+
$parser->setImportDirs( $this->getImportDirs() );
|
81 |
+
foreach ( $this->libFunctions as $name => $func ) {
|
82 |
+
$parser->registerFunction( $name, $func );
|
83 |
+
}
|
84 |
+
$parser->parse($buffer);
|
85 |
+
if ( count( $this->registeredVars ) ) {
|
86 |
+
$parser->ModifyVars( $this->registeredVars );
|
87 |
}
|
88 |
|
89 |
+
return $parser->getCss();
|
90 |
}
|
91 |
|
92 |
+
protected function getOptions() {
|
93 |
+
$options = array( 'relativeUrls'=>false );
|
94 |
+
switch( $this->formatterName ) {
|
95 |
+
case 'compressed':
|
96 |
+
$options['compress'] = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
break;
|
|
|
|
|
|
|
98 |
}
|
99 |
+
if (is_array($this->options))
|
100 |
+
{
|
101 |
+
$options = array_merge($options, $this->options);
|
102 |
+
}
|
103 |
+
return $options;
|
104 |
+
}
|
105 |
|
106 |
+
protected function getImportDirs() {
|
107 |
+
$dirs_ = (array)$this->importDir;
|
108 |
+
$dirs = array();
|
109 |
+
foreach ( $dirs_ as $dir ) {
|
110 |
+
$dirs[$dir] = '';
|
111 |
}
|
112 |
+
return $dirs;
|
113 |
}
|
114 |
|
115 |
+
public function compile( $string, $name = null ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
$oldImport = $this->importDir;
|
118 |
+
$this->importDir = (array)$this->importDir;
|
|
|
|
|
119 |
|
120 |
+
$this->allParsedFiles = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
+
$parser = new Less_Parser( $this->getOptions() );
|
123 |
+
$parser->SetImportDirs( $this->getImportDirs() );
|
124 |
+
if ( count( $this->registeredVars ) ) {
|
125 |
+
$parser->ModifyVars( $this->registeredVars );
|
|
|
126 |
}
|
127 |
+
foreach ( $this->libFunctions as $name => $func ) {
|
128 |
+
$parser->registerFunction( $name, $func );
|
|
|
|
|
129 |
}
|
130 |
+
$parser->parse( $string );
|
131 |
+
$out = $parser->getCss();
|
132 |
|
133 |
+
$parsed = Less_Parser::AllParsedFiles();
|
134 |
+
foreach ( $parsed as $file ) {
|
135 |
+
$this->addParsedFile( $file );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
}
|
137 |
|
138 |
+
$this->importDir = $oldImport;
|
|
|
139 |
|
140 |
+
return $out;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
|
143 |
+
public function compileFile( $fname, $outFname = null ) {
|
144 |
+
if ( !is_readable( $fname ) ) {
|
145 |
+
throw new Exception( 'load error: failed to find '.$fname );
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
147 |
|
148 |
+
$pi = pathinfo( $fname );
|
|
|
149 |
|
150 |
+
$oldImport = $this->importDir;
|
151 |
|
152 |
+
$this->importDir = (array)$this->importDir;
|
153 |
+
$this->importDir[] = Less_Parser::AbsPath( $pi['dirname'] ).'/';
|
|
|
154 |
|
155 |
+
$this->allParsedFiles = array();
|
156 |
+
$this->addParsedFile( $fname );
|
|
|
|
|
|
|
|
|
157 |
|
158 |
+
$parser = new Less_Parser( $this->getOptions() );
|
159 |
+
$parser->SetImportDirs( $this->getImportDirs() );
|
160 |
+
if ( count( $this->registeredVars ) ) {
|
161 |
+
$parser->ModifyVars( $this->registeredVars );
|
162 |
}
|
163 |
+
foreach ( $this->libFunctions as $name => $func ) {
|
164 |
+
$parser->registerFunction( $name, $func );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
166 |
+
$parser->parseFile( $fname );
|
167 |
+
$out = $parser->getCss();
|
168 |
|
169 |
+
$parsed = Less_Parser::AllParsedFiles();
|
170 |
+
foreach ( $parsed as $file ) {
|
171 |
+
$this->addParsedFile( $file );
|
172 |
+
}
|
173 |
|
174 |
+
$this->importDir = $oldImport;
|
|
|
|
|
175 |
|
176 |
+
if ( $outFname !== null ) {
|
177 |
+
return file_put_contents( $outFname, $out );
|
|
|
|
|
|
|
|
|
|
|
178 |
}
|
179 |
|
180 |
return $out;
|
181 |
}
|
182 |
|
183 |
+
public function checkedCompile( $in, $out ) {
|
184 |
+
if ( !is_file( $out ) || filemtime( $in ) > filemtime( $out ) ) {
|
185 |
+
$this->compileFile($in, $out);
|
186 |
+
return true;
|
187 |
+
}
|
188 |
+
return false;
|
189 |
}
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
192 |
+
/**
|
193 |
+
* Execute lessphp on a .less file or a lessphp cache structure
|
194 |
+
*
|
195 |
+
* The lessphp cache structure contains information about a specific
|
196 |
+
* less file having been parsed. It can be used as a hint for future
|
197 |
+
* calls to determine whether or not a rebuild is required.
|
198 |
+
*
|
199 |
+
* The cache structure contains two important keys that may be used
|
200 |
+
* externally:
|
201 |
+
*
|
202 |
+
* compiled: The final compiled CSS
|
203 |
+
* updated: The time (in seconds) the CSS was last compiled
|
204 |
+
*
|
205 |
+
* The cache structure is a plain-ol' PHP associative array and can
|
206 |
+
* be serialized and unserialized without a hitch.
|
207 |
+
*
|
208 |
+
* @param mixed $in Input
|
209 |
+
* @param bool $force Force rebuild?
|
210 |
+
* @return array lessphp cache structure
|
211 |
+
*/
|
212 |
+
public function cachedCompile( $in, $force = false ) {
|
213 |
+
// assume no root
|
214 |
+
$root = null;
|
215 |
|
216 |
+
if ( is_string( $in ) ) {
|
217 |
+
$root = $in;
|
218 |
+
} elseif ( is_array( $in ) and isset( $in['root'] ) ) {
|
219 |
+
if ( $force or ! isset( $in['files'] ) ) {
|
220 |
+
// If we are forcing a recompile or if for some reason the
|
221 |
+
// structure does not contain any file information we should
|
222 |
+
// specify the root to trigger a rebuild.
|
223 |
+
$root = $in['root'];
|
224 |
+
} elseif ( isset( $in['files'] ) and is_array( $in['files'] ) ) {
|
225 |
+
foreach ( $in['files'] as $fname => $ftime ) {
|
226 |
+
if ( !file_exists( $fname ) or filemtime( $fname ) > $ftime ) {
|
227 |
+
// One of the files we knew about previously has changed
|
228 |
+
// so we should look at our incoming root again.
|
229 |
+
$root = $in['root'];
|
230 |
break;
|
231 |
}
|
232 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
+
} else {
|
235 |
+
// TODO: Throw an exception? We got neither a string nor something
|
236 |
+
// that looks like a compatible lessphp cache structure.
|
237 |
+
return null;
|
238 |
}
|
239 |
|
240 |
+
if ( $root !== null ) {
|
241 |
+
// If we have a root value which means we should rebuild.
|
242 |
+
$out = array();
|
243 |
+
$out['root'] = $root;
|
244 |
+
$out['compiled'] = $this->compileFile($root);
|
245 |
+
$out['files'] = $this->allParsedFiles();
|
246 |
+
$out['updated'] = time();
|
247 |
+
return $out;
|
248 |
} else {
|
249 |
+
// No changes, pass back the structure
|
250 |
+
// we were given initially.
|
251 |
+
return $in;
|
252 |
}
|
253 |
}
|
254 |
|
255 |
+
public function ccompile( $in, $out, $less = null ) {
|
256 |
+
if ( $less === null ) {
|
257 |
+
$less = new self;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
}
|
259 |
+
return $less->checkedCompile( $in, $out );
|
|
|
260 |
}
|
261 |
|
262 |
+
public static function cexecute( $in, $force = false, $less = null ) {
|
263 |
+
if ( $less === null ) {
|
264 |
+
$less = new self;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
}
|
266 |
+
return $less->cachedCompile($in, $force);
|
|
|
267 |
}
|
268 |
|
269 |
+
public function allParsedFiles() {
|
270 |
+
return $this->allParsedFiles;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
}
|
272 |
|
273 |
+
protected function addParsedFile( $file ) {
|
274 |
+
$this->allParsedFiles[Less_Parser::AbsPath( $file )] = filemtime( $file );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
}
|
276 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base/inc/lib/Less/Autoloader.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Autoloader
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage autoload
|
8 |
+
*/
|
9 |
+
class Less_Autoloader {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Registered flag
|
13 |
+
*
|
14 |
+
* @var boolean
|
15 |
+
*/
|
16 |
+
protected static $registered = false;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Library directory
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected static $libDir;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Register the autoloader in the spl autoloader
|
27 |
+
*
|
28 |
+
* @return void
|
29 |
+
* @throws Exception If there was an error in registration
|
30 |
+
*/
|
31 |
+
public static function register(){
|
32 |
+
if( self::$registered ){
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
self::$libDir = dirname(__FILE__);
|
37 |
+
|
38 |
+
if(false === spl_autoload_register(array('Less_Autoloader', 'loadClass'))){
|
39 |
+
throw new Exception('Unable to register Less_Autoloader::loadClass as an autoloading method.');
|
40 |
+
}
|
41 |
+
|
42 |
+
self::$registered = true;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Unregisters the autoloader
|
47 |
+
*
|
48 |
+
* @return void
|
49 |
+
*/
|
50 |
+
public static function unregister(){
|
51 |
+
spl_autoload_unregister(array('Less_Autoloader', 'loadClass'));
|
52 |
+
self::$registered = false;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Loads the class
|
57 |
+
*
|
58 |
+
* @param string $className The class to load
|
59 |
+
*/
|
60 |
+
public static function loadClass($className){
|
61 |
+
|
62 |
+
|
63 |
+
// handle only package classes
|
64 |
+
if(strpos($className, 'Less_') !== 0){
|
65 |
+
return;
|
66 |
+
}
|
67 |
+
|
68 |
+
$className = substr($className,5);
|
69 |
+
$fileName = self::$libDir . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
70 |
+
|
71 |
+
if(file_exists($fileName)){
|
72 |
+
require $fileName;
|
73 |
+
return true;
|
74 |
+
}else{
|
75 |
+
throw new Exception('file not loadable '.$fileName);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
}
|
base/inc/lib/Less/Cache.php
ADDED
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/Version.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Utility for handling the generation and caching of css files
|
7 |
+
*
|
8 |
+
* @package Less
|
9 |
+
* @subpackage cache
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class Less_Cache{
|
13 |
+
|
14 |
+
// directory less.php can use for storing data
|
15 |
+
public static $cache_dir = false;
|
16 |
+
|
17 |
+
// prefix for the storing data
|
18 |
+
public static $prefix = 'lessphp_';
|
19 |
+
|
20 |
+
// prefix for the storing vars
|
21 |
+
public static $prefix_vars = 'lessphpvars_';
|
22 |
+
|
23 |
+
// specifies the number of seconds after which data created by less.php will be seen as 'garbage' and potentially cleaned up
|
24 |
+
public static $gc_lifetime = 604800;
|
25 |
+
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Save and reuse the results of compiled less files.
|
29 |
+
* The first call to Get() will generate css and save it.
|
30 |
+
* Subsequent calls to Get() with the same arguments will return the same css filename
|
31 |
+
*
|
32 |
+
* @param array $less_files Array of .less files to compile
|
33 |
+
* @param array $parser_options Array of compiler options
|
34 |
+
* @param array $modify_vars Array of variables
|
35 |
+
* @return string Name of the css file
|
36 |
+
*/
|
37 |
+
public static function Get( $less_files, $parser_options = array(), $modify_vars = array() ){
|
38 |
+
|
39 |
+
|
40 |
+
//check $cache_dir
|
41 |
+
if( isset($parser_options['cache_dir']) ){
|
42 |
+
Less_Cache::$cache_dir = $parser_options['cache_dir'];
|
43 |
+
}
|
44 |
+
|
45 |
+
if( empty(Less_Cache::$cache_dir) ){
|
46 |
+
throw new Exception('cache_dir not set');
|
47 |
+
}
|
48 |
+
|
49 |
+
if( isset($parser_options['prefix']) ){
|
50 |
+
Less_Cache::$prefix = $parser_options['prefix'];
|
51 |
+
}
|
52 |
+
|
53 |
+
if( empty(Less_Cache::$prefix) ){
|
54 |
+
throw new Exception('prefix not set');
|
55 |
+
}
|
56 |
+
|
57 |
+
if( isset($parser_options['prefix_vars']) ){
|
58 |
+
Less_Cache::$prefix_vars = $parser_options['prefix_vars'];
|
59 |
+
}
|
60 |
+
|
61 |
+
if( empty(Less_Cache::$prefix_vars) ){
|
62 |
+
throw new Exception('prefix_vars not set');
|
63 |
+
}
|
64 |
+
|
65 |
+
self::CheckCacheDir();
|
66 |
+
$less_files = (array)$less_files;
|
67 |
+
|
68 |
+
|
69 |
+
//create a file for variables
|
70 |
+
if( !empty($modify_vars) ){
|
71 |
+
$lessvars = Less_Parser::serializeVars($modify_vars);
|
72 |
+
$vars_file = Less_Cache::$cache_dir . Less_Cache::$prefix_vars . sha1($lessvars) . '.less';
|
73 |
+
|
74 |
+
if( !file_exists($vars_file) ){
|
75 |
+
file_put_contents($vars_file, $lessvars);
|
76 |
+
}
|
77 |
+
|
78 |
+
$less_files += array($vars_file => '/');
|
79 |
+
}
|
80 |
+
|
81 |
+
|
82 |
+
// generate name for compiled css file
|
83 |
+
$hash = md5(json_encode($less_files));
|
84 |
+
$list_file = Less_Cache::$cache_dir . Less_Cache::$prefix . $hash . '.list';
|
85 |
+
|
86 |
+
// check cached content
|
87 |
+
if( !isset($parser_options['use_cache']) || $parser_options['use_cache'] === true ){
|
88 |
+
if( file_exists($list_file) ){
|
89 |
+
|
90 |
+
self::ListFiles($list_file, $list, $cached_name);
|
91 |
+
$compiled_name = self::CompiledName($list, $hash);
|
92 |
+
|
93 |
+
// if $cached_name is the same as the $compiled name, don't regenerate
|
94 |
+
if( !$cached_name || $cached_name === $compiled_name ){
|
95 |
+
|
96 |
+
$output_file = self::OutputFile($compiled_name, $parser_options );
|
97 |
+
|
98 |
+
if( $output_file && file_exists($output_file) ){
|
99 |
+
@touch($list_file);
|
100 |
+
return basename($output_file); // for backwards compatibility, we just return the name of the file
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
$compiled = self::Cache( $less_files, $parser_options );
|
107 |
+
if( !$compiled ){
|
108 |
+
return false;
|
109 |
+
}
|
110 |
+
|
111 |
+
$compiled_name = self::CompiledName( $less_files, $hash );
|
112 |
+
$output_file = self::OutputFile($compiled_name, $parser_options );
|
113 |
+
|
114 |
+
|
115 |
+
//save the file list
|
116 |
+
$list = $less_files;
|
117 |
+
$list[] = $compiled_name;
|
118 |
+
$cache = implode("\n",$list);
|
119 |
+
file_put_contents( $list_file, $cache );
|
120 |
+
|
121 |
+
|
122 |
+
//save the css
|
123 |
+
file_put_contents( $output_file, $compiled );
|
124 |
+
|
125 |
+
|
126 |
+
//clean up
|
127 |
+
self::CleanCache();
|
128 |
+
|
129 |
+
return basename($output_file);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Force the compiler to regenerate the cached css file
|
134 |
+
*
|
135 |
+
* @param array $less_files Array of .less files to compile
|
136 |
+
* @param array $parser_options Array of compiler options
|
137 |
+
* @param array $modify_vars Array of variables
|
138 |
+
* @return string Name of the css file
|
139 |
+
*/
|
140 |
+
public static function Regen( $less_files, $parser_options = array(), $modify_vars = array() ){
|
141 |
+
$parser_options['use_cache'] = false;
|
142 |
+
return self::Get( $less_files, $parser_options, $modify_vars );
|
143 |
+
}
|
144 |
+
|
145 |
+
public static function Cache( &$less_files, $parser_options = array() ){
|
146 |
+
|
147 |
+
|
148 |
+
// get less.php if it exists
|
149 |
+
$file = dirname(__FILE__) . '/Less.php';
|
150 |
+
if( file_exists($file) && !class_exists('Less_Parser') ){
|
151 |
+
require_once($file);
|
152 |
+
}
|
153 |
+
|
154 |
+
$parser_options['cache_dir'] = Less_Cache::$cache_dir;
|
155 |
+
$parser = new Less_Parser($parser_options);
|
156 |
+
|
157 |
+
|
158 |
+
// combine files
|
159 |
+
foreach($less_files as $file_path => $uri_or_less ){
|
160 |
+
|
161 |
+
//treat as less markup if there are newline characters
|
162 |
+
if( strpos($uri_or_less,"\n") !== false ){
|
163 |
+
$parser->Parse( $uri_or_less );
|
164 |
+
continue;
|
165 |
+
}
|
166 |
+
|
167 |
+
$parser->ParseFile( $file_path, $uri_or_less );
|
168 |
+
}
|
169 |
+
|
170 |
+
$compiled = $parser->getCss();
|
171 |
+
|
172 |
+
|
173 |
+
$less_files = $parser->allParsedFiles();
|
174 |
+
|
175 |
+
return $compiled;
|
176 |
+
}
|
177 |
+
|
178 |
+
|
179 |
+
private static function OutputFile( $compiled_name, $parser_options ){
|
180 |
+
|
181 |
+
//custom output file
|
182 |
+
if( !empty($parser_options['output']) ){
|
183 |
+
|
184 |
+
//relative to cache directory?
|
185 |
+
if( preg_match('#[\\\\/]#',$parser_options['output']) ){
|
186 |
+
return $parser_options['output'];
|
187 |
+
}
|
188 |
+
|
189 |
+
return Less_Cache::$cache_dir.$parser_options['output'];
|
190 |
+
}
|
191 |
+
|
192 |
+
return Less_Cache::$cache_dir.$compiled_name;
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
private static function CompiledName( $files, $extrahash ){
|
197 |
+
|
198 |
+
//save the file list
|
199 |
+
$temp = array(Less_Version::cache_version);
|
200 |
+
foreach($files as $file){
|
201 |
+
$temp[] = filemtime($file)."\t".filesize($file)."\t".$file;
|
202 |
+
}
|
203 |
+
|
204 |
+
return Less_Cache::$prefix.sha1(json_encode($temp).$extrahash).'.css';
|
205 |
+
}
|
206 |
+
|
207 |
+
|
208 |
+
public static function SetCacheDir( $dir ){
|
209 |
+
Less_Cache::$cache_dir = $dir;
|
210 |
+
self::CheckCacheDir();
|
211 |
+
}
|
212 |
+
|
213 |
+
public static function CheckCacheDir(){
|
214 |
+
|
215 |
+
Less_Cache::$cache_dir = str_replace('\\','/',Less_Cache::$cache_dir);
|
216 |
+
Less_Cache::$cache_dir = rtrim(Less_Cache::$cache_dir,'/').'/';
|
217 |
+
|
218 |
+
if( !file_exists(Less_Cache::$cache_dir) ){
|
219 |
+
if( !mkdir(Less_Cache::$cache_dir) ){
|
220 |
+
throw new Less_Exception_Parser('Less.php cache directory couldn\'t be created: '.Less_Cache::$cache_dir);
|
221 |
+
}
|
222 |
+
|
223 |
+
}elseif( !is_dir(Less_Cache::$cache_dir) ){
|
224 |
+
throw new Less_Exception_Parser('Less.php cache directory doesn\'t exist: '.Less_Cache::$cache_dir);
|
225 |
+
|
226 |
+
}elseif( !is_writable(Less_Cache::$cache_dir) ){
|
227 |
+
throw new Less_Exception_Parser('Less.php cache directory isn\'t writable: '.Less_Cache::$cache_dir);
|
228 |
+
|
229 |
+
}
|
230 |
+
|
231 |
+
}
|
232 |
+
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Delete unused less.php files
|
236 |
+
*
|
237 |
+
*/
|
238 |
+
public static function CleanCache(){
|
239 |
+
static $clean = false;
|
240 |
+
|
241 |
+
|
242 |
+
if( $clean || empty(Less_Cache::$cache_dir) ){
|
243 |
+
return;
|
244 |
+
}
|
245 |
+
|
246 |
+
$clean = true;
|
247 |
+
|
248 |
+
// only remove files with extensions created by less.php
|
249 |
+
// css files removed based on the list files
|
250 |
+
$remove_types = array('lesscache'=>1,'list'=>1,'less'=>1,'map'=>1);
|
251 |
+
|
252 |
+
$files = scandir(Less_Cache::$cache_dir);
|
253 |
+
if( !$files ){
|
254 |
+
return;
|
255 |
+
}
|
256 |
+
|
257 |
+
$check_time = time() - self::$gc_lifetime;
|
258 |
+
foreach($files as $file){
|
259 |
+
|
260 |
+
|
261 |
+
// don't delete if the file wasn't created with less.php
|
262 |
+
if( strpos($file,Less_Cache::$prefix) !== 0 ){
|
263 |
+
continue;
|
264 |
+
}
|
265 |
+
|
266 |
+
$parts = explode('.',$file);
|
267 |
+
$type = array_pop($parts);
|
268 |
+
|
269 |
+
|
270 |
+
if( !isset($remove_types[$type]) ){
|
271 |
+
continue;
|
272 |
+
}
|
273 |
+
|
274 |
+
$full_path = Less_Cache::$cache_dir . $file;
|
275 |
+
$mtime = filemtime($full_path);
|
276 |
+
|
277 |
+
// don't delete if it's a relatively new file
|
278 |
+
if( $mtime > $check_time ){
|
279 |
+
continue;
|
280 |
+
}
|
281 |
+
|
282 |
+
|
283 |
+
// delete the list file and associated css file
|
284 |
+
if( $type === 'list' ){
|
285 |
+
self::ListFiles($full_path, $list, $css_file_name);
|
286 |
+
if( $css_file_name ){
|
287 |
+
$css_file = Less_Cache::$cache_dir . $css_file_name;
|
288 |
+
if( file_exists($css_file) ){
|
289 |
+
unlink($css_file);
|
290 |
+
}
|
291 |
+
}
|
292 |
+
}
|
293 |
+
|
294 |
+
unlink($full_path);
|
295 |
+
}
|
296 |
+
|
297 |
+
|
298 |
+
}
|
299 |
+
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Get the list of less files and generated css file from a list file
|
303 |
+
*
|
304 |
+
*/
|
305 |
+
static function ListFiles($list_file, &$list, &$css_file_name ){
|
306 |
+
|
307 |
+
$list = explode("\n",file_get_contents($list_file));
|
308 |
+
|
309 |
+
//pop the cached name that should match $compiled_name
|
310 |
+
$css_file_name = array_pop($list);
|
311 |
+
|
312 |
+
if( !preg_match('/^' . Less_Cache::$prefix . '[a-f0-9]+\.css$/',$css_file_name) ){
|
313 |
+
$list[] = $css_file_name;
|
314 |
+
$css_file_name = false;
|
315 |
+
}
|
316 |
+
|
317 |
+
}
|
318 |
+
|
319 |
+
}
|
base/inc/lib/Less/Colors.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Utility for css colors
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage color
|
8 |
+
*/
|
9 |
+
class Less_Colors {
|
10 |
+
|
11 |
+
public static $colors = array(
|
12 |
+
'aliceblue'=>'#f0f8ff',
|
13 |
+
'antiquewhite'=>'#faebd7',
|
14 |
+
'aqua'=>'#00ffff',
|
15 |
+
'aquamarine'=>'#7fffd4',
|
16 |
+
'azure'=>'#f0ffff',
|
17 |
+
'beige'=>'#f5f5dc',
|
18 |
+
'bisque'=>'#ffe4c4',
|
19 |
+
'black'=>'#000000',
|
20 |
+
'blanchedalmond'=>'#ffebcd',
|
21 |
+
'blue'=>'#0000ff',
|
22 |
+
'blueviolet'=>'#8a2be2',
|
23 |
+
'brown'=>'#a52a2a',
|
24 |
+
'burlywood'=>'#deb887',
|
25 |
+
'cadetblue'=>'#5f9ea0',
|
26 |
+
'chartreuse'=>'#7fff00',
|
27 |
+
'chocolate'=>'#d2691e',
|
28 |
+
'coral'=>'#ff7f50',
|
29 |
+
'cornflowerblue'=>'#6495ed',
|
30 |
+
'cornsilk'=>'#fff8dc',
|
31 |
+
'crimson'=>'#dc143c',
|
32 |
+
'cyan'=>'#00ffff',
|
33 |
+
'darkblue'=>'#00008b',
|
34 |
+
'darkcyan'=>'#008b8b',
|
35 |
+
'darkgoldenrod'=>'#b8860b',
|
36 |
+
'darkgray'=>'#a9a9a9',
|
37 |
+
'darkgrey'=>'#a9a9a9',
|
38 |
+
'darkgreen'=>'#006400',
|
39 |
+
'darkkhaki'=>'#bdb76b',
|
40 |
+
'darkmagenta'=>'#8b008b',
|
41 |
+
'darkolivegreen'=>'#556b2f',
|
42 |
+
'darkorange'=>'#ff8c00',
|
43 |
+
'darkorchid'=>'#9932cc',
|
44 |
+
'darkred'=>'#8b0000',
|
45 |
+
'darksalmon'=>'#e9967a',
|
46 |
+
'darkseagreen'=>'#8fbc8f',
|
47 |
+
'darkslateblue'=>'#483d8b',
|
48 |
+
'darkslategray'=>'#2f4f4f',
|
49 |
+
'darkslategrey'=>'#2f4f4f',
|
50 |
+
'darkturquoise'=>'#00ced1',
|
51 |
+
'darkviolet'=>'#9400d3',
|
52 |
+
'deeppink'=>'#ff1493',
|
53 |
+
'deepskyblue'=>'#00bfff',
|
54 |
+
'dimgray'=>'#696969',
|
55 |
+
'dimgrey'=>'#696969',
|
56 |
+
'dodgerblue'=>'#1e90ff',
|
57 |
+
'firebrick'=>'#b22222',
|
58 |
+
'floralwhite'=>'#fffaf0',
|
59 |
+
'forestgreen'=>'#228b22',
|
60 |
+
'fuchsia'=>'#ff00ff',
|
61 |
+
'gainsboro'=>'#dcdcdc',
|
62 |
+
'ghostwhite'=>'#f8f8ff',
|
63 |
+
'gold'=>'#ffd700',
|
64 |
+
'goldenrod'=>'#daa520',
|
65 |
+
'gray'=>'#808080',
|
66 |
+
'grey'=>'#808080',
|
67 |
+
'green'=>'#008000',
|
68 |
+
'greenyellow'=>'#adff2f',
|
69 |
+
'honeydew'=>'#f0fff0',
|
70 |
+
'hotpink'=>'#ff69b4',
|
71 |
+
'indianred'=>'#cd5c5c',
|
72 |
+
'indigo'=>'#4b0082',
|
73 |
+
'ivory'=>'#fffff0',
|
74 |
+
'khaki'=>'#f0e68c',
|
75 |
+
'lavender'=>'#e6e6fa',
|
76 |
+
'lavenderblush'=>'#fff0f5',
|
77 |
+
'lawngreen'=>'#7cfc00',
|
78 |
+
'lemonchiffon'=>'#fffacd',
|
79 |
+
'lightblue'=>'#add8e6',
|
80 |
+
'lightcoral'=>'#f08080',
|
81 |
+
'lightcyan'=>'#e0ffff',
|
82 |
+
'lightgoldenrodyellow'=>'#fafad2',
|
83 |
+
'lightgray'=>'#d3d3d3',
|
84 |
+
'lightgrey'=>'#d3d3d3',
|
85 |
+
'lightgreen'=>'#90ee90',
|
86 |
+
'lightpink'=>'#ffb6c1',
|
87 |
+
'lightsalmon'=>'#ffa07a',
|
88 |
+
'lightseagreen'=>'#20b2aa',
|
89 |
+
'lightskyblue'=>'#87cefa',
|
90 |
+
'lightslategray'=>'#778899',
|
91 |
+
'lightslategrey'=>'#778899',
|
92 |
+
'lightsteelblue'=>'#b0c4de',
|
93 |
+
'lightyellow'=>'#ffffe0',
|
94 |
+
'lime'=>'#00ff00',
|
95 |
+
'limegreen'=>'#32cd32',
|
96 |
+
'linen'=>'#faf0e6',
|
97 |
+
'magenta'=>'#ff00ff',
|
98 |
+
'maroon'=>'#800000',
|
99 |
+
'mediumaquamarine'=>'#66cdaa',
|
100 |
+
'mediumblue'=>'#0000cd',
|
101 |
+
'mediumorchid'=>'#ba55d3',
|
102 |
+
'mediumpurple'=>'#9370d8',
|
103 |
+
'mediumseagreen'=>'#3cb371',
|
104 |
+
'mediumslateblue'=>'#7b68ee',
|
105 |
+
'mediumspringgreen'=>'#00fa9a',
|
106 |
+
'mediumturquoise'=>'#48d1cc',
|
107 |
+
'mediumvioletred'=>'#c71585',
|
108 |
+
'midnightblue'=>'#191970',
|
109 |
+
'mintcream'=>'#f5fffa',
|
110 |
+
'mistyrose'=>'#ffe4e1',
|
111 |
+
'moccasin'=>'#ffe4b5',
|
112 |
+
'navajowhite'=>'#ffdead',
|
113 |
+
'navy'=>'#000080',
|
114 |
+
'oldlace'=>'#fdf5e6',
|
115 |
+
'olive'=>'#808000',
|
116 |
+
'olivedrab'=>'#6b8e23',
|
117 |
+
'orange'=>'#ffa500',
|
118 |
+
'orangered'=>'#ff4500',
|
119 |
+
'orchid'=>'#da70d6',
|
120 |
+
'palegoldenrod'=>'#eee8aa',
|
121 |
+
'palegreen'=>'#98fb98',
|
122 |
+
'paleturquoise'=>'#afeeee',
|
123 |
+
'palevioletred'=>'#d87093',
|
124 |
+
'papayawhip'=>'#ffefd5',
|
125 |
+
'peachpuff'=>'#ffdab9',
|
126 |
+
'peru'=>'#cd853f',
|
127 |
+
'pink'=>'#ffc0cb',
|
128 |
+
'plum'=>'#dda0dd',
|
129 |
+
'powderblue'=>'#b0e0e6',
|
130 |
+
'purple'=>'#800080',
|
131 |
+
'red'=>'#ff0000',
|
132 |
+
'rosybrown'=>'#bc8f8f',
|
133 |
+
'royalblue'=>'#4169e1',
|
134 |
+
'saddlebrown'=>'#8b4513',
|
135 |
+
'salmon'=>'#fa8072',
|
136 |
+
'sandybrown'=>'#f4a460',
|
137 |
+
'seagreen'=>'#2e8b57',
|
138 |
+
'seashell'=>'#fff5ee',
|
139 |
+
'sienna'=>'#a0522d',
|
140 |
+
'silver'=>'#c0c0c0',
|
141 |
+
'skyblue'=>'#87ceeb',
|
142 |
+
'slateblue'=>'#6a5acd',
|
143 |
+
'slategray'=>'#708090',
|
144 |
+
'slategrey'=>'#708090',
|
145 |
+
'snow'=>'#fffafa',
|
146 |
+
'springgreen'=>'#00ff7f',
|
147 |
+
'steelblue'=>'#4682b4',
|
148 |
+
'tan'=>'#d2b48c',
|
149 |
+
'teal'=>'#008080',
|
150 |
+
'thistle'=>'#d8bfd8',
|
151 |
+
'tomato'=>'#ff6347',
|
152 |
+
'turquoise'=>'#40e0d0',
|
153 |
+
'violet'=>'#ee82ee',
|
154 |
+
'wheat'=>'#f5deb3',
|
155 |
+
'white'=>'#ffffff',
|
156 |
+
'whitesmoke'=>'#f5f5f5',
|
157 |
+
'yellow'=>'#ffff00',
|
158 |
+
'yellowgreen'=>'#9acd32'
|
159 |
+
);
|
160 |
+
|
161 |
+
public static function hasOwnProperty($color) {
|
162 |
+
return isset(self::$colors[$color]);
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
public static function color($color) {
|
167 |
+
return self::$colors[$color];
|
168 |
+
}
|
169 |
+
|
170 |
+
}
|
base/inc/lib/Less/Configurable.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Configurable
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage Core
|
8 |
+
*/
|
9 |
+
abstract class Less_Configurable {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Array of options
|
13 |
+
*
|
14 |
+
* @var array
|
15 |
+
*/
|
16 |
+
protected $options = array();
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Array of default options
|
20 |
+
*
|
21 |
+
* @var array
|
22 |
+
*/
|
23 |
+
protected $defaultOptions = array();
|
24 |
+
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Set options
|
28 |
+
*
|
29 |
+
* If $options is an object it will be converted into an array by called
|
30 |
+
* it's toArray method.
|
31 |
+
*
|
32 |
+
* @throws Exception
|
33 |
+
* @param array|object $options
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
public function setOptions($options){
|
37 |
+
$options = array_intersect_key($options,$this->defaultOptions);
|
38 |
+
$this->options = array_merge($this->defaultOptions, $this->options, $options);
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Get an option value by name
|
44 |
+
*
|
45 |
+
* If the option is empty or not set a NULL value will be returned.
|
46 |
+
*
|
47 |
+
* @param string $name
|
48 |
+
* @param mixed $default Default value if confiuration of $name is not present
|
49 |
+
* @return mixed
|
50 |
+
*/
|
51 |
+
public function getOption($name, $default = null){
|
52 |
+
if(isset($this->options[$name])){
|
53 |
+
return $this->options[$name];
|
54 |
+
}
|
55 |
+
return $default;
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Set an option
|
61 |
+
*
|
62 |
+
* @param string $name
|
63 |
+
* @param mixed $value
|
64 |
+
*/
|
65 |
+
public function setOption($name, $value){
|
66 |
+
$this->options[$name] = $value;
|
67 |
+
}
|
68 |
+
|
69 |
+
}
|
base/inc/lib/Less/Environment.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Environment
|
6 |
+
*
|
7 |
+
* @package Less
|
8 |
+
* @subpackage environment
|
9 |
+
*/
|
10 |
+
class Less_Environment{
|
11 |
+
|
12 |
+
//public $paths = array(); // option - unmodified - paths to search for imports on
|
13 |
+
//public static $files = array(); // list of files that have been imported, used for import-once
|
14 |
+
//public $rootpath; // option - rootpath to append to URL's
|
15 |
+
//public static $strictImports = null; // option -
|
16 |
+
//public $insecure; // option - whether to allow imports from insecure ssl hosts
|
17 |
+
//public $processImports; // option - whether to process imports. if false then imports will not be imported
|
18 |
+
//public $javascriptEnabled; // option - whether JavaScript is enabled. if undefined, defaults to true
|
19 |
+
//public $useFileCache; // browser only - whether to use the per file session cache
|
20 |
+
public $currentFileInfo; // information about the current file - for error reporting and importing and making urls relative etc.
|
21 |
+
|
22 |
+
public $importMultiple = false; // whether we are currently importing multiple copies
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
public $frames = array();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @var array
|
32 |
+
*/
|
33 |
+
public $mediaBlocks = array();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @var array
|
37 |
+
*/
|
38 |
+
public $mediaPath = array();
|
39 |
+
|
40 |
+
public static $parensStack = 0;
|
41 |
+
|
42 |
+
public static $tabLevel = 0;
|
43 |
+
|
44 |
+
public static $lastRule = false;
|
45 |
+
|
46 |
+
public static $_outputMap;
|
47 |
+
|
48 |
+
public static $mixin_stack = 0;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @var array
|
52 |
+
*/
|
53 |
+
public $functions = array();
|
54 |
+
|
55 |
+
|
56 |
+
public function Init(){
|
57 |
+
|
58 |
+
self::$parensStack = 0;
|
59 |
+
self::$tabLevel = 0;
|
60 |
+
self::$lastRule = false;
|
61 |
+
self::$mixin_stack = 0;
|
62 |
+
|
63 |
+
if( Less_Parser::$options['compress'] ){
|
64 |
+
|
65 |
+
Less_Environment::$_outputMap = array(
|
66 |
+
',' => ',',
|
67 |
+
': ' => ':',
|
68 |
+
'' => '',
|
69 |
+
' ' => ' ',
|
70 |
+
':' => ' :',
|
71 |
+
'+' => '+',
|
72 |
+
'~' => '~',
|
73 |
+
'>' => '>',
|
74 |
+
'|' => '|',
|
75 |
+
'^' => '^',
|
76 |
+
'^^' => '^^'
|
77 |
+
);
|
78 |
+
|
79 |
+
}else{
|
80 |
+
|
81 |
+
Less_Environment::$_outputMap = array(
|
82 |
+
',' => ', ',
|
83 |
+
': ' => ': ',
|
84 |
+
'' => '',
|
85 |
+
' ' => ' ',
|
86 |
+
':' => ' :',
|
87 |
+
'+' => ' + ',
|
88 |
+
'~' => ' ~ ',
|
89 |
+
'>' => ' > ',
|
90 |
+
'|' => '|',
|
91 |
+
'^' => ' ^ ',
|
92 |
+
'^^' => ' ^^ '
|
93 |
+
);
|
94 |
+
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
public function copyEvalEnv($frames = array() ){
|
100 |
+
$new_env = new Less_Environment();
|
101 |
+
$new_env->frames = $frames;
|
102 |
+
return $new_env;
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
public static function isMathOn(){
|
107 |
+
return !Less_Parser::$options['strictMath'] || Less_Environment::$parensStack;
|
108 |
+
}
|
109 |
+
|
110 |
+
public static function isPathRelative($path){
|
111 |
+
return !preg_match('/^(?:[a-z-]+:|\/)/',$path);
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Canonicalize a path by resolving references to '/./', '/../'
|
117 |
+
* Does not remove leading "../"
|
118 |
+
* @param string path or url
|
119 |
+
* @return string Canonicalized path
|
120 |
+
*
|
121 |
+
*/
|
122 |
+
public static function normalizePath($path){
|
123 |
+
|
124 |
+
$segments = explode('/',$path);
|
125 |
+
$segments = array_reverse($segments);
|
126 |
+
|
127 |
+
$path = array();
|
128 |
+
$path_len = 0;
|
129 |
+
|
130 |
+
while( $segments ){
|
131 |
+
$segment = array_pop($segments);
|
132 |
+
switch( $segment ) {
|
133 |
+
|
134 |
+
case '.':
|
135 |
+
break;
|
136 |
+
|
137 |
+
case '..':
|
138 |
+
if( !$path_len || ( $path[$path_len-1] === '..') ){
|
139 |
+
$path[] = $segment;
|
140 |
+
$path_len++;
|
141 |
+
}else{
|
142 |
+
array_pop($path);
|
143 |
+
$path_len--;
|
144 |
+
}
|
145 |
+
break;
|
146 |
+
|
147 |
+
default:
|
148 |
+
$path[] = $segment;
|
149 |
+
$path_len++;
|
150 |
+
break;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
return implode('/',$path);
|
155 |
+
}
|
156 |
+
|
157 |
+
|
158 |
+
public function unshiftFrame($frame){
|
159 |
+
array_unshift($this->frames, $frame);
|
160 |
+
}
|
161 |
+
|
162 |
+
public function shiftFrame(){
|
163 |
+
return array_shift($this->frames);
|
164 |
+
}
|
165 |
+
|
166 |
+
}
|
base/inc/lib/Less/Exception/Chunk.php
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Chunk Exception
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage exception
|
8 |
+
*/
|
9 |
+
class Less_Exception_Chunk extends Less_Exception_Parser{
|
10 |
+
|
11 |
+
|
12 |
+
protected $parserCurrentIndex = 0;
|
13 |
+
|
14 |
+
protected $emitFrom = 0;
|
15 |
+
|
16 |
+
protected $input_len;
|
17 |
+
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructor
|
21 |
+
*
|
22 |
+
* @param string $input
|
23 |
+
* @param Exception $previous Previous exception
|
24 |
+
* @param integer $index The current parser index
|
25 |
+
* @param Less_FileInfo|string $currentFile The file
|
26 |
+
* @param integer $code The exception code
|
27 |
+
*/
|
28 |
+
public function __construct($input, Exception $previous = null, $index = null, $currentFile = null, $code = 0){
|
29 |
+
|
30 |
+
$this->message = 'ParseError: Unexpected input'; //default message
|
31 |
+
|
32 |
+
$this->index = $index;
|
33 |
+
|
34 |
+
$this->currentFile = $currentFile;
|
35 |
+
|
36 |
+
$this->input = $input;
|
37 |
+
$this->input_len = strlen($input);
|
38 |
+
|
39 |
+
$this->Chunks();
|
40 |
+
$this->genMessage();
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
/**
|
45 |
+
* See less.js chunks()
|
46 |
+
* We don't actually need the chunks
|
47 |
+
*
|
48 |
+
*/
|
49 |
+
protected function Chunks(){
|
50 |
+
$level = 0;
|
51 |
+
$parenLevel = 0;
|
52 |
+
$lastMultiCommentEndBrace = null;
|
53 |
+
$lastOpening = null;
|
54 |
+
$lastMultiComment = null;
|
55 |
+
$lastParen = null;
|
56 |
+
|
57 |
+
for( $this->parserCurrentIndex = 0; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++ ){
|
58 |
+
$cc = $this->CharCode($this->parserCurrentIndex);
|
59 |
+
if ((($cc >= 97) && ($cc <= 122)) || ($cc < 34)) {
|
60 |
+
// a-z or whitespace
|
61 |
+
continue;
|
62 |
+
}
|
63 |
+
|
64 |
+
switch ($cc) {
|
65 |
+
|
66 |
+
// (
|
67 |
+
case 40:
|
68 |
+
$parenLevel++;
|
69 |
+
$lastParen = $this->parserCurrentIndex;
|
70 |
+
continue;
|
71 |
+
|
72 |
+
// )
|
73 |
+
case 41:
|
74 |
+
$parenLevel--;
|
75 |
+
if( $parenLevel < 0 ){
|
76 |
+
return $this->fail("missing opening `(`");
|
77 |
+
}
|
78 |
+
continue;
|
79 |
+
|
80 |
+
// ;
|
81 |
+
case 59:
|
82 |
+
//if (!$parenLevel) { $this->emitChunk(); }
|
83 |
+
continue;
|
84 |
+
|
85 |
+
// {
|
86 |
+
case 123:
|
87 |
+
$level++;
|
88 |
+
$lastOpening = $this->parserCurrentIndex;
|
89 |
+
continue;
|
90 |
+
|
91 |
+
// }
|
92 |
+
case 125:
|
93 |
+
$level--;
|
94 |
+
if( $level < 0 ){
|
95 |
+
return $this->fail("missing opening `{`");
|
96 |
+
|
97 |
+
}
|
98 |
+
//if (!$level && !$parenLevel) { $this->emitChunk(); }
|
99 |
+
continue;
|
100 |
+
// \
|
101 |
+
case 92:
|
102 |
+
if ($this->parserCurrentIndex < $this->input_len - 1) { $this->parserCurrentIndex++; continue; }
|
103 |
+
return $this->fail("unescaped `\\`");
|
104 |
+
|
105 |
+
// ", ' and `
|
106 |
+
case 34:
|
107 |
+
case 39:
|
108 |
+
case 96:
|
109 |
+
$matched = 0;
|
110 |
+
$currentChunkStartIndex = $this->parserCurrentIndex;
|
111 |
+
for ($this->parserCurrentIndex = $this->parserCurrentIndex + 1; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++) {
|
112 |
+
$cc2 = $this->CharCode($this->parserCurrentIndex);
|
113 |
+
if ($cc2 > 96) { continue; }
|
114 |
+
if ($cc2 == $cc) { $matched = 1; break; }
|
115 |
+
if ($cc2 == 92) { // \
|
116 |
+
if ($this->parserCurrentIndex == $this->input_len - 1) {
|
117 |
+
return $this->fail("unescaped `\\`");
|
118 |
+
}
|
119 |
+
$this->parserCurrentIndex++;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
if ($matched) { continue; }
|
123 |
+
return $this->fail("unmatched `" . chr($cc) . "`", $currentChunkStartIndex);
|
124 |
+
|
125 |
+
// /, check for comment
|
126 |
+
case 47:
|
127 |
+
if ($parenLevel || ($this->parserCurrentIndex == $this->input_len - 1)) { continue; }
|
128 |
+
$cc2 = $this->CharCode($this->parserCurrentIndex+1);
|
129 |
+
if ($cc2 == 47) {
|
130 |
+
// //, find lnfeed
|
131 |
+
for ($this->parserCurrentIndex = $this->parserCurrentIndex + 2; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++) {
|
132 |
+
$cc2 = $this->CharCode($this->parserCurrentIndex);
|
133 |
+
if (($cc2 <= 13) && (($cc2 == 10) || ($cc2 == 13))) { break; }
|
134 |
+
}
|
135 |
+
} else if ($cc2 == 42) {
|
136 |
+
// /*, find */
|
137 |
+
$lastMultiComment = $currentChunkStartIndex = $this->parserCurrentIndex;
|
138 |
+
for ($this->parserCurrentIndex = $this->parserCurrentIndex + 2; $this->parserCurrentIndex < $this->input_len - 1; $this->parserCurrentIndex++) {
|
139 |
+
$cc2 = $this->CharCode($this->parserCurrentIndex);
|
140 |
+
if ($cc2 == 125) { $lastMultiCommentEndBrace = $this->parserCurrentIndex; }
|
141 |
+
if ($cc2 != 42) { continue; }
|
142 |
+
if ($this->CharCode($this->parserCurrentIndex+1) == 47) { break; }
|
143 |
+
}
|
144 |
+
if ($this->parserCurrentIndex == $this->input_len - 1) {
|
145 |
+
return $this->fail("missing closing `*/`", $currentChunkStartIndex);
|
146 |
+
}
|
147 |
+
}
|
148 |
+
continue;
|
149 |
+
|
150 |
+
// *, check for unmatched */
|
151 |
+
case 42:
|
152 |
+
if (($this->parserCurrentIndex < $this->input_len - 1) && ($this->CharCode($this->parserCurrentIndex+1) == 47)) {
|
153 |
+
return $this->fail("unmatched `/*`");
|
154 |
+
}
|
155 |
+
continue;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
if( $level !== 0 ){
|
160 |
+
if( ($lastMultiComment > $lastOpening) && ($lastMultiCommentEndBrace > $lastMultiComment) ){
|
161 |
+
return $this->fail("missing closing `}` or `*/`", $lastOpening);
|
162 |
+
} else {
|
163 |
+
return $this->fail("missing closing `}`", $lastOpening);
|
164 |
+
}
|
165 |
+
} else if ( $parenLevel !== 0 ){
|
166 |
+
return $this->fail("missing closing `)`", $lastParen);
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
//chunk didn't fail
|
171 |
+
|
172 |
+
|
173 |
+
//$this->emitChunk(true);
|
174 |
+
}
|
175 |
+
|
176 |
+
public function CharCode($pos){
|
177 |
+
return ord($this->input[$pos]);
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
public function fail( $msg, $index = null ){
|
182 |
+
|
183 |
+
if( !$index ){
|
184 |
+
$this->index = $this->parserCurrentIndex;
|
185 |
+
}else{
|
186 |
+
$this->index = $index;
|
187 |
+
}
|
188 |
+
$this->message = 'ParseError: '.$msg;
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
/*
|
193 |
+
function emitChunk( $force = false ){
|
194 |
+
$len = $this->parserCurrentIndex - $this->emitFrom;
|
195 |
+
if ((($len < 512) && !$force) || !$len) {
|
196 |
+
return;
|
197 |
+
}
|
198 |
+
$chunks[] = substr($this->input, $this->emitFrom, $this->parserCurrentIndex + 1 - $this->emitFrom );
|
199 |
+
$this->emitFrom = $this->parserCurrentIndex + 1;
|
200 |
+
}
|
201 |
+
*/
|
202 |
+
|
203 |
+
}
|
base/inc/lib/Less/Exception/Compiler.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Compiler Exception
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage exception
|
8 |
+
*/
|
9 |
+
class Less_Exception_Compiler extends Less_Exception_Parser{
|
10 |
+
|
11 |
+
}
|
base/inc/lib/Less/Exception/Parser.php
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Parser Exception
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage exception
|
8 |
+
*/
|
9 |
+
class Less_Exception_Parser extends Exception{
|
10 |
+
|
11 |
+
/**
|
12 |
+
* The current file
|
13 |
+
*
|
14 |
+
* @var Less_ImportedFile
|
15 |
+
*/
|
16 |
+
public $currentFile;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* The current parser index
|
20 |
+
*
|
21 |
+
* @var integer
|
22 |
+
*/
|
23 |
+
public $index;
|
24 |
+
|
25 |
+
protected $input;
|
26 |
+
|
27 |
+
protected $details = array();
|
28 |
+
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Constructor
|
32 |
+
*
|
33 |
+
* @param string $message
|
34 |
+
* @param Exception $previous Previous exception
|
35 |
+
* @param integer $index The current parser index
|
36 |
+
* @param Less_FileInfo|string $currentFile The file
|
37 |
+
* @param integer $code The exception code
|
38 |
+
*/
|
39 |
+
public function __construct($message = null, Exception $previous = null, $index = null, $currentFile = null, $code = 0){
|
40 |
+
|
41 |
+
if (PHP_VERSION_ID < 50300) {
|
42 |
+
$this->previous = $previous;
|
43 |
+
parent::__construct($message, $code);
|
44 |
+
} else {
|
45 |
+
parent::__construct($message, $code, $previous);
|
46 |
+
}
|
47 |
+
|
48 |
+
$this->currentFile = $currentFile;
|
49 |
+
$this->index = $index;
|
50 |
+
|
51 |
+
$this->genMessage();
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
protected function getInput(){
|
56 |
+
|
57 |
+
if( !$this->input && $this->currentFile && $this->currentFile['filename'] && file_exists($this->currentFile['filename']) ){
|
58 |
+
$this->input = file_get_contents( $this->currentFile['filename'] );
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Converts the exception to string
|
66 |
+
*
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
public function genMessage(){
|
70 |
+
|
71 |
+
if( $this->currentFile && $this->currentFile['filename'] ){
|
72 |
+
$this->message .= ' in '.basename($this->currentFile['filename']);
|
73 |
+
}
|
74 |
+
|
75 |
+
if( $this->index !== null ){
|
76 |
+
$this->getInput();
|
77 |
+
if( $this->input ){
|
78 |
+
$line = self::getLineNumber();
|
79 |
+
$this->message .= ' on line '.$line.', column '.self::getColumn();
|
80 |
+
|
81 |
+
$lines = explode("\n",$this->input);
|
82 |
+
|
83 |
+
$count = count($lines);
|
84 |
+
$start_line = max(0, $line-3);
|
85 |
+
$last_line = min($count, $start_line+6);
|
86 |
+
$num_len = strlen($last_line);
|
87 |
+
for( $i = $start_line; $i < $last_line; $i++ ){
|
88 |
+
$this->message .= "\n".str_pad($i+1,$num_len,'0',STR_PAD_LEFT).'| '.$lines[$i];
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Returns the line number the error was encountered
|
97 |
+
*
|
98 |
+
* @return integer
|
99 |
+
*/
|
100 |
+
public function getLineNumber(){
|
101 |
+
if( $this->index ){
|
102 |
+
// https://bugs.php.net/bug.php?id=49790
|
103 |
+
if (ini_get("mbstring.func_overload")) {
|
104 |
+
return substr_count(substr($this->input, 0, $this->index), "\n") + 1;
|
105 |
+
} else {
|
106 |
+
return substr_count($this->input, "\n", 0, $this->index) + 1;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
return 1;
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Returns the column the error was encountered
|
115 |
+
*
|
116 |
+
* @return integer
|
117 |
+
*/
|
118 |
+
public function getColumn(){
|
119 |
+
|
120 |
+
$part = substr($this->input, 0, $this->index);
|
121 |
+
$pos = strrpos($part,"\n");
|
122 |
+
return $this->index - $pos;
|
123 |
+
}
|
124 |
+
|
125 |
+
}
|
base/inc/lib/Less/Functions.php
ADDED
@@ -0,0 +1,1188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Builtin functions
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage function
|
8 |
+
* @see http://lesscss.org/functions/
|
9 |
+
*/
|
10 |
+
class Less_Functions{
|
11 |
+
|
12 |
+
public $env;
|
13 |
+
public $currentFileInfo;
|
14 |
+
|
15 |
+
function __construct($env, $currentFileInfo = null ){
|
16 |
+
$this->env = $env;
|
17 |
+
$this->currentFileInfo = $currentFileInfo;
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @param string $op
|
22 |
+
*/
|
23 |
+
public static function operate( $op, $a, $b ){
|
24 |
+
switch ($op) {
|
25 |
+
case '+': return $a + $b;
|
26 |
+
case '-': return $a - $b;
|
27 |
+
case '*': return $a * $b;
|
28 |
+
case '/': return $a / $b;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
public static function clamp($val, $max = 1){
|
33 |
+
return min( max($val, 0), $max);
|
34 |
+
}
|
35 |
+
|
36 |
+
public static function fround( $value ){
|
37 |
+
|
38 |
+
if( $value === 0 ){
|
39 |
+
return $value;
|
40 |
+
}
|
41 |
+
|
42 |
+
if( Less_Parser::$options['numPrecision'] ){
|
43 |
+
$p = pow(10, Less_Parser::$options['numPrecision']);
|
44 |
+
return round( $value * $p) / $p;
|
45 |
+
}
|
46 |
+
return $value;
|
47 |
+
}
|
48 |
+
|
49 |
+
public static function number($n){
|
50 |
+
|
51 |
+
if ($n instanceof Less_Tree_Dimension) {
|
52 |
+
return floatval( $n->unit->is('%') ? $n->value / 100 : $n->value);
|
53 |
+
} else if (is_numeric($n)) {
|
54 |
+
return $n;
|
55 |
+
} else {
|
56 |
+
throw new Less_Exception_Compiler("color functions take numbers as parameters");
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
public static function scaled($n, $size = 255 ){
|
61 |
+
if( $n instanceof Less_Tree_Dimension && $n->unit->is('%') ){
|
62 |
+
return (float)$n->value * $size / 100;
|
63 |
+
} else {
|
64 |
+
return Less_Functions::number($n);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public function rgb ($r = null, $g = null, $b = null){
|
69 |
+
if (is_null($r) || is_null($g) || is_null($b)) {
|
70 |
+
throw new Less_Exception_Compiler("rgb expects three parameters");
|
71 |
+
}
|
72 |
+
return $this->rgba($r, $g, $b, 1.0);
|
73 |
+
}
|
74 |
+
|
75 |
+
public function rgba($r = null, $g = null, $b = null, $a = null){
|
76 |
+
$rgb = array($r, $g, $b);
|
77 |
+
$rgb = array_map(array('Less_Functions','scaled'),$rgb);
|
78 |
+
|
79 |
+
$a = self::number($a);
|
80 |
+
return new Less_Tree_Color($rgb, $a);
|
81 |
+
}
|
82 |
+
|
83 |
+
public function hsl($h, $s, $l){
|
84 |
+
return $this->hsla($h, $s, $l, 1.0);
|
85 |
+
}
|
86 |
+
|
87 |
+
public function hsla($h, $s, $l, $a){
|
88 |
+
|
89 |
+
$h = fmod(self::number($h), 360) / 360; // Classic % operator will change float to int
|
90 |
+
$s = self::clamp(self::number($s));
|
91 |
+
$l = self::clamp(self::number($l));
|
92 |
+
$a = self::clamp(self::number($a));
|
93 |
+
|
94 |
+
$m2 = $l <= 0.5 ? $l * ($s + 1) : $l + $s - $l * $s;
|
95 |
+
|
96 |
+
$m1 = $l * 2 - $m2;
|
97 |
+
|
98 |
+
return $this->rgba( self::hsla_hue($h + 1/3, $m1, $m2) * 255,
|
99 |
+
self::hsla_hue($h, $m1, $m2) * 255,
|
100 |
+
self::hsla_hue($h - 1/3, $m1, $m2) * 255,
|
101 |
+
$a);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* @param double $h
|
106 |
+
*/
|
107 |
+
public function hsla_hue($h, $m1, $m2){
|
108 |
+
$h = $h < 0 ? $h + 1 : ($h > 1 ? $h - 1 : $h);
|
109 |
+
if ($h * 6 < 1) return $m1 + ($m2 - $m1) * $h * 6;
|
110 |
+
else if ($h * 2 < 1) return $m2;
|
111 |
+
else if ($h * 3 < 2) return $m1 + ($m2 - $m1) * (2/3 - $h) * 6;
|
112 |
+
else return $m1;
|
113 |
+
}
|
114 |
+
|
115 |
+
public function hsv($h, $s, $v) {
|
116 |
+
return $this->hsva($h, $s, $v, 1.0);
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* @param double $a
|
121 |
+
*/
|
122 |
+
public function hsva($h, $s, $v, $a) {
|
123 |
+
$h = ((Less_Functions::number($h) % 360) / 360 ) * 360;
|
124 |
+
$s = Less_Functions::number($s);
|
125 |
+
$v = Less_Functions::number($v);
|
126 |
+
$a = Less_Functions::number($a);
|
127 |
+
|
128 |
+
$i = floor(($h / 60) % 6);
|
129 |
+
$f = ($h / 60) - $i;
|
130 |
+
|
131 |
+
$vs = array( $v,
|
132 |
+
$v * (1 - $s),
|
133 |
+
$v * (1 - $f * $s),
|
134 |
+
$v * (1 - (1 - $f) * $s));
|
135 |
+
|
136 |
+
$perm = array(array(0, 3, 1),
|
137 |
+
array(2, 0, 1),
|
138 |
+
array(1, 0, 3),
|
139 |
+
array(1, 2, 0),
|
140 |
+
array(3, 1, 0),
|
141 |
+
array(0, 1, 2));
|
142 |
+
|
143 |
+
return $this->rgba($vs[$perm[$i][0]] * 255,
|
144 |
+
$vs[$perm[$i][1]] * 255,
|
145 |
+
$vs[$perm[$i][2]] * 255,
|
146 |
+
$a);
|
147 |
+
}
|
148 |
+
|
149 |
+
public function hue($color = null){
|
150 |
+
if (!$color instanceof Less_Tree_Color) {
|
151 |
+
throw new Less_Exception_Compiler('The first argument to hue must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
152 |
+
}
|
153 |
+
|
154 |
+
$c = $color->toHSL();
|
155 |
+
return new Less_Tree_Dimension(Less_Parser::round($c['h']));
|
156 |
+
}
|
157 |
+
|
158 |
+
public function saturation($color = null){
|
159 |
+
if (!$color instanceof Less_Tree_Color) {
|
160 |
+
throw new Less_Exception_Compiler('The first argument to saturation must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
161 |
+
}
|
162 |
+
|
163 |
+
$c = $color->toHSL();
|
164 |
+
return new Less_Tree_Dimension(Less_Parser::round($c['s'] * 100), '%');
|
165 |
+
}
|
166 |
+
|
167 |
+
public function lightness($color = null){
|
168 |
+
if (!$color instanceof Less_Tree_Color) {
|
169 |
+
throw new Less_Exception_Compiler('The first argument to lightness must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
170 |
+
}
|
171 |
+
|
172 |
+
$c = $color->toHSL();
|
173 |
+
return new Less_Tree_Dimension(Less_Parser::round($c['l'] * 100), '%');
|
174 |
+
}
|
175 |
+
|
176 |
+
public function hsvhue( $color = null ){
|
177 |
+
if (!$color instanceof Less_Tree_Color) {
|
178 |
+
throw new Less_Exception_Compiler('The first argument to hsvhue must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
179 |
+
}
|
180 |
+
|
181 |
+
$hsv = $color->toHSV();
|
182 |
+
return new Less_Tree_Dimension( Less_Parser::round($hsv['h']) );
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
public function hsvsaturation( $color = null ){
|
187 |
+
if (!$color instanceof Less_Tree_Color) {
|
188 |
+
throw new Less_Exception_Compiler('The first argument to hsvsaturation must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
189 |
+
}
|
190 |
+
|
191 |
+
$hsv = $color->toHSV();
|
192 |
+
return new Less_Tree_Dimension( Less_Parser::round($hsv['s'] * 100), '%' );
|
193 |
+
}
|
194 |
+
|
195 |
+
public function hsvvalue( $color = null ){
|
196 |
+
if (!$color instanceof Less_Tree_Color) {
|
197 |
+
throw new Less_Exception_Compiler('The first argument to hsvvalue must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
198 |
+
}
|
199 |
+
|
200 |
+
$hsv = $color->toHSV();
|
201 |
+
return new Less_Tree_Dimension( Less_Parser::round($hsv['v'] * 100), '%' );
|
202 |
+
}
|
203 |
+
|
204 |
+
public function red($color = null) {
|
205 |
+
if (!$color instanceof Less_Tree_Color) {
|
206 |
+
throw new Less_Exception_Compiler('The first argument to red must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
207 |
+
}
|
208 |
+
|
209 |
+
return new Less_Tree_Dimension( $color->rgb[0] );
|
210 |
+
}
|
211 |
+
|
212 |
+
public function green($color = null) {
|
213 |
+
if (!$color instanceof Less_Tree_Color) {
|
214 |
+
throw new Less_Exception_Compiler('The first argument to green must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
215 |
+
}
|
216 |
+
|
217 |
+
return new Less_Tree_Dimension( $color->rgb[1] );
|
218 |
+
}
|
219 |
+
|
220 |
+
public function blue($color = null) {
|
221 |
+
if (!$color instanceof Less_Tree_Color) {
|
222 |
+
throw new Less_Exception_Compiler('The first argument to blue must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
223 |
+
}
|
224 |
+
|
225 |
+
return new Less_Tree_Dimension( $color->rgb[2] );
|
226 |
+
}
|
227 |
+
|
228 |
+
public function alpha($color = null){
|
229 |
+
if (!$color instanceof Less_Tree_Color) {
|
230 |
+
throw new Less_Exception_Compiler('The first argument to alpha must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
231 |
+
}
|
232 |
+
|
233 |
+
$c = $color->toHSL();
|
234 |
+
return new Less_Tree_Dimension($c['a']);
|
235 |
+
}
|
236 |
+
|
237 |
+
public function luma ($color = null) {
|
238 |
+
if (!$color instanceof Less_Tree_Color) {
|
239 |
+
throw new Less_Exception_Compiler('The first argument to luma must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
240 |
+
}
|
241 |
+
|
242 |
+
return new Less_Tree_Dimension(Less_Parser::round( $color->luma() * $color->alpha * 100), '%');
|
243 |
+
}
|
244 |
+
|
245 |
+
public function luminance( $color = null ){
|
246 |
+
if (!$color instanceof Less_Tree_Color) {
|
247 |
+
throw new Less_Exception_Compiler('The first argument to luminance must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
248 |
+
}
|
249 |
+
|
250 |
+
$luminance =
|
251 |
+
(0.2126 * $color->rgb[0] / 255)
|
252 |
+
+ (0.7152 * $color->rgb[1] / 255)
|
253 |
+
+ (0.0722 * $color->rgb[2] / 255);
|
254 |
+
|
255 |
+
return new Less_Tree_Dimension(Less_Parser::round( $luminance * $color->alpha * 100), '%');
|
256 |
+
}
|
257 |
+
|
258 |
+
public function saturate($color = null, $amount = null){
|
259 |
+
// filter: saturate(3.2);
|
260 |
+
// should be kept as is, so check for color
|
261 |
+
if ($color instanceof Less_Tree_Dimension) {
|
262 |
+
return null;
|
263 |
+
}
|
264 |
+
|
265 |
+
if (!$color instanceof Less_Tree_Color) {
|
266 |
+
throw new Less_Exception_Compiler('The first argument to saturate must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
267 |
+
}
|
268 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
269 |
+
throw new Less_Exception_Compiler('The second argument to saturate must be a percentage' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
270 |
+
}
|
271 |
+
|
272 |
+
$hsl = $color->toHSL();
|
273 |
+
|
274 |
+
$hsl['s'] += $amount->value / 100;
|
275 |
+
$hsl['s'] = self::clamp($hsl['s']);
|
276 |
+
|
277 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* @param Less_Tree_Dimension $amount
|
282 |
+
*/
|
283 |
+
public function desaturate($color = null, $amount = null){
|
284 |
+
if (!$color instanceof Less_Tree_Color) {
|
285 |
+
throw new Less_Exception_Compiler('The first argument to desaturate must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
286 |
+
}
|
287 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
288 |
+
throw new Less_Exception_Compiler('The second argument to desaturate must be a percentage' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
289 |
+
}
|
290 |
+
|
291 |
+
$hsl = $color->toHSL();
|
292 |
+
|
293 |
+
$hsl['s'] -= $amount->value / 100;
|
294 |
+
$hsl['s'] = self::clamp($hsl['s']);
|
295 |
+
|
296 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
297 |
+
}
|
298 |
+
|
299 |
+
|
300 |
+
|
301 |
+
public function lighten($color = null, $amount=null){
|
302 |
+
if (!$color instanceof Less_Tree_Color) {
|
303 |
+
throw new Less_Exception_Compiler('The first argument to lighten must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
304 |
+
}
|
305 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
306 |
+
throw new Less_Exception_Compiler('The second argument to lighten must be a percentage' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
307 |
+
}
|
308 |
+
|
309 |
+
$hsl = $color->toHSL();
|
310 |
+
|
311 |
+
$hsl['l'] += $amount->value / 100;
|
312 |
+
$hsl['l'] = self::clamp($hsl['l']);
|
313 |
+
|
314 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
315 |
+
}
|
316 |
+
|
317 |
+
public function darken($color = null, $amount = null){
|
318 |
+
if (!$color instanceof Less_Tree_Color) {
|
319 |
+
throw new Less_Exception_Compiler('The first argument to darken must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
320 |
+
}
|
321 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
322 |
+
throw new Less_Exception_Compiler('The second argument to darken must be a percentage' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
323 |
+
}
|
324 |
+
|
325 |
+
$hsl = $color->toHSL();
|
326 |
+
$hsl['l'] -= $amount->value / 100;
|
327 |
+
$hsl['l'] = self::clamp($hsl['l']);
|
328 |
+
|
329 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
330 |
+
}
|
331 |
+
|
332 |
+
public function fadein($color = null, $amount = null){
|
333 |
+
if (!$color instanceof Less_Tree_Color) {
|
334 |
+
throw new Less_Exception_Compiler('The first argument to fadein must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
335 |
+
}
|
336 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
337 |
+
throw new Less_Exception_Compiler('The second argument to fadein must be a percentage' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
338 |
+
}
|
339 |
+
|
340 |
+
$hsl = $color->toHSL();
|
341 |
+
$hsl['a'] += $amount->value / 100;
|
342 |
+
$hsl['a'] = self::clamp($hsl['a']);
|
343 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
344 |
+
}
|
345 |
+
|
346 |
+
public function fadeout($color = null, $amount = null){
|
347 |
+
if (!$color instanceof Less_Tree_Color) {
|
348 |
+
throw new Less_Exception_Compiler('The first argument to fadeout must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
349 |
+
}
|
350 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
351 |
+
throw new Less_Exception_Compiler('The second argument to fadeout must be a percentage' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
352 |
+
}
|
353 |
+
|
354 |
+
$hsl = $color->toHSL();
|
355 |
+
$hsl['a'] -= $amount->value / 100;
|
356 |
+
$hsl['a'] = self::clamp($hsl['a']);
|
357 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
358 |
+
}
|
359 |
+
|
360 |
+
public function fade($color = null, $amount = null){
|
361 |
+
if (!$color instanceof Less_Tree_Color) {
|
362 |
+
throw new Less_Exception_Compiler('The first argument to fade must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
363 |
+
}
|
364 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
365 |
+
throw new Less_Exception_Compiler('The second argument to fade must be a percentage' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
366 |
+
}
|
367 |
+
|
368 |
+
$hsl = $color->toHSL();
|
369 |
+
|
370 |
+
$hsl['a'] = $amount->value / 100;
|
371 |
+
$hsl['a'] = self::clamp($hsl['a']);
|
372 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
373 |
+
}
|
374 |
+
|
375 |
+
|
376 |
+
|
377 |
+
public function spin($color = null, $amount = null){
|
378 |
+
if (!$color instanceof Less_Tree_Color) {
|
379 |
+
throw new Less_Exception_Compiler('The first argument to spin must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
380 |
+
}
|
381 |
+
if (!$amount instanceof Less_Tree_Dimension) {
|
382 |
+
throw new Less_Exception_Compiler('The second argument to spin must be a number' . ($amount instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
383 |
+
}
|
384 |
+
|
385 |
+
$hsl = $color->toHSL();
|
386 |
+
$hue = fmod($hsl['h'] + $amount->value, 360);
|
387 |
+
|
388 |
+
$hsl['h'] = $hue < 0 ? 360 + $hue : $hue;
|
389 |
+
|
390 |
+
return $this->hsla($hsl['h'], $hsl['s'], $hsl['l'], $hsl['a']);
|
391 |
+
}
|
392 |
+
|
393 |
+
//
|
394 |
+
// Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
|
395 |
+
// http://sass-lang.com
|
396 |
+
//
|
397 |
+
|
398 |
+
/**
|
399 |
+
* @param Less_Tree_Color $color1
|
400 |
+
*/
|
401 |
+
public function mix($color1 = null, $color2 = null, $weight = null){
|
402 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
403 |
+
throw new Less_Exception_Compiler('The first argument to mix must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
404 |
+
}
|
405 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
406 |
+
throw new Less_Exception_Compiler('The second argument to mix must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
407 |
+
}
|
408 |
+
if (!$weight) {
|
409 |
+
$weight = new Less_Tree_Dimension('50', '%');
|
410 |
+
}
|
411 |
+
if (!$weight instanceof Less_Tree_Dimension) {
|
412 |
+
throw new Less_Exception_Compiler('The third argument to contrast must be a percentage' . ($weight instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
413 |
+
}
|
414 |
+
|
415 |
+
$p = $weight->value / 100.0;
|
416 |
+
$w = $p * 2 - 1;
|
417 |
+
$hsl1 = $color1->toHSL();
|
418 |
+
$hsl2 = $color2->toHSL();
|
419 |
+
$a = $hsl1['a'] - $hsl2['a'];
|
420 |
+
|
421 |
+
$w1 = (((($w * $a) == -1) ? $w : ($w + $a) / (1 + $w * $a)) + 1) / 2;
|
422 |
+
$w2 = 1 - $w1;
|
423 |
+
|
424 |
+
$rgb = array($color1->rgb[0] * $w1 + $color2->rgb[0] * $w2,
|
425 |
+
$color1->rgb[1] * $w1 + $color2->rgb[1] * $w2,
|
426 |
+
$color1->rgb[2] * $w1 + $color2->rgb[2] * $w2);
|
427 |
+
|
428 |
+
$alpha = $color1->alpha * $p + $color2->alpha * (1 - $p);
|
429 |
+
|
430 |
+
return new Less_Tree_Color($rgb, $alpha);
|
431 |
+
}
|
432 |
+
|
433 |
+
public function greyscale($color){
|
434 |
+
return $this->desaturate($color, new Less_Tree_Dimension(100,'%'));
|
435 |
+
}
|
436 |
+
|
437 |
+
|
438 |
+
public function contrast( $color, $dark = null, $light = null, $threshold = null){
|
439 |
+
// filter: contrast(3.2);
|
440 |
+
// should be kept as is, so check for color
|
441 |
+
if (!$color instanceof Less_Tree_Color) {
|
442 |
+
return null;
|
443 |
+
}
|
444 |
+
if( !$light ){
|
445 |
+
$light = $this->rgba(255, 255, 255, 1.0);
|
446 |
+
}
|
447 |
+
if( !$dark ){
|
448 |
+
$dark = $this->rgba(0, 0, 0, 1.0);
|
449 |
+
}
|
450 |
+
|
451 |
+
if (!$dark instanceof Less_Tree_Color) {
|
452 |
+
throw new Less_Exception_Compiler('The second argument to contrast must be a color' . ($dark instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
453 |
+
}
|
454 |
+
if (!$light instanceof Less_Tree_Color) {
|
455 |
+
throw new Less_Exception_Compiler('The third argument to contrast must be a color' . ($light instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
456 |
+
}
|
457 |
+
|
458 |
+
//Figure out which is actually light and dark!
|
459 |
+
if( $dark->luma() > $light->luma() ){
|
460 |
+
$t = $light;
|
461 |
+
$light = $dark;
|
462 |
+
$dark = $t;
|
463 |
+
}
|
464 |
+
if( !$threshold ){
|
465 |
+
$threshold = 0.43;
|
466 |
+
} else {
|
467 |
+
$threshold = Less_Functions::number($threshold);
|
468 |
+
}
|
469 |
+
|
470 |
+
if( $color->luma() < $threshold ){
|
471 |
+
return $light;
|
472 |
+
} else {
|
473 |
+
return $dark;
|
474 |
+
}
|
475 |
+
}
|
476 |
+
|
477 |
+
public function e ($str){
|
478 |
+
if( is_string($str) ){
|
479 |
+
return new Less_Tree_Anonymous($str);
|
480 |
+
}
|
481 |
+
return new Less_Tree_Anonymous($str instanceof Less_Tree_JavaScript ? $str->expression : $str->value);
|
482 |
+
}
|
483 |
+
|
484 |
+
public function escape ($str){
|
485 |
+
|
486 |
+
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'",'%3F'=>'?','%26'=>'&','%2C'=>',','%2F'=>'/','%40'=>'@','%2B'=>'+','%24'=>'$');
|
487 |
+
|
488 |
+
return new Less_Tree_Anonymous(strtr(rawurlencode($str->value), $revert));
|
489 |
+
}
|
490 |
+
|
491 |
+
|
492 |
+
/**
|
493 |
+
* todo: This function will need some additional work to make it work the same as less.js
|
494 |
+
*
|
495 |
+
*/
|
496 |
+
public function replace( $string, $pattern, $replacement, $flags = null ){
|
497 |
+
$result = $string->value;
|
498 |
+
|
499 |
+
$expr = '/'.str_replace('/','\\/',$pattern->value).'/';
|
500 |
+
if( $flags && $flags->value){
|
501 |
+
$expr .= self::replace_flags($flags->value);
|
502 |
+
}
|
503 |
+
|
504 |
+
$result = preg_replace($expr,$replacement->value,$result);
|
505 |
+
|
506 |
+
|
507 |
+
if( property_exists($string,'quote') ){
|
508 |
+
return new Less_Tree_Quoted( $string->quote, $result, $string->escaped);
|
509 |
+
}
|
510 |
+
return new Less_Tree_Quoted( '', $result );
|
511 |
+
}
|
512 |
+
|
513 |
+
public static function replace_flags($flags){
|
514 |
+
$flags = str_split($flags,1);
|
515 |
+
$new_flags = '';
|
516 |
+
|
517 |
+
foreach($flags as $flag){
|
518 |
+
switch($flag){
|
519 |
+
case 'e':
|
520 |
+
case 'g':
|
521 |
+
break;
|
522 |
+
|
523 |
+
default:
|
524 |
+
$new_flags .= $flag;
|
525 |
+
break;
|
526 |
+
}
|
527 |
+
}
|
528 |
+
|
529 |
+
return $new_flags;
|
530 |
+
}
|
531 |
+
|
532 |
+
public function _percent(){
|
533 |
+
$string = func_get_arg(0);
|
534 |
+
|
535 |
+
$args = func_get_args();
|
536 |
+
array_shift($args);
|
537 |
+
$result = $string->value;
|
538 |
+
|
539 |
+
foreach($args as $arg){
|
540 |
+
if( preg_match('/%[sda]/i',$result, $token) ){
|
541 |
+
$token = $token[0];
|
542 |
+
$value = stristr($token, 's') ? $arg->value : $arg->toCSS();
|
543 |
+
$value = preg_match('/[A-Z]$/', $token) ? urlencode($value) : $value;
|
544 |
+
$result = preg_replace('/%[sda]/i',$value, $result, 1);
|
545 |
+
}
|
546 |
+
}
|
547 |
+
$result = str_replace('%%', '%', $result);
|
548 |
+
|
549 |
+
return new Less_Tree_Quoted( $string->quote , $result, $string->escaped);
|
550 |
+
}
|
551 |
+
|
552 |
+
public function unit( $val, $unit = null) {
|
553 |
+
if( !($val instanceof Less_Tree_Dimension) ){
|
554 |
+
throw new Less_Exception_Compiler('The first argument to unit must be a number' . ($val instanceof Less_Tree_Operation ? '. Have you forgotten parenthesis?' : '.') );
|
555 |
+
}
|
556 |
+
|
557 |
+
if( $unit ){
|
558 |
+
if( $unit instanceof Less_Tree_Keyword ){
|
559 |
+
$unit = $unit->value;
|
560 |
+
} else {
|
561 |
+
$unit = $unit->toCSS();
|
562 |
+
}
|
563 |
+
} else {
|
564 |
+
$unit = "";
|
565 |
+
}
|
566 |
+
return new Less_Tree_Dimension($val->value, $unit );
|
567 |
+
}
|
568 |
+
|
569 |
+
public function convert($val, $unit){
|
570 |
+
return $val->convertTo($unit->value);
|
571 |
+
}
|
572 |
+
|
573 |
+
public function round($n, $f = false) {
|
574 |
+
|
575 |
+
$fraction = 0;
|
576 |
+
if( $f !== false ){
|
577 |
+
$fraction = $f->value;
|
578 |
+
}
|
579 |
+
|
580 |
+
return $this->_math('Less_Parser::round',null, $n, $fraction);
|
581 |
+
}
|
582 |
+
|
583 |
+
public function pi(){
|
584 |
+
return new Less_Tree_Dimension(M_PI);
|
585 |
+
}
|
586 |
+
|
587 |
+
public function mod($a, $b) {
|
588 |
+
return new Less_Tree_Dimension( $a->value % $b->value, $a->unit);
|
589 |
+
}
|
590 |
+
|
591 |
+
|
592 |
+
|
593 |
+
public function pow($x, $y) {
|
594 |
+
if( is_numeric($x) && is_numeric($y) ){
|
595 |
+
$x = new Less_Tree_Dimension($x);
|
596 |
+
$y = new Less_Tree_Dimension($y);
|
597 |
+
}elseif( !($x instanceof Less_Tree_Dimension) || !($y instanceof Less_Tree_Dimension) ){
|
598 |
+
throw new Less_Exception_Compiler('Arguments must be numbers');
|
599 |
+
}
|
600 |
+
|
601 |
+
return new Less_Tree_Dimension( pow($x->value, $y->value), $x->unit );
|
602 |
+
}
|
603 |
+
|
604 |
+
// var mathFunctions = [{name:"ce ...
|
605 |
+
public function ceil( $n ){ return $this->_math('ceil', null, $n); }
|
606 |
+
public function floor( $n ){ return $this->_math('floor', null, $n); }
|
607 |
+
public function sqrt( $n ){ return $this->_math('sqrt', null, $n); }
|
608 |
+
public function abs( $n ){ return $this->_math('abs', null, $n); }
|
609 |
+
|
610 |
+
public function tan( $n ){ return $this->_math('tan', '', $n); }
|
611 |
+
public function sin( $n ){ return $this->_math('sin', '', $n); }
|
612 |
+
public function cos( $n ){ return $this->_math('cos', '', $n); }
|
613 |
+
|
614 |
+
public function atan( $n ){ return $this->_math('atan', 'rad', $n); }
|
615 |
+
public function asin( $n ){ return $this->_math('asin', 'rad', $n); }
|
616 |
+
public function acos( $n ){ return $this->_math('acos', 'rad', $n); }
|
617 |
+
|
618 |
+
private function _math() {
|
619 |
+
$args = func_get_args();
|
620 |
+
$fn = array_shift($args);
|
621 |
+
$unit = array_shift($args);
|
622 |
+
|
623 |
+
if ($args[0] instanceof Less_Tree_Dimension) {
|
624 |
+
|
625 |
+
if( $unit === null ){
|
626 |
+
$unit = $args[0]->unit;
|
627 |
+
}else{
|
628 |
+
$args[0] = $args[0]->unify();
|
629 |
+
}
|
630 |
+
$args[0] = (float)$args[0]->value;
|
631 |
+
return new Less_Tree_Dimension( call_user_func_array($fn, $args), $unit);
|
632 |
+
} else if (is_numeric($args[0])) {
|
633 |
+
return call_user_func_array($fn,$args);
|
634 |
+
} else {
|
635 |
+
throw new Less_Exception_Compiler("math functions take numbers as parameters");
|
636 |
+
}
|
637 |
+
}
|
638 |
+
|
639 |
+
/**
|
640 |
+
* @param boolean $isMin
|
641 |
+
*/
|
642 |
+
private function _minmax( $isMin, $args ){
|
643 |
+
|
644 |
+
$arg_count = count($args);
|
645 |
+
|
646 |
+
if( $arg_count < 1 ){
|
647 |
+
throw new Less_Exception_Compiler( 'one or more arguments required');
|
648 |
+
}
|
649 |
+
|
650 |
+
$j = null;
|
651 |
+
$unitClone = null;
|
652 |
+
$unitStatic = null;
|
653 |
+
|
654 |
+
|
655 |
+
$order = array(); // elems only contains original argument values.
|
656 |
+
$values = array(); // key is the unit.toString() for unified tree.Dimension values,
|
657 |
+
// value is the index into the order array.
|
658 |
+
|
659 |
+
|
660 |
+
for( $i = 0; $i < $arg_count; $i++ ){
|
661 |
+
$current = $args[$i];
|
662 |
+
if( !($current instanceof Less_Tree_Dimension) ){
|
663 |
+
if( is_array($args[$i]->value) ){
|
664 |
+
$args[] = $args[$i]->value;
|
665 |
+
}
|
666 |
+
continue;
|
667 |
+
}
|
668 |
+
|
669 |
+
if( $current->unit->toString() === '' && !$unitClone ){
|
670 |
+
$temp = new Less_Tree_Dimension($current->value, $unitClone);
|
671 |
+
$currentUnified = $temp->unify();
|
672 |
+
}else{
|
673 |
+
$currentUnified = $current->unify();
|
674 |
+
}
|
675 |
+
|
676 |
+
if( $currentUnified->unit->toString() === "" && !$unitStatic ){
|
677 |
+
$unit = $unitStatic;
|
678 |
+
}else{
|
679 |
+
$unit = $currentUnified->unit->toString();
|
680 |
+
}
|
681 |
+
|
682 |
+
if( $unit !== '' && !$unitStatic || $unit !== '' && $order[0]->unify()->unit->toString() === "" ){
|
683 |
+
$unitStatic = $unit;
|
684 |
+
}
|
685 |
+
|
686 |
+
if( $unit != '' && !$unitClone ){
|
687 |
+
$unitClone = $current->unit->toString();
|
688 |
+
}
|
689 |
+
|
690 |
+
if( isset($values['']) && $unit !== '' && $unit === $unitStatic ){
|
691 |
+
$j = $values[''];
|
692 |
+
}elseif( isset($values[$unit]) ){
|
693 |
+
$j = $values[$unit];
|
694 |
+
}else{
|
695 |
+
|
696 |
+
if( $unitStatic && $unit !== $unitStatic ){
|
697 |
+
throw new Less_Exception_Compiler( 'incompatible types');
|
698 |
+
}
|
699 |
+
$values[$unit] = count($order);
|
700 |
+
$order[] = $current;
|
701 |
+
continue;
|
702 |
+
}
|
703 |
+
|
704 |
+
|
705 |
+
if( $order[$j]->unit->toString() === "" && $unitClone ){
|
706 |
+
$temp = new Less_Tree_Dimension( $order[$j]->value, $unitClone);
|
707 |
+
$referenceUnified = $temp->unify();
|
708 |
+
}else{
|
709 |
+
$referenceUnified = $order[$j]->unify();
|
710 |
+
}
|
711 |
+
if( ($isMin && $currentUnified->value < $referenceUnified->value) || (!$isMin && $currentUnified->value > $referenceUnified->value) ){
|
712 |
+
$order[$j] = $current;
|
713 |
+
}
|
714 |
+
}
|
715 |
+
|
716 |
+
if( count($order) == 1 ){
|
717 |
+
return $order[0];
|
718 |
+
}
|
719 |
+
$args = array();
|
720 |
+
foreach($order as $a){
|
721 |
+
$args[] = $a->toCSS($this->env);
|
722 |
+
}
|
723 |
+
return new Less_Tree_Anonymous( ($isMin?'min(':'max(') . implode(Less_Environment::$_outputMap[','],$args).')');
|
724 |
+
}
|
725 |
+
|
726 |
+
public function min(){
|
727 |
+
$args = func_get_args();
|
728 |
+
return $this->_minmax( true, $args );
|
729 |
+
}
|
730 |
+
|
731 |
+
public function max(){
|
732 |
+
$args = func_get_args();
|
733 |
+
return $this->_minmax( false, $args );
|
734 |
+
}
|
735 |
+
|
736 |
+
public function getunit($n){
|
737 |
+
return new Less_Tree_Anonymous($n->unit);
|
738 |
+
}
|
739 |
+
|
740 |
+
public function argb($color) {
|
741 |
+
if (!$color instanceof Less_Tree_Color) {
|
742 |
+
throw new Less_Exception_Compiler('The first argument to argb must be a color' . ($color instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
743 |
+
}
|
744 |
+
|
745 |
+
return new Less_Tree_Anonymous($color->toARGB());
|
746 |
+
}
|
747 |
+
|
748 |
+
public function percentage($n) {
|
749 |
+
return new Less_Tree_Dimension($n->value * 100, '%');
|
750 |
+
}
|
751 |
+
|
752 |
+
public function color($n) {
|
753 |
+
|
754 |
+
if( $n instanceof Less_Tree_Quoted ){
|
755 |
+
$colorCandidate = $n->value;
|
756 |
+
$returnColor = Less_Tree_Color::fromKeyword($colorCandidate);
|
757 |
+
if( $returnColor ){
|
758 |
+
return $returnColor;
|
759 |
+
}
|
760 |
+
if( preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/',$colorCandidate) ){
|
761 |
+
return new Less_Tree_Color(substr($colorCandidate, 1));
|
762 |
+
}
|
763 |
+
throw new Less_Exception_Compiler("argument must be a color keyword or 3/6 digit hex e.g. #FFF");
|
764 |
+
} else {
|
765 |
+
throw new Less_Exception_Compiler("argument must be a string");
|
766 |
+
}
|
767 |
+
}
|
768 |
+
|
769 |
+
|
770 |
+
public function iscolor($n) {
|
771 |
+
return $this->_isa($n, 'Less_Tree_Color');
|
772 |
+
}
|
773 |
+
|
774 |
+
public function isnumber($n) {
|
775 |
+
return $this->_isa($n, 'Less_Tree_Dimension');
|
776 |
+
}
|
777 |
+
|
778 |
+
public function isstring($n) {
|
779 |
+
return $this->_isa($n, 'Less_Tree_Quoted');
|
780 |
+
}
|
781 |
+
|
782 |
+
public function iskeyword($n) {
|
783 |
+
return $this->_isa($n, 'Less_Tree_Keyword');
|
784 |
+
}
|
785 |
+
|
786 |
+
public function isurl($n) {
|
787 |
+
return $this->_isa($n, 'Less_Tree_Url');
|
788 |
+
}
|
789 |
+
|
790 |
+
public function ispixel($n) {
|
791 |
+
return $this->isunit($n, 'px');
|
792 |
+
}
|
793 |
+
|
794 |
+
public function ispercentage($n) {
|
795 |
+
return $this->isunit($n, '%');
|
796 |
+
}
|
797 |
+
|
798 |
+
public function isem($n) {
|
799 |
+
return $this->isunit($n, 'em');
|
800 |
+
}
|
801 |
+
|
802 |
+
/**
|
803 |
+
* @param string $unit
|
804 |
+
*/
|
805 |
+
public function isunit( $n, $unit ){
|
806 |
+
|
807 |
+
if( is_object($unit) && property_exists($unit,'value') ){
|
808 |
+
$unit = $unit->value;
|
809 |
+
}
|
810 |
+
|
811 |
+
return ($n instanceof Less_Tree_Dimension) && $n->unit->is($unit) ? new Less_Tree_Keyword('true') : new Less_Tree_Keyword('false');
|
812 |
+
}
|
813 |
+
|
814 |
+
/**
|
815 |
+
* @param string $type
|
816 |
+
*/
|
817 |
+
private function _isa($n, $type) {
|
818 |
+
return is_a($n, $type) ? new Less_Tree_Keyword('true') : new Less_Tree_Keyword('false');
|
819 |
+
}
|
820 |
+
|
821 |
+
public function tint($color, $amount = null) {
|
822 |
+
return $this->mix( $this->rgb(255,255,255), $color, $amount);
|
823 |
+
}
|
824 |
+
|
825 |
+
public function shade($color, $amount = null) {
|
826 |
+
return $this->mix($this->rgb(0, 0, 0), $color, $amount);
|
827 |
+
}
|
828 |
+
|
829 |
+
public function extract($values, $index ){
|
830 |
+
$index = (int)$index->value - 1; // (1-based index)
|
831 |
+
// handle non-array values as an array of length 1
|
832 |
+
// return 'undefined' if index is invalid
|
833 |
+
if( property_exists($values,'value') && is_array($values->value) ){
|
834 |
+
if( isset($values->value[$index]) ){
|
835 |
+
return $values->value[$index];
|
836 |
+
}
|
837 |
+
return null;
|
838 |
+
|
839 |
+
}elseif( (int)$index === 0 ){
|
840 |
+
return $values;
|
841 |
+
}
|
842 |
+
|
843 |
+
return null;
|
844 |
+
}
|
845 |
+
|
846 |
+
public function length($values){
|
847 |
+
$n = (property_exists($values,'value') && is_array($values->value)) ? count($values->value) : 1;
|
848 |
+
return new Less_Tree_Dimension($n);
|
849 |
+
}
|
850 |
+
|
851 |
+
public function datauri($mimetypeNode, $filePathNode = null ) {
|
852 |
+
|
853 |
+
$filePath = ( $filePathNode ? $filePathNode->value : null );
|
854 |
+
$mimetype = $mimetypeNode->value;
|
855 |
+
|
856 |
+
$args = 2;
|
857 |
+
if( !$filePath ){
|
858 |
+
$filePath = $mimetype;
|
859 |
+
$args = 1;
|
860 |
+
}
|
861 |
+
|
862 |
+
$filePath = str_replace('\\','/',$filePath);
|
863 |
+
if( Less_Environment::isPathRelative($filePath) ){
|
864 |
+
|
865 |
+
if( Less_Parser::$options['relativeUrls'] ){
|
866 |
+
$temp = $this->currentFileInfo['currentDirectory'];
|
867 |
+
} else {
|
868 |
+
$temp = $this->currentFileInfo['entryPath'];
|
869 |
+
}
|
870 |
+
|
871 |
+
if( !empty($temp) ){
|
872 |
+
$filePath = Less_Environment::normalizePath(rtrim($temp,'/').'/'.$filePath);
|
873 |
+
}
|
874 |
+
|
875 |
+
}
|
876 |
+
|
877 |
+
|
878 |
+
// detect the mimetype if not given
|
879 |
+
if( $args < 2 ){
|
880 |
+
|
881 |
+
/* incomplete
|
882 |
+
$mime = require('mime');
|
883 |
+
mimetype = mime.lookup(path);
|
884 |
+
|
885 |
+
// use base 64 unless it's an ASCII or UTF-8 format
|
886 |
+
var charset = mime.charsets.lookup(mimetype);
|
887 |
+
useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;
|
888 |
+
if (useBase64) mimetype += ';base64';
|
889 |
+
*/
|
890 |
+
|
891 |
+
$mimetype = Less_Mime::lookup($filePath);
|
892 |
+
|
893 |
+
$charset = Less_Mime::charsets_lookup($mimetype);
|
894 |
+
$useBase64 = !in_array($charset,array('US-ASCII', 'UTF-8'));
|
895 |
+
if( $useBase64 ){ $mimetype .= ';base64'; }
|
896 |
+
|
897 |
+
}else{
|
898 |
+
$useBase64 = preg_match('/;base64$/',$mimetype);
|
899 |
+
}
|
900 |
+
|
901 |
+
|
902 |
+
if( file_exists($filePath) ){
|
903 |
+
$buf = @file_get_contents($filePath);
|
904 |
+
}else{
|
905 |
+
$buf = false;
|
906 |
+
}
|
907 |
+
|
908 |
+
|
909 |
+
// IE8 cannot handle a data-uri larger than 32KB. If this is exceeded
|
910 |
+
// and the --ieCompat flag is enabled, return a normal url() instead.
|
911 |
+
$DATA_URI_MAX_KB = 32;
|
912 |
+
$fileSizeInKB = round( strlen($buf) / 1024 );
|
913 |
+
if( $fileSizeInKB >= $DATA_URI_MAX_KB ){
|
914 |
+
$url = new Less_Tree_Url( ($filePathNode ? $filePathNode : $mimetypeNode), $this->currentFileInfo);
|
915 |
+
return $url->compile($this);
|
916 |
+
}
|
917 |
+
|
918 |
+
if( $buf ){
|
919 |
+
$buf = $useBase64 ? base64_encode($buf) : rawurlencode($buf);
|
920 |
+
$filePath = '"data:' . $mimetype . ',' . $buf . '"';
|
921 |
+
}
|
922 |
+
|
923 |
+
return new Less_Tree_Url( new Less_Tree_Anonymous($filePath) );
|
924 |
+
}
|
925 |
+
|
926 |
+
//svg-gradient
|
927 |
+
public function svggradient( $direction ){
|
928 |
+
|
929 |
+
$throw_message = 'svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]';
|
930 |
+
$arguments = func_get_args();
|
931 |
+
|
932 |
+
if( count($arguments) < 3 ){
|
933 |
+
throw new Less_Exception_Compiler( $throw_message );
|
934 |
+
}
|
935 |
+
|
936 |
+
$stops = array_slice($arguments,1);
|
937 |
+
$gradientType = 'linear';
|
938 |
+
$rectangleDimension = 'x="0" y="0" width="1" height="1"';
|
939 |
+
$useBase64 = true;
|
940 |
+
$directionValue = $direction->toCSS();
|
941 |
+
|
942 |
+
|
943 |
+
switch( $directionValue ){
|
944 |
+
case "to bottom":
|
945 |
+
$gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"';
|
946 |
+
break;
|
947 |
+
case "to right":
|
948 |
+
$gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"';
|
949 |
+
break;
|
950 |
+
case "to bottom right":
|
951 |
+
$gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"';
|
952 |
+
break;
|
953 |
+
case "to top right":
|
954 |
+
$gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"';
|
955 |
+
break;
|
956 |
+
case "ellipse":
|
957 |
+
case "ellipse at center":
|
958 |
+
$gradientType = "radial";
|
959 |
+
$gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"';
|
960 |
+
$rectangleDimension = 'x="-50" y="-50" width="101" height="101"';
|
961 |
+
break;
|
962 |
+
default:
|
963 |
+
throw new Less_Exception_Compiler( "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'" );
|
964 |
+
}
|
965 |
+
|
966 |
+
$returner = '<?xml version="1.0" ?>' .
|
967 |
+
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">' .
|
968 |
+
'<' . $gradientType . 'Gradient id="gradient" gradientUnits="userSpaceOnUse" ' . $gradientDirectionSvg . '>';
|
969 |
+
|
970 |
+
for( $i = 0; $i < count($stops); $i++ ){
|
971 |
+
if( is_object($stops[$i]) && property_exists($stops[$i],'value') ){
|
972 |
+
$color = $stops[$i]->value[0];
|
973 |
+
$position = $stops[$i]->value[1];
|
974 |
+
}else{
|
975 |
+
$color = $stops[$i];
|
976 |
+
$position = null;
|
977 |
+
}
|
978 |
+
|
979 |
+
if( !($color instanceof Less_Tree_Color) || (!(($i === 0 || $i+1 === count($stops)) && $position === null) && !($position instanceof Less_Tree_Dimension)) ){
|
980 |
+
throw new Less_Exception_Compiler( $throw_message );
|
981 |
+
}
|
982 |
+
if( $position ){
|
983 |
+
$positionValue = $position->toCSS();
|
984 |
+
}elseif( $i === 0 ){
|
985 |
+
$positionValue = '0%';
|
986 |
+
}else{
|
987 |
+
$positionValue = '100%';
|
988 |
+
}
|
989 |
+
$alpha = $color->alpha;
|
990 |
+
$returner .= '<stop offset="' . $positionValue . '" stop-color="' . $color->toRGB() . '"' . ($alpha < 1 ? ' stop-opacity="' . $alpha . '"' : '') . '/>';
|
991 |
+
}
|
992 |
+
|
993 |
+
$returner .= '</' . $gradientType . 'Gradient><rect ' . $rectangleDimension . ' fill="url(#gradient)" /></svg>';
|
994 |
+
|
995 |
+
|
996 |
+
if( $useBase64 ){
|
997 |
+
$returner = "'data:image/svg+xml;base64,".base64_encode($returner)."'";
|
998 |
+
}else{
|
999 |
+
$returner = "'data:image/svg+xml,".$returner."'";
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
return new Less_Tree_URL( new Less_Tree_Anonymous( $returner ) );
|
1003 |
+
}
|
1004 |
+
|
1005 |
+
|
1006 |
+
/**
|
1007 |
+
* Php version of javascript's `encodeURIComponent` function
|
1008 |
+
*
|
1009 |
+
* @param string $string The string to encode
|
1010 |
+
* @return string The encoded string
|
1011 |
+
*/
|
1012 |
+
public static function encodeURIComponent($string){
|
1013 |
+
$revert = array('%21' => '!', '%2A' => '*', '%27' => "'", '%28' => '(', '%29' => ')');
|
1014 |
+
return strtr(rawurlencode($string), $revert);
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
|
1018 |
+
// Color Blending
|
1019 |
+
// ref: http://www.w3.org/TR/compositing-1
|
1020 |
+
|
1021 |
+
public function colorBlend( $mode, $color1, $color2 ){
|
1022 |
+
$ab = $color1->alpha; // backdrop
|
1023 |
+
$as = $color2->alpha; // source
|
1024 |
+
$r = array(); // result
|
1025 |
+
|
1026 |
+
$ar = $as + $ab * (1 - $as);
|
1027 |
+
for( $i = 0; $i < 3; $i++ ){
|
1028 |
+
$cb = $color1->rgb[$i] / 255;
|
1029 |
+
$cs = $color2->rgb[$i] / 255;
|
1030 |
+
$cr = call_user_func( $mode, $cb, $cs );
|
1031 |
+
if( $ar ){
|
1032 |
+
$cr = ($as * $cs + $ab * ($cb - $as * ($cb + $cs - $cr))) / $ar;
|
1033 |
+
}
|
1034 |
+
$r[$i] = $cr * 255;
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
return new Less_Tree_Color($r, $ar);
|
1038 |
+
}
|
1039 |
+
|
1040 |
+
public function multiply($color1 = null, $color2 = null ){
|
1041 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1042 |
+
throw new Less_Exception_Compiler('The first argument to multiply must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1043 |
+
}
|
1044 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1045 |
+
throw new Less_Exception_Compiler('The second argument to multiply must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
return $this->colorBlend( array($this,'colorBlendMultiply'), $color1, $color2 );
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
private function colorBlendMultiply($cb, $cs){
|
1052 |
+
return $cb * $cs;
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
public function screen($color1 = null, $color2 = null ){
|
1056 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1057 |
+
throw new Less_Exception_Compiler('The first argument to screen must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1058 |
+
}
|
1059 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1060 |
+
throw new Less_Exception_Compiler('The second argument to screen must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
return $this->colorBlend( array($this,'colorBlendScreen'), $color1, $color2 );
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
private function colorBlendScreen( $cb, $cs){
|
1067 |
+
return $cb + $cs - $cb * $cs;
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
public function overlay($color1 = null, $color2 = null){
|
1071 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1072 |
+
throw new Less_Exception_Compiler('The first argument to overlay must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1073 |
+
}
|
1074 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1075 |
+
throw new Less_Exception_Compiler('The second argument to overlay must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
return $this->colorBlend( array($this,'colorBlendOverlay'), $color1, $color2 );
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
private function colorBlendOverlay($cb, $cs ){
|
1082 |
+
$cb *= 2;
|
1083 |
+
return ($cb <= 1)
|
1084 |
+
? $this->colorBlendMultiply($cb, $cs)
|
1085 |
+
: $this->colorBlendScreen($cb - 1, $cs);
|
1086 |
+
}
|
1087 |
+
|
1088 |
+
public function softlight($color1 = null, $color2 = null){
|
1089 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1090 |
+
throw new Less_Exception_Compiler('The first argument to softlight must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1091 |
+
}
|
1092 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1093 |
+
throw new Less_Exception_Compiler('The second argument to softlight must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
return $this->colorBlend( array($this,'colorBlendSoftlight'), $color1, $color2 );
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
private function colorBlendSoftlight($cb, $cs ){
|
1100 |
+
$d = 1;
|
1101 |
+
$e = $cb;
|
1102 |
+
if( $cs > 0.5 ){
|
1103 |
+
$e = 1;
|
1104 |
+
$d = ($cb > 0.25) ? sqrt($cb)
|
1105 |
+
: ((16 * $cb - 12) * $cb + 4) * $cb;
|
1106 |
+
}
|
1107 |
+
return $cb - (1 - 2 * $cs) * $e * ($d - $cb);
|
1108 |
+
}
|
1109 |
+
|
1110 |
+
public function hardlight($color1 = null, $color2 = null){
|
1111 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1112 |
+
throw new Less_Exception_Compiler('The first argument to hardlight must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1113 |
+
}
|
1114 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1115 |
+
throw new Less_Exception_Compiler('The second argument to hardlight must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
return $this->colorBlend( array($this,'colorBlendHardlight'), $color1, $color2 );
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
private function colorBlendHardlight( $cb, $cs ){
|
1122 |
+
return $this->colorBlendOverlay($cs, $cb);
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
public function difference($color1 = null, $color2 = null) {
|
1126 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1127 |
+
throw new Less_Exception_Compiler('The first argument to difference must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1128 |
+
}
|
1129 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1130 |
+
throw new Less_Exception_Compiler('The second argument to difference must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
return $this->colorBlend( array($this,'colorBlendDifference'), $color1, $color2 );
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
private function colorBlendDifference( $cb, $cs ){
|
1137 |
+
return abs($cb - $cs);
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
public function exclusion( $color1 = null, $color2 = null ){
|
1141 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1142 |
+
throw new Less_Exception_Compiler('The first argument to exclusion must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1143 |
+
}
|
1144 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1145 |
+
throw new Less_Exception_Compiler('The second argument to exclusion must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1146 |
+
}
|
1147 |
+
|
1148 |
+
return $this->colorBlend( array($this,'colorBlendExclusion'), $color1, $color2 );
|
1149 |
+
}
|
1150 |
+
|
1151 |
+
private function colorBlendExclusion( $cb, $cs ){
|
1152 |
+
return $cb + $cs - 2 * $cb * $cs;
|
1153 |
+
}
|
1154 |
+
|
1155 |
+
public function average($color1 = null, $color2 = null){
|
1156 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1157 |
+
throw new Less_Exception_Compiler('The first argument to average must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1158 |
+
}
|
1159 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1160 |
+
throw new Less_Exception_Compiler('The second argument to average must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1161 |
+
}
|
1162 |
+
|
1163 |
+
return $this->colorBlend( array($this,'colorBlendAverage'), $color1, $color2 );
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
// non-w3c functions:
|
1167 |
+
public function colorBlendAverage($cb, $cs ){
|
1168 |
+
return ($cb + $cs) / 2;
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
public function negation($color1 = null, $color2 = null ){
|
1172 |
+
if (!$color1 instanceof Less_Tree_Color) {
|
1173 |
+
throw new Less_Exception_Compiler('The first argument to negation must be a color' . ($color1 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1174 |
+
}
|
1175 |
+
if (!$color2 instanceof Less_Tree_Color) {
|
1176 |
+
throw new Less_Exception_Compiler('The second argument to negation must be a color' . ($color2 instanceof Less_Tree_Expression ? ' (did you forgot commas?)' : '') );
|
1177 |
+
}
|
1178 |
+
|
1179 |
+
return $this->colorBlend( array($this,'colorBlendNegation'), $color1, $color2 );
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
public function colorBlendNegation($cb, $cs){
|
1183 |
+
return 1 - abs($cb + $cs - 1);
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
// ~ End of Color Blending
|
1187 |
+
|
1188 |
+
}
|
base/inc/lib/Less/Less.php.combine
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
./Parser.php
|
3 |
+
./Colors.php
|
4 |
+
./Environment.php
|
5 |
+
./Functions.php
|
6 |
+
./Mime.php
|
7 |
+
./Tree.php
|
8 |
+
./Output.php
|
9 |
+
./Visitor.php
|
10 |
+
./VisitorReplacing.php
|
11 |
+
./Configurable.php
|
12 |
+
./Tree
|
13 |
+
./Visitor
|
14 |
+
./Exception/Parser.php
|
15 |
+
./Exception/
|
16 |
+
./Output
|
17 |
+
./SourceMap
|
base/inc/lib/Less/Mime.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Mime lookup
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage node
|
8 |
+
*/
|
9 |
+
class Less_Mime{
|
10 |
+
|
11 |
+
// this map is intentionally incomplete
|
12 |
+
// if you want more, install 'mime' dep
|
13 |
+
static $_types = array(
|
14 |
+
'.htm' => 'text/html',
|
15 |
+
'.html'=> 'text/html',
|
16 |
+
'.gif' => 'image/gif',
|
17 |
+
'.jpg' => 'image/jpeg',
|
18 |
+
'.jpeg'=> 'image/jpeg',
|
19 |
+
'.png' => 'image/png',
|
20 |
+
'.ttf' => 'application/x-font-ttf',
|
21 |
+
'.otf' => 'application/x-font-otf',
|
22 |
+
'.eot' => 'application/vnd.ms-fontobject',
|
23 |
+
'.woff' => 'application/x-font-woff',
|
24 |
+
'.svg' => 'image/svg+xml',
|
25 |
+
);
|
26 |
+
|
27 |
+
public static function lookup( $filepath ){
|
28 |
+
$parts = explode('.',$filepath);
|
29 |
+
$ext = '.'.strtolower(array_pop($parts));
|
30 |
+
|
31 |
+
if( !isset(self::$_types[$ext]) ){
|
32 |
+
return null;
|
33 |
+
}
|
34 |
+
return self::$_types[$ext];
|
35 |
+
}
|
36 |
+
|
37 |
+
public static function charsets_lookup( $type = null ){
|
38 |
+
// assumes all text types are UTF-8
|
39 |
+
return $type && preg_match('/^text\//',$type) ? 'UTF-8' : '';
|
40 |
+
}
|
41 |
+
}
|
base/inc/lib/Less/Output.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Parser output
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage output
|
8 |
+
*/
|
9 |
+
class Less_Output{
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Output holder
|
13 |
+
*
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
protected $strs = array();
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Adds a chunk to the stack
|
20 |
+
*
|
21 |
+
* @param string $chunk The chunk to output
|
22 |
+
* @param Less_FileInfo $fileInfo The file information
|
23 |
+
* @param integer $index The index
|
24 |
+
* @param mixed $mapLines
|
25 |
+
*/
|
26 |
+
public function add($chunk, $fileInfo = null, $index = 0, $mapLines = null){
|
27 |
+
$this->strs[] = $chunk;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Is the output empty?
|
32 |
+
*
|
33 |
+
* @return boolean
|
34 |
+
*/
|
35 |
+
public function isEmpty(){
|
36 |
+
return count($this->strs) === 0;
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Converts the output to string
|
42 |
+
*
|
43 |
+
* @return string
|
44 |
+
*/
|
45 |
+
public function toString(){
|
46 |
+
return implode('',$this->strs);
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
base/inc/lib/Less/Output/Mapped.php
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Parser output with source map
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage Output
|
8 |
+
*/
|
9 |
+
class Less_Output_Mapped extends Less_Output {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* The source map generator
|
13 |
+
*
|
14 |
+
* @var Less_SourceMap_Generator
|
15 |
+
*/
|
16 |
+
protected $generator;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Current line
|
20 |
+
*
|
21 |
+
* @var integer
|
22 |
+
*/
|
23 |
+
protected $lineNumber = 0;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Current column
|
27 |
+
*
|
28 |
+
* @var integer
|
29 |
+
*/
|
30 |
+
protected $column = 0;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Array of contents map (file and its content)
|
34 |
+
*
|
35 |
+
* @var array
|
36 |
+
*/
|
37 |
+
protected $contentsMap = array();
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Constructor
|
41 |
+
*
|
42 |
+
* @param array $contentsMap Array of filename to contents map
|
43 |
+
* @param Less_SourceMap_Generator $generator
|
44 |
+
*/
|
45 |
+
public function __construct(array $contentsMap, $generator){
|
46 |
+
$this->contentsMap = $contentsMap;
|
47 |
+
$this->generator = $generator;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Adds a chunk to the stack
|
52 |
+
* The $index for less.php may be different from less.js since less.php does not chunkify inputs
|
53 |
+
*
|
54 |
+
* @param string $chunk
|
55 |
+
* @param string $fileInfo
|
56 |
+
* @param integer $index
|
57 |
+
* @param mixed $mapLines
|
58 |
+
*/
|
59 |
+
public function add($chunk, $fileInfo = null, $index = 0, $mapLines = null){
|
60 |
+
|
61 |
+
//ignore adding empty strings
|
62 |
+
if( $chunk === '' ){
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
$sourceLines = array();
|
68 |
+
$sourceColumns = ' ';
|
69 |
+
|
70 |
+
|
71 |
+
if( $fileInfo ){
|
72 |
+
|
73 |
+
$url = $fileInfo['currentUri'];
|
74 |
+
|
75 |
+
if( isset($this->contentsMap[$url]) ){
|
76 |
+
$inputSource = substr($this->contentsMap[$url], 0, $index);
|
77 |
+
$sourceLines = explode("\n", $inputSource);
|
78 |
+
$sourceColumns = end($sourceLines);
|
79 |
+
}else{
|
80 |
+
throw new Exception('Filename '.$url.' not in contentsMap');
|
81 |
+
}
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
$lines = explode("\n", $chunk);
|
86 |
+
$columns = end($lines);
|
87 |
+
|
88 |
+
if($fileInfo){
|
89 |
+
|
90 |
+
if(!$mapLines){
|
91 |
+
$this->generator->addMapping(
|
92 |
+
$this->lineNumber + 1, // generated_line
|
93 |
+
$this->column, // generated_column
|
94 |
+
count($sourceLines), // original_line
|
95 |
+
strlen($sourceColumns), // original_column
|
96 |
+
$fileInfo
|
97 |
+
);
|
98 |
+
}else{
|
99 |
+
for($i = 0, $count = count($lines); $i < $count; $i++){
|
100 |
+
$this->generator->addMapping(
|
101 |
+
$this->lineNumber + $i + 1, // generated_line
|
102 |
+
$i === 0 ? $this->column : 0, // generated_column
|
103 |
+
count($sourceLines) + $i, // original_line
|
104 |
+
$i === 0 ? strlen($sourceColumns) : 0, // original_column
|
105 |
+
$fileInfo
|
106 |
+
);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
if(count($lines) === 1){
|
112 |
+
$this->column += strlen($columns);
|
113 |
+
}else{
|
114 |
+
$this->lineNumber += count($lines) - 1;
|
115 |
+
$this->column = strlen($columns);
|
116 |
+
}
|
117 |
+
|
118 |
+
// add only chunk
|
119 |
+
parent::add($chunk);
|
120 |
+
}
|
121 |
+
|
122 |
+
}
|
base/inc/lib/Less/Parser.php
ADDED
@@ -0,0 +1,2816 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/Cache.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class for parsing and compiling less files into css
|
7 |
+
*
|
8 |
+
* @package Less
|
9 |
+
* @subpackage parser
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class Less_Parser{
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Default parser options
|
17 |
+
*/
|
18 |
+
public static $default_options = array(
|
19 |
+
'compress' => false, // option - whether to compress
|
20 |
+
'strictUnits' => false, // whether units need to evaluate correctly
|
21 |
+
'strictMath' => false, // whether math has to be within parenthesis
|
22 |
+
'relativeUrls' => true, // option - whether to adjust URL's to be relative
|
23 |
+
'urlArgs' => '', // whether to add args into url tokens
|
24 |
+
'numPrecision' => 8,
|
25 |
+
|
26 |
+
'import_dirs' => array(),
|
27 |
+
'import_callback' => null,
|
28 |
+
'cache_dir' => null,
|
29 |
+
'cache_method' => 'php', // false, 'serialize', 'php', 'var_export', 'callback';
|
30 |
+
'cache_callback_get' => null,
|
31 |
+
'cache_callback_set' => null,
|
32 |
+
|
33 |
+
'sourceMap' => false, // whether to output a source map
|
34 |
+
'sourceMapBasepath' => null,
|
35 |
+
'sourceMapWriteTo' => null,
|
36 |
+
'sourceMapURL' => null,
|
37 |
+
|
38 |
+
'indentation' => ' ',
|
39 |
+
|
40 |
+
'plugins' => array(),
|
41 |
+
|
42 |
+
);
|
43 |
+
|
44 |
+
public static $options = array();
|
45 |
+
|
46 |
+
|
47 |
+
private $input; // Less input string
|
48 |
+
private $input_len; // input string length
|
49 |
+
private $pos; // current index in `input`
|
50 |
+
private $saveStack = array(); // holds state for backtracking
|
51 |
+
private $furthest;
|
52 |
+
private $mb_internal_encoding = ''; // for remember exists value of mbstring.internal_encoding
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @var Less_Environment
|
56 |
+
*/
|
57 |
+
private $env;
|
58 |
+
|
59 |
+
protected $rules = array();
|
60 |
+
|
61 |
+
private static $imports = array();
|
62 |
+
|
63 |
+
public static $has_extends = false;
|
64 |
+
|
65 |
+
public static $next_id = 0;
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Filename to contents of all parsed the files
|
69 |
+
*
|
70 |
+
* @var array
|
71 |
+
*/
|
72 |
+
public static $contentsMap = array();
|
73 |
+
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @param Less_Environment|array|null $env
|
77 |
+
*/
|
78 |
+
public function __construct( $env = null ){
|
79 |
+
|
80 |
+
// Top parser on an import tree must be sure there is one "env"
|
81 |
+
// which will then be passed around by reference.
|
82 |
+
if( $env instanceof Less_Environment ){
|
83 |
+
$this->env = $env;
|
84 |
+
}else{
|
85 |
+
$this->SetOptions(Less_Parser::$default_options);
|
86 |
+
$this->Reset( $env );
|
87 |
+
}
|
88 |
+
|
89 |
+
// mbstring.func_overload > 1 bugfix
|
90 |
+
// The encoding value must be set for each source file,
|
91 |
+
// therefore, to conserve resources and improve the speed of this design is taken here
|
92 |
+
if (ini_get('mbstring.func_overload')) {
|
93 |
+
$this->mb_internal_encoding = ini_get('mbstring.internal_encoding');
|
94 |
+
@ini_set('mbstring.internal_encoding', 'ascii');
|
95 |
+
}
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Reset the parser state completely
|
102 |
+
*
|
103 |
+
*/
|
104 |
+
public function Reset( $options = null ){
|
105 |
+
$this->rules = array();
|
106 |
+
self::$imports = array();
|
107 |
+
self::$has_extends = false;
|
108 |
+
self::$imports = array();
|
109 |
+
self::$contentsMap = array();
|
110 |
+
|
111 |
+
$this->env = new Less_Environment($options);
|
112 |
+
|
113 |
+
//set new options
|
114 |
+
if( is_array($options) ){
|
115 |
+
$this->SetOptions(Less_Parser::$default_options);
|
116 |
+
$this->SetOptions($options);
|
117 |
+
}
|
118 |
+
|
119 |
+
$this->env->Init();
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Set one or more compiler options
|
124 |
+
* options: import_dirs, cache_dir, cache_method
|
125 |
+
*
|
126 |
+
*/
|
127 |
+
public function SetOptions( $options ){
|
128 |
+
foreach($options as $option => $value){
|
129 |
+
$this->SetOption($option,$value);
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Set one compiler option
|
135 |
+
*
|
136 |
+
*/
|
137 |
+
public function SetOption($option,$value){
|
138 |
+
|
139 |
+
switch($option){
|
140 |
+
|
141 |
+
case 'import_dirs':
|
142 |
+
$this->SetImportDirs($value);
|
143 |
+
return;
|
144 |
+
|
145 |
+
case 'cache_dir':
|
146 |
+
if( is_string($value) ){
|
147 |
+
Less_Cache::SetCacheDir($value);
|
148 |
+
Less_Cache::CheckCacheDir();
|
149 |
+
}
|
150 |
+
return;
|
151 |
+
}
|
152 |
+
|
153 |
+
Less_Parser::$options[$option] = $value;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Registers a new custom function
|
158 |
+
*
|
159 |
+
* @param string $name function name
|
160 |
+
* @param callable $callback callback
|
161 |
+
*/
|
162 |
+
public function registerFunction($name, $callback) {
|
163 |
+
$this->env->functions[$name] = $callback;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Removed an already registered function
|
168 |
+
*
|
169 |
+
* @param string $name function name
|
170 |
+
*/
|
171 |
+
public function unregisterFunction($name) {
|
172 |
+
if( isset($this->env->functions[$name]) )
|
173 |
+
unset($this->env->functions[$name]);
|
174 |
+
}
|
175 |
+
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Get the current css buffer
|
179 |
+
*
|
180 |
+
* @return string
|
181 |
+
*/
|
182 |
+
public function getCss(){
|
183 |
+
|
184 |
+
$precision = ini_get('precision');
|
185 |
+
@ini_set('precision',16);
|
186 |
+
$locale = setlocale(LC_NUMERIC, 0);
|
187 |
+
setlocale(LC_NUMERIC, "C");
|
188 |
+
|
189 |
+
try {
|
190 |
+
|
191 |
+
$root = new Less_Tree_Ruleset(array(), $this->rules );
|
192 |
+
$root->root = true;
|
193 |
+
$root->firstRoot = true;
|
194 |
+
|
195 |
+
|
196 |
+
$this->PreVisitors($root);
|
197 |
+
|
198 |
+
self::$has_extends = false;
|
199 |
+
$evaldRoot = $root->compile($this->env);
|
200 |
+
|
201 |
+
|
202 |
+
|
203 |
+
$this->PostVisitors($evaldRoot);
|
204 |
+
|
205 |
+
if( Less_Parser::$options['sourceMap'] ){
|
206 |
+
$generator = new Less_SourceMap_Generator($evaldRoot, Less_Parser::$contentsMap, Less_Parser::$options );
|
207 |
+
// will also save file
|
208 |
+
// FIXME: should happen somewhere else?
|
209 |
+
$css = $generator->generateCSS();
|
210 |
+
}else{
|
211 |
+
$css = $evaldRoot->toCSS();
|
212 |
+
}
|
213 |
+
|
214 |
+
if( Less_Parser::$options['compress'] ){
|
215 |
+
$css = preg_replace('/(^(\s)+)|((\s)+$)/', '', $css);
|
216 |
+
}
|
217 |
+
|
218 |
+
} catch (Exception $exc) {
|
219 |
+
// Intentional fall-through so we can reset environment
|
220 |
+
}
|
221 |
+
|
222 |
+
//reset php settings
|
223 |
+
@ini_set('precision',$precision);
|
224 |
+
setlocale(LC_NUMERIC, $locale);
|
225 |
+
|
226 |
+
// If you previously defined $this->mb_internal_encoding
|
227 |
+
// is required to return the encoding as it was before
|
228 |
+
if ($this->mb_internal_encoding != '') {
|
229 |
+
@ini_set("mbstring.internal_encoding", $this->mb_internal_encoding);
|
230 |
+
$this->mb_internal_encoding = '';
|
231 |
+
}
|
232 |
+
|
233 |
+
// Rethrow exception after we handled resetting the environment
|
234 |
+
if (!empty($exc)) {
|
235 |
+
throw $exc;
|
236 |
+
}
|
237 |
+
|
238 |
+
return $css;
|
239 |
+
}
|
240 |
+
|
241 |
+
public function findValueOf($varName)
|
242 |
+
{
|
243 |
+
foreach($this->rules as $rule){
|
244 |
+
if(isset($rule->variable) && ($rule->variable == true) && (str_replace("@","",$rule->name) == $varName)){
|
245 |
+
return $this->getVariableValue($rule);
|
246 |
+
}
|
247 |
+
}
|
248 |
+
return null;
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
*
|
253 |
+
* this function gets the private rules variable and returns an array of the found variables
|
254 |
+
* it uses a helper method getVariableValue() that contains the logic ot fetch the value from the rule object
|
255 |
+
*
|
256 |
+
* @return array
|
257 |
+
*/
|
258 |
+
public function getVariables()
|
259 |
+
{
|
260 |
+
$variables = array();
|
261 |
+
|
262 |
+
$not_variable_type = array(
|
263 |
+
'Comment', // this include less comments ( // ) and css comments (/* */)
|
264 |
+
'Import', // do not search variables in included files @import
|
265 |
+
'Ruleset', // selectors (.someclass, #someid, …)
|
266 |
+
'Operation', //
|
267 |
+
);
|
268 |
+
|
269 |
+
// @TODO run compilation if not runned yet
|
270 |
+
foreach ($this->rules as $key => $rule) {
|
271 |
+
if (in_array($rule->type, $not_variable_type)) {
|
272 |
+
continue;
|
273 |
+
}
|
274 |
+
|
275 |
+
// Note: it seems rule->type is always Rule when variable = true
|
276 |
+
if ($rule->type == 'Rule' && $rule->variable) {
|
277 |
+
$variables[$rule->name] = $this->getVariableValue($rule);
|
278 |
+
} else {
|
279 |
+
if ($rule->type == 'Comment') {
|
280 |
+
$variables[] = $this->getVariableValue($rule);
|
281 |
+
}
|
282 |
+
}
|
283 |
+
}
|
284 |
+
return $variables;
|
285 |
+
}
|
286 |
+
|
287 |
+
public function findVarByName($var_name)
|
288 |
+
{
|
289 |
+
foreach($this->rules as $rule){
|
290 |
+
if(isset($rule->variable) && ($rule->variable == true)){
|
291 |
+
if($rule->name == $var_name){
|
292 |
+
return $this->getVariableValue($rule);
|
293 |
+
}
|
294 |
+
}
|
295 |
+
}
|
296 |
+
return null;
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
*
|
301 |
+
* This method gets the value of the less variable from the rules object.
|
302 |
+
* Since the objects vary here we add the logic for extracting the css/less value.
|
303 |
+
*
|
304 |
+
* @param $var
|
305 |
+
*
|
306 |
+
* @return bool|string
|
307 |
+
*/
|
308 |
+
private function getVariableValue($var)
|
309 |
+
{
|
310 |
+
if (!is_a($var, 'Less_Tree')) {
|
311 |
+
throw new Exception('var is not a Less_Tree object');
|
312 |
+
}
|
313 |
+
|
314 |
+
switch ($var->type) {
|
315 |
+
case 'Color':
|
316 |
+
return $this->rgb2html($var->rgb);
|
317 |
+
case 'Unit':
|
318 |
+
return $var->value. $var->unit->numerator[0];
|
319 |
+
case 'Variable':
|
320 |
+
return $this->findVarByName($var->name);
|
321 |
+
case 'Keyword':
|
322 |
+
return $var->value;
|
323 |
+
case 'Rule':
|
324 |
+
return $this->getVariableValue($var->value);
|
325 |
+
case 'Value':
|
326 |
+
$value = '';
|
327 |
+
foreach ($var->value as $sub_value) {
|
328 |
+
$value .= $this->getVariableValue($sub_value).' ';
|
329 |
+
}
|
330 |
+
return $value;
|
331 |
+
case 'Quoted':
|
332 |
+
return $var->quote.$var->value.$var->quote;
|
333 |
+
case 'Dimension':
|
334 |
+
$value = $var->value;
|
335 |
+
if ($var->unit && $var->unit->numerator) {
|
336 |
+
$value .= $var->unit->numerator[0];
|
337 |
+
}
|
338 |
+
return $value;
|
339 |
+
case 'Expression':
|
340 |
+
$value = "";
|
341 |
+
foreach($var->value as $item) {
|
342 |
+
$value .= $this->getVariableValue($item)." ";
|
343 |
+
}
|
344 |
+
return $value;
|
345 |
+
case 'Operation':
|
346 |
+
throw new Exception('getVariables() require Less to be compiled. please use $parser->getCss() before calling getVariables()');
|
347 |
+
case 'Comment':
|
348 |
+
case 'Import':
|
349 |
+
case 'Ruleset':
|
350 |
+
default:
|
351 |
+
throw new Exception("type missing in switch/case getVariableValue for ".$var->type);
|
352 |
+
}
|
353 |
+
return false;
|
354 |
+
}
|
355 |
+
|
356 |
+
private function rgb2html($r, $g=-1, $b=-1)
|
357 |
+
{
|
358 |
+
if (is_array($r) && sizeof($r) == 3)
|
359 |
+
list($r, $g, $b) = $r;
|
360 |
+
|
361 |
+
$r = intval($r); $g = intval($g);
|
362 |
+
$b = intval($b);
|
363 |
+
|
364 |
+
$r = dechex($r<0?0:($r>255?255:$r));
|
365 |
+
$g = dechex($g<0?0:($g>255?255:$g));
|
366 |
+
$b = dechex($b<0?0:($b>255?255:$b));
|
367 |
+
|
368 |
+
$color = (strlen($r) < 2?'0':'').$r;
|
369 |
+
$color .= (strlen($g) < 2?'0':'').$g;
|
370 |
+
$color .= (strlen($b) < 2?'0':'').$b;
|
371 |
+
return '#'.$color;
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Run pre-compile visitors
|
376 |
+
*
|
377 |
+
*/
|
378 |
+
private function PreVisitors($root){
|
379 |
+
|
380 |
+
if( Less_Parser::$options['plugins'] ){
|
381 |
+
foreach(Less_Parser::$options['plugins'] as $plugin){
|
382 |
+
if( !empty($plugin->isPreEvalVisitor) ){
|
383 |
+
$plugin->run($root);
|
384 |
+
}
|
385 |
+
}
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Run post-compile visitors
|
392 |
+
*
|
393 |
+
*/
|
394 |
+
private function PostVisitors($evaldRoot){
|
395 |
+
|
396 |
+
$visitors = array();
|
397 |
+
$visitors[] = new Less_Visitor_joinSelector();
|
398 |
+
if( self::$has_extends ){
|
399 |
+
$visitors[] = new Less_Visitor_processExtends();
|
400 |
+
}
|
401 |
+
$visitors[] = new Less_Visitor_toCSS();
|
402 |
+
|
403 |
+
|
404 |
+
if( Less_Parser::$options['plugins'] ){
|
405 |
+
foreach(Less_Parser::$options['plugins'] as $plugin){
|
406 |
+
if( property_exists($plugin,'isPreEvalVisitor') && $plugin->isPreEvalVisitor ){
|
407 |
+
continue;
|
408 |
+
}
|
409 |
+
|
410 |
+
if( property_exists($plugin,'isPreVisitor') && $plugin->isPreVisitor ){
|
411 |
+
array_unshift( $visitors, $plugin);
|
412 |
+
}else{
|
413 |
+
$visitors[] = $plugin;
|
414 |
+
}
|
415 |
+
}
|
416 |
+
}
|
417 |
+
|
418 |
+
|
419 |
+
for($i = 0; $i < count($visitors); $i++ ){
|
420 |
+
$visitors[$i]->run($evaldRoot);
|
421 |
+
}
|
422 |
+
|
423 |
+
}
|
424 |
+
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Parse a Less string into css
|
428 |
+
*
|
429 |
+
* @param string $str The string to convert
|
430 |
+
* @param string $uri_root The url of the file
|
431 |
+
* @return Less_Tree_Ruleset|Less_Parser
|
432 |
+
*/
|
433 |
+
public function parse( $str, $file_uri = null ){
|
434 |
+
|
435 |
+
if( !$file_uri ){
|
436 |
+
$uri_root = '';
|
437 |
+
$filename = 'anonymous-file-'.Less_Parser::$next_id++.'.less';
|
438 |
+
}else{
|
439 |
+
$file_uri = self::WinPath($file_uri);
|
440 |
+
$filename = $file_uri;
|
441 |
+
$uri_root = dirname($file_uri);
|
442 |
+
}
|
443 |
+
|
444 |
+
$previousFileInfo = $this->env->currentFileInfo;
|
445 |
+
$uri_root = self::WinPath($uri_root);
|
446 |
+
$this->SetFileInfo($filename, $uri_root);
|
447 |
+
|
448 |
+
$this->input = $str;
|
449 |
+
$this->_parse();
|
450 |
+
|
451 |
+
if( $previousFileInfo ){
|
452 |
+
$this->env->currentFileInfo = $previousFileInfo;
|
453 |
+
}
|
454 |
+
|
455 |
+
return $this;
|
456 |
+
}
|
457 |
+
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Parse a Less string from a given file
|
461 |
+
*
|
462 |
+
* @throws Less_Exception_Parser
|
463 |
+
* @param string $filename The file to parse
|
464 |
+
* @param string $uri_root The url of the file
|
465 |
+
* @param bool $returnRoot Indicates whether the return value should be a css string a root node
|
466 |
+
* @return Less_Tree_Ruleset|Less_Parser
|
467 |
+
*/
|
468 |
+
public function parseFile( $filename, $uri_root = '', $returnRoot = false){
|
469 |
+
|
470 |
+
if( !file_exists($filename) ){
|
471 |
+
$this->Error(sprintf('File `%s` not found.', $filename));
|
472 |
+
}
|
473 |
+
|
474 |
+
|
475 |
+
// fix uri_root?
|
476 |
+
// Instead of The mixture of file path for the first argument and directory path for the second argument has bee
|
477 |
+
if( !$returnRoot && !empty($uri_root) && basename($uri_root) == basename($filename) ){
|
478 |
+
$uri_root = dirname($uri_root);
|
479 |
+
}
|
480 |
+
|
481 |
+
|
482 |
+
$previousFileInfo = $this->env->currentFileInfo;
|
483 |
+
|
484 |
+
|
485 |
+
if( $filename ){
|
486 |
+
$filename = self::AbsPath($filename, true);
|
487 |
+
}
|
488 |
+
$uri_root = self::WinPath($uri_root);
|
489 |
+
|
490 |
+
$this->SetFileInfo($filename, $uri_root);
|
491 |
+
|
492 |
+
self::AddParsedFile($filename);
|
493 |
+
|
494 |
+
if( $returnRoot ){
|
495 |
+
$rules = $this->GetRules( $filename );
|
496 |
+
$return = new Less_Tree_Ruleset(array(), $rules );
|
497 |
+
}else{
|
498 |
+
$this->_parse( $filename );
|
499 |
+
$return = $this;
|
500 |
+
}
|
501 |
+
|
502 |
+
if( $previousFileInfo ){
|
503 |
+
$this->env->currentFileInfo = $previousFileInfo;
|
504 |
+
}
|
505 |
+
|
506 |
+
return $return;
|
507 |
+
}
|
508 |
+
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Allows a user to set variables values
|
512 |
+
* @param array $vars
|
513 |
+
* @return Less_Parser
|
514 |
+
*/
|
515 |
+
public function ModifyVars( $vars ){
|
516 |
+
|
517 |
+
$this->input = Less_Parser::serializeVars( $vars );
|
518 |
+
$this->_parse();
|
519 |
+
|
520 |
+
return $this;
|
521 |
+
}
|
522 |
+
|
523 |
+
|
524 |
+
/**
|
525 |
+
* @param string $filename
|
526 |
+
*/
|
527 |
+
public function SetFileInfo( $filename, $uri_root = ''){
|
528 |
+
|
529 |
+
$filename = Less_Environment::normalizePath($filename);
|
530 |
+
$dirname = preg_replace('/[^\/\\\\]*$/','',$filename);
|
531 |
+
|
532 |
+
if( !empty($uri_root) ){
|
533 |
+
$uri_root = rtrim($uri_root,'/').'/';
|
534 |
+
}
|
535 |
+
|
536 |
+
$currentFileInfo = array();
|
537 |
+
|
538 |
+
//entry info
|
539 |
+
if( isset($this->env->currentFileInfo) ){
|
540 |
+
$currentFileInfo['entryPath'] = $this->env->currentFileInfo['entryPath'];
|
541 |
+
$currentFileInfo['entryUri'] = $this->env->currentFileInfo['entryUri'];
|
542 |
+
$currentFileInfo['rootpath'] = $this->env->currentFileInfo['rootpath'];
|
543 |
+
|
544 |
+
}else{
|
545 |
+
$currentFileInfo['entryPath'] = $dirname;
|
546 |
+
$currentFileInfo['entryUri'] = $uri_root;
|
547 |
+
$currentFileInfo['rootpath'] = $dirname;
|
548 |
+
}
|
549 |
+
|
550 |
+
$currentFileInfo['currentDirectory'] = $dirname;
|
551 |
+
$currentFileInfo['currentUri'] = $uri_root.basename($filename);
|
552 |
+
$currentFileInfo['filename'] = $filename;
|
553 |
+
$currentFileInfo['uri_root'] = $uri_root;
|
554 |
+
|
555 |
+
|
556 |
+
//inherit reference
|
557 |
+
if( isset($this->env->currentFileInfo['reference']) && $this->env->currentFileInfo['reference'] ){
|
558 |
+
$currentFileInfo['reference'] = true;
|
559 |
+
}
|
560 |
+
|
561 |
+
$this->env->currentFileInfo = $currentFileInfo;
|
562 |
+
}
|
563 |
+
|
564 |
+
|
565 |
+
/**
|
566 |
+
* @deprecated 1.5.1.2
|
567 |
+
*
|
568 |
+
*/
|
569 |
+
public function SetCacheDir( $dir ){
|
570 |
+
|
571 |
+
if( !file_exists($dir) ){
|
572 |
+
if( mkdir($dir) ){
|
573 |
+
return true;
|
574 |
+
}
|
575 |
+
throw new Less_Exception_Parser('Less.php cache directory couldn\'t be created: '.$dir);
|
576 |
+
|
577 |
+
}elseif( !is_dir($dir) ){
|
578 |
+
throw new Less_Exception_Parser('Less.php cache directory doesn\'t exist: '.$dir);
|
579 |
+
|
580 |
+
}elseif( !is_writable($dir) ){
|
581 |
+
throw new Less_Exception_Parser('Less.php cache directory isn\'t writable: '.$dir);
|
582 |
+
|
583 |
+
}else{
|
584 |
+
$dir = self::WinPath($dir);
|
585 |
+
Less_Cache::$cache_dir = rtrim($dir,'/').'/';
|
586 |
+
return true;
|
587 |
+
}
|
588 |
+
}
|
589 |
+
|
590 |
+
|
591 |
+
/**
|
592 |
+
* Set a list of directories or callbacks the parser should use for determining import paths
|
593 |
+
*
|
594 |
+
* @param array $dirs
|
595 |
+
*/
|
596 |
+
public function SetImportDirs( $dirs ){
|
597 |
+
Less_Parser::$options['import_dirs'] = array();
|
598 |
+
|
599 |
+
foreach($dirs as $path => $uri_root){
|
600 |
+
|
601 |
+
$path = self::WinPath($path);
|
602 |
+
if( !empty($path) ){
|
603 |
+
$path = rtrim($path,'/').'/';
|
604 |
+
}
|
605 |
+
|
606 |
+
if ( !is_callable($uri_root) ){
|
607 |
+
$uri_root = self::WinPath($uri_root);
|
608 |
+
if( !empty($uri_root) ){
|
609 |
+
$uri_root = rtrim($uri_root,'/').'/';
|
610 |
+
}
|
611 |
+
}
|
612 |
+
|
613 |
+
Less_Parser::$options['import_dirs'][$path] = $uri_root;
|
614 |
+
}
|
615 |
+
}
|
616 |
+
|
617 |
+
/**
|
618 |
+
* @param string $file_path
|
619 |
+
*/
|
620 |
+
private function _parse( $file_path = null ){
|
621 |
+
$this->rules = array_merge($this->rules, $this->GetRules( $file_path ));
|
622 |
+
}
|
623 |
+
|
624 |
+
|
625 |
+
/**
|
626 |
+
* Return the results of parsePrimary for $file_path
|
627 |
+
* Use cache and save cached results if possible
|
628 |
+
*
|
629 |
+
* @param string|null $file_path
|
630 |
+
*/
|
631 |
+
private function GetRules( $file_path ){
|
632 |
+
|
633 |
+
$this->SetInput($file_path);
|
634 |
+
|
635 |
+
$cache_file = $this->CacheFile( $file_path );
|
636 |
+
if( $cache_file ){
|
637 |
+
if( Less_Parser::$options['cache_method'] == 'callback' ){
|
638 |
+
if( is_callable(Less_Parser::$options['cache_callback_get']) ){
|
639 |
+
$cache = call_user_func_array(
|
640 |
+
Less_Parser::$options['cache_callback_get'],
|
641 |
+
array($this, $file_path, $cache_file)
|
642 |
+
);
|
643 |
+
|
644 |
+
if( $cache ){
|
645 |
+
$this->UnsetInput();
|
646 |
+
return $cache;
|
647 |
+
}
|
648 |
+
}
|
649 |
+
|
650 |
+
}elseif( file_exists($cache_file) ){
|
651 |
+
switch(Less_Parser::$options['cache_method']){
|
652 |
+
|
653 |
+
// Using serialize
|
654 |
+
// Faster but uses more memory
|
655 |
+
case 'serialize':
|
656 |
+
$cache = unserialize(file_get_contents($cache_file));
|
657 |
+
if( $cache ){
|
658 |
+
touch($cache_file);
|
659 |
+
$this->UnsetInput();
|
660 |
+
return $cache;
|
661 |
+
}
|
662 |
+
break;
|
663 |
+
|
664 |
+
|
665 |
+
// Using generated php code
|
666 |
+
case 'var_export':
|
667 |
+
case 'php':
|
668 |
+
$this->UnsetInput();
|
669 |
+
return include($cache_file);
|
670 |
+
}
|
671 |
+
}
|
672 |
+
}
|
673 |
+
|
674 |
+
$rules = $this->parsePrimary();
|
675 |
+
|
676 |
+
if( $this->pos < $this->input_len ){
|
677 |
+
throw new Less_Exception_Chunk($this->input, null, $this->furthest, $this->env->currentFileInfo);
|
678 |
+
}
|
679 |
+
|
680 |
+
$this->UnsetInput();
|
681 |
+
|
682 |
+
|
683 |
+
//save the cache
|
684 |
+
if( $cache_file ){
|
685 |
+
if( Less_Parser::$options['cache_method'] == 'callback' ){
|
686 |
+
if( is_callable(Less_Parser::$options['cache_callback_set']) ){
|
687 |
+
call_user_func_array(
|
688 |
+
Less_Parser::$options['cache_callback_set'],
|
689 |
+
array($this, $file_path, $cache_file, $rules)
|
690 |
+
);
|
691 |
+
}
|
692 |
+
|
693 |
+
}else{
|
694 |
+
//msg('write cache file');
|
695 |
+
switch(Less_Parser::$options['cache_method']){
|
696 |
+
case 'serialize':
|
697 |
+
file_put_contents( $cache_file, serialize($rules) );
|
698 |
+
break;
|
699 |
+
case 'php':
|
700 |
+
file_put_contents( $cache_file, '<?php return '.self::ArgString($rules).'; ?>' );
|
701 |
+
break;
|
702 |
+
case 'var_export':
|
703 |
+
//Requires __set_state()
|
704 |
+
file_put_contents( $cache_file, '<?php return '.var_export($rules,true).'; ?>' );
|
705 |
+
break;
|
706 |
+
}
|
707 |
+
|
708 |
+
Less_Cache::CleanCache();
|
709 |
+
}
|
710 |
+
}
|
711 |
+
|
712 |
+
return $rules;
|
713 |
+
}
|
714 |
+
|
715 |
+
|
716 |
+
/**
|
717 |
+
* Set up the input buffer
|
718 |
+
*
|
719 |
+
*/
|
720 |
+
public function SetInput( $file_path ){
|
721 |
+
|
722 |
+
if( $file_path ){
|
723 |
+
$this->input = file_get_contents( $file_path );
|
724 |
+
}
|
725 |
+
|
726 |
+
$this->pos = $this->furthest = 0;
|
727 |
+
|
728 |
+
// Remove potential UTF Byte Order Mark
|
729 |
+
$this->input = preg_replace('/\\G\xEF\xBB\xBF/', '', $this->input);
|
730 |
+
$this->input_len = strlen($this->input);
|
731 |
+
|
732 |
+
|
733 |
+
if( Less_Parser::$options['sourceMap'] && $this->env->currentFileInfo ){
|
734 |
+
$uri = $this->env->currentFileInfo['currentUri'];
|
735 |
+
Less_Parser::$contentsMap[$uri] = $this->input;
|
736 |
+
}
|
737 |
+
|
738 |
+
}
|
739 |
+
|
740 |
+
|
741 |
+
/**
|
742 |
+
* Free up some memory
|
743 |
+
*
|
744 |
+
*/
|
745 |
+
public function UnsetInput(){
|
746 |
+
unset($this->input, $this->pos, $this->input_len, $this->furthest);
|
747 |
+
$this->saveStack = array();
|
748 |
+
}
|
749 |
+
|
750 |
+
|
751 |
+
public function CacheFile( $file_path ){
|
752 |
+
|
753 |
+
if( $file_path && $this->CacheEnabled() ){
|
754 |
+
|
755 |
+
$env = get_object_vars($this->env);
|
756 |
+
unset($env['frames']);
|
757 |
+
|
758 |
+
$parts = array();
|
759 |
+
$parts[] = $file_path;
|
760 |
+
$parts[] = filesize( $file_path );
|
761 |
+
$parts[] = filemtime( $file_path );
|
762 |
+
$parts[] = $env;
|
763 |
+
$parts[] = Less_Version::cache_version;
|
764 |
+
$parts[] = Less_Parser::$options['cache_method'];
|
765 |
+
return Less_Cache::$cache_dir . Less_Cache::$prefix . base_convert( sha1(json_encode($parts) ), 16, 36) . '.lesscache';
|
766 |
+
}
|
767 |
+
}
|
768 |
+
|
769 |
+
|
770 |
+
static function AddParsedFile($file){
|
771 |
+
self::$imports[] = $file;
|
772 |
+
}
|
773 |
+
|
774 |
+
static function AllParsedFiles(){
|
775 |
+
return self::$imports;
|
776 |
+
}
|
777 |
+
|
778 |
+
/**
|
779 |
+
* @param string $file
|
780 |
+
*/
|
781 |
+
static function FileParsed($file){
|
782 |
+
return in_array($file,self::$imports);
|
783 |
+
}
|
784 |
+
|
785 |
+
|
786 |
+
function save() {
|
787 |
+
$this->saveStack[] = $this->pos;
|
788 |
+
}
|
789 |
+
|
790 |
+
private function restore() {
|
791 |
+
$this->pos = array_pop($this->saveStack);
|
792 |
+
}
|
793 |
+
|
794 |
+
private function forget(){
|
795 |
+
array_pop($this->saveStack);
|
796 |
+
}
|
797 |
+
|
798 |
+
/**
|
799 |
+
* Determine if the character at the specified offset from the current position is a white space.
|
800 |
+
*
|
801 |
+
* @param int $offset
|
802 |
+
*
|
803 |
+
* @return bool
|
804 |
+
*/
|
805 |
+
private function isWhitespace($offset = 0) {
|
806 |
+
return strpos(" \t\n\r\v\f", $this->input[$this->pos + $offset]) !== false;
|
807 |
+
}
|
808 |
+
|
809 |
+
/**
|
810 |
+
* Parse from a token, regexp or string, and move forward if match
|
811 |
+
*
|
812 |
+
* @param array $toks
|
813 |
+
* @return array
|
814 |
+
*/
|
815 |
+
private function match($toks){
|
816 |
+
|
817 |
+
// The match is confirmed, add the match length to `this::pos`,
|
818 |
+
// and consume any extra white-space characters (' ' || '\n')
|
819 |
+
// which come after that. The reason for this is that LeSS's
|
820 |
+
// grammar is mostly white-space insensitive.
|
821 |
+
//
|
822 |
+
|
823 |
+
foreach($toks as $tok){
|
824 |
+
|
825 |
+
$char = $tok[0];
|
826 |
+
|
827 |
+
if( $char === '/' ){
|
828 |
+
$match = $this->MatchReg($tok);
|
829 |
+
|
830 |
+
if( $match ){
|
831 |
+
return count($match) === 1 ? $match[0] : $match;
|
832 |
+
}
|
833 |
+
|
834 |
+
}elseif( $char === '#' ){
|
835 |
+
$match = $this->MatchChar($tok[1]);
|
836 |
+
|
837 |
+
}else{
|
838 |
+
// Non-terminal, match using a function call
|
839 |
+
$match = $this->$tok();
|
840 |
+
|
841 |
+
}
|
842 |
+
|
843 |
+
if( $match ){
|
844 |
+
return $match;
|
845 |
+
}
|
846 |
+
}
|
847 |
+
}
|
848 |
+
|
849 |
+
/**
|
850 |
+
* @param string[] $toks
|
851 |
+
*
|
852 |
+
* @return string
|
853 |
+
*/
|
854 |
+
private function MatchFuncs($toks){
|
855 |
+
|
856 |
+
if( $this->pos < $this->input_len ){
|
857 |
+
foreach($toks as $tok){
|
858 |
+
$match = $this->$tok();
|
859 |
+
if( $match ){
|
860 |
+
return $match;
|
861 |
+
}
|
862 |
+
}
|
863 |
+
}
|
864 |
+
|
865 |
+
}
|
866 |
+
|
867 |
+
// Match a single character in the input,
|
868 |
+
private function MatchChar($tok){
|
869 |
+
if( ($this->pos < $this->input_len) && ($this->input[$this->pos] === $tok) ){
|
870 |
+
$this->skipWhitespace(1);
|
871 |
+
return $tok;
|
872 |
+
}
|
873 |
+
}
|
874 |
+
|
875 |
+
// Match a regexp from the current start point
|
876 |
+
private function MatchReg($tok){
|
877 |
+
|
878 |
+
if( preg_match($tok, $this->input, $match, 0, $this->pos) ){
|
879 |
+
$this->skipWhitespace(strlen($match[0]));
|
880 |
+
return $match;
|
881 |
+
}
|
882 |
+
}
|
883 |
+
|
884 |
+
|
885 |
+
/**
|
886 |
+
* Same as match(), but don't change the state of the parser,
|
887 |
+
* just return the match.
|
888 |
+
*
|
889 |
+
* @param string $tok
|
890 |
+
* @return integer
|
891 |
+
*/
|
892 |
+
public function PeekReg($tok){
|
893 |
+
return preg_match($tok, $this->input, $match, 0, $this->pos);
|
894 |
+
}
|
895 |
+
|
896 |
+
/**
|
897 |
+
* @param string $tok
|
898 |
+
*/
|
899 |
+
public function PeekChar($tok){
|
900 |
+
//return ($this->input[$this->pos] === $tok );
|
901 |
+
return ($this->pos < $this->input_len) && ($this->input[$this->pos] === $tok );
|
902 |
+
}
|
903 |
+
|
904 |
+
|
905 |
+
/**
|
906 |
+
* @param integer $length
|
907 |
+
*/
|
908 |
+
public function skipWhitespace($length){
|
909 |
+
|
910 |
+
$this->pos += $length;
|
911 |
+
|
912 |
+
for(; $this->pos < $this->input_len; $this->pos++ ){
|
913 |
+
$c = $this->input[$this->pos];
|
914 |
+
|
915 |
+
if( ($c !== "\n") && ($c !== "\r") && ($c !== "\t") && ($c !== ' ') ){
|
916 |
+
break;
|
917 |
+
}
|
918 |
+
}
|
919 |
+
}
|
920 |
+
|
921 |
+
|
922 |
+
/**
|
923 |
+
* @param string $tok
|
924 |
+
* @param string|null $msg
|
925 |
+
*/
|
926 |
+
public function expect($tok, $msg = NULL) {
|
927 |
+
$result = $this->match( array($tok) );
|
928 |
+
if (!$result) {
|
929 |
+
$this->Error( $msg ? "Expected '" . $tok . "' got '" . $this->input[$this->pos] . "'" : $msg );
|
930 |
+
} else {
|
931 |
+
return $result;
|
932 |
+
}
|
933 |
+
}
|
934 |
+
|
935 |
+
/**
|
936 |
+
* @param string $tok
|
937 |
+
*/
|
938 |
+
public function expectChar($tok, $msg = null ){
|
939 |
+
$result = $this->MatchChar($tok);
|
940 |
+
if( !$result ){
|
941 |
+
$msg = $msg ? $msg : "Expected '" . $tok . "' got '" . $this->input[$this->pos] . "'";
|
942 |
+
$this->Error( $msg );
|
943 |
+
}else{
|
944 |
+
return $result;
|
945 |
+
}
|
946 |
+
}
|
947 |
+
|
948 |
+
//
|
949 |
+
// Here in, the parsing rules/functions
|
950 |
+
//
|
951 |
+
// The basic structure of the syntax tree generated is as follows:
|
952 |
+
//
|
953 |
+
// Ruleset -> Rule -> Value -> Expression -> Entity
|
954 |
+
//
|
955 |
+
// Here's some LESS code:
|
956 |
+
//
|
957 |
+
// .class {
|
958 |
+
// color: #fff;
|
959 |
+
// border: 1px solid #000;
|
960 |
+
// width: @w + 4px;
|
961 |
+
// > .child {...}
|
962 |
+
// }
|
963 |
+
//
|
964 |
+
// And here's what the parse tree might look like:
|
965 |
+
//
|
966 |
+
// Ruleset (Selector '.class', [
|
967 |
+
// Rule ("color", Value ([Expression [Color #fff]]))
|
968 |
+
// Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]]))
|
969 |
+
// Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]]))
|
970 |
+
// Ruleset (Selector [Element '>', '.child'], [...])
|
971 |
+
// ])
|
972 |
+
//
|
973 |
+
// In general, most rules will try to parse a token with the `$()` function, and if the return
|
974 |
+
// value is truly, will return a new node, of the relevant type. Sometimes, we need to check
|
975 |
+
// first, before parsing, that's when we use `peek()`.
|
976 |
+
//
|
977 |
+
|
978 |
+
//
|
979 |
+
// The `primary` rule is the *entry* and *exit* point of the parser.
|
980 |
+
// The rules here can appear at any level of the parse tree.
|
981 |
+
//
|
982 |
+
// The recursive nature of the grammar is an interplay between the `block`
|
983 |
+
// rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
|
984 |
+
// as represented by this simplified grammar:
|
985 |
+
//
|
986 |
+
// primary → (ruleset | rule)+
|
987 |
+
// ruleset → selector+ block
|
988 |
+
// block → '{' primary '}'
|
989 |
+
//
|
990 |
+
// Only at one point is the primary rule not called from the
|
991 |
+
// block rule: at the root level.
|
992 |
+
//
|
993 |
+
private function parsePrimary(){
|
994 |
+
$root = array();
|
995 |
+
|
996 |
+
while( true ){
|
997 |
+
|
998 |
+
if( $this->pos >= $this->input_len ){
|
999 |
+
break;
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
$node = $this->parseExtend(true);
|
1003 |
+
if( $node ){
|
1004 |
+
$root = array_merge($root,$node);
|
1005 |
+
continue;
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
//$node = $this->MatchFuncs( array( 'parseMixinDefinition', 'parseRule', 'parseRuleset', 'parseMixinCall', 'parseComment', 'parseDirective'));
|
1009 |
+
$node = $this->MatchFuncs( array( 'parseMixinDefinition', 'parseNameValue', 'parseRule', 'parseRuleset', 'parseMixinCall', 'parseComment', 'parseRulesetCall', 'parseDirective'));
|
1010 |
+
|
1011 |
+
if( $node ){
|
1012 |
+
$root[] = $node;
|
1013 |
+
}elseif( !$this->MatchReg('/\\G[\s\n;]+/') ){
|
1014 |
+
break;
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
if( $this->PeekChar('}') ){
|
1018 |
+
break;
|
1019 |
+
}
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
return $root;
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
|
1026 |
+
|
1027 |
+
// We create a Comment node for CSS comments `/* */`,
|
1028 |
+
// but keep the LeSS comments `//` silent, by just skipping
|
1029 |
+
// over them.
|
1030 |
+
private function parseComment(){
|
1031 |
+
|
1032 |
+
if( $this->input[$this->pos] !== '/' ){
|
1033 |
+
return;
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
if( $this->input[$this->pos+1] === '/' ){
|
1037 |
+
$match = $this->MatchReg('/\\G\/\/.*/');
|
1038 |
+
return $this->NewObj4('Less_Tree_Comment',array($match[0], true, $this->pos, $this->env->currentFileInfo));
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
//$comment = $this->MatchReg('/\\G\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/');
|
1042 |
+
$comment = $this->MatchReg('/\\G\/\*(?s).*?\*+\/\n?/');//not the same as less.js to prevent fatal errors
|
1043 |
+
if( $comment ){
|
1044 |
+
return $this->NewObj4('Less_Tree_Comment',array($comment[0], false, $this->pos, $this->env->currentFileInfo));
|
1045 |
+
}
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
private function parseComments(){
|
1049 |
+
$comments = array();
|
1050 |
+
|
1051 |
+
while( $this->pos < $this->input_len ){
|
1052 |
+
$comment = $this->parseComment();
|
1053 |
+
if( !$comment ){
|
1054 |
+
break;
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
$comments[] = $comment;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
return $comments;
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
|
1064 |
+
|
1065 |
+
//
|
1066 |
+
// A string, which supports escaping " and '
|
1067 |
+
//
|
1068 |
+
// "milky way" 'he\'s the one!'
|
1069 |
+
//
|
1070 |
+
private function parseEntitiesQuoted() {
|
1071 |
+
$j = $this->pos;
|
1072 |
+
$e = false;
|
1073 |
+
$index = $this->pos;
|
1074 |
+
|
1075 |
+
if( $this->input[$this->pos] === '~' ){
|
1076 |
+
$j++;
|
1077 |
+
$e = true; // Escaped strings
|
1078 |
+
}
|
1079 |
+
|
1080 |
+
$char = $this->input[$j];
|
1081 |
+
if( $char !== '"' && $char !== "'" ){
|
1082 |
+
return;
|
1083 |
+
}
|
1084 |
+
|
1085 |
+
if ($e) {
|
1086 |
+
$this->MatchChar('~');
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
|
1090 |
+
$matched = $this->MatchQuoted($char, $j+1);
|
1091 |
+
if( $matched === false ){
|
1092 |
+
return;
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
$quoted = $char.$matched.$char;
|
1096 |
+
return $this->NewObj5('Less_Tree_Quoted',array($quoted, $matched, $e, $index, $this->env->currentFileInfo) );
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
|
1100 |
+
/**
|
1101 |
+
* When PCRE JIT is enabled in php, regular expressions don't work for matching quoted strings
|
1102 |
+
*
|
1103 |
+
* $regex = '/\\G\'((?:[^\'\\\\\r\n]|\\\\.|\\\\\r\n|\\\\[\n\r\f])*)\'/';
|
1104 |
+
* $regex = '/\\G"((?:[^"\\\\\r\n]|\\\\.|\\\\\r\n|\\\\[\n\r\f])*)"/';
|
1105 |
+
*
|
1106 |
+
*/
|
1107 |
+
private function MatchQuoted($quote_char, $i){
|
1108 |
+
|
1109 |
+
$matched = '';
|
1110 |
+
while( $i < $this->input_len ){
|
1111 |
+
$c = $this->input[$i];
|
1112 |
+
|
1113 |
+
//escaped character
|
1114 |
+
if( $c === '\\' ){
|
1115 |
+
$matched .= $c . $this->input[$i+1];
|
1116 |
+
$i += 2;
|
1117 |
+
continue;
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
if( $c === $quote_char ){
|
1121 |
+
$this->pos = $i+1;
|
1122 |
+
$this->skipWhitespace(0);
|
1123 |
+
return $matched;
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
if( $c === "\r" || $c === "\n" ){
|
1127 |
+
return false;
|
1128 |
+
}
|
1129 |
+
|
1130 |
+
$i++;
|
1131 |
+
$matched .= $c;
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
return false;
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
|
1138 |
+
//
|
1139 |
+
// A catch-all word, such as:
|
1140 |
+
//
|
1141 |
+
// black border-collapse
|
1142 |
+
//
|
1143 |
+
private function parseEntitiesKeyword(){
|
1144 |
+
|
1145 |
+
//$k = $this->MatchReg('/\\G[_A-Za-z-][_A-Za-z0-9-]*/');
|
1146 |
+
$k = $this->MatchReg('/\\G%|\\G[_A-Za-z-][_A-Za-z0-9-]*/');
|
1147 |
+
if( $k ){
|
1148 |
+
$k = $k[0];
|
1149 |
+
$color = $this->fromKeyword($k);
|
1150 |
+
if( $color ){
|
1151 |
+
return $color;
|
1152 |
+
}
|
1153 |
+
return $this->NewObj1('Less_Tree_Keyword',$k);
|
1154 |
+
}
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
// duplicate of Less_Tree_Color::FromKeyword
|
1158 |
+
private function FromKeyword( $keyword ){
|
1159 |
+
$keyword = strtolower($keyword);
|
1160 |
+
|
1161 |
+
if( Less_Colors::hasOwnProperty($keyword) ){
|
1162 |
+
// detect named color
|
1163 |
+
return $this->NewObj1('Less_Tree_Color',substr(Less_Colors::color($keyword), 1));
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
if( $keyword === 'transparent' ){
|
1167 |
+
return $this->NewObj3('Less_Tree_Color', array( array(0, 0, 0), 0, true));
|
1168 |
+
}
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
//
|
1172 |
+
// A function call
|
1173 |
+
//
|
1174 |
+
// rgb(255, 0, 255)
|
1175 |
+
//
|
1176 |
+
// We also try to catch IE's `alpha()`, but let the `alpha` parser
|
1177 |
+
// deal with the details.
|
1178 |
+
//
|
1179 |
+
// The arguments are parsed with the `entities.arguments` parser.
|
1180 |
+
//
|
1181 |
+
private function parseEntitiesCall(){
|
1182 |
+
$index = $this->pos;
|
1183 |
+
|
1184 |
+
if( !preg_match('/\\G([\w-]+|%|progid:[\w\.]+)\(/', $this->input, $name,0,$this->pos) ){
|
1185 |
+
return;
|
1186 |
+
}
|
1187 |
+
$name = $name[1];
|
1188 |
+
$nameLC = strtolower($name);
|
1189 |
+
|
1190 |
+
if ($nameLC === 'url') {
|
1191 |
+
return null;
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
$this->pos += strlen($name);
|
1195 |
+
|
1196 |
+
if( $nameLC === 'alpha' ){
|
1197 |
+
$alpha_ret = $this->parseAlpha();
|
1198 |
+
if( $alpha_ret ){
|
1199 |
+
return $alpha_ret;
|
1200 |
+
}
|
1201 |
+
}
|
1202 |
+
|
1203 |
+
$this->MatchChar('('); // Parse the '(' and consume whitespace.
|
1204 |
+
|
1205 |
+
$args = $this->parseEntitiesArguments();
|
1206 |
+
|
1207 |
+
if( !$this->MatchChar(')') ){
|
1208 |
+
return;
|
1209 |
+
}
|
1210 |
+
|
1211 |
+
if ($name) {
|
1212 |
+
return $this->NewObj4('Less_Tree_Call',array($name, $args, $index, $this->env->currentFileInfo) );
|
1213 |
+
}
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
/**
|
1217 |
+
* Parse a list of arguments
|
1218 |
+
*
|
1219 |
+
* @return array
|
1220 |
+
*/
|
1221 |
+
private function parseEntitiesArguments(){
|
1222 |
+
|
1223 |
+
$args = array();
|
1224 |
+
while( true ){
|
1225 |
+
$arg = $this->MatchFuncs( array('parseEntitiesAssignment','parseExpression') );
|
1226 |
+
if( !$arg ){
|
1227 |
+
break;
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
$args[] = $arg;
|
1231 |
+
if( !$this->MatchChar(',') ){
|
1232 |
+
break;
|
1233 |
+
}
|
1234 |
+
}
|
1235 |
+
return $args;
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
private function parseEntitiesLiteral(){
|
1239 |
+
return $this->MatchFuncs( array('parseEntitiesDimension','parseEntitiesColor','parseEntitiesQuoted','parseUnicodeDescriptor') );
|
1240 |
+
}
|
1241 |
+
|
1242 |
+
// Assignments are argument entities for calls.
|
1243 |
+
// They are present in ie filter properties as shown below.
|
1244 |
+
//
|
1245 |
+
// filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )
|
1246 |
+
//
|
1247 |
+
private function parseEntitiesAssignment() {
|
1248 |
+
|
1249 |
+
$key = $this->MatchReg('/\\G\w+(?=\s?=)/');
|
1250 |
+
if( !$key ){
|
1251 |
+
return;
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
if( !$this->MatchChar('=') ){
|
1255 |
+
return;
|
1256 |
+
}
|
1257 |
+
|
1258 |
+
$value = $this->parseEntity();
|
1259 |
+
if( $value ){
|
1260 |
+
return $this->NewObj2('Less_Tree_Assignment',array($key[0], $value));
|
1261 |
+
}
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
//
|
1265 |
+
// Parse url() tokens
|
1266 |
+
//
|
1267 |
+
// We use a specific rule for urls, because they don't really behave like
|
1268 |
+
// standard function calls. The difference is that the argument doesn't have
|
1269 |
+
// to be enclosed within a string, so it can't be parsed as an Expression.
|
1270 |
+
//
|
1271 |
+
private function parseEntitiesUrl(){
|
1272 |
+
|
1273 |
+
|
1274 |
+
if( $this->input[$this->pos] !== 'u' || !$this->matchReg('/\\Gurl\(/') ){
|
1275 |
+
return;
|
1276 |
+
}
|
1277 |
+
|
1278 |
+
$value = $this->match( array('parseEntitiesQuoted','parseEntitiesVariable','/\\Gdata\:.*?[^\)]+/','/\\G(?:(?:\\\\[\(\)\'"])|[^\(\)\'"])+/') );
|
1279 |
+
if( !$value ){
|
1280 |
+
$value = '';
|
1281 |
+
}
|
1282 |
+
|
1283 |
+
|
1284 |
+
$this->expectChar(')');
|
1285 |
+
|
1286 |
+
|
1287 |
+
if( isset($value->value) || $value instanceof Less_Tree_Variable ){
|
1288 |
+
return $this->NewObj2('Less_Tree_Url',array($value, $this->env->currentFileInfo));
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
return $this->NewObj2('Less_Tree_Url', array( $this->NewObj1('Less_Tree_Anonymous',$value), $this->env->currentFileInfo) );
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
|
1295 |
+
//
|
1296 |
+
// A Variable entity, such as `@fink`, in
|
1297 |
+
//
|
1298 |
+
// width: @fink + 2px
|
1299 |
+
//
|
1300 |
+
// We use a different parser for variable definitions,
|
1301 |
+
// see `parsers.variable`.
|
1302 |
+
//
|
1303 |
+
private function parseEntitiesVariable(){
|
1304 |
+
$index = $this->pos;
|
1305 |
+
if ($this->PeekChar('@') && ($name = $this->MatchReg('/\\G@@?[\w-]+/'))) {
|
1306 |
+
return $this->NewObj3('Less_Tree_Variable', array( $name[0], $index, $this->env->currentFileInfo));
|
1307 |
+
}
|
1308 |
+
}
|
1309 |
+
|
1310 |
+
|
1311 |
+
// A variable entity using the protective {} e.g. @{var}
|
1312 |
+
private function parseEntitiesVariableCurly() {
|
1313 |
+
$index = $this->pos;
|
1314 |
+
|
1315 |
+
if( $this->input_len > ($this->pos+1) && $this->input[$this->pos] === '@' && ($curly = $this->MatchReg('/\\G@\{([\w-]+)\}/')) ){
|
1316 |
+
return $this->NewObj3('Less_Tree_Variable',array('@'.$curly[1], $index, $this->env->currentFileInfo));
|
1317 |
+
}
|
1318 |
+
}
|
1319 |
+
|
1320 |
+
//
|
1321 |
+
// A Hexadecimal color
|
1322 |
+
//
|
1323 |
+
// #4F3C2F
|
1324 |
+
//
|
1325 |
+
// `rgb` and `hsl` colors are parsed through the `entities.call` parser.
|
1326 |
+
//
|
1327 |
+
private function parseEntitiesColor(){
|
1328 |
+
if ($this->PeekChar('#') && ($rgb = $this->MatchReg('/\\G#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/'))) {
|
1329 |
+
return $this->NewObj1('Less_Tree_Color',$rgb[1]);
|
1330 |
+
}
|
1331 |
+
}
|
1332 |
+
|
1333 |
+
//
|
1334 |
+
// A Dimension, that is, a number and a unit
|
1335 |
+
//
|
1336 |
+
// 0.5em 95%
|
1337 |
+
//
|
1338 |
+
private function parseEntitiesDimension(){
|
1339 |
+
|
1340 |
+
$c = @ord($this->input[$this->pos]);
|
1341 |
+
|
1342 |
+
//Is the first char of the dimension 0-9, '.', '+' or '-'
|
1343 |
+
if (($c > 57 || $c < 43) || $c === 47 || $c == 44){
|
1344 |
+
return;
|
1345 |
+
}
|
1346 |
+
|
1347 |
+
$value = $this->MatchReg('/\\G([+-]?\d*\.?\d+)(%|[a-z]+)?/');
|
1348 |
+
if( $value ){
|
1349 |
+
|
1350 |
+
if( isset($value[2]) ){
|
1351 |
+
return $this->NewObj2('Less_Tree_Dimension', array($value[1],$value[2]));
|
1352 |
+
}
|
1353 |
+
return $this->NewObj1('Less_Tree_Dimension',$value[1]);
|
1354 |
+
}
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
|
1358 |
+
//
|
1359 |
+
// A unicode descriptor, as is used in unicode-range
|
1360 |
+
//
|
1361 |
+
// U+0?? or U+00A1-00A9
|
1362 |
+
//
|
1363 |
+
function parseUnicodeDescriptor() {
|
1364 |
+
$ud = $this->MatchReg('/\\G(U\+[0-9a-fA-F?]+)(\-[0-9a-fA-F?]+)?/');
|
1365 |
+
if( $ud ){
|
1366 |
+
return $this->NewObj1('Less_Tree_UnicodeDescriptor', $ud[0]);
|
1367 |
+
}
|
1368 |
+
}
|
1369 |
+
|
1370 |
+
|
1371 |
+
//
|
1372 |
+
// JavaScript code to be evaluated
|
1373 |
+
//
|
1374 |
+
// `window.location.href`
|
1375 |
+
//
|
1376 |
+
private function parseEntitiesJavascript(){
|
1377 |
+
$e = false;
|
1378 |
+
$j = $this->pos;
|
1379 |
+
if( $this->input[$j] === '~' ){
|
1380 |
+
$j++;
|
1381 |
+
$e = true;
|
1382 |
+
}
|
1383 |
+
if( $this->input[$j] !== '`' ){
|
1384 |
+
return;
|
1385 |
+
}
|
1386 |
+
if( $e ){
|
1387 |
+
$this->MatchChar('~');
|
1388 |
+
}
|
1389 |
+
$str = $this->MatchReg('/\\G`([^`]*)`/');
|
1390 |
+
if( $str ){
|
1391 |
+
return $this->NewObj3('Less_Tree_Javascript', array($str[1], $this->pos, $e));
|
1392 |
+
}
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
|
1396 |
+
//
|
1397 |
+
// The variable part of a variable definition. Used in the `rule` parser
|
1398 |
+
//
|
1399 |
+
// @fink:
|
1400 |
+
//
|
1401 |
+
private function parseVariable(){
|
1402 |
+
if ($this->PeekChar('@') && ($name = $this->MatchReg('/\\G(@[\w-]+)\s*:/'))) {
|
1403 |
+
return $name[1];
|
1404 |
+
}
|
1405 |
+
}
|
1406 |
+
|
1407 |
+
|
1408 |
+
//
|
1409 |
+
// The variable part of a variable definition. Used in the `rule` parser
|
1410 |
+
//
|
1411 |
+
// @fink();
|
1412 |
+
//
|
1413 |
+
private function parseRulesetCall(){
|
1414 |
+
|
1415 |
+
if( $this->input[$this->pos] === '@' && ($name = $this->MatchReg('/\\G(@[\w-]+)\s*\(\s*\)\s*;/')) ){
|
1416 |
+
return $this->NewObj1('Less_Tree_RulesetCall', $name[1] );
|
1417 |
+
}
|
1418 |
+
}
|
1419 |
+
|
1420 |
+
|
1421 |
+
//
|
1422 |
+
// extend syntax - used to extend selectors
|
1423 |
+
//
|
1424 |
+
function parseExtend($isRule = false){
|
1425 |
+
|
1426 |
+
$index = $this->pos;
|
1427 |
+
$extendList = array();
|
1428 |
+
|
1429 |
+
|
1430 |
+
if( !$this->MatchReg( $isRule ? '/\\G&:extend\(/' : '/\\G:extend\(/' ) ){ return; }
|
1431 |
+
|
1432 |
+
do{
|
1433 |
+
$option = null;
|
1434 |
+
$elements = array();
|
1435 |
+
while( true ){
|
1436 |
+
$option = $this->MatchReg('/\\G(all)(?=\s*(\)|,))/');
|
1437 |
+
if( $option ){ break; }
|
1438 |
+
$e = $this->parseElement();
|
1439 |
+
if( !$e ){ break; }
|
1440 |
+
$elements[] = $e;
|
1441 |
+
}
|
1442 |
+
|
1443 |
+
if( $option ){
|
1444 |
+
$option = $option[1];
|
1445 |
+
}
|
1446 |
+
|
1447 |
+
$extendList[] = $this->NewObj3('Less_Tree_Extend', array( $this->NewObj1('Less_Tree_Selector',$elements), $option, $index ));
|
1448 |
+
|
1449 |
+
}while( $this->MatchChar(",") );
|
1450 |
+
|
1451 |
+
$this->expect('/\\G\)/');
|
1452 |
+
|
1453 |
+
if( $isRule ){
|
1454 |
+
$this->expect('/\\G;/');
|
1455 |
+
}
|
1456 |
+
|
1457 |
+
return $extendList;
|
1458 |
+
}
|
1459 |
+
|
1460 |
+
|
1461 |
+
//
|
1462 |
+
// A Mixin call, with an optional argument list
|
1463 |
+
//
|
1464 |
+
// #mixins > .square(#fff);
|
1465 |
+
// .rounded(4px, black);
|
1466 |
+
// .button;
|
1467 |
+
//
|
1468 |
+
// The `while` loop is there because mixins can be
|
1469 |
+
// namespaced, but we only support the child and descendant
|
1470 |
+
// selector for now.
|
1471 |
+
//
|
1472 |
+
private function parseMixinCall(){
|
1473 |
+
|
1474 |
+
$char = $this->input[$this->pos];
|
1475 |
+
if( $char !== '.' && $char !== '#' ){
|
1476 |
+
return;
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
$index = $this->pos;
|
1480 |
+
$this->save(); // stop us absorbing part of an invalid selector
|
1481 |
+
|
1482 |
+
$elements = $this->parseMixinCallElements();
|
1483 |
+
|
1484 |
+
if( $elements ){
|
1485 |
+
|
1486 |
+
if( $this->MatchChar('(') ){
|
1487 |
+
$returned = $this->parseMixinArgs(true);
|
1488 |
+
$args = $returned['args'];
|
1489 |
+
$this->expectChar(')');
|
1490 |
+
}else{
|
1491 |
+
$args = array();
|
1492 |
+
}
|
1493 |
+
|
1494 |
+
$important = $this->parseImportant();
|
1495 |
+
|
1496 |
+
if( $this->parseEnd() ){
|
1497 |
+
$this->forget();
|
1498 |
+
return $this->NewObj5('Less_Tree_Mixin_Call', array( $elements, $args, $index, $this->env->currentFileInfo, $important));
|
1499 |
+
}
|
1500 |
+
}
|
1501 |
+
|
1502 |
+
$this->restore();
|
1503 |
+
}
|
1504 |
+
|
1505 |
+
|
1506 |
+
private function parseMixinCallElements(){
|
1507 |
+
$elements = array();
|
1508 |
+
$c = null;
|
1509 |
+
|
1510 |
+
while( true ){
|
1511 |
+
$elemIndex = $this->pos;
|
1512 |
+
$e = $this->MatchReg('/\\G[#.](?:[\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/');
|
1513 |
+
if( !$e ){
|
1514 |
+
break;
|
1515 |
+
}
|
1516 |
+
$elements[] = $this->NewObj4('Less_Tree_Element', array($c, $e[0], $elemIndex, $this->env->currentFileInfo));
|
1517 |
+
$c = $this->MatchChar('>');
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
return $elements;
|
1521 |
+
}
|
1522 |
+
|
1523 |
+
|
1524 |
+
|
1525 |
+
/**
|
1526 |
+
* @param boolean $isCall
|
1527 |
+
*/
|
1528 |
+
private function parseMixinArgs( $isCall ){
|
1529 |
+
$expressions = array();
|
1530 |
+
$argsSemiColon = array();
|
1531 |
+
$isSemiColonSeperated = null;
|
1532 |
+
$argsComma = array();
|
1533 |
+
$expressionContainsNamed = null;
|
1534 |
+
$name = null;
|
1535 |
+
$returner = array('args'=>array(), 'variadic'=> false);
|
1536 |
+
|
1537 |
+
$this->save();
|
1538 |
+
|
1539 |
+
while( true ){
|
1540 |
+
if( $isCall ){
|
1541 |
+
$arg = $this->MatchFuncs( array( 'parseDetachedRuleset','parseExpression' ) );
|
1542 |
+
} else {
|
1543 |
+
$this->parseComments();
|
1544 |
+
if( $this->input[ $this->pos ] === '.' && $this->MatchReg('/\\G\.{3}/') ){
|
1545 |
+
$returner['variadic'] = true;
|
1546 |
+
if( $this->MatchChar(";") && !$isSemiColonSeperated ){
|
1547 |
+
$isSemiColonSeperated = true;
|
1548 |
+
}
|
1549 |
+
|
1550 |
+
if( $isSemiColonSeperated ){
|
1551 |
+
$argsSemiColon[] = array('variadic'=>true);
|
1552 |
+
}else{
|
1553 |
+
$argsComma[] = array('variadic'=>true);
|
1554 |
+
}
|
1555 |
+
break;
|
1556 |
+
}
|
1557 |
+
$arg = $this->MatchFuncs( array('parseEntitiesVariable','parseEntitiesLiteral','parseEntitiesKeyword') );
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
if( !$arg ){
|
1561 |
+
break;
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
|
1565 |
+
$nameLoop = null;
|
1566 |
+
if( $arg instanceof Less_Tree_Expression ){
|
1567 |
+
$arg->throwAwayComments();
|
1568 |
+
}
|
1569 |
+
$value = $arg;
|
1570 |
+
$val = null;
|
1571 |
+
|
1572 |
+
if( $isCall ){
|
1573 |
+
// Variable
|
1574 |
+
if( property_exists($arg,'value') && count($arg->value) == 1 ){
|
1575 |
+
$val = $arg->value[0];
|
1576 |
+
}
|
1577 |
+
} else {
|
1578 |
+
$val = $arg;
|
1579 |
+
}
|
1580 |
+
|
1581 |
+
|
1582 |
+
if( $val instanceof Less_Tree_Variable ){
|
1583 |
+
|
1584 |
+
if( $this->MatchChar(':') ){
|
1585 |
+
if( $expressions ){
|
1586 |
+
if( $isSemiColonSeperated ){
|
1587 |
+
$this->Error('Cannot mix ; and , as delimiter types');
|
1588 |
+
}
|
1589 |
+
$expressionContainsNamed = true;
|
1590 |
+
}
|
1591 |
+
|
1592 |
+
// we do not support setting a ruleset as a default variable - it doesn't make sense
|
1593 |
+
// However if we do want to add it, there is nothing blocking it, just don't error
|
1594 |
+
// and remove isCall dependency below
|
1595 |
+
$value = null;
|
1596 |
+
if( $isCall ){
|
1597 |
+
$value = $this->parseDetachedRuleset();
|
1598 |
+
}
|
1599 |
+
if( !$value ){
|
1600 |
+
$value = $this->parseExpression();
|
1601 |
+
}
|
1602 |
+
|
1603 |
+
if( !$value ){
|
1604 |
+
if( $isCall ){
|
1605 |
+
$this->Error('could not understand value for named argument');
|
1606 |
+
} else {
|
1607 |
+
$this->restore();
|
1608 |
+
$returner['args'] = array();
|
1609 |
+
return $returner;
|
1610 |
+
}
|
1611 |
+
}
|
1612 |
+
|
1613 |
+
$nameLoop = ($name = $val->name);
|
1614 |
+
}elseif( !$isCall && $this->MatchReg('/\\G\.{3}/') ){
|
1615 |
+
$returner['variadic'] = true;
|
1616 |
+
if( $this->MatchChar(";") && !$isSemiColonSeperated ){
|
1617 |
+
$isSemiColonSeperated = true;
|
1618 |
+
}
|
1619 |
+
if( $isSemiColonSeperated ){
|
1620 |
+
$argsSemiColon[] = array('name'=> $arg->name, 'variadic' => true);
|
1621 |
+
}else{
|
1622 |
+
$argsComma[] = array('name'=> $arg->name, 'variadic' => true);
|
1623 |
+
}
|
1624 |
+
break;
|
1625 |
+
}elseif( !$isCall ){
|
1626 |
+
$name = $nameLoop = $val->name;
|
1627 |
+
$value = null;
|
1628 |
+
}
|
1629 |
+
}
|
1630 |
+
|
1631 |
+
if( $value ){
|
1632 |
+
$expressions[] = $value;
|
1633 |
+
}
|
1634 |
+
|
1635 |
+
$argsComma[] = array('name'=>$nameLoop, 'value'=>$value );
|
1636 |
+
|
1637 |
+
if( $this->MatchChar(',') ){
|
1638 |
+
continue;
|
1639 |
+
}
|
1640 |
+
|
1641 |
+
if( $this->MatchChar(';') || $isSemiColonSeperated ){
|
1642 |
+
|
1643 |
+
if( $expressionContainsNamed ){
|
1644 |
+
$this->Error('Cannot mix ; and , as delimiter types');
|
1645 |
+
}
|
1646 |
+
|
1647 |
+
$isSemiColonSeperated = true;
|
1648 |
+
|
1649 |
+
if( count($expressions) > 1 ){
|
1650 |
+
$value = $this->NewObj1('Less_Tree_Value', $expressions);
|
1651 |
+
}
|
1652 |
+
$argsSemiColon[] = array('name'=>$name, 'value'=>$value );
|
1653 |
+
|
1654 |
+
$name = null;
|
1655 |
+
$expressions = array();
|
1656 |
+
$expressionContainsNamed = false;
|
1657 |
+
}
|
1658 |
+
}
|
1659 |
+
|
1660 |
+
$this->forget();
|
1661 |
+
$returner['args'] = ($isSemiColonSeperated ? $argsSemiColon : $argsComma);
|
1662 |
+
return $returner;
|
1663 |
+
}
|
1664 |
+
|
1665 |
+
|
1666 |
+
|
1667 |
+
//
|
1668 |
+
// A Mixin definition, with a list of parameters
|
1669 |
+
//
|
1670 |
+
// .rounded (@radius: 2px, @color) {
|
1671 |
+
// ...
|
1672 |
+
// }
|
1673 |
+
//
|
1674 |
+
// Until we have a finer grained state-machine, we have to
|
1675 |
+
// do a look-ahead, to make sure we don't have a mixin call.
|
1676 |
+
// See the `rule` function for more information.
|
1677 |
+
//
|
1678 |
+
// We start by matching `.rounded (`, and then proceed on to
|
1679 |
+
// the argument list, which has optional default values.
|
1680 |
+
// We store the parameters in `params`, with a `value` key,
|
1681 |
+
// if there is a value, such as in the case of `@radius`.
|
1682 |
+
//
|
1683 |
+
// Once we've got our params list, and a closing `)`, we parse
|
1684 |
+
// the `{...}` block.
|
1685 |
+
//
|
1686 |
+
private function parseMixinDefinition(){
|
1687 |
+
$cond = null;
|
1688 |
+
|
1689 |
+
$char = $this->input[$this->pos];
|
1690 |
+
if( ($char !== '.' && $char !== '#') || ($char === '{' && $this->PeekReg('/\\G[^{]*\}/')) ){
|
1691 |
+
return;
|
1692 |
+
}
|
1693 |
+
|
1694 |
+
$this->save();
|
1695 |
+
|
1696 |
+
$match = $this->MatchReg('/\\G([#.](?:[\w-]|\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/');
|
1697 |
+
if( $match ){
|
1698 |
+
$name = $match[1];
|
1699 |
+
|
1700 |
+
$argInfo = $this->parseMixinArgs( false );
|
1701 |
+
$params = $argInfo['args'];
|
1702 |
+
$variadic = $argInfo['variadic'];
|
1703 |
+
|
1704 |
+
|
1705 |
+
// .mixincall("@{a}");
|
1706 |
+
// looks a bit like a mixin definition..
|
1707 |
+
// also
|
1708 |
+
// .mixincall(@a: {rule: set;});
|
1709 |
+
// so we have to be nice and restore
|
1710 |
+
if( !$this->MatchChar(')') ){
|
1711 |
+
$this->furthest = $this->pos;
|
1712 |
+
$this->restore();
|
1713 |
+
return;
|
1714 |
+
}
|
1715 |
+
|
1716 |
+
|
1717 |
+
$this->parseComments();
|
1718 |
+
|
1719 |
+
if ($this->MatchReg('/\\Gwhen/')) { // Guard
|
1720 |
+
$cond = $this->expect('parseConditions', 'Expected conditions');
|
1721 |
+
}
|
1722 |
+
|
1723 |
+
$ruleset = $this->parseBlock();
|
1724 |
+
|
1725 |
+
if( is_array($ruleset) ){
|
1726 |
+
$this->forget();
|
1727 |
+
return $this->NewObj5('Less_Tree_Mixin_Definition', array( $name, $params, $ruleset, $cond, $variadic));
|
1728 |
+
}
|
1729 |
+
|
1730 |
+
$this->restore();
|
1731 |
+
}else{
|
1732 |
+
$this->forget();
|
1733 |
+
}
|
1734 |
+
}
|
1735 |
+
|
1736 |
+
//
|
1737 |
+
// Entities are the smallest recognized token,
|
1738 |
+
// and can be found inside a rule's value.
|
1739 |
+
//
|
1740 |
+
private function parseEntity(){
|
1741 |
+
|
1742 |
+
return $this->MatchFuncs( array('parseEntitiesLiteral','parseEntitiesVariable','parseEntitiesUrl','parseEntitiesCall','parseEntitiesKeyword','parseEntitiesJavascript','parseComment') );
|
1743 |
+
}
|
1744 |
+
|
1745 |
+
//
|
1746 |
+
// A Rule terminator. Note that we use `peek()` to check for '}',
|
1747 |
+
// because the `block` rule will be expecting it, but we still need to make sure
|
1748 |
+
// it's there, if ';' was omitted.
|
1749 |
+
//
|
1750 |
+
private function parseEnd(){
|
1751 |
+
return $this->MatchChar(';') || $this->PeekChar('}');
|
1752 |
+
}
|
1753 |
+
|
1754 |
+
//
|
1755 |
+
// IE's alpha function
|
1756 |
+
//
|
1757 |
+
// alpha(opacity=88)
|
1758 |
+
//
|
1759 |
+
private function parseAlpha(){
|
1760 |
+
|
1761 |
+
if ( ! $this->MatchReg('/\\G\(opacity=/i')) {
|
1762 |
+
return;
|
1763 |
+
}
|
1764 |
+
|
1765 |
+
$value = $this->MatchReg('/\\G[0-9]+/');
|
1766 |
+
if( $value ){
|
1767 |
+
$value = $value[0];
|
1768 |
+
}else{
|
1769 |
+
$value = $this->parseEntitiesVariable();
|
1770 |
+
if( !$value ){
|
1771 |
+
return;
|
1772 |
+
}
|
1773 |
+
}
|
1774 |
+
|
1775 |
+
$this->expectChar(')');
|
1776 |
+
return $this->NewObj1('Less_Tree_Alpha',$value);
|
1777 |
+
}
|
1778 |
+
|
1779 |
+
|
1780 |
+
//
|
1781 |
+
// A Selector Element
|
1782 |
+
//
|
1783 |
+
// div
|
1784 |
+
// + h1
|
1785 |
+
// #socks
|
1786 |
+
// input[type="text"]
|
1787 |
+
//
|
1788 |
+
// Elements are the building blocks for Selectors,
|
1789 |
+
// they are made out of a `Combinator` (see combinator rule),
|
1790 |
+
// and an element name, such as a tag a class, or `*`.
|
1791 |
+
//
|
1792 |
+
private function parseElement(){
|
1793 |
+
$c = $this->parseCombinator();
|
1794 |
+
$index = $this->pos;
|
1795 |
+
|
1796 |
+
$e = $this->match( array('/\\G(?:\d+\.\d+|\d+)%/', '/\\G(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/',
|
1797 |
+
'#*', '#&', 'parseAttribute', '/\\G\([^()@]+\)/', '/\\G[\.#](?=@)/', 'parseEntitiesVariableCurly') );
|
1798 |
+
|
1799 |
+
if( is_null($e) ){
|
1800 |
+
$this->save();
|
1801 |
+
if( $this->MatchChar('(') ){
|
1802 |
+
if( ($v = $this->parseSelector()) && $this->MatchChar(')') ){
|
1803 |
+
$e = $this->NewObj1('Less_Tree_Paren',$v);
|
1804 |
+
$this->forget();
|
1805 |
+
}else{
|
1806 |
+
$this->restore();
|
1807 |
+
}
|
1808 |
+
}else{
|
1809 |
+
$this->forget();
|
1810 |
+
}
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
if( !is_null($e) ){
|
1814 |
+
return $this->NewObj4('Less_Tree_Element',array( $c, $e, $index, $this->env->currentFileInfo));
|
1815 |
+
}
|
1816 |
+
}
|
1817 |
+
|
1818 |
+
//
|
1819 |
+
// Combinators combine elements together, in a Selector.
|
1820 |
+
//
|
1821 |
+
// Because our parser isn't white-space sensitive, special care
|
1822 |
+
// has to be taken, when parsing the descendant combinator, ` `,
|
1823 |
+
// as it's an empty space. We have to check the previous character
|
1824 |
+
// in the input, to see if it's a ` ` character.
|
1825 |
+
//
|
1826 |
+
private function parseCombinator(){
|
1827 |
+
if( $this->pos < $this->input_len ){
|
1828 |
+
$c = $this->input[$this->pos];
|
1829 |
+
if ($c === '>' || $c === '+' || $c === '~' || $c === '|' || $c === '^' ){
|
1830 |
+
|
1831 |
+
$this->pos++;
|
1832 |
+
if( $this->input[$this->pos] === '^' ){
|
1833 |
+
$c = '^^';
|
1834 |
+
$this->pos++;
|
1835 |
+
}
|
1836 |
+
|
1837 |
+
$this->skipWhitespace(0);
|
1838 |
+
|
1839 |
+
return $c;
|
1840 |
+
}
|
1841 |
+
|
1842 |
+
if( $this->pos > 0 && $this->isWhitespace(-1) ){
|
1843 |
+
return ' ';
|
1844 |
+
}
|
1845 |
+
}
|
1846 |
+
}
|
1847 |
+
|
1848 |
+
//
|
1849 |
+
// A CSS selector (see selector below)
|
1850 |
+
// with less extensions e.g. the ability to extend and guard
|
1851 |
+
//
|
1852 |
+
private function parseLessSelector(){
|
1853 |
+
return $this->parseSelector(true);
|
1854 |
+
}
|
1855 |
+
|
1856 |
+
//
|
1857 |
+
// A CSS Selector
|
1858 |
+
//
|
1859 |
+
// .class > div + h1
|
1860 |
+
// li a:hover
|
1861 |
+
//
|
1862 |
+
// Selectors are made out of one or more Elements, see above.
|
1863 |
+
//
|
1864 |
+
private function parseSelector( $isLess = false ){
|
1865 |
+
$elements = array();
|
1866 |
+
$extendList = array();
|
1867 |
+
$condition = null;
|
1868 |
+
$when = false;
|
1869 |
+
$extend = false;
|
1870 |
+
$e = null;
|
1871 |
+
$c = null;
|
1872 |
+
$index = $this->pos;
|
1873 |
+
|
1874 |
+
while( ($isLess && ($extend = $this->parseExtend())) || ($isLess && ($when = $this->MatchReg('/\\Gwhen/') )) || ($e = $this->parseElement()) ){
|
1875 |
+
if( $when ){
|
1876 |
+
$condition = $this->expect('parseConditions', 'expected condition');
|
1877 |
+
}elseif( $condition ){
|
1878 |
+
//error("CSS guard can only be used at the end of selector");
|
1879 |
+
}elseif( $extend ){
|
1880 |
+
$extendList = array_merge($extendList,$extend);
|
1881 |
+
}else{
|
1882 |
+
//if( count($extendList) ){
|
1883 |
+
//error("Extend can only be used at the end of selector");
|
1884 |
+
//}
|
1885 |
+
if( $this->pos < $this->input_len ){
|
1886 |
+
$c = $this->input[ $this->pos ];
|
1887 |
+
}
|
1888 |
+
$elements[] = $e;
|
1889 |
+
$e = null;
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
if( $c === '{' || $c === '}' || $c === ';' || $c === ',' || $c === ')') { break; }
|
1893 |
+
}
|
1894 |
+
|
1895 |
+
if( $elements ){
|
1896 |
+
return $this->NewObj5('Less_Tree_Selector',array($elements, $extendList, $condition, $index, $this->env->currentFileInfo));
|
1897 |
+
}
|
1898 |
+
if( $extendList ) {
|
1899 |
+
$this->Error('Extend must be used to extend a selector, it cannot be used on its own');
|
1900 |
+
}
|
1901 |
+
}
|
1902 |
+
|
1903 |
+
private function parseTag(){
|
1904 |
+
return ( $tag = $this->MatchReg('/\\G[A-Za-z][A-Za-z-]*[0-9]?/') ) ? $tag : $this->MatchChar('*');
|
1905 |
+
}
|
1906 |
+
|
1907 |
+
private function parseAttribute(){
|
1908 |
+
|
1909 |
+
$val = null;
|
1910 |
+
|
1911 |
+
if( !$this->MatchChar('[') ){
|
1912 |
+
return;
|
1913 |
+
}
|
1914 |
+
|
1915 |
+
$key = $this->parseEntitiesVariableCurly();
|
1916 |
+
if( !$key ){
|
1917 |
+
$key = $this->expect('/\\G(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\\\.)+/');
|
1918 |
+
}
|
1919 |
+
|
1920 |
+
$op = $this->MatchReg('/\\G[|~*$^]?=/');
|
1921 |
+
if( $op ){
|
1922 |
+
$val = $this->match( array('parseEntitiesQuoted','/\\G[0-9]+%/','/\\G[\w-]+/','parseEntitiesVariableCurly') );
|
1923 |
+
}
|
1924 |
+
|
1925 |
+
$this->expectChar(']');
|
1926 |
+
|
1927 |
+
return $this->NewObj3('Less_Tree_Attribute',array( $key, $op[0], $val));
|
1928 |
+
}
|
1929 |
+
|
1930 |
+
//
|
1931 |
+
// The `block` rule is used by `ruleset` and `mixin.definition`.
|
1932 |
+
// It's a wrapper around the `primary` rule, with added `{}`.
|
1933 |
+
//
|
1934 |
+
private function parseBlock(){
|
1935 |
+
if( $this->MatchChar('{') ){
|
1936 |
+
$content = $this->parsePrimary();
|
1937 |
+
if( $this->MatchChar('}') ){
|
1938 |
+
return $content;
|
1939 |
+
}
|
1940 |
+
}
|
1941 |
+
}
|
1942 |
+
|
1943 |
+
private function parseBlockRuleset(){
|
1944 |
+
$block = $this->parseBlock();
|
1945 |
+
|
1946 |
+
if( $block ){
|
1947 |
+
$block = $this->NewObj2('Less_Tree_Ruleset',array( null, $block));
|
1948 |
+
}
|
1949 |
+
|
1950 |
+
return $block;
|
1951 |
+
}
|
1952 |
+
|
1953 |
+
private function parseDetachedRuleset(){
|
1954 |
+
$blockRuleset = $this->parseBlockRuleset();
|
1955 |
+
if( $blockRuleset ){
|
1956 |
+
return $this->NewObj1('Less_Tree_DetachedRuleset',$blockRuleset);
|
1957 |
+
}
|
1958 |
+
}
|
1959 |
+
|
1960 |
+
//
|
1961 |
+
// div, .class, body > p {...}
|
1962 |
+
//
|
1963 |
+
private function parseRuleset(){
|
1964 |
+
$selectors = array();
|
1965 |
+
|
1966 |
+
$this->save();
|
1967 |
+
|
1968 |
+
while( true ){
|
1969 |
+
$s = $this->parseLessSelector();
|
1970 |
+
if( !$s ){
|
1971 |
+
break;
|
1972 |
+
}
|
1973 |
+
$selectors[] = $s;
|
1974 |
+
$this->parseComments();
|
1975 |
+
|
1976 |
+
if( $s->condition && count($selectors) > 1 ){
|
1977 |
+
$this->Error('Guards are only currently allowed on a single selector.');
|
1978 |
+
}
|
1979 |
+
|
1980 |
+
if( !$this->MatchChar(',') ){
|
1981 |
+
break;
|
1982 |
+
}
|
1983 |
+
if( $s->condition ){
|
1984 |
+
$this->Error('Guards are only currently allowed on a single selector.');
|
1985 |
+
}
|
1986 |
+
$this->parseComments();
|
1987 |
+
}
|
1988 |
+
|
1989 |
+
|
1990 |
+
if( $selectors ){
|
1991 |
+
$rules = $this->parseBlock();
|
1992 |
+
if( is_array($rules) ){
|
1993 |
+
$this->forget();
|
1994 |
+
return $this->NewObj2('Less_Tree_Ruleset',array( $selectors, $rules)); //Less_Environment::$strictImports
|
1995 |
+
}
|
1996 |
+
}
|
1997 |
+
|
1998 |
+
// Backtrack
|
1999 |
+
$this->furthest = $this->pos;
|
2000 |
+
$this->restore();
|
2001 |
+
}
|
2002 |
+
|
2003 |
+
/**
|
2004 |
+
* Custom less.php parse function for finding simple name-value css pairs
|
2005 |
+
* ex: width:100px;
|
2006 |
+
*
|
2007 |
+
*/
|
2008 |
+
private function parseNameValue(){
|
2009 |
+
|
2010 |
+
$index = $this->pos;
|
2011 |
+
$this->save();
|
2012 |
+
|
2013 |
+
|
2014 |
+
//$match = $this->MatchReg('/\\G([a-zA-Z\-]+)\s*:\s*((?:\'")?[a-zA-Z0-9\-% \.,!]+?(?:\'")?)\s*([;}])/');
|
2015 |
+
$match = $this->MatchReg('/\\G([a-zA-Z\-]+)\s*:\s*([\'"]?[#a-zA-Z0-9\-%\.,]+?[\'"]?) *(! *important)?\s*([;}])/');
|
2016 |
+
if( $match ){
|
2017 |
+
|
2018 |
+
if( $match[4] == '}' ){
|
2019 |
+
$this->pos = $index + strlen($match[0])-1;
|
2020 |
+
}
|
2021 |
+
|
2022 |
+
if( $match[3] ){
|
2023 |
+
$match[2] .= ' !important';
|
2024 |
+
}
|
2025 |
+
|
2026 |
+
return $this->NewObj4('Less_Tree_NameValue',array( $match[1], $match[2], $index, $this->env->currentFileInfo));
|
2027 |
+
}
|
2028 |
+
|
2029 |
+
$this->restore();
|
2030 |
+
}
|
2031 |
+
|
2032 |
+
|
2033 |
+
private function parseRule( $tryAnonymous = null ){
|
2034 |
+
|
2035 |
+
$merge = false;
|
2036 |
+
$startOfRule = $this->pos;
|
2037 |
+
|
2038 |
+
$c = $this->input[$this->pos];
|
2039 |
+
if( $c === '.' || $c === '#' || $c === '&' ){
|
2040 |
+
return;
|
2041 |
+
}
|
2042 |
+
|
2043 |
+
$this->save();
|
2044 |
+
$name = $this->MatchFuncs( array('parseVariable','parseRuleProperty'));
|
2045 |
+
|
2046 |
+
if( $name ){
|
2047 |
+
|
2048 |
+
$isVariable = is_string($name);
|
2049 |
+
|
2050 |
+
$value = null;
|
2051 |
+
if( $isVariable ){
|
2052 |
+
$value = $this->parseDetachedRuleset();
|
2053 |
+
}
|
2054 |
+
|
2055 |
+
$important = null;
|
2056 |
+
if( !$value ){
|
2057 |
+
|
2058 |
+
// prefer to try to parse first if its a variable or we are compressing
|
2059 |
+
// but always fallback on the other one
|
2060 |
+
//if( !$tryAnonymous && is_string($name) && $name[0] === '@' ){
|
2061 |
+
if( !$tryAnonymous && (Less_Parser::$options['compress'] || $isVariable) ){
|
2062 |
+
$value = $this->MatchFuncs( array('parseValue','parseAnonymousValue'));
|
2063 |
+
}else{
|
2064 |
+
$value = $this->MatchFuncs( array('parseAnonymousValue','parseValue'));
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
$important = $this->parseImportant();
|
2068 |
+
|
2069 |
+
// a name returned by this.ruleProperty() is always an array of the form:
|
2070 |
+
// [string-1, ..., string-n, ""] or [string-1, ..., string-n, "+"]
|
2071 |
+
// where each item is a tree.Keyword or tree.Variable
|
2072 |
+
if( !$isVariable && is_array($name) ){
|
2073 |
+
$nm = array_pop($name);
|
2074 |
+
if( $nm->value ){
|
2075 |
+
$merge = $nm->value;
|
2076 |
+
}
|
2077 |
+
}
|
2078 |
+
}
|
2079 |
+
|
2080 |
+
|
2081 |
+
if( $value && $this->parseEnd() ){
|
2082 |
+
$this->forget();
|
2083 |
+
return $this->NewObj6('Less_Tree_Rule',array( $name, $value, $important, $merge, $startOfRule, $this->env->currentFileInfo));
|
2084 |
+
}else{
|
2085 |
+
$this->furthest = $this->pos;
|
2086 |
+
$this->restore();
|
2087 |
+
if( $value && !$tryAnonymous ){
|
2088 |
+
return $this->parseRule(true);
|
2089 |
+
}
|
2090 |
+
}
|
2091 |
+
}else{
|
2092 |
+
$this->forget();
|
2093 |
+
}
|
2094 |
+
}
|
2095 |
+
|
2096 |
+
function parseAnonymousValue(){
|
2097 |
+
|
2098 |
+
if( preg_match('/\\G([^@+\/\'"*`(;{}-]*);/',$this->input, $match, 0, $this->pos) ){
|
2099 |
+
$this->pos += strlen($match[1]);
|
2100 |
+
return $this->NewObj1('Less_Tree_Anonymous',$match[1]);
|
2101 |
+
}
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
//
|
2105 |
+
// An @import directive
|
2106 |
+
//
|
2107 |
+
// @import "lib";
|
2108 |
+
//
|
2109 |
+
// Depending on our environment, importing is done differently:
|
2110 |
+
// In the browser, it's an XHR request, in Node, it would be a
|
2111 |
+
// file-system operation. The function used for importing is
|
2112 |
+
// stored in `import`, which we pass to the Import constructor.
|
2113 |
+
//
|
2114 |
+
private function parseImport(){
|
2115 |
+
|
2116 |
+
$this->save();
|
2117 |
+
|
2118 |
+
$dir = $this->MatchReg('/\\G@import?\s+/');
|
2119 |
+
|
2120 |
+
if( $dir ){
|
2121 |
+
$options = $this->parseImportOptions();
|
2122 |
+
$path = $this->MatchFuncs( array('parseEntitiesQuoted','parseEntitiesUrl'));
|
2123 |
+
|
2124 |
+
if( $path ){
|
2125 |
+
$features = $this->parseMediaFeatures();
|
2126 |
+
if( $this->MatchChar(';') ){
|
2127 |
+
if( $features ){
|
2128 |
+
$features = $this->NewObj1('Less_Tree_Value',$features);
|
2129 |
+
}
|
2130 |
+
|
2131 |
+
$this->forget();
|
2132 |
+
return $this->NewObj5('Less_Tree_Import',array( $path, $features, $options, $this->pos, $this->env->currentFileInfo));
|
2133 |
+
}
|
2134 |
+
}
|
2135 |
+
}
|
2136 |
+
|
2137 |
+
$this->restore();
|
2138 |
+
}
|
2139 |
+
|
2140 |
+
private function parseImportOptions(){
|
2141 |
+
|
2142 |
+
$options = array();
|
2143 |
+
|
2144 |
+
// list of options, surrounded by parens
|
2145 |
+
if( !$this->MatchChar('(') ){
|
2146 |
+
return $options;
|
2147 |
+
}
|
2148 |
+
do{
|
2149 |
+
$optionName = $this->parseImportOption();
|
2150 |
+
if( $optionName ){
|
2151 |
+
$value = true;
|
2152 |
+
switch( $optionName ){
|
2153 |
+
case "css":
|
2154 |
+
$optionName = "less";
|
2155 |
+
$value = false;
|
2156 |
+
break;
|
2157 |
+
case "once":
|
2158 |
+
$optionName = "multiple";
|
2159 |
+
$value = false;
|
2160 |
+
break;
|
2161 |
+
}
|
2162 |
+
$options[$optionName] = $value;
|
2163 |
+
if( !$this->MatchChar(',') ){ break; }
|
2164 |
+
}
|
2165 |
+
}while( $optionName );
|
2166 |
+
$this->expectChar(')');
|
2167 |
+
return $options;
|
2168 |
+
}
|
2169 |
+
|
2170 |
+
private function parseImportOption(){
|
2171 |
+
$opt = $this->MatchReg('/\\G(less|css|multiple|once|inline|reference|optional)/');
|
2172 |
+
if( $opt ){
|
2173 |
+
return $opt[1];
|
2174 |
+
}
|
2175 |
+
}
|
2176 |
+
|
2177 |
+
private function parseMediaFeature() {
|
2178 |
+
$nodes = array();
|
2179 |
+
|
2180 |
+
do{
|
2181 |
+
$e = $this->MatchFuncs(array('parseEntitiesKeyword','parseEntitiesVariable'));
|
2182 |
+
if( $e ){
|
2183 |
+
$nodes[] = $e;
|
2184 |
+
} elseif ($this->MatchChar('(')) {
|
2185 |
+
$p = $this->parseProperty();
|
2186 |
+
$e = $this->parseValue();
|
2187 |
+
if ($this->MatchChar(')')) {
|
2188 |
+
if ($p && $e) {
|
2189 |
+
$r = $this->NewObj7('Less_Tree_Rule', array( $p, $e, null, null, $this->pos, $this->env->currentFileInfo, true));
|
2190 |
+
$nodes[] = $this->NewObj1('Less_Tree_Paren',$r);
|
2191 |
+
} elseif ($e) {
|
2192 |
+
$nodes[] = $this->NewObj1('Less_Tree_Paren',$e);
|
2193 |
+
} else {
|
2194 |
+
return null;
|
2195 |
+
}
|
2196 |
+
} else
|
2197 |
+
return null;
|
2198 |
+
}
|
2199 |
+
} while ($e);
|
2200 |
+
|
2201 |
+
if ($nodes) {
|
2202 |
+
return $this->NewObj1('Less_Tree_Expression',$nodes);
|
2203 |
+
}
|
2204 |
+
}
|
2205 |
+
|
2206 |
+
private function parseMediaFeatures() {
|
2207 |
+
$features = array();
|
2208 |
+
|
2209 |
+
do{
|
2210 |
+
$e = $this->parseMediaFeature();
|
2211 |
+
if( $e ){
|
2212 |
+
$features[] = $e;
|
2213 |
+
if (!$this->MatchChar(',')) break;
|
2214 |
+
}else{
|
2215 |
+
$e = $this->parseEntitiesVariable();
|
2216 |
+
if( $e ){
|
2217 |
+
$features[] = $e;
|
2218 |
+
if (!$this->MatchChar(',')) break;
|
2219 |
+
}
|
2220 |
+
}
|
2221 |
+
} while ($e);
|
2222 |
+
|
2223 |
+
return $features ? $features : null;
|
2224 |
+
}
|
2225 |
+
|
2226 |
+
private function parseMedia() {
|
2227 |
+
if( $this->MatchReg('/\\G@media/') ){
|
2228 |
+
$features = $this->parseMediaFeatures();
|
2229 |
+
$rules = $this->parseBlock();
|
2230 |
+
|
2231 |
+
if( is_array($rules) ){
|
2232 |
+
return $this->NewObj4('Less_Tree_Media',array( $rules, $features, $this->pos, $this->env->currentFileInfo));
|
2233 |
+
}
|
2234 |
+
}
|
2235 |
+
}
|
2236 |
+
|
2237 |
+
|
2238 |
+
//
|
2239 |
+
// A CSS Directive
|
2240 |
+
//
|
2241 |
+
// @charset "utf-8";
|
2242 |
+
//
|
2243 |
+
private function parseDirective(){
|
2244 |
+
|
2245 |
+
if( !$this->PeekChar('@') ){
|
2246 |
+
return;
|
2247 |
+
}
|
2248 |
+
|
2249 |
+
$rules = null;
|
2250 |
+
$index = $this->pos;
|
2251 |
+
$hasBlock = true;
|
2252 |
+
$hasIdentifier = false;
|
2253 |
+
$hasExpression = false;
|
2254 |
+
$hasUnknown = false;
|
2255 |
+
|
2256 |
+
|
2257 |
+
$value = $this->MatchFuncs(array('parseImport','parseMedia'));
|
2258 |
+
if( $value ){
|
2259 |
+
return $value;
|
2260 |
+
}
|
2261 |
+
|
2262 |
+
$this->save();
|
2263 |
+
|
2264 |
+
$name = $this->MatchReg('/\\G@[a-z-]+/');
|
2265 |
+
|
2266 |
+
if( !$name ) return;
|
2267 |
+
$name = $name[0];
|
2268 |
+
|
2269 |
+
|
2270 |
+
$nonVendorSpecificName = $name;
|
2271 |
+
$pos = strpos($name,'-', 2);
|
2272 |
+
if( $name[1] == '-' && $pos > 0 ){
|
2273 |
+
$nonVendorSpecificName = "@" . substr($name, $pos + 1);
|
2274 |
+
}
|
2275 |
+
|
2276 |
+
|
2277 |
+
switch( $nonVendorSpecificName ){
|
2278 |
+
/*
|
2279 |
+
case "@font-face":
|
2280 |
+
case "@viewport":
|
2281 |
+
case "@top-left":
|
2282 |
+
case "@top-left-corner":
|
2283 |
+
case "@top-center":
|
2284 |
+
case "@top-right":
|
2285 |
+
case "@top-right-corner":
|
2286 |
+
case "@bottom-left":
|
2287 |
+
case "@bottom-left-corner":
|
2288 |
+
case "@bottom-center":
|
2289 |
+
case "@bottom-right":
|
2290 |
+
case "@bottom-right-corner":
|
2291 |
+
case "@left-top":
|
2292 |
+
case "@left-middle":
|
2293 |
+
case "@left-bottom":
|
2294 |
+
case "@right-top":
|
2295 |
+
case "@right-middle":
|
2296 |
+
case "@right-bottom":
|
2297 |
+
hasBlock = true;
|
2298 |
+
break;
|
2299 |
+
*/
|
2300 |
+
case "@charset":
|
2301 |
+
$hasIdentifier = true;
|
2302 |
+
$hasBlock = false;
|
2303 |
+
break;
|
2304 |
+
case "@namespace":
|
2305 |
+
$hasExpression = true;
|
2306 |
+
$hasBlock = false;
|
2307 |
+
break;
|
2308 |
+
case "@keyframes":
|
2309 |
+
$hasIdentifier = true;
|
2310 |
+
break;
|
2311 |
+
case "@host":
|
2312 |
+
case "@page":
|
2313 |
+
case "@document":
|
2314 |
+
case "@supports":
|
2315 |
+
$hasUnknown = true;
|
2316 |
+
break;
|
2317 |
+
}
|
2318 |
+
|
2319 |
+
if( $hasIdentifier ){
|
2320 |
+
$value = $this->parseEntity();
|
2321 |
+
if( !$value ){
|
2322 |
+
$this->error("expected " . $name . " identifier");
|
2323 |
+
}
|
2324 |
+
} else if( $hasExpression ){
|
2325 |
+
$value = $this->parseExpression();
|
2326 |
+
if( !$value ){
|
2327 |
+
$this->error("expected " . $name. " expression");
|
2328 |
+
}
|
2329 |
+
} else if ($hasUnknown) {
|
2330 |
+
|
2331 |
+
$value = $this->MatchReg('/\\G[^{;]+/');
|
2332 |
+
if( $value ){
|
2333 |
+
$value = $this->NewObj1('Less_Tree_Anonymous',trim($value[0]));
|
2334 |
+
}
|
2335 |
+
}
|
2336 |
+
|
2337 |
+
if( $hasBlock ){
|
2338 |
+
$rules = $this->parseBlockRuleset();
|
2339 |
+
}
|
2340 |
+
|
2341 |
+
if( $rules || (!$hasBlock && $value && $this->MatchChar(';'))) {
|
2342 |
+
$this->forget();
|
2343 |
+
return $this->NewObj5('Less_Tree_Directive',array($name, $value, $rules, $index, $this->env->currentFileInfo));
|
2344 |
+
}
|
2345 |
+
|
2346 |
+
$this->restore();
|
2347 |
+
}
|
2348 |
+
|
2349 |
+
|
2350 |
+
//
|
2351 |
+
// A Value is a comma-delimited list of Expressions
|
2352 |
+
//
|
2353 |
+
// font-family: Baskerville, Georgia, serif;
|
2354 |
+
//
|
2355 |
+
// In a Rule, a Value represents everything after the `:`,
|
2356 |
+
// and before the `;`.
|
2357 |
+
//
|
2358 |
+
private function parseValue(){
|
2359 |
+
$expressions = array();
|
2360 |
+
|
2361 |
+
do{
|
2362 |
+
$e = $this->parseExpression();
|
2363 |
+
if( $e ){
|
2364 |
+
$expressions[] = $e;
|
2365 |
+
if (! $this->MatchChar(',')) {
|
2366 |
+
break;
|
2367 |
+
}
|
2368 |
+
}
|
2369 |
+
}while($e);
|
2370 |
+
|
2371 |
+
if( $expressions ){
|
2372 |
+
return $this->NewObj1('Less_Tree_Value',$expressions);
|
2373 |
+
}
|
2374 |
+
}
|
2375 |
+
|
2376 |
+
private function parseImportant (){
|
2377 |
+
if( $this->PeekChar('!') && $this->MatchReg('/\\G! *important/') ){
|
2378 |
+
return ' !important';
|
2379 |
+
}
|
2380 |
+
}
|
2381 |
+
|
2382 |
+
private function parseSub (){
|
2383 |
+
|
2384 |
+
if( $this->MatchChar('(') ){
|
2385 |
+
$a = $this->parseAddition();
|
2386 |
+
if( $a ){
|
2387 |
+
$this->expectChar(')');
|
2388 |
+
return $this->NewObj2('Less_Tree_Expression',array( array($a), true) ); //instead of $e->parens = true so the value is cached
|
2389 |
+
}
|
2390 |
+
}
|
2391 |
+
}
|
2392 |
+
|
2393 |
+
|
2394 |
+
/**
|
2395 |
+
* Parses multiplication operation
|
2396 |
+
*
|
2397 |
+
* @return Less_Tree_Operation|null
|
2398 |
+
*/
|
2399 |
+
function parseMultiplication(){
|
2400 |
+
|
2401 |
+
$return = $m = $this->parseOperand();
|
2402 |
+
if( $return ){
|
2403 |
+
while( true ){
|
2404 |
+
|
2405 |
+
$isSpaced = $this->isWhitespace( -1 );
|
2406 |
+
|
2407 |
+
if( $this->PeekReg('/\\G\/[*\/]/') ){
|
2408 |
+
break;
|
2409 |
+
}
|
2410 |
+
|
2411 |
+
$op = $this->MatchChar('/');
|
2412 |
+
if( !$op ){
|
2413 |
+
$op = $this->MatchChar('*');
|
2414 |
+
if( !$op ){
|
2415 |
+
break;
|
2416 |
+
}
|
2417 |
+
}
|
2418 |
+
|
2419 |
+
$a = $this->parseOperand();
|
2420 |
+
|
2421 |
+
if(!$a) { break; }
|
2422 |
+
|
2423 |
+
$m->parensInOp = true;
|
2424 |
+
$a->parensInOp = true;
|
2425 |
+
$return = $this->NewObj3('Less_Tree_Operation',array( $op, array( $return, $a ), $isSpaced) );
|
2426 |
+
}
|
2427 |
+
}
|
2428 |
+
return $return;
|
2429 |
+
|
2430 |
+
}
|
2431 |
+
|
2432 |
+
|
2433 |
+
/**
|
2434 |
+
* Parses an addition operation
|
2435 |
+
*
|
2436 |
+
* @return Less_Tree_Operation|null
|
2437 |
+
*/
|
2438 |
+
private function parseAddition (){
|
2439 |
+
|
2440 |
+
$return = $m = $this->parseMultiplication();
|
2441 |
+
if( $return ){
|
2442 |
+
while( true ){
|
2443 |
+
|
2444 |
+
$isSpaced = $this->isWhitespace( -1 );
|
2445 |
+
|
2446 |
+
$op = $this->MatchReg('/\\G[-+]\s+/');
|
2447 |
+
if( $op ){
|
2448 |
+
$op = $op[0];
|
2449 |
+
}else{
|
2450 |
+
if( !$isSpaced ){
|
2451 |
+
$op = $this->match(array('#+','#-'));
|
2452 |
+
}
|
2453 |
+
if( !$op ){
|
2454 |
+
break;
|
2455 |
+
}
|
2456 |
+
}
|
2457 |
+
|
2458 |
+
$a = $this->parseMultiplication();
|
2459 |
+
if( !$a ){
|
2460 |
+
break;
|
2461 |
+
}
|
2462 |
+
|
2463 |
+
$m->parensInOp = true;
|
2464 |
+
$a->parensInOp = true;
|
2465 |
+
$return = $this->NewObj3('Less_Tree_Operation',array($op, array($return, $a), $isSpaced));
|
2466 |
+
}
|
2467 |
+
}
|
2468 |
+
|
2469 |
+
return $return;
|
2470 |
+
}
|
2471 |
+
|
2472 |
+
|
2473 |
+
/**
|
2474 |
+
* Parses the conditions
|
2475 |
+
*
|
2476 |
+
* @return Less_Tree_Condition|null
|
2477 |
+
*/
|
2478 |
+
private function parseConditions() {
|
2479 |
+
$index = $this->pos;
|
2480 |
+
$return = $a = $this->parseCondition();
|
2481 |
+
if( $a ){
|
2482 |
+
while( true ){
|
2483 |
+
if( !$this->PeekReg('/\\G,\s*(not\s*)?\(/') || !$this->MatchChar(',') ){
|
2484 |
+
break;
|
2485 |
+
}
|
2486 |
+
$b = $this->parseCondition();
|
2487 |
+
if( !$b ){
|
2488 |
+
break;
|
2489 |
+
}
|
2490 |
+
|
2491 |
+
$return = $this->NewObj4('Less_Tree_Condition',array('or', $return, $b, $index));
|
2492 |
+
}
|
2493 |
+
return $return;
|
2494 |
+
}
|
2495 |
+
}
|
2496 |
+
|
2497 |
+
private function parseCondition() {
|
2498 |
+
$index = $this->pos;
|
2499 |
+
$negate = false;
|
2500 |
+
$c = null;
|
2501 |
+
|
2502 |
+
if ($this->MatchReg('/\\Gnot/')) $negate = true;
|
2503 |
+
$this->expectChar('(');
|
2504 |
+
$a = $this->MatchFuncs(array('parseAddition','parseEntitiesKeyword','parseEntitiesQuoted'));
|
2505 |
+
|
2506 |
+
if( $a ){
|
2507 |
+
$op = $this->MatchReg('/\\G(?:>=|<=|=<|[<=>])/');
|
2508 |
+
if( $op ){
|
2509 |
+
$b = $this->MatchFuncs(array('parseAddition','parseEntitiesKeyword','parseEntitiesQuoted'));
|
2510 |
+
if( $b ){
|
2511 |
+
$c = $this->NewObj5('Less_Tree_Condition',array($op[0], $a, $b, $index, $negate));
|
2512 |
+
} else {
|
2513 |
+
$this->Error('Unexpected expression');
|
2514 |
+
}
|
2515 |
+
} else {
|
2516 |
+
$k = $this->NewObj1('Less_Tree_Keyword','true');
|
2517 |
+
$c = $this->NewObj5('Less_Tree_Condition',array('=', $a, $k, $index, $negate));
|
2518 |
+
}
|
2519 |
+
$this->expectChar(')');
|
2520 |
+
return $this->MatchReg('/\\Gand/') ? $this->NewObj3('Less_Tree_Condition',array('and', $c, $this->parseCondition())) : $c;
|
2521 |
+
}
|
2522 |
+
}
|
2523 |
+
|
2524 |
+
/**
|
2525 |
+
* An operand is anything that can be part of an operation,
|
2526 |
+
* such as a Color, or a Variable
|
2527 |
+
*
|
2528 |
+
*/
|
2529 |
+
private function parseOperand (){
|
2530 |
+
|
2531 |
+
$negate = false;
|
2532 |
+
$offset = $this->pos+1;
|
2533 |
+
if( $offset >= $this->input_len ){
|
2534 |
+
return;
|
2535 |
+
}
|
2536 |
+
$char = $this->input[$offset];
|
2537 |
+
if( $char === '@' || $char === '(' ){
|
2538 |
+
$negate = $this->MatchChar('-');
|
2539 |
+
}
|
2540 |
+
|
2541 |
+
$o = $this->MatchFuncs(array('parseSub','parseEntitiesDimension','parseEntitiesColor','parseEntitiesVariable','parseEntitiesCall'));
|
2542 |
+
|
2543 |
+
if( $negate ){
|
2544 |
+
$o->parensInOp = true;
|
2545 |
+
$o = $this->NewObj1('Less_Tree_Negative',$o);
|
2546 |
+
}
|
2547 |
+
|
2548 |
+
return $o;
|
2549 |
+
}
|
2550 |
+
|
2551 |
+
|
2552 |
+
/**
|
2553 |
+
* Expressions either represent mathematical operations,
|
2554 |
+
* or white-space delimited Entities.
|
2555 |
+
*
|
2556 |
+
* 1px solid black
|
2557 |
+
* @var * 2
|
2558 |
+
*
|
2559 |
+
* @return Less_Tree_Expression|null
|
2560 |
+
*/
|
2561 |
+
private function parseExpression (){
|
2562 |
+
$entities = array();
|
2563 |
+
|
2564 |
+
do{
|
2565 |
+
$e = $this->MatchFuncs(array('parseAddition','parseEntity'));
|
2566 |
+
if( $e ){
|
2567 |
+
$entities[] = $e;
|
2568 |
+
// operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here
|
2569 |
+
if( !$this->PeekReg('/\\G\/[\/*]/') ){
|
2570 |
+
$delim = $this->MatchChar('/');
|
2571 |
+
if( $delim ){
|
2572 |
+
$entities[] = $this->NewObj1('Less_Tree_Anonymous',$delim);
|
2573 |
+
}
|
2574 |
+
}
|
2575 |
+
}
|
2576 |
+
}while($e);
|
2577 |
+
|
2578 |
+
if( $entities ){
|
2579 |
+
return $this->NewObj1('Less_Tree_Expression',$entities);
|
2580 |
+
}
|
2581 |
+
}
|
2582 |
+
|
2583 |
+
|
2584 |
+
/**
|
2585 |
+
* Parse a property
|
2586 |
+
* eg: 'min-width', 'orientation', etc
|
2587 |
+
*
|
2588 |
+
* @return string
|
2589 |
+
*/
|
2590 |
+
private function parseProperty (){
|
2591 |
+
$name = $this->MatchReg('/\\G(\*?-?[_a-zA-Z0-9-]+)\s*:/');
|
2592 |
+
if( $name ){
|
2593 |
+
return $name[1];
|
2594 |
+
}
|
2595 |
+
}
|
2596 |
+
|
2597 |
+
|
2598 |
+
/**
|
2599 |
+
* Parse a rule property
|
2600 |
+
* eg: 'color', 'width', 'height', etc
|
2601 |
+
*
|
2602 |
+
* @return string
|
2603 |
+
*/
|
2604 |
+
private function parseRuleProperty(){
|
2605 |
+
$offset = $this->pos;
|
2606 |
+
$name = array();
|
2607 |
+
$index = array();
|
2608 |
+
$length = 0;
|
2609 |
+
|
2610 |
+
|
2611 |
+
$this->rulePropertyMatch('/\\G(\*?)/', $offset, $length, $index, $name );
|
2612 |
+
while( $this->rulePropertyMatch('/\\G((?:[\w-]+)|(?:@\{[\w-]+\}))/', $offset, $length, $index, $name )); // !
|
2613 |
+
|
2614 |
+
if( (count($name) > 1) && $this->rulePropertyMatch('/\\G\s*((?:\+_|\+)?)\s*:/', $offset, $length, $index, $name) ){
|
2615 |
+
// at last, we have the complete match now. move forward,
|
2616 |
+
// convert name particles to tree objects and return:
|
2617 |
+
$this->skipWhitespace($length);
|
2618 |
+
|
2619 |
+
if( $name[0] === '' ){
|
2620 |
+
array_shift($name);
|
2621 |
+
array_shift($index);
|
2622 |
+
}
|
2623 |
+
foreach($name as $k => $s ){
|
2624 |
+
if( !$s || $s[0] !== '@' ){
|
2625 |
+
$name[$k] = $this->NewObj1('Less_Tree_Keyword',$s);
|
2626 |
+
}else{
|
2627 |
+
$name[$k] = $this->NewObj3('Less_Tree_Variable',array('@' . substr($s,2,-1), $index[$k], $this->env->currentFileInfo));
|
2628 |
+
}
|
2629 |
+
}
|
2630 |
+
return $name;
|
2631 |
+
}
|
2632 |
+
|
2633 |
+
|
2634 |
+
}
|
2635 |
+
|
2636 |
+
private function rulePropertyMatch( $re, &$offset, &$length, &$index, &$name ){
|
2637 |
+
preg_match($re, $this->input, $a, 0, $offset);
|
2638 |
+
if( $a ){
|
2639 |
+
$index[] = $this->pos + $length;
|
2640 |
+
$length += strlen($a[0]);
|
2641 |
+
$offset += strlen($a[0]);
|
2642 |
+
$name[] = $a[1];
|
2643 |
+
return true;
|
2644 |
+
}
|
2645 |
+
}
|
2646 |
+
|
2647 |
+
public static function serializeVars( $vars ){
|
2648 |
+
$s = '';
|
2649 |
+
|
2650 |
+
foreach($vars as $name => $value){
|
2651 |
+
$s .= (($name[0] === '@') ? '' : '@') . $name .': '. $value . ((substr($value,-1) === ';') ? '' : ';');
|
2652 |
+
}
|
2653 |
+
|
2654 |
+
return $s;
|
2655 |
+
}
|
2656 |
+
|
2657 |
+
|
2658 |
+
/**
|
2659 |
+
* Some versions of php have trouble with method_exists($a,$b) if $a is not an object
|
2660 |
+
*
|
2661 |
+
* @param string $b
|
2662 |
+
*/
|
2663 |
+
public static function is_method($a,$b){
|
2664 |
+
return is_object($a) && method_exists($a,$b);
|
2665 |
+
}
|
2666 |
+
|
2667 |
+
|
2668 |
+
/**
|
2669 |
+
* Round numbers similarly to javascript
|
2670 |
+
* eg: 1.499999 to 1 instead of 2
|
2671 |
+
*
|
2672 |
+
*/
|
2673 |
+
public static function round($i, $precision = 0){
|
2674 |
+
|
2675 |
+
$precision = pow(10,$precision);
|
2676 |
+
$i = $i*$precision;
|
2677 |
+
|
2678 |
+
$ceil = ceil($i);
|
2679 |
+
$floor = floor($i);
|
2680 |
+
if( ($ceil - $i) <= ($i - $floor) ){
|
2681 |
+
return $ceil/$precision;
|
2682 |
+
}else{
|
2683 |
+
return $floor/$precision;
|
2684 |
+
}
|
2685 |
+
}
|
2686 |
+
|
2687 |
+
|
2688 |
+
/**
|
2689 |
+
* Create Less_Tree_* objects and optionally generate a cache string
|
2690 |
+
*
|
2691 |
+
* @return mixed
|
2692 |
+
*/
|
2693 |
+
public function NewObj0($class){
|
2694 |
+
$obj = new $class();
|
2695 |
+
if( $this->CacheEnabled() ){
|
2696 |
+
$obj->cache_string = ' new '.$class.'()';
|
2697 |
+
}
|
2698 |
+
return $obj;
|
2699 |
+
}
|
2700 |
+
|
2701 |
+
public function NewObj1($class, $arg){
|
2702 |
+
$obj = new $class( $arg );
|
2703 |
+
if( $this->CacheEnabled() ){
|
2704 |
+
$obj->cache_string = ' new '.$class.'('.Less_Parser::ArgString($arg).')';
|
2705 |
+
}
|
2706 |
+
return $obj;
|
2707 |
+
}
|
2708 |
+
|
2709 |
+
public function NewObj2($class, $args){
|
2710 |
+
$obj = new $class( $args[0], $args[1] );
|
2711 |
+
if( $this->CacheEnabled() ){
|
2712 |
+
$this->ObjCache( $obj, $class, $args);
|
2713 |
+
}
|
2714 |
+
return $obj;
|
2715 |
+
}
|
2716 |
+
|
2717 |
+
public function NewObj3($class, $args){
|
2718 |
+
$obj = new $class( $args[0], $args[1], $args[2] );
|
2719 |
+
if( $this->CacheEnabled() ){
|
2720 |
+
$this->ObjCache( $obj, $class, $args);
|
2721 |
+
}
|
2722 |
+
return $obj;
|
2723 |
+
}
|
2724 |
+
|
2725 |
+
public function NewObj4($class, $args){
|
2726 |
+
$obj = new $class( $args[0], $args[1], $args[2], $args[3] );
|
2727 |
+
if( $this->CacheEnabled() ){
|
2728 |
+
$this->ObjCache( $obj, $class, $args);
|
2729 |
+
}
|
2730 |
+
return $obj;
|
2731 |
+
}
|
2732 |
+
|
2733 |
+
public function NewObj5($class, $args){
|
2734 |
+
$obj = new $class( $args[0], $args[1], $args[2], $args[3], $args[4] );
|
2735 |
+
if( $this->CacheEnabled() ){
|
2736 |
+
$this->ObjCache( $obj, $class, $args);
|
2737 |
+
}
|
2738 |
+
return $obj;
|
2739 |
+
}
|
2740 |
+
|
2741 |
+
public function NewObj6($class, $args){
|
2742 |
+
$obj = new $class( $args[0], $args[1], $args[2], $args[3], $args[4], $args[5] );
|
2743 |
+
if( $this->CacheEnabled() ){
|
2744 |
+
$this->ObjCache( $obj, $class, $args);
|
2745 |
+
}
|
2746 |
+
return $obj;
|
2747 |
+
}
|
2748 |
+
|
2749 |
+
public function NewObj7($class, $args){
|
2750 |
+
$obj = new $class( $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6] );
|
2751 |
+
if( $this->CacheEnabled() ){
|
2752 |
+
$this->ObjCache( $obj, $class, $args);
|
2753 |
+
}
|
2754 |
+
return $obj;
|
2755 |
+
}
|
2756 |
+
|
2757 |
+
//caching
|
2758 |
+
public function ObjCache($obj, $class, $args=array()){
|
2759 |
+
$obj->cache_string = ' new '.$class.'('. self::ArgCache($args).')';
|
2760 |
+
}
|
2761 |
+
|
2762 |
+
public function ArgCache($args){
|
2763 |
+
return implode(',',array_map( array('Less_Parser','ArgString'),$args));
|
2764 |
+
}
|
2765 |
+
|
2766 |
+
|
2767 |
+
/**
|
2768 |
+
* Convert an argument to a string for use in the parser cache
|
2769 |
+
*
|
2770 |
+
* @return string
|
2771 |
+
*/
|
2772 |
+
public static function ArgString($arg){
|
2773 |
+
|
2774 |
+
$type = gettype($arg);
|
2775 |
+
|
2776 |
+
if( $type === 'object'){
|
2777 |
+
$string = $arg->cache_string;
|
2778 |
+
unset($arg->cache_string);
|
2779 |
+
return $string;
|
2780 |
+
|
2781 |
+
}elseif( $type === 'array' ){
|
2782 |
+
$string = ' Array(';
|
2783 |
+
foreach($arg as $k => $a){
|
2784 |
+
$string .= var_export($k,true).' => '.self::ArgString($a).',';
|
2785 |
+
}
|
2786 |
+
return $string . ')';
|
2787 |
+
}
|
2788 |
+
|
2789 |
+
return var_export($arg,true);
|
2790 |
+
}
|
2791 |
+
|
2792 |
+
public function Error($msg){
|
2793 |
+
throw new Less_Exception_Parser($msg, null, $this->furthest, $this->env->currentFileInfo);
|
2794 |
+
}
|
2795 |
+
|
2796 |
+
public static function WinPath($path){
|
2797 |
+
return str_replace('\\', '/', $path);
|
2798 |
+
}
|
2799 |
+
|
2800 |
+
public static function AbsPath($path, $winPath = false){
|
2801 |
+
if (strpos($path, '//') !== false && preg_match('_^(https?:)?//\\w+(\\.\\w+)+/\\w+_i', $path)) {
|
2802 |
+
return $winPath ? '' : false;
|
2803 |
+
} else {
|
2804 |
+
$path = realpath($path);
|
2805 |
+
if ($winPath) {
|
2806 |
+
$path = self::WinPath($path);
|
2807 |
+
}
|
2808 |
+
return $path;
|
2809 |
+
}
|
2810 |
+
}
|
2811 |
+
|
2812 |
+
public function CacheEnabled(){
|
2813 |
+
return (Less_Parser::$options['cache_method'] && (Less_Cache::$cache_dir || (Less_Parser::$options['cache_method'] == 'callback')));
|
2814 |
+
}
|
2815 |
+
|
2816 |
+
}
|
base/inc/lib/Less/SourceMap/Base64VLQ.php
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Encode / Decode Base64 VLQ.
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage SourceMap
|
8 |
+
*/
|
9 |
+
class Less_SourceMap_Base64VLQ {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Shift
|
13 |
+
*
|
14 |
+
* @var integer
|
15 |
+
*/
|
16 |
+
private $shift = 5;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Mask
|
20 |
+
*
|
21 |
+
* @var integer
|
22 |
+
*/
|
23 |
+
private $mask = 0x1F; // == (1 << shift) == 0b00011111
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Continuation bit
|
27 |
+
*
|
28 |
+
* @var integer
|
29 |
+
*/
|
30 |
+
private $continuationBit = 0x20; // == (mask - 1 ) == 0b00100000
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Char to integer map
|
34 |
+
*
|
35 |
+
* @var array
|
36 |
+
*/
|
37 |
+
private $charToIntMap = array(
|
38 |
+
'A' => 0, 'B' => 1, 'C' => 2, 'D' => 3, 'E' => 4, 'F' => 5, 'G' => 6,
|
39 |
+
'H' => 7,'I' => 8, 'J' => 9, 'K' => 10, 'L' => 11, 'M' => 12, 'N' => 13,
|
40 |
+
'O' => 14, 'P' => 15, 'Q' => 16, 'R' => 17, 'S' => 18, 'T' => 19, 'U' => 20,
|
41 |
+
'V' => 21, 'W' => 22, 'X' => 23, 'Y' => 24, 'Z' => 25, 'a' => 26, 'b' => 27,
|
42 |
+
'c' => 28, 'd' => 29, 'e' => 30, 'f' => 31, 'g' => 32, 'h' => 33, 'i' => 34,
|
43 |
+
'j' => 35, 'k' => 36, 'l' => 37, 'm' => 38, 'n' => 39, 'o' => 40, 'p' => 41,
|
44 |
+
'q' => 42, 'r' => 43, 's' => 44, 't' => 45, 'u' => 46, 'v' => 47, 'w' => 48,
|
45 |
+
'x' => 49, 'y' => 50, 'z' => 51, 0 => 52, 1 => 53, 2 => 54, 3 => 55, 4 => 56,
|
46 |
+
5 => 57, 6 => 58, 7 => 59, 8 => 60, 9 => 61, '+' => 62, '/' => 63,
|
47 |
+
);
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Integer to char map
|
51 |
+
*
|
52 |
+
* @var array
|
53 |
+
*/
|
54 |
+
private $intToCharMap = array(
|
55 |
+
0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D', 4 => 'E', 5 => 'F', 6 => 'G',
|
56 |
+
7 => 'H', 8 => 'I', 9 => 'J', 10 => 'K', 11 => 'L', 12 => 'M', 13 => 'N',
|
57 |
+
14 => 'O', 15 => 'P', 16 => 'Q', 17 => 'R', 18 => 'S', 19 => 'T', 20 => 'U',
|
58 |
+
21 => 'V', 22 => 'W', 23 => 'X', 24 => 'Y', 25 => 'Z', 26 => 'a', 27 => 'b',
|
59 |
+
28 => 'c', 29 => 'd', 30 => 'e', 31 => 'f', 32 => 'g', 33 => 'h', 34 => 'i',
|
60 |
+
35 => 'j', 36 => 'k', 37 => 'l', 38 => 'm', 39 => 'n', 40 => 'o', 41 => 'p',
|
61 |
+
42 => 'q', 43 => 'r', 44 => 's', 45 => 't', 46 => 'u', 47 => 'v', 48 => 'w',
|
62 |
+
49 => 'x', 50 => 'y', 51 => 'z', 52 => '0', 53 => '1', 54 => '2', 55 => '3',
|
63 |
+
56 => '4', 57 => '5', 58 => '6', 59 => '7', 60 => '8', 61 => '9', 62 => '+',
|
64 |
+
63 => '/',
|
65 |
+
);
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Constructor
|
69 |
+
*/
|
70 |
+
public function __construct(){
|
71 |
+
// I leave it here for future reference
|
72 |
+
// foreach(str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/') as $i => $char)
|
73 |
+
// {
|
74 |
+
// $this->charToIntMap[$char] = $i;
|
75 |
+
// $this->intToCharMap[$i] = $char;
|
76 |
+
// }
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Convert from a two-complement value to a value where the sign bit is
|
81 |
+
* is placed in the least significant bit. For example, as decimals:
|
82 |
+
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
83 |
+
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
84 |
+
* We generate the value for 32 bit machines, hence -2147483648 becomes 1, not 4294967297,
|
85 |
+
* even on a 64 bit machine.
|
86 |
+
* @param string $aValue
|
87 |
+
*/
|
88 |
+
public function toVLQSigned($aValue){
|
89 |
+
return 0xffffffff & ($aValue < 0 ? ((-$aValue) << 1) + 1 : ($aValue << 1) + 0);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Convert to a two-complement value from a value where the sign bit is
|
94 |
+
* is placed in the least significant bit. For example, as decimals:
|
95 |
+
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
96 |
+
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
97 |
+
* We assume that the value was generated with a 32 bit machine in mind.
|
98 |
+
* Hence
|
99 |
+
* 1 becomes -2147483648
|
100 |
+
* even on a 64 bit machine.
|
101 |
+
* @param integer $aValue
|
102 |
+
*/
|
103 |
+
public function fromVLQSigned($aValue){
|
104 |
+
return $aValue & 1 ? $this->zeroFill(~$aValue + 2, 1) | (-1 - 0x7fffffff) : $this->zeroFill($aValue, 1);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Return the base 64 VLQ encoded value.
|
109 |
+
*
|
110 |
+
* @param string $aValue The value to encode
|
111 |
+
* @return string The encoded value
|
112 |
+
*/
|
113 |
+
public function encode($aValue){
|
114 |
+
$encoded = '';
|
115 |
+
$vlq = $this->toVLQSigned($aValue);
|
116 |
+
do
|
117 |
+
{
|
118 |
+
$digit = $vlq & $this->mask;
|
119 |
+
$vlq = $this->zeroFill($vlq, $this->shift);
|
120 |
+
if($vlq > 0){
|
121 |
+
$digit |= $this->continuationBit;
|
122 |
+
}
|
123 |
+
$encoded .= $this->base64Encode($digit);
|
124 |
+
} while($vlq > 0);
|
125 |
+
|
126 |
+
return $encoded;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Return the value decoded from base 64 VLQ.
|
131 |
+
*
|
132 |
+
* @param string $encoded The encoded value to decode
|
133 |
+
* @return integer The decoded value
|
134 |
+
*/
|
135 |
+
public function decode($encoded){
|
136 |
+
$vlq = 0;
|
137 |
+
$i = 0;
|
138 |
+
do
|
139 |
+
{
|
140 |
+
$digit = $this->base64Decode($encoded[$i]);
|
141 |
+
$vlq |= ($digit & $this->mask) << ($i * $this->shift);
|
142 |
+
$i++;
|
143 |
+
} while($digit & $this->continuationBit);
|
144 |
+
|
145 |
+
return $this->fromVLQSigned($vlq);
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Right shift with zero fill.
|
150 |
+
*
|
151 |
+
* @param integer $a number to shift
|
152 |
+
* @param integer $b number of bits to shift
|
153 |
+
* @return integer
|
154 |
+
*/
|
155 |
+
public function zeroFill($a, $b){
|
156 |
+
return ($a >= 0) ? ($a >> $b) : ($a >> $b) & (PHP_INT_MAX >> ($b - 1));
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Encode single 6-bit digit as base64.
|
161 |
+
*
|
162 |
+
* @param integer $number
|
163 |
+
* @return string
|
164 |
+
* @throws Exception If the number is invalid
|
165 |
+
*/
|
166 |
+
public function base64Encode($number){
|
167 |
+
if($number < 0 || $number > 63){
|
168 |
+
throw new Exception(sprintf('Invalid number "%s" given. Must be between 0 and 63.', $number));
|
169 |
+
}
|
170 |
+
return $this->intToCharMap[$number];
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Decode single 6-bit digit from base64
|
175 |
+
*
|
176 |
+
* @param string $char
|
177 |
+
* @return number
|
178 |
+
* @throws Exception If the number is invalid
|
179 |
+
*/
|
180 |
+
public function base64Decode($char){
|
181 |
+
if(!array_key_exists($char, $this->charToIntMap)){
|
182 |
+
throw new Exception(sprintf('Invalid base 64 digit "%s" given.', $char));
|
183 |
+
}
|
184 |
+
return $this->charToIntMap[$char];
|
185 |
+
}
|
186 |
+
|
187 |
+
}
|
base/inc/lib/Less/SourceMap/Generator.php
ADDED
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Source map generator
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage Output
|
8 |
+
*/
|
9 |
+
class Less_SourceMap_Generator extends Less_Configurable {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* What version of source map does the generator generate?
|
13 |
+
*/
|
14 |
+
const VERSION = 3;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Array of default options
|
18 |
+
*
|
19 |
+
* @var array
|
20 |
+
*/
|
21 |
+
protected $defaultOptions = array(
|
22 |
+
// an optional source root, useful for relocating source files
|
23 |
+
// on a server or removing repeated values in the 'sources' entry.
|
24 |
+
// This value is prepended to the individual entries in the 'source' field.
|
25 |
+
'sourceRoot' => '',
|
26 |
+
|
27 |
+
// an optional name of the generated code that this source map is associated with.
|
28 |
+
'sourceMapFilename' => null,
|
29 |
+
|
30 |
+
// url of the map
|
31 |
+
'sourceMapURL' => null,
|
32 |
+
|
33 |
+
// absolute path to a file to write the map to
|
34 |
+
'sourceMapWriteTo' => null,
|
35 |
+
|
36 |
+
// output source contents?
|
37 |
+
'outputSourceFiles' => false,
|
38 |
+
|
39 |
+
// base path for filename normalization
|
40 |
+
'sourceMapRootpath' => '',
|
41 |
+
|
42 |
+
// base path for filename normalization
|
43 |
+
'sourceMapBasepath' => ''
|
44 |
+
);
|
45 |
+
|
46 |
+
/**
|
47 |
+
* The base64 VLQ encoder
|
48 |
+
*
|
49 |
+
* @var Less_SourceMap_Base64VLQ
|
50 |
+
*/
|
51 |
+
protected $encoder;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Array of mappings
|
55 |
+
*
|
56 |
+
* @var array
|
57 |
+
*/
|
58 |
+
protected $mappings = array();
|
59 |
+
|
60 |
+
/**
|
61 |
+
* The root node
|
62 |
+
*
|
63 |
+
* @var Less_Tree_Ruleset
|
64 |
+
*/
|
65 |
+
protected $root;
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Array of contents map
|
69 |
+
*
|
70 |
+
* @var array
|
71 |
+
*/
|
72 |
+
protected $contentsMap = array();
|
73 |
+
|
74 |
+
/**
|
75 |
+
* File to content map
|
76 |
+
*
|
77 |
+
* @var array
|
78 |
+
*/
|
79 |
+
protected $sources = array();
|
80 |
+
protected $source_keys = array();
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Constructor
|
84 |
+
*
|
85 |
+
* @param Less_Tree_Ruleset $root The root node
|
86 |
+
* @param array $options Array of options
|
87 |
+
*/
|
88 |
+
public function __construct(Less_Tree_Ruleset $root, $contentsMap, $options = array()){
|
89 |
+
$this->root = $root;
|
90 |
+
$this->contentsMap = $contentsMap;
|
91 |
+
$this->encoder = new Less_SourceMap_Base64VLQ();
|
92 |
+
|
93 |
+
$this->SetOptions($options);
|
94 |
+
|
95 |
+
$this->options['sourceMapRootpath'] = $this->fixWindowsPath($this->options['sourceMapRootpath'], true);
|
96 |
+
$this->options['sourceMapBasepath'] = $this->fixWindowsPath($this->options['sourceMapBasepath'], true);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Generates the CSS
|
101 |
+
*
|
102 |
+
* @return string
|
103 |
+
*/
|
104 |
+
public function generateCSS(){
|
105 |
+
$output = new Less_Output_Mapped($this->contentsMap, $this);
|
106 |
+
|
107 |
+
// catch the output
|
108 |
+
$this->root->genCSS($output);
|
109 |
+
|
110 |
+
|
111 |
+
$sourceMapUrl = $this->getOption('sourceMapURL');
|
112 |
+
$sourceMapFilename = $this->getOption('sourceMapFilename');
|
113 |
+
$sourceMapContent = $this->generateJson();
|
114 |
+
$sourceMapWriteTo = $this->getOption('sourceMapWriteTo');
|
115 |
+
|
116 |
+
if( !$sourceMapUrl && $sourceMapFilename ){
|
117 |
+
$sourceMapUrl = $this->normalizeFilename($sourceMapFilename);
|
118 |
+
}
|
119 |
+
|
120 |
+
// write map to a file
|
121 |
+
if( $sourceMapWriteTo ){
|
122 |
+
$this->saveMap($sourceMapWriteTo, $sourceMapContent);
|
123 |
+
}
|
124 |
+
|
125 |
+
// inline the map
|
126 |
+
if( !$sourceMapUrl ){
|
127 |
+
$sourceMapUrl = sprintf('data:application/json,%s', Less_Functions::encodeURIComponent($sourceMapContent));
|
128 |
+
}
|
129 |
+
|
130 |
+
if( $sourceMapUrl ){
|
131 |
+
$output->add( sprintf('/*# sourceMappingURL=%s */', $sourceMapUrl) );
|
132 |
+
}
|
133 |
+
|
134 |
+
return $output->toString();
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Saves the source map to a file
|
139 |
+
*
|
140 |
+
* @param string $file The absolute path to a file
|
141 |
+
* @param string $content The content to write
|
142 |
+
* @throws Exception If the file could not be saved
|
143 |
+
*/
|
144 |
+
protected function saveMap($file, $content){
|
145 |
+
$dir = dirname($file);
|
146 |
+
// directory does not exist
|
147 |
+
if( !is_dir($dir) ){
|
148 |
+
// FIXME: create the dir automatically?
|
149 |
+
throw new Exception(sprintf('The directory "%s" does not exist. Cannot save the source map.', $dir));
|
150 |
+
}
|
151 |
+
// FIXME: proper saving, with dir write check!
|
152 |
+
if(file_put_contents($file, $content) === false){
|
153 |
+
throw new Exception(sprintf('Cannot save the source map to "%s"', $file));
|
154 |
+
}
|
155 |
+
return true;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Normalizes the filename
|
160 |
+
*
|
161 |
+
* @param string $filename
|
162 |
+
* @return string
|
163 |
+
*/
|
164 |
+
protected function normalizeFilename($filename){
|
165 |
+
|
166 |
+
$filename = $this->fixWindowsPath($filename);
|
167 |
+
|
168 |
+
$rootpath = $this->getOption('sourceMapRootpath');
|
169 |
+
$basePath = $this->getOption('sourceMapBasepath');
|
170 |
+
|
171 |
+
// "Trim" the 'sourceMapBasepath' from the output filename.
|
172 |
+
if (strpos($filename, $basePath) === 0) {
|
173 |
+
$filename = substr($filename, strlen($basePath));
|
174 |
+
}
|
175 |
+
|
176 |
+
// Remove extra leading path separators.
|
177 |
+
if(strpos($filename, '\\') === 0 || strpos($filename, '/') === 0){
|
178 |
+
$filename = substr($filename, 1);
|
179 |
+
}
|
180 |
+
|
181 |
+
return $rootpath . $filename;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Adds a mapping
|
186 |
+
*
|
187 |
+
* @param integer $generatedLine The line number in generated file
|
188 |
+
* @param integer $generatedColumn The column number in generated file
|
189 |
+
* @param integer $originalLine The line number in original file
|
190 |
+
* @param integer $originalColumn The column number in original file
|
191 |
+
* @param string $sourceFile The original source file
|
192 |
+
*/
|
193 |
+
public function addMapping($generatedLine, $generatedColumn, $originalLine, $originalColumn, $fileInfo ){
|
194 |
+
|
195 |
+
$this->mappings[] = array(
|
196 |
+
'generated_line' => $generatedLine,
|
197 |
+
'generated_column' => $generatedColumn,
|
198 |
+
'original_line' => $originalLine,
|
199 |
+
'original_column' => $originalColumn,
|
200 |
+
'source_file' => $fileInfo['currentUri']
|
201 |
+
);
|
202 |
+
|
203 |
+
$this->sources[$fileInfo['currentUri']] = $fileInfo['filename'];
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Generates the JSON source map
|
209 |
+
*
|
210 |
+
* @return string
|
211 |
+
* @see https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#
|
212 |
+
*/
|
213 |
+
protected function generateJson(){
|
214 |
+
|
215 |
+
$sourceMap = array();
|
216 |
+
$mappings = $this->generateMappings();
|
217 |
+
|
218 |
+
// File version (always the first entry in the object) and must be a positive integer.
|
219 |
+
$sourceMap['version'] = self::VERSION;
|
220 |
+
|
221 |
+
|
222 |
+
// An optional name of the generated code that this source map is associated with.
|
223 |
+
$file = $this->getOption('sourceMapFilename');
|
224 |
+
if( $file ){
|
225 |
+
$sourceMap['file'] = $file;
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
// An optional source root, useful for relocating source files on a server or removing repeated values in the 'sources' entry. This value is prepended to the individual entries in the 'source' field.
|
230 |
+
$root = $this->getOption('sourceRoot');
|
231 |
+
if( $root ){
|
232 |
+
$sourceMap['sourceRoot'] = $root;
|
233 |
+
}
|
234 |
+
|
235 |
+
|
236 |
+
// A list of original sources used by the 'mappings' entry.
|
237 |
+
$sourceMap['sources'] = array();
|
238 |
+
foreach($this->sources as $source_uri => $source_filename){
|
239 |
+
$sourceMap['sources'][] = $this->normalizeFilename($source_filename);
|
240 |
+
}
|
241 |
+
|
242 |
+
|
243 |
+
// A list of symbol names used by the 'mappings' entry.
|
244 |
+
$sourceMap['names'] = array();
|
245 |
+
|
246 |
+
// A string with the encoded mapping data.
|
247 |
+
$sourceMap['mappings'] = $mappings;
|
248 |
+
|
249 |
+
if( $this->getOption('outputSourceFiles') ){
|
250 |
+
// An optional list of source content, useful when the 'source' can't be hosted.
|
251 |
+
// The contents are listed in the same order as the sources above.
|
252 |
+
// 'null' may be used if some original sources should be retrieved by name.
|
253 |
+
$sourceMap['sourcesContent'] = $this->getSourcesContent();
|
254 |
+
}
|
255 |
+
|
256 |
+
// less.js compat fixes
|
257 |
+
if( count($sourceMap['sources']) && empty($sourceMap['sourceRoot']) ){
|
258 |
+
unset($sourceMap['sourceRoot']);
|
259 |
+
}
|
260 |
+
|
261 |
+
return json_encode($sourceMap);
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Returns the sources contents
|
266 |
+
*
|
267 |
+
* @return array|null
|
268 |
+
*/
|
269 |
+
protected function getSourcesContent(){
|
270 |
+
if(empty($this->sources)){
|
271 |
+
return;
|
272 |
+
}
|
273 |
+
$content = array();
|
274 |
+
foreach($this->sources as $sourceFile){
|
275 |
+
$content[] = file_get_contents($sourceFile);
|
276 |
+
}
|
277 |
+
return $content;
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Generates the mappings string
|
282 |
+
*
|
283 |
+
* @return string
|
284 |
+
*/
|
285 |
+
public function generateMappings(){
|
286 |
+
|
287 |
+
if( !count($this->mappings) ){
|
288 |
+
return '';
|
289 |
+
}
|
290 |
+
|
291 |
+
$this->source_keys = array_flip(array_keys($this->sources));
|
292 |
+
|
293 |
+
|
294 |
+
// group mappings by generated line number.
|
295 |
+
$groupedMap = $groupedMapEncoded = array();
|
296 |
+
foreach($this->mappings as $m){
|
297 |
+
$groupedMap[$m['generated_line']][] = $m;
|
298 |
+
}
|
299 |
+
ksort($groupedMap);
|
300 |
+
|
301 |
+
$lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0;
|
302 |
+
|
303 |
+
foreach($groupedMap as $lineNumber => $line_map){
|
304 |
+
while(++$lastGeneratedLine < $lineNumber){
|
305 |
+
$groupedMapEncoded[] = ';';
|
306 |
+
}
|
307 |
+
|
308 |
+
$lineMapEncoded = array();
|
309 |
+
$lastGeneratedColumn = 0;
|
310 |
+
|
311 |
+
foreach($line_map as $m){
|
312 |
+
$mapEncoded = $this->encoder->encode($m['generated_column'] - $lastGeneratedColumn);
|
313 |
+
$lastGeneratedColumn = $m['generated_column'];
|
314 |
+
|
315 |
+
// find the index
|
316 |
+
if( $m['source_file'] ){
|
317 |
+
$index = $this->findFileIndex($m['source_file']);
|
318 |
+
if( $index !== false ){
|
319 |
+
$mapEncoded .= $this->encoder->encode($index - $lastOriginalIndex);
|
320 |
+
$lastOriginalIndex = $index;
|
321 |
+
|
322 |
+
// lines are stored 0-based in SourceMap spec version 3
|
323 |
+
$mapEncoded .= $this->encoder->encode($m['original_line'] - 1 - $lastOriginalLine);
|
324 |
+
$lastOriginalLine = $m['original_line'] - 1;
|
325 |
+
|
326 |
+
$mapEncoded .= $this->encoder->encode($m['original_column'] - $lastOriginalColumn);
|
327 |
+
$lastOriginalColumn = $m['original_column'];
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
$lineMapEncoded[] = $mapEncoded;
|
332 |
+
}
|
333 |
+
|
334 |
+
$groupedMapEncoded[] = implode(',', $lineMapEncoded) . ';';
|
335 |
+
}
|
336 |
+
|
337 |
+
return rtrim(implode($groupedMapEncoded), ';');
|
338 |
+
}
|
339 |
+
|
340 |
+
/**
|
341 |
+
* Finds the index for the filename
|
342 |
+
*
|
343 |
+
* @param string $filename
|
344 |
+
* @return integer|false
|
345 |
+
*/
|
346 |
+
protected function findFileIndex($filename){
|
347 |
+
return $this->source_keys[$filename];
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* fix windows paths
|
352 |
+
* @param string $path
|
353 |
+
* @return string
|
354 |
+
*/
|
355 |
+
public function fixWindowsPath($path, $addEndSlash = false){
|
356 |
+
$slash = ($addEndSlash) ? '/' : '';
|
357 |
+
if( !empty($path) ){
|
358 |
+
$path = str_replace('\\', '/', $path);
|
359 |
+
$path = rtrim($path,'/') . $slash;
|
360 |
+
}
|
361 |
+
|
362 |
+
return $path;
|
363 |
+
}
|
364 |
+
|
365 |
+
}
|
base/inc/lib/Less/Tree.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Tree
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree{
|
10 |
+
|
11 |
+
public $cache_string;
|
12 |
+
|
13 |
+
public function toCSS(){
|
14 |
+
$output = new Less_Output();
|
15 |
+
$this->genCSS($output);
|
16 |
+
return $output->toString();
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Generate CSS by adding it to the output object
|
22 |
+
*
|
23 |
+
* @param Less_Output $output The output
|
24 |
+
* @return void
|
25 |
+
*/
|
26 |
+
public function genCSS($output){}
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @param Less_Tree_Ruleset[] $rules
|
31 |
+
*/
|
32 |
+
public static function outputRuleset( $output, $rules ){
|
33 |
+
|
34 |
+
$ruleCnt = count($rules);
|
35 |
+
Less_Environment::$tabLevel++;
|
36 |
+
|
37 |
+
|
38 |
+
// Compressed
|
39 |
+
if( Less_Parser::$options['compress'] ){
|
40 |
+
$output->add('{');
|
41 |
+
for( $i = 0; $i < $ruleCnt; $i++ ){
|
42 |
+
$rules[$i]->genCSS( $output );
|
43 |
+
}
|
44 |
+
|
45 |
+
$output->add( '}' );
|
46 |
+
Less_Environment::$tabLevel--;
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
// Non-compressed
|
52 |
+
$tabSetStr = "\n".str_repeat( Less_Parser::$options['indentation'] , Less_Environment::$tabLevel-1 );
|
53 |
+
$tabRuleStr = $tabSetStr.Less_Parser::$options['indentation'];
|
54 |
+
|
55 |
+
$output->add( " {" );
|
56 |
+
for($i = 0; $i < $ruleCnt; $i++ ){
|
57 |
+
$output->add( $tabRuleStr );
|
58 |
+
$rules[$i]->genCSS( $output );
|
59 |
+
}
|
60 |
+
Less_Environment::$tabLevel--;
|
61 |
+
$output->add( $tabSetStr.'}' );
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
public function accept($visitor){}
|
66 |
+
|
67 |
+
|
68 |
+
public static function ReferencedArray($rules){
|
69 |
+
foreach($rules as $rule){
|
70 |
+
if( method_exists($rule, 'markReferenced') ){
|
71 |
+
$rule->markReferenced();
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Requires php 5.3+
|
79 |
+
*/
|
80 |
+
public static function __set_state($args){
|
81 |
+
|
82 |
+
$class = get_called_class();
|
83 |
+
$obj = new $class(null,null,null,null);
|
84 |
+
foreach($args as $key => $val){
|
85 |
+
$obj->$key = $val;
|
86 |
+
}
|
87 |
+
return $obj;
|
88 |
+
}
|
89 |
+
|
90 |
+
}
|
base/inc/lib/Less/Tree/Alpha.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Alpha
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Alpha extends Less_Tree{
|
10 |
+
public $value;
|
11 |
+
public $type = 'Alpha';
|
12 |
+
|
13 |
+
public function __construct($val){
|
14 |
+
$this->value = $val;
|
15 |
+
}
|
16 |
+
|
17 |
+
//function accept( $visitor ){
|
18 |
+
// $this->value = $visitor->visit( $this->value );
|
19 |
+
//}
|
20 |
+
|
21 |
+
public function compile($env){
|
22 |
+
|
23 |
+
if( is_object($this->value) ){
|
24 |
+
$this->value = $this->value->compile($env);
|
25 |
+
}
|
26 |
+
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @see Less_Tree::genCSS
|
32 |
+
*/
|
33 |
+
public function genCSS( $output ){
|
34 |
+
|
35 |
+
$output->add( "alpha(opacity=" );
|
36 |
+
|
37 |
+
if( is_string($this->value) ){
|
38 |
+
$output->add( $this->value );
|
39 |
+
}else{
|
40 |
+
$this->value->genCSS( $output);
|
41 |
+
}
|
42 |
+
|
43 |
+
$output->add( ')' );
|
44 |
+
}
|
45 |
+
|
46 |
+
public function toCSS(){
|
47 |
+
return "alpha(opacity=" . (is_string($this->value) ? $this->value : $this->value->toCSS()) . ")";
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
}
|
base/inc/lib/Less/Tree/Anonymous.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Anonymous
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Anonymous extends Less_Tree{
|
10 |
+
public $value;
|
11 |
+
public $quote;
|
12 |
+
public $index;
|
13 |
+
public $mapLines;
|
14 |
+
public $currentFileInfo;
|
15 |
+
public $type = 'Anonymous';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param integer $index
|
19 |
+
* @param boolean $mapLines
|
20 |
+
*/
|
21 |
+
public function __construct($value, $index = null, $currentFileInfo = null, $mapLines = null ){
|
22 |
+
$this->value = $value;
|
23 |
+
$this->index = $index;
|
24 |
+
$this->mapLines = $mapLines;
|
25 |
+
$this->currentFileInfo = $currentFileInfo;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function compile(){
|
29 |
+
return new Less_Tree_Anonymous($this->value, $this->index, $this->currentFileInfo, $this->mapLines);
|
30 |
+
}
|
31 |
+
|
32 |
+
public function compare($x){
|
33 |
+
if( !is_object($x) ){
|
34 |
+
return -1;
|
35 |
+
}
|
36 |
+
|
37 |
+
$left = $this->toCSS();
|
38 |
+
$right = $x->toCSS();
|
39 |
+
|
40 |
+
if( $left === $right ){
|
41 |
+
return 0;
|
42 |
+
}
|
43 |
+
|
44 |
+
return $left < $right ? -1 : 1;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @see Less_Tree::genCSS
|
49 |
+
*/
|
50 |
+
public function genCSS( $output ){
|
51 |
+
$output->add( $this->value, $this->currentFileInfo, $this->index, $this->mapLines );
|
52 |
+
}
|
53 |
+
|
54 |
+
public function toCSS(){
|
55 |
+
return $this->value;
|
56 |
+
}
|
57 |
+
|
58 |
+
}
|
base/inc/lib/Less/Tree/Assignment.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Assignment
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Assignment extends Less_Tree{
|
10 |
+
|
11 |
+
public $key;
|
12 |
+
public $value;
|
13 |
+
public $type = 'Assignment';
|
14 |
+
|
15 |
+
public function __construct($key, $val) {
|
16 |
+
$this->key = $key;
|
17 |
+
$this->value = $val;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function accept( $visitor ){
|
21 |
+
$this->value = $visitor->visitObj( $this->value );
|
22 |
+
}
|
23 |
+
|
24 |
+
public function compile($env) {
|
25 |
+
return new Less_Tree_Assignment( $this->key, $this->value->compile($env));
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @see Less_Tree::genCSS
|
30 |
+
*/
|
31 |
+
public function genCSS( $output ){
|
32 |
+
$output->add( $this->key . '=' );
|
33 |
+
$this->value->genCSS( $output );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function toCss(){
|
37 |
+
return $this->key . '=' . $this->value->toCSS();
|
38 |
+
}
|
39 |
+
}
|
base/inc/lib/Less/Tree/Attribute.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Attribute
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Attribute extends Less_Tree{
|
10 |
+
|
11 |
+
public $key;
|
12 |
+
public $op;
|
13 |
+
public $value;
|
14 |
+
public $type = 'Attribute';
|
15 |
+
|
16 |
+
public function __construct($key, $op, $value){
|
17 |
+
$this->key = $key;
|
18 |
+
$this->op = $op;
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function compile($env){
|
23 |
+
|
24 |
+
$key_obj = is_object($this->key);
|
25 |
+
$val_obj = is_object($this->value);
|
26 |
+
|
27 |
+
if( !$key_obj && !$val_obj ){
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
return new Less_Tree_Attribute(
|
32 |
+
$key_obj ? $this->key->compile($env) : $this->key ,
|
33 |
+
$this->op,
|
34 |
+
$val_obj ? $this->value->compile($env) : $this->value);
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @see Less_Tree::genCSS
|
39 |
+
*/
|
40 |
+
public function genCSS( $output ){
|
41 |
+
$output->add( $this->toCSS() );
|
42 |
+
}
|
43 |
+
|
44 |
+
public function toCSS(){
|
45 |
+
$value = $this->key;
|
46 |
+
|
47 |
+
if( $this->op ){
|
48 |
+
$value .= $this->op;
|
49 |
+
$value .= (is_object($this->value) ? $this->value->toCSS() : $this->value);
|
50 |
+
}
|
51 |
+
|
52 |
+
return '[' . $value . ']';
|
53 |
+
}
|
54 |
+
}
|
base/inc/lib/Less/Tree/Call.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Call
|
6 |
+
*
|
7 |
+
* @package Less
|
8 |
+
* @subpackage tree
|
9 |
+
*/
|
10 |
+
class Less_Tree_Call extends Less_Tree{
|
11 |
+
public $value;
|
12 |
+
|
13 |
+
public $name;
|
14 |
+
public $args;
|
15 |
+
public $index;
|
16 |
+
public $currentFileInfo;
|
17 |
+
public $type = 'Call';
|
18 |
+
|
19 |
+
public function __construct($name, $args, $index, $currentFileInfo = null ){
|
20 |
+
$this->name = $name;
|
21 |
+
$this->args = $args;
|
22 |
+
$this->index = $index;
|
23 |
+
$this->currentFileInfo = $currentFileInfo;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function accept( $visitor ){
|
27 |
+
$this->args = $visitor->visitArray( $this->args );
|
28 |
+
}
|
29 |
+
|
30 |
+
//
|
31 |
+
// When evaluating a function call,
|
32 |
+
// we either find the function in `tree.functions` [1],
|
33 |
+
// in which case we call it, passing the evaluated arguments,
|
34 |
+
// or we simply print it out as it appeared originally [2].
|
35 |
+
//
|
36 |
+
// The *functions.js* file contains the built-in functions.
|
37 |
+
//
|
38 |
+
// The reason why we evaluate the arguments, is in the case where
|
39 |
+
// we try to pass a variable to a function, like: `saturate(@color)`.
|
40 |
+
// The function should receive the value, not the variable.
|
41 |
+
//
|
42 |
+
public function compile($env=null){
|
43 |
+
$args = array();
|
44 |
+
foreach($this->args as $a){
|
45 |
+
$args[] = $a->compile($env);
|
46 |
+
}
|
47 |
+
|
48 |
+
$nameLC = strtolower($this->name);
|
49 |
+
switch($nameLC){
|
50 |
+
case '%':
|
51 |
+
$nameLC = '_percent';
|
52 |
+
break;
|
53 |
+
|
54 |
+
case 'get-unit':
|
55 |
+
$nameLC = 'getunit';
|
56 |
+
break;
|
57 |
+
|
58 |
+
case 'data-uri':
|
59 |
+
$nameLC = 'datauri';
|
60 |
+
break;
|
61 |
+
|
62 |
+
case 'svg-gradient':
|
63 |
+
$nameLC = 'svggradient';
|
64 |
+
break;
|
65 |
+
}
|
66 |
+
|
67 |
+
$result = null;
|
68 |
+
if( $nameLC === 'default' ){
|
69 |
+
$result = Less_Tree_DefaultFunc::compile();
|
70 |
+
|
71 |
+
}else{
|
72 |
+
|
73 |
+
if( method_exists('Less_Functions',$nameLC) ){ // 1.
|
74 |
+
try {
|
75 |
+
|
76 |
+
$func = new Less_Functions($env, $this->currentFileInfo);
|
77 |
+
$result = call_user_func_array( array($func,$nameLC),$args);
|
78 |
+
|
79 |
+
} catch (Exception $e) {
|
80 |
+
throw new Less_Exception_Compiler('error evaluating function `' . $this->name . '` '.$e->getMessage().' index: '. $this->index);
|
81 |
+
}
|
82 |
+
} elseif( isset( $env->functions[$nameLC] ) && is_callable( $env->functions[$nameLC] ) ) {
|
83 |
+
try {
|
84 |
+
$result = call_user_func_array( $env->functions[$nameLC], $args );
|
85 |
+
} catch (Exception $e) {
|
86 |
+
throw new Less_Exception_Compiler('error evaluating function `' . $this->name . '` '.$e->getMessage().' index: '. $this->index);
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
if( $result !== null ){
|
92 |
+
return $result;
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
return new Less_Tree_Call( $this->name, $args, $this->index, $this->currentFileInfo );
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @see Less_Tree::genCSS
|
101 |
+
*/
|
102 |
+
public function genCSS( $output ){
|
103 |
+
|
104 |
+
$output->add( $this->name . '(', $this->currentFileInfo, $this->index );
|
105 |
+
$args_len = count($this->args);
|
106 |
+
for($i = 0; $i < $args_len; $i++ ){
|
107 |
+
$this->args[$i]->genCSS( $output );
|
108 |
+
if( $i + 1 < $args_len ){
|
109 |
+
$output->add( ', ' );
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
$output->add( ')' );
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
//public function toCSS(){
|
118 |
+
// return $this->compile()->toCSS();
|
119 |
+
//}
|
120 |
+
|
121 |
+
}
|
base/inc/lib/Less/Tree/Color.php
ADDED
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Color
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Color extends Less_Tree{
|
10 |
+
public $rgb;
|
11 |
+
public $alpha;
|
12 |
+
public $isTransparentKeyword;
|
13 |
+
public $type = 'Color';
|
14 |
+
|
15 |
+
public function __construct($rgb, $a = 1, $isTransparentKeyword = null ){
|
16 |
+
|
17 |
+
if( $isTransparentKeyword ){
|
18 |
+
$this->rgb = $rgb;
|
19 |
+
$this->alpha = $a;
|
20 |
+
$this->isTransparentKeyword = true;
|
21 |
+
return;
|
22 |
+
}
|
23 |
+
|
24 |
+
$this->rgb = array();
|
25 |
+
if( is_array($rgb) ){
|
26 |
+
$this->rgb = $rgb;
|
27 |
+
}else if( strlen($rgb) == 6 ){
|
28 |
+
foreach(str_split($rgb, 2) as $c){
|
29 |
+
$this->rgb[] = hexdec($c);
|
30 |
+
}
|
31 |
+
}else{
|
32 |
+
foreach(str_split($rgb, 1) as $c){
|
33 |
+
$this->rgb[] = hexdec($c.$c);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
$this->alpha = is_numeric($a) ? $a : 1;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function compile(){
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function luma(){
|
44 |
+
$r = $this->rgb[0] / 255;
|
45 |
+
$g = $this->rgb[1] / 255;
|
46 |
+
$b = $this->rgb[2] / 255;
|
47 |
+
|
48 |
+
$r = ($r <= 0.03928) ? $r / 12.92 : pow((($r + 0.055) / 1.055), 2.4);
|
49 |
+
$g = ($g <= 0.03928) ? $g / 12.92 : pow((($g + 0.055) / 1.055), 2.4);
|
50 |
+
$b = ($b <= 0.03928) ? $b / 12.92 : pow((($b + 0.055) / 1.055), 2.4);
|
51 |
+
|
52 |
+
return 0.2126 * $r + 0.7152 * $g + 0.0722 * $b;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @see Less_Tree::genCSS
|
57 |
+
*/
|
58 |
+
public function genCSS( $output ){
|
59 |
+
$output->add( $this->toCSS() );
|
60 |
+
}
|
61 |
+
|
62 |
+
public function toCSS( $doNotCompress = false ){
|
63 |
+
$compress = Less_Parser::$options['compress'] && !$doNotCompress;
|
64 |
+
$alpha = Less_Functions::fround( $this->alpha );
|
65 |
+
|
66 |
+
|
67 |
+
//
|
68 |
+
// If we have some transparency, the only way to represent it
|
69 |
+
// is via `rgba`. Otherwise, we use the hex representation,
|
70 |
+
// which has better compatibility with older browsers.
|
71 |
+
// Values are capped between `0` and `255`, rounded and zero-padded.
|
72 |
+
//
|
73 |
+
if( $alpha < 1 ){
|
74 |
+
if( ( $alpha === 0 || $alpha === 0.0 ) && isset($this->isTransparentKeyword) && $this->isTransparentKeyword ){
|
75 |
+
return 'transparent';
|
76 |
+
}
|
77 |
+
|
78 |
+
$values = array();
|
79 |
+
foreach($this->rgb as $c){
|
80 |
+
$values[] = Less_Functions::clamp( round($c), 255);
|
81 |
+
}
|
82 |
+
$values[] = $alpha;
|
83 |
+
|
84 |
+
$glue = ($compress ? ',' : ', ');
|
85 |
+
return "rgba(" . implode($glue, $values) . ")";
|
86 |
+
}else{
|
87 |
+
|
88 |
+
$color = $this->toRGB();
|
89 |
+
|
90 |
+
if( $compress ){
|
91 |
+
|
92 |
+
// Convert color to short format
|
93 |
+
if( $color[1] === $color[2] && $color[3] === $color[4] && $color[5] === $color[6]) {
|
94 |
+
$color = '#'.$color[1] . $color[3] . $color[5];
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
return $color;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
//
|
103 |
+
// Operations have to be done per-channel, if not,
|
104 |
+
// channels will spill onto each other. Once we have
|
105 |
+
// our result, in the form of an integer triplet,
|
106 |
+
// we create a new Color node to hold the result.
|
107 |
+
//
|
108 |
+
|
109 |
+
/**
|
110 |
+
* @param string $op
|
111 |
+
*/
|
112 |
+
public function operate( $op, $other) {
|
113 |
+
$rgb = array();
|
114 |
+
$alpha = $this->alpha * (1 - $other->alpha) + $other->alpha;
|
115 |
+
for ($c = 0; $c < 3; $c++) {
|
116 |
+
$rgb[$c] = Less_Functions::operate( $op, $this->rgb[$c], $other->rgb[$c]);
|
117 |
+
}
|
118 |
+
return new Less_Tree_Color($rgb, $alpha);
|
119 |
+
}
|
120 |
+
|
121 |
+
public function toRGB(){
|
122 |
+
return $this->toHex($this->rgb);
|
123 |
+
}
|
124 |
+
|
125 |
+
public function toHSL(){
|
126 |
+
$r = $this->rgb[0] / 255;
|
127 |
+
$g = $this->rgb[1] / 255;
|
128 |
+
$b = $this->rgb[2] / 255;
|
129 |
+
$a = $this->alpha;
|
130 |
+
|
131 |
+
$max = max($r, $g, $b);
|
132 |
+
$min = min($r, $g, $b);
|
133 |
+
$l = ($max + $min) / 2;
|
134 |
+
$d = $max - $min;
|
135 |
+
|
136 |
+
$h = $s = 0;
|
137 |
+
if( $max !== $min ){
|
138 |
+
$s = $l > 0.5 ? $d / (2 - $max - $min) : $d / ($max + $min);
|
139 |
+
|
140 |
+
switch ($max) {
|
141 |
+
case $r: $h = ($g - $b) / $d + ($g < $b ? 6 : 0); break;
|
142 |
+
case $g: $h = ($b - $r) / $d + 2; break;
|
143 |
+
case $b: $h = ($r - $g) / $d + 4; break;
|
144 |
+
}
|
145 |
+
$h /= 6;
|
146 |
+
}
|
147 |
+
return array('h' => $h * 360, 's' => $s, 'l' => $l, 'a' => $a );
|
148 |
+
}
|
149 |
+
|
150 |
+
//Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
|
151 |
+
public function toHSV() {
|
152 |
+
$r = $this->rgb[0] / 255;
|
153 |
+
$g = $this->rgb[1] / 255;
|
154 |
+
$b = $this->rgb[2] / 255;
|
155 |
+
$a = $this->alpha;
|
156 |
+
|
157 |
+
$max = max($r, $g, $b);
|
158 |
+
$min = min($r, $g, $b);
|
159 |
+
|
160 |
+
$v = $max;
|
161 |
+
|
162 |
+
$d = $max - $min;
|
163 |
+
if ($max === 0) {
|
164 |
+
$s = 0;
|
165 |
+
} else {
|
166 |
+
$s = $d / $max;
|
167 |
+
}
|
168 |
+
|
169 |
+
$h = 0;
|
170 |
+
if( $max !== $min ){
|
171 |
+
switch($max){
|
172 |
+
case $r: $h = ($g - $b) / $d + ($g < $b ? 6 : 0); break;
|
173 |
+
case $g: $h = ($b - $r) / $d + 2; break;
|
174 |
+
case $b: $h = ($r - $g) / $d + 4; break;
|
175 |
+
}
|
176 |
+
$h /= 6;
|
177 |
+
}
|
178 |
+
return array('h'=> $h * 360, 's'=> $s, 'v'=> $v, 'a' => $a );
|
179 |
+
}
|
180 |
+
|
181 |
+
public function toARGB(){
|
182 |
+
$argb = array_merge( (array) Less_Parser::round($this->alpha * 255), $this->rgb);
|
183 |
+
return $this->toHex( $argb );
|
184 |
+
}
|
185 |
+
|
186 |
+
public function compare($x){
|
187 |
+
|
188 |
+
if( !property_exists( $x, 'rgb' ) ){
|
189 |
+
return -1;
|
190 |
+
}
|
191 |
+
|
192 |
+
|
193 |
+
return ($x->rgb[0] === $this->rgb[0] &&
|
194 |
+
$x->rgb[1] === $this->rgb[1] &&
|
195 |
+
$x->rgb[2] === $this->rgb[2] &&
|
196 |
+
$x->alpha === $this->alpha) ? 0 : -1;
|
197 |
+
}
|
198 |
+
|
199 |
+
public function toHex( $v ){
|
200 |
+
|
201 |
+
$ret = '#';
|
202 |
+
foreach($v as $c){
|
203 |
+
$c = Less_Functions::clamp( Less_Parser::round($c), 255);
|
204 |
+
if( $c < 16 ){
|
205 |
+
$ret .= '0';
|
206 |
+
}
|
207 |
+
$ret .= dechex($c);
|
208 |
+
}
|
209 |
+
|
210 |
+
return $ret;
|
211 |
+
}
|
212 |
+
|
213 |
+
|
214 |
+
/**
|
215 |
+
* @param string $keyword
|
216 |
+
*/
|
217 |
+
public static function fromKeyword( $keyword ){
|
218 |
+
$keyword = strtolower($keyword);
|
219 |
+
|
220 |
+
if( Less_Colors::hasOwnProperty($keyword) ){
|
221 |
+
// detect named color
|
222 |
+
return new Less_Tree_Color(substr(Less_Colors::color($keyword), 1));
|
223 |
+
}
|
224 |
+
|
225 |
+
if( $keyword === 'transparent' ){
|
226 |
+
return new Less_Tree_Color( array(0, 0, 0), 0, true);
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
}
|
base/inc/lib/Less/Tree/Comment.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Comment
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Comment extends Less_Tree{
|
10 |
+
|
11 |
+
public $value;
|
12 |
+
public $silent;
|
13 |
+
public $isReferenced;
|
14 |
+
public $currentFileInfo;
|
15 |
+
public $type = 'Comment';
|
16 |
+
|
17 |
+
public function __construct($value, $silent, $index = null, $currentFileInfo = null ){
|
18 |
+
$this->value = $value;
|
19 |
+
$this->silent = !! $silent;
|
20 |
+
$this->currentFileInfo = $currentFileInfo;
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @see Less_Tree::genCSS
|
25 |
+
*/
|
26 |
+
public function genCSS( $output ){
|
27 |
+
//if( $this->debugInfo ){
|
28 |
+
//$output->add( tree.debugInfo($env, $this), $this->currentFileInfo, $this->index);
|
29 |
+
//}
|
30 |
+
$output->add( trim($this->value) );//TODO shouldn't need to trim, we shouldn't grab the \n
|
31 |
+
}
|
32 |
+
|
33 |
+
public function toCSS(){
|
34 |
+
return Less_Parser::$options['compress'] ? '' : $this->value;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function isSilent(){
|
38 |
+
$isReference = ($this->currentFileInfo && isset($this->currentFileInfo['reference']) && (!isset($this->isReferenced) || !$this->isReferenced) );
|
39 |
+
$isCompressed = Less_Parser::$options['compress'] && !preg_match('/^\/\*!/', $this->value);
|
40 |
+
return $this->silent || $isReference || $isCompressed;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function compile(){
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function markReferenced(){
|
48 |
+
$this->isReferenced = true;
|
49 |
+
}
|
50 |
+
|
51 |
+
}
|
base/inc/lib/Less/Tree/Condition.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Condition
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Condition extends Less_Tree{
|
10 |
+
|
11 |
+
public $op;
|
12 |
+
public $lvalue;
|
13 |
+
public $rvalue;
|
14 |
+
public $index;
|
15 |
+
public $negate;
|
16 |
+
public $type = 'Condition';
|
17 |
+
|
18 |
+
public function __construct($op, $l, $r, $i = 0, $negate = false) {
|
19 |
+
$this->op = trim($op);
|
20 |
+
$this->lvalue = $l;
|
21 |
+
$this->rvalue = $r;
|
22 |
+
$this->index = $i;
|
23 |
+
$this->negate = $negate;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function accept($visitor){
|
27 |
+
$this->lvalue = $visitor->visitObj( $this->lvalue );
|
28 |
+
$this->rvalue = $visitor->visitObj( $this->rvalue );
|
29 |
+
}
|
30 |
+
|
31 |
+
public function compile($env) {
|
32 |
+
$a = $this->lvalue->compile($env);
|
33 |
+
$b = $this->rvalue->compile($env);
|
34 |
+
|
35 |
+
switch( $this->op ){
|
36 |
+
case 'and':
|
37 |
+
$result = $a && $b;
|
38 |
+
break;
|
39 |
+
|
40 |
+
case 'or':
|
41 |
+
$result = $a || $b;
|
42 |
+
break;
|
43 |
+
|
44 |
+
default:
|
45 |
+
if( Less_Parser::is_method($a, 'compare') ){
|
46 |
+
$result = $a->compare($b);
|
47 |
+
}elseif( Less_Parser::is_method($b, 'compare') ){
|
48 |
+
$result = $b->compare($a);
|
49 |
+
}else{
|
50 |
+
throw new Less_Exception_Compiler('Unable to perform comparison', null, $this->index);
|
51 |
+
}
|
52 |
+
|
53 |
+
switch ($result) {
|
54 |
+
case -1:
|
55 |
+
$result = $this->op === '<' || $this->op === '=<' || $this->op === '<=';
|
56 |
+
break;
|
57 |
+
|
58 |
+
case 0:
|
59 |
+
$result = $this->op === '=' || $this->op === '>=' || $this->op === '=<' || $this->op === '<=';
|
60 |
+
break;
|
61 |
+
|
62 |
+
case 1:
|
63 |
+
$result = $this->op === '>' || $this->op === '>=';
|
64 |
+
break;
|
65 |
+
}
|
66 |
+
break;
|
67 |
+
}
|
68 |
+
|
69 |
+
return $this->negate ? !$result : $result;
|
70 |
+
}
|
71 |
+
|
72 |
+
}
|
base/inc/lib/Less/Tree/DefaultFunc.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* DefaultFunc
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_DefaultFunc{
|
10 |
+
|
11 |
+
static $error_;
|
12 |
+
static $value_;
|
13 |
+
|
14 |
+
public static function compile(){
|
15 |
+
if( self::$error_ ){
|
16 |
+
throw new Exception(self::$error_);
|
17 |
+
}
|
18 |
+
if( self::$value_ !== null ){
|
19 |
+
return self::$value_ ? new Less_Tree_Keyword('true') : new Less_Tree_Keyword('false');
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public static function value( $v ){
|
24 |
+
self::$value_ = $v;
|
25 |
+
}
|
26 |
+
|
27 |
+
public static function error( $e ){
|
28 |
+
self::$error_ = $e;
|
29 |
+
}
|
30 |
+
|
31 |
+
public static function reset(){
|
32 |
+
self::$value_ = self::$error_ = null;
|
33 |
+
}
|
34 |
+
}
|
base/inc/lib/Less/Tree/DetachedRuleset.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* DetachedRuleset
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_DetachedRuleset extends Less_Tree{
|
10 |
+
|
11 |
+
public $ruleset;
|
12 |
+
public $frames;
|
13 |
+
public $type = 'DetachedRuleset';
|
14 |
+
|
15 |
+
public function __construct( $ruleset, $frames = null ){
|
16 |
+
$this->ruleset = $ruleset;
|
17 |
+
$this->frames = $frames;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function accept($visitor) {
|
21 |
+
$this->ruleset = $visitor->visitObj($this->ruleset);
|
22 |
+
}
|
23 |
+
|
24 |
+
public function compile($env){
|
25 |
+
if( $this->frames ){
|
26 |
+
$frames = $this->frames;
|
27 |
+
}else{
|
28 |
+
$frames = $env->frames;
|
29 |
+
}
|
30 |
+
return new Less_Tree_DetachedRuleset($this->ruleset, $frames);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function callEval($env) {
|
34 |
+
if( $this->frames ){
|
35 |
+
return $this->ruleset->compile( $env->copyEvalEnv( array_merge($this->frames,$env->frames) ) );
|
36 |
+
}
|
37 |
+
return $this->ruleset->compile( $env );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
base/inc/lib/Less/Tree/Dimension.php
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Dimension
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Dimension extends Less_Tree{
|
10 |
+
|
11 |
+
public $value;
|
12 |
+
public $unit;
|
13 |
+
public $type = 'Dimension';
|
14 |
+
|
15 |
+
public function __construct($value, $unit = null){
|
16 |
+
$this->value = floatval($value);
|
17 |
+
|
18 |
+
if( $unit && ($unit instanceof Less_Tree_Unit) ){
|
19 |
+
$this->unit = $unit;
|
20 |
+
}elseif( $unit ){
|
21 |
+
$this->unit = new Less_Tree_Unit( array($unit) );
|
22 |
+
}else{
|
23 |
+
$this->unit = new Less_Tree_Unit( );
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
public function accept( $visitor ){
|
28 |
+
$this->unit = $visitor->visitObj( $this->unit );
|
29 |
+
}
|
30 |
+
|
31 |
+
public function compile(){
|
32 |
+
return $this;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function toColor() {
|
36 |
+
return new Less_Tree_Color(array($this->value, $this->value, $this->value));
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @see Less_Tree::genCSS
|
41 |
+
*/
|
42 |
+
public function genCSS( $output ){
|
43 |
+
|
44 |
+
if( Less_Parser::$options['strictUnits'] && !$this->unit->isSingular() ){
|
45 |
+
throw new Less_Exception_Compiler("Multiple units in dimension. Correct the units or use the unit function. Bad unit: ".$this->unit->toString());
|
46 |
+
}
|
47 |
+
|
48 |
+
$value = Less_Functions::fround( $this->value );
|
49 |
+
$strValue = (string)$value;
|
50 |
+
|
51 |
+
if( $value !== 0 && $value < 0.000001 && $value > -0.000001 ){
|
52 |
+
// would be output 1e-6 etc.
|
53 |
+
$strValue = number_format($strValue,10);
|
54 |
+
$strValue = preg_replace('/\.?0+$/','', $strValue);
|
55 |
+
}
|
56 |
+
|
57 |
+
if( Less_Parser::$options['compress'] ){
|
58 |
+
// Zero values doesn't need a unit
|
59 |
+
if( $value === 0 && $this->unit->isLength() ){
|
60 |
+
$output->add( $strValue );
|
61 |
+
return $strValue;
|
62 |
+
}
|
63 |
+
|
64 |
+
// Float values doesn't need a leading zero
|
65 |
+
if( $value > 0 && $value < 1 && $strValue[0] === '0' ){
|
66 |
+
$strValue = substr($strValue,1);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
$output->add( $strValue );
|
71 |
+
$this->unit->genCSS( $output );
|
72 |
+
}
|
73 |
+
|
74 |
+
public function __toString(){
|
75 |
+
return $this->toCSS();
|
76 |
+
}
|
77 |
+
|
78 |
+
// In an operation between two Dimensions,
|
79 |
+
// we default to the first Dimension's unit,
|
80 |
+
// so `1px + 2em` will yield `3px`.
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @param string $op
|
84 |
+
*/
|
85 |
+
public function operate( $op, $other){
|
86 |
+
|
87 |
+
$value = Less_Functions::operate( $op, $this->value, $other->value);
|
88 |
+
$unit = clone $this->unit;
|
89 |
+
|
90 |
+
if( $op === '+' || $op === '-' ){
|
91 |
+
|
92 |
+
if( !$unit->numerator && !$unit->denominator ){
|
93 |
+
$unit->numerator = $other->unit->numerator;
|
94 |
+
$unit->denominator = $other->unit->denominator;
|
95 |
+
}elseif( !$other->unit->numerator && !$other->unit->denominator ){
|
96 |
+
// do nothing
|
97 |
+
}else{
|
98 |
+
$other = $other->convertTo( $this->unit->usedUnits());
|
99 |
+
|
100 |
+
if( Less_Parser::$options['strictUnits'] && $other->unit->toString() !== $unit->toCSS() ){
|
101 |
+
throw new Less_Exception_Compiler("Incompatible units. Change the units or use the unit function. Bad units: '" . $unit->toString() . "' and " . $other->unit->toString() . "'.");
|
102 |
+
}
|
103 |
+
|
104 |
+
$value = Less_Functions::operate( $op, $this->value, $other->value);
|
105 |
+
}
|
106 |
+
}elseif( $op === '*' ){
|
107 |
+
$unit->numerator = array_merge($unit->numerator, $other->unit->numerator);
|
108 |
+
$unit->denominator = array_merge($unit->denominator, $other->unit->denominator);
|
109 |
+
sort($unit->numerator);
|
110 |
+
sort($unit->denominator);
|
111 |
+
$unit->cancel();
|
112 |
+
}elseif( $op === '/' ){
|
113 |
+
$unit->numerator = array_merge($unit->numerator, $other->unit->denominator);
|
114 |
+
$unit->denominator = array_merge($unit->denominator, $other->unit->numerator);
|
115 |
+
sort($unit->numerator);
|
116 |
+
sort($unit->denominator);
|
117 |
+
$unit->cancel();
|
118 |
+
}
|
119 |
+
return new Less_Tree_Dimension( $value, $unit);
|
120 |
+
}
|
121 |
+
|
122 |
+
public function compare($other) {
|
123 |
+
if ($other instanceof Less_Tree_Dimension) {
|
124 |
+
|
125 |
+
if( $this->unit->isEmpty() || $other->unit->isEmpty() ){
|
126 |
+
$a = $this;
|
127 |
+
$b = $other;
|
128 |
+
} else {
|
129 |
+
$a = $this->unify();
|
130 |
+
$b = $other->unify();
|
131 |
+
if( $a->unit->compare($b->unit) !== 0 ){
|
132 |
+
return -1;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
$aValue = $a->value;
|
136 |
+
$bValue = $b->value;
|
137 |
+
|
138 |
+
if ($bValue > $aValue) {
|
139 |
+
return -1;
|
140 |
+
} elseif ($bValue < $aValue) {
|
141 |
+
return 1;
|
142 |
+
} else {
|
143 |
+
return 0;
|
144 |
+
}
|
145 |
+
} else {
|
146 |
+
return -1;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
public function unify() {
|
151 |
+
return $this->convertTo(array('length'=> 'px', 'duration'=> 's', 'angle' => 'rad' ));
|
152 |
+
}
|
153 |
+
|
154 |
+
public function convertTo($conversions) {
|
155 |
+
$value = $this->value;
|
156 |
+
$unit = clone $this->unit;
|
157 |
+
|
158 |
+
if( is_string($conversions) ){
|
159 |
+
$derivedConversions = array();
|
160 |
+
foreach( Less_Tree_UnitConversions::$groups as $i ){
|
161 |
+
if( isset(Less_Tree_UnitConversions::${$i}[$conversions]) ){
|
162 |
+
$derivedConversions = array( $i => $conversions);
|
163 |
+
}
|
164 |
+
}
|
165 |
+
$conversions = $derivedConversions;
|
166 |
+
}
|
167 |
+
|
168 |
+
|
169 |
+
foreach($conversions as $groupName => $targetUnit){
|
170 |
+
$group = Less_Tree_UnitConversions::${$groupName};
|
171 |
+
|
172 |
+
//numerator
|
173 |
+
foreach($unit->numerator as $i => $atomicUnit){
|
174 |
+
$atomicUnit = $unit->numerator[$i];
|
175 |
+
if( !isset($group[$atomicUnit]) ){
|
176 |
+
continue;
|
177 |
+
}
|
178 |
+
|
179 |
+
$value = $value * ($group[$atomicUnit] / $group[$targetUnit]);
|
180 |
+
|
181 |
+
$unit->numerator[$i] = $targetUnit;
|
182 |
+
}
|
183 |
+
|
184 |
+
//denominator
|
185 |
+
foreach($unit->denominator as $i => $atomicUnit){
|
186 |
+
$atomicUnit = $unit->denominator[$i];
|
187 |
+
if( !isset($group[$atomicUnit]) ){
|
188 |
+
continue;
|
189 |
+
}
|
190 |
+
|
191 |
+
$value = $value / ($group[$atomicUnit] / $group[$targetUnit]);
|
192 |
+
|
193 |
+
$unit->denominator[$i] = $targetUnit;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
$unit->cancel();
|
198 |
+
|
199 |
+
return new Less_Tree_Dimension( $value, $unit);
|
200 |
+
}
|
201 |
+
}
|
base/inc/lib/Less/Tree/Directive.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Directive
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Directive extends Less_Tree{
|
10 |
+
|
11 |
+
public $name;
|
12 |
+
public $value;
|
13 |
+
public $rules;
|
14 |
+
public $index;
|
15 |
+
public $isReferenced;
|
16 |
+
public $currentFileInfo;
|
17 |
+
public $debugInfo;
|
18 |
+
public $type = 'Directive';
|
19 |
+
|
20 |
+
public function __construct($name, $value = null, $rules, $index = null, $currentFileInfo = null, $debugInfo = null ){
|
21 |
+
$this->name = $name;
|
22 |
+
$this->value = $value;
|
23 |
+
if( $rules ){
|
24 |
+
$this->rules = $rules;
|
25 |
+
$this->rules->allowImports = true;
|
26 |
+
}
|
27 |
+
|
28 |
+
$this->index = $index;
|
29 |
+
$this->currentFileInfo = $currentFileInfo;
|
30 |
+
$this->debugInfo = $debugInfo;
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
public function accept( $visitor ){
|
35 |
+
if( $this->rules ){
|
36 |
+
$this->rules = $visitor->visitObj( $this->rules );
|
37 |
+
}
|
38 |
+
if( $this->value ){
|
39 |
+
$this->value = $visitor->visitObj( $this->value );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @see Less_Tree::genCSS
|
46 |
+
*/
|
47 |
+
public function genCSS( $output ){
|
48 |
+
$value = $this->value;
|
49 |
+
$rules = $this->rules;
|
50 |
+
$output->add( $this->name, $this->currentFileInfo, $this->index );
|
51 |
+
if( $this->value ){
|
52 |
+
$output->add(' ');
|
53 |
+
$this->value->genCSS($output);
|
54 |
+
}
|
55 |
+
if( $this->rules ){
|
56 |
+
Less_Tree::outputRuleset( $output, array($this->rules));
|
57 |
+
} else {
|
58 |
+
$output->add(';');
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
public function compile($env){
|
63 |
+
|
64 |
+
$value = $this->value;
|
65 |
+
$rules = $this->rules;
|
66 |
+
if( $value ){
|
67 |
+
$value = $value->compile($env);
|
68 |
+
}
|
69 |
+
|
70 |
+
if( $rules ){
|
71 |
+
$rules = $rules->compile($env);
|
72 |
+
$rules->root = true;
|
73 |
+
}
|
74 |
+
|
75 |
+
return new Less_Tree_Directive( $this->name, $value, $rules, $this->index, $this->currentFileInfo, $this->debugInfo );
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
public function variable($name){
|
80 |
+
if( $this->rules ){
|
81 |
+
return $this->rules->variable($name);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
public function find($selector){
|
86 |
+
if( $this->rules ){
|
87 |
+
return $this->rules->find($selector, $this);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
//rulesets: function () { if (this.rules) return tree.Ruleset.prototype.rulesets.apply(this.rules); },
|
92 |
+
|
93 |
+
public function markReferenced(){
|
94 |
+
$this->isReferenced = true;
|
95 |
+
if( $this->rules ){
|
96 |
+
Less_Tree::ReferencedArray($this->rules->rules);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
base/inc/lib/Less/Tree/Element.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Element
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Element extends Less_Tree{
|
10 |
+
|
11 |
+
public $combinator = '';
|
12 |
+
public $value = '';
|
13 |
+
public $index;
|
14 |
+
public $currentFileInfo;
|
15 |
+
public $type = 'Element';
|
16 |
+
|
17 |
+
public $value_is_object = false;
|
18 |
+
|
19 |
+
public function __construct($combinator, $value, $index = null, $currentFileInfo = null ){
|
20 |
+
|
21 |
+
$this->value = $value;
|
22 |
+
$this->value_is_object = is_object($value);
|
23 |
+
|
24 |
+
if( $combinator ){
|
25 |
+
$this->combinator = $combinator;
|
26 |
+
}
|
27 |
+
|
28 |
+
$this->index = $index;
|
29 |
+
$this->currentFileInfo = $currentFileInfo;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function accept( $visitor ){
|
33 |
+
if( $this->value_is_object ){ //object or string
|
34 |
+
$this->value = $visitor->visitObj( $this->value );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
public function compile($env){
|
39 |
+
|
40 |
+
if( Less_Environment::$mixin_stack ){
|
41 |
+
return new Less_Tree_Element($this->combinator, ($this->value_is_object ? $this->value->compile($env) : $this->value), $this->index, $this->currentFileInfo );
|
42 |
+
}
|
43 |
+
|
44 |
+
if( $this->value_is_object ){
|
45 |
+
$this->value = $this->value->compile($env);
|
46 |
+
}
|
47 |
+
|
48 |
+
return $this;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @see Less_Tree::genCSS
|
53 |
+
*/
|
54 |
+
public function genCSS( $output ){
|
55 |
+
$output->add( $this->toCSS(), $this->currentFileInfo, $this->index );
|
56 |
+
}
|
57 |
+
|
58 |
+
public function toCSS(){
|
59 |
+
|
60 |
+
if( $this->value_is_object ){
|
61 |
+
$value = $this->value->toCSS();
|
62 |
+
}else{
|
63 |
+
$value = $this->value;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
if( $value === '' && $this->combinator && $this->combinator === '&' ){
|
68 |
+
return '';
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
return Less_Environment::$_outputMap[$this->combinator] . $value;
|
73 |
+
}
|
74 |
+
|
75 |
+
}
|
base/inc/lib/Less/Tree/Expression.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Expression
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Expression extends Less_Tree{
|
10 |
+
|
11 |
+
public $value = array();
|
12 |
+
public $parens = false;
|
13 |
+
public $parensInOp = false;
|
14 |
+
public $type = 'Expression';
|
15 |
+
|
16 |
+
public function __construct( $value, $parens = null ){
|
17 |
+
$this->value = $value;
|
18 |
+
$this->parens = $parens;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function accept( $visitor ){
|
22 |
+
$this->value = $visitor->visitArray( $this->value );
|
23 |
+
}
|
24 |
+
|
25 |
+
public function compile($env) {
|
26 |
+
|
27 |
+
$doubleParen = false;
|
28 |
+
|
29 |
+
if( $this->parens && !$this->parensInOp ){
|
30 |
+
Less_Environment::$parensStack++;
|
31 |
+
}
|
32 |
+
|
33 |
+
$returnValue = null;
|
34 |
+
if( $this->value ){
|
35 |
+
|
36 |
+
$count = count($this->value);
|
37 |
+
|
38 |
+
if( $count > 1 ){
|
39 |
+
|
40 |
+
$ret = array();
|
41 |
+
foreach($this->value as $e){
|
42 |
+
$ret[] = $e->compile($env);
|
43 |
+
}
|
44 |
+
$returnValue = new Less_Tree_Expression($ret);
|
45 |
+
|
46 |
+
}else{
|
47 |
+
|
48 |
+
if( ($this->value[0] instanceof Less_Tree_Expression) && $this->value[0]->parens && !$this->value[0]->parensInOp ){
|
49 |
+
$doubleParen = true;
|
50 |
+
}
|
51 |
+
|
52 |
+
$returnValue = $this->value[0]->compile($env);
|
53 |
+
}
|
54 |
+
|
55 |
+
} else {
|
56 |
+
$returnValue = $this;
|
57 |
+
}
|
58 |
+
|
59 |
+
if( $this->parens ){
|
60 |
+
if( !$this->parensInOp ){
|
61 |
+
Less_Environment::$parensStack--;
|
62 |
+
|
63 |
+
}elseif( !Less_Environment::isMathOn() && !$doubleParen ){
|
64 |
+
$returnValue = new Less_Tree_Paren($returnValue);
|
65 |
+
|
66 |
+
}
|
67 |
+
}
|
68 |
+
return $returnValue;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* @see Less_Tree::genCSS
|
73 |
+
*/
|
74 |
+
public function genCSS( $output ){
|
75 |
+
$val_len = count($this->value);
|
76 |
+
for( $i = 0; $i < $val_len; $i++ ){
|
77 |
+
$this->value[$i]->genCSS( $output );
|
78 |
+
if( $i + 1 < $val_len ){
|
79 |
+
$output->add( ' ' );
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
public function throwAwayComments() {
|
85 |
+
|
86 |
+
if( is_array($this->value) ){
|
87 |
+
$new_value = array();
|
88 |
+
foreach($this->value as $v){
|
89 |
+
if( $v instanceof Less_Tree_Comment ){
|
90 |
+
continue;
|
91 |
+
}
|
92 |
+
$new_value[] = $v;
|
93 |
+
}
|
94 |
+
$this->value = $new_value;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
base/inc/lib/Less/Tree/Extend.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Extend
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Extend extends Less_Tree{
|
10 |
+
|
11 |
+
public $selector;
|
12 |
+
public $option;
|
13 |
+
public $index;
|
14 |
+
public $selfSelectors = array();
|
15 |
+
public $allowBefore;
|
16 |
+
public $allowAfter;
|
17 |
+
public $firstExtendOnThisSelectorPath;
|
18 |
+
public $type = 'Extend';
|
19 |
+
public $ruleset;
|
20 |
+
|
21 |
+
|
22 |
+
public $object_id;
|
23 |
+
public $parent_ids = array();
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @param integer $index
|
27 |
+
*/
|
28 |
+
public function __construct($selector, $option, $index){
|
29 |
+
static $i = 0;
|
30 |
+
$this->selector = $selector;
|
31 |
+
$this->option = $option;
|
32 |
+
$this->index = $index;
|
33 |
+
|
34 |
+
switch($option){
|
35 |
+
case "all":
|
36 |
+
$this->allowBefore = true;
|
37 |
+
$this->allowAfter = true;
|
38 |
+
break;
|
39 |
+
default:
|
40 |
+
$this->allowBefore = false;
|
41 |
+
$this->allowAfter = false;
|
42 |
+
break;
|
43 |
+
}
|
44 |
+
|
45 |
+
$this->object_id = $i++;
|
46 |
+
$this->parent_ids = array($this->object_id);
|
47 |
+
}
|
48 |
+
|
49 |
+
public function accept( $visitor ){
|
50 |
+
$this->selector = $visitor->visitObj( $this->selector );
|
51 |
+
}
|
52 |
+
|
53 |
+
public function compile( $env ){
|
54 |
+
Less_Parser::$has_extends = true;
|
55 |
+
$this->selector = $this->selector->compile($env);
|
56 |
+
return $this;
|
57 |
+
//return new Less_Tree_Extend( $this->selector->compile($env), $this->option, $this->index);
|
58 |
+
}
|
59 |
+
|
60 |
+
public function findSelfSelectors( $selectors ){
|
61 |
+
$selfElements = array();
|
62 |
+
|
63 |
+
|
64 |
+
for( $i = 0, $selectors_len = count($selectors); $i < $selectors_len; $i++ ){
|
65 |
+
$selectorElements = $selectors[$i]->elements;
|
66 |
+
// duplicate the logic in genCSS function inside the selector node.
|
67 |
+
// future TODO - move both logics into the selector joiner visitor
|
68 |
+
if( $i && $selectorElements && $selectorElements[0]->combinator === "") {
|
69 |
+
$selectorElements[0]->combinator = ' ';
|
70 |
+
}
|
71 |
+
$selfElements = array_merge( $selfElements, $selectors[$i]->elements );
|
72 |
+
}
|
73 |
+
|
74 |
+
$this->selfSelectors = array(new Less_Tree_Selector($selfElements));
|
75 |
+
}
|
76 |
+
|
77 |
+
}
|
base/inc/lib/Less/Tree/Import.php
ADDED
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* CSS @import node
|
5 |
+
*
|
6 |
+
* The general strategy here is that we don't want to wait
|
7 |
+
* for the parsing to be completed, before we start importing
|
8 |
+
* the file. That's because in the context of a browser,
|
9 |
+
* most of the time will be spent waiting for the server to respond.
|
10 |
+
*
|
11 |
+
* On creation, we push the import path to our import queue, though
|
12 |
+
* `import,push`, we also pass it a callback, which it'll call once
|
13 |
+
* the file has been fetched, and parsed.
|
14 |
+
*
|
15 |
+
* @package Less
|
16 |
+
* @subpackage tree
|
17 |
+
*/
|
18 |
+
class Less_Tree_Import extends Less_Tree{
|
19 |
+
|
20 |
+
public $options;
|
21 |
+
public $index;
|
22 |
+
public $path;
|
23 |
+
public $features;
|
24 |
+
public $currentFileInfo;
|
25 |
+
public $css;
|
26 |
+
public $skip;
|
27 |
+
public $root;
|
28 |
+
public $type = 'Import';
|
29 |
+
|
30 |
+
public function __construct($path, $features, $options, $index, $currentFileInfo = null ){
|
31 |
+
$this->options = $options;
|
32 |
+
$this->index = $index;
|
33 |
+
$this->path = $path;
|
34 |
+
$this->features = $features;
|
35 |
+
$this->currentFileInfo = $currentFileInfo;
|
36 |
+
|
37 |
+
if( is_array($options) ){
|
38 |
+
$this->options += array('inline'=>false);
|
39 |
+
|
40 |
+
if( isset($this->options['less']) || $this->options['inline'] ){
|
41 |
+
$this->css = !isset($this->options['less']) || !$this->options['less'] || $this->options['inline'];
|
42 |
+
} else {
|
43 |
+
$pathValue = $this->getPath();
|
44 |
+
if( $pathValue && preg_match('/css([\?;].*)?$/',$pathValue) ){
|
45 |
+
$this->css = true;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
//
|
52 |
+
// The actual import node doesn't return anything, when converted to CSS.
|
53 |
+
// The reason is that it's used at the evaluation stage, so that the rules
|
54 |
+
// it imports can be treated like any other rules.
|
55 |
+
//
|
56 |
+
// In `eval`, we make sure all Import nodes get evaluated, recursively, so
|
57 |
+
// we end up with a flat structure, which can easily be imported in the parent
|
58 |
+
// ruleset.
|
59 |
+
//
|
60 |
+
|
61 |
+
public function accept($visitor){
|
62 |
+
|
63 |
+
if( $this->features ){
|
64 |
+
$this->features = $visitor->visitObj($this->features);
|
65 |
+
}
|
66 |
+
$this->path = $visitor->visitObj($this->path);
|
67 |
+
|
68 |
+
if( !$this->options['inline'] && $this->root ){
|
69 |
+
$this->root = $visitor->visit($this->root);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* @see Less_Tree::genCSS
|
75 |
+
*/
|
76 |
+
public function genCSS( $output ){
|
77 |
+
if( $this->css ){
|
78 |
+
|
79 |
+
$output->add( '@import ', $this->currentFileInfo, $this->index );
|
80 |
+
|
81 |
+
$this->path->genCSS( $output );
|
82 |
+
if( $this->features ){
|
83 |
+
$output->add( ' ' );
|
84 |
+
$this->features->genCSS( $output );
|
85 |
+
}
|
86 |
+
$output->add( ';' );
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
public function toCSS(){
|
91 |
+
$features = $this->features ? ' ' . $this->features->toCSS() : '';
|
92 |
+
|
93 |
+
if ($this->css) {
|
94 |
+
return "@import " . $this->path->toCSS() . $features . ";\n";
|
95 |
+
} else {
|
96 |
+
return "";
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @return string
|
102 |
+
*/
|
103 |
+
public function getPath(){
|
104 |
+
if ($this->path instanceof Less_Tree_Quoted) {
|
105 |
+
$path = $this->path->value;
|
106 |
+
$path = ( isset($this->css) || preg_match('/(\.[a-z]*$)|([\?;].*)$/',$path)) ? $path : $path . '.less';
|
107 |
+
} else if ($this->path instanceof Less_Tree_URL) {
|
108 |
+
$path = $this->path->value->value;
|
109 |
+
}else{
|
110 |
+
return null;
|
111 |
+
}
|
112 |
+
|
113 |
+
//remove query string and fragment
|
114 |
+
return preg_replace('/[\?#][^\?]*$/','',$path);
|
115 |
+
}
|
116 |
+
|
117 |
+
public function compileForImport( $env ){
|
118 |
+
return new Less_Tree_Import( $this->path->compile($env), $this->features, $this->options, $this->index, $this->currentFileInfo);
|
119 |
+
}
|
120 |
+
|
121 |
+
public function compilePath($env) {
|
122 |
+
$path = $this->path->compile($env);
|
123 |
+
$rootpath = '';
|
124 |
+
if( $this->currentFileInfo && $this->currentFileInfo['rootpath'] ){
|
125 |
+
$rootpath = $this->currentFileInfo['rootpath'];
|
126 |
+
}
|
127 |
+
|
128 |
+
|
129 |
+
if( !($path instanceof Less_Tree_URL) ){
|
130 |
+
if( $rootpath ){
|
131 |
+
$pathValue = $path->value;
|
132 |
+
// Add the base path if the import is relative
|
133 |
+
if( $pathValue && Less_Environment::isPathRelative($pathValue) ){
|
134 |
+
$path->value = $this->currentFileInfo['uri_root'].$pathValue;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
$path->value = Less_Environment::normalizePath($path->value);
|
138 |
+
}
|
139 |
+
|
140 |
+
|
141 |
+
|
142 |
+
return $path;
|
143 |
+
}
|
144 |
+
|
145 |
+
public function compile( $env ){
|
146 |
+
|
147 |
+
$evald = $this->compileForImport($env);
|
148 |
+
|
149 |
+
//get path & uri
|
150 |
+
$path_and_uri = null;
|
151 |
+
if( is_callable(Less_Parser::$options['import_callback']) ){
|
152 |
+
$path_and_uri = call_user_func(Less_Parser::$options['import_callback'],$evald);
|
153 |
+
}
|
154 |
+
|
155 |
+
if( !$path_and_uri ){
|
156 |
+
$path_and_uri = $evald->PathAndUri();
|
157 |
+
}
|
158 |
+
|
159 |
+
if( $path_and_uri ){
|
160 |
+
list($full_path, $uri) = $path_and_uri;
|
161 |
+
}else{
|
162 |
+
$full_path = $uri = $evald->getPath();
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
//import once
|
167 |
+
if( $evald->skip( $full_path, $env) ){
|
168 |
+
return array();
|
169 |
+
}
|
170 |
+
|
171 |
+
if( $this->options['inline'] ){
|
172 |
+
//todo needs to reference css file not import
|
173 |
+
//$contents = new Less_Tree_Anonymous($this->root, 0, array('filename'=>$this->importedFilename), true );
|
174 |
+
|
175 |
+
Less_Parser::AddParsedFile($full_path);
|
176 |
+
$contents = new Less_Tree_Anonymous( file_get_contents($full_path), 0, array(), true );
|
177 |
+
|
178 |
+
if( $this->features ){
|
179 |
+
return new Less_Tree_Media( array($contents), $this->features->value );
|
180 |
+
}
|
181 |
+
|
182 |
+
return array( $contents );
|
183 |
+
}
|
184 |
+
|
185 |
+
// optional (need to be before "CSS" to support optional CSS imports. CSS should be checked only if empty($this->currentFileInfo))
|
186 |
+
if( isset($this->options['optional']) && $this->options['optional'] && !file_exists($full_path) && (!$evald->css || !empty($this->currentFileInfo))) {
|
187 |
+
return array();
|
188 |
+
}
|
189 |
+
|
190 |
+
|
191 |
+
// css ?
|
192 |
+
if( $evald->css ){
|
193 |
+
$features = ( $evald->features ? $evald->features->compile($env) : null );
|
194 |
+
return new Less_Tree_Import( $this->compilePath( $env), $features, $this->options, $this->index);
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
return $this->ParseImport( $full_path, $uri, $env );
|
199 |
+
}
|
200 |
+
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Using the import directories, get the full absolute path and uri of the import
|
204 |
+
*
|
205 |
+
* @param Less_Tree_Import $evald
|
206 |
+
*/
|
207 |
+
public function PathAndUri(){
|
208 |
+
|
209 |
+
$evald_path = $this->getPath();
|
210 |
+
|
211 |
+
if( $evald_path ){
|
212 |
+
|
213 |
+
$import_dirs = array();
|
214 |
+
|
215 |
+
if( Less_Environment::isPathRelative($evald_path) ){
|
216 |
+
//if the path is relative, the file should be in the current directory
|
217 |
+
$import_dirs[ $this->currentFileInfo['currentDirectory'] ] = $this->currentFileInfo['uri_root'];
|
218 |
+
|
219 |
+
}else{
|
220 |
+
//otherwise, the file should be relative to the server root
|
221 |
+
$import_dirs[ $this->currentFileInfo['entryPath'] ] = $this->currentFileInfo['entryUri'];
|
222 |
+
|
223 |
+
//if the user supplied entryPath isn't the actual root
|
224 |
+
$import_dirs[ $_SERVER['DOCUMENT_ROOT'] ] = '';
|
225 |
+
|
226 |
+
}
|
227 |
+
|
228 |
+
// always look in user supplied import directories
|
229 |
+
$import_dirs = array_merge( $import_dirs, Less_Parser::$options['import_dirs'] );
|
230 |
+
|
231 |
+
|
232 |
+
foreach( $import_dirs as $rootpath => $rooturi){
|
233 |
+
if( is_callable($rooturi) ){
|
234 |
+
list($path, $uri) = call_user_func($rooturi, $evald_path);
|
235 |
+
if( is_string($path) ){
|
236 |
+
$full_path = $path;
|
237 |
+
return array( $full_path, $uri );
|
238 |
+
}
|
239 |
+
}elseif( !empty($rootpath) ){
|
240 |
+
|
241 |
+
$path = rtrim($rootpath,'/\\').'/'.ltrim($evald_path,'/\\');
|
242 |
+
|
243 |
+
if( file_exists($path) ){
|
244 |
+
$full_path = Less_Environment::normalizePath($path);
|
245 |
+
$uri = Less_Environment::normalizePath(dirname($rooturi.$evald_path));
|
246 |
+
return array( $full_path, $uri );
|
247 |
+
} elseif( file_exists($path.'.less') ){
|
248 |
+
$full_path = Less_Environment::normalizePath($path.'.less');
|
249 |
+
$uri = Less_Environment::normalizePath(dirname($rooturi.$evald_path.'.less'));
|
250 |
+
return array( $full_path, $uri );
|
251 |
+
}
|
252 |
+
}
|
253 |
+
}
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Parse the import url and return the rules
|
260 |
+
*
|
261 |
+
* @return Less_Tree_Media|array
|
262 |
+
*/
|
263 |
+
public function ParseImport( $full_path, $uri, $env ){
|
264 |
+
|
265 |
+
$import_env = clone $env;
|
266 |
+
if( (isset($this->options['reference']) && $this->options['reference']) || isset($this->currentFileInfo['reference']) ){
|
267 |
+
$import_env->currentFileInfo['reference'] = true;
|
268 |
+
}
|
269 |
+
|
270 |
+
if( (isset($this->options['multiple']) && $this->options['multiple']) ){
|
271 |
+
$import_env->importMultiple = true;
|
272 |
+
}
|
273 |
+
|
274 |
+
$parser = new Less_Parser($import_env);
|
275 |
+
$root = $parser->parseFile($full_path, $uri, true);
|
276 |
+
|
277 |
+
|
278 |
+
$ruleset = new Less_Tree_Ruleset(array(), $root->rules );
|
279 |
+
$ruleset->evalImports($import_env);
|
280 |
+
|
281 |
+
return $this->features ? new Less_Tree_Media($ruleset->rules, $this->features->value) : $ruleset->rules;
|
282 |
+
}
|
283 |
+
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Should the import be skipped?
|
287 |
+
*
|
288 |
+
* @return boolean|null
|
289 |
+
*/
|
290 |
+
private function Skip($path, $env){
|
291 |
+
|
292 |
+
$path = Less_Parser::AbsPath($path, true);
|
293 |
+
|
294 |
+
if( $path && Less_Parser::FileParsed($path) ){
|
295 |
+
|
296 |
+
if( isset($this->currentFileInfo['reference']) ){
|
297 |
+
return true;
|
298 |
+
}
|
299 |
+
|
300 |
+
return !isset($this->options['multiple']) && !$env->importMultiple;
|
301 |
+
}
|
302 |
+
|
303 |
+
}
|
304 |
+
}
|
base/inc/lib/Less/Tree/Javascript.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Javascript
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Javascript extends Less_Tree{
|
10 |
+
|
11 |
+
public $type = 'Javascript';
|
12 |
+
public $escaped;
|
13 |
+
public $expression;
|
14 |
+
public $index;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @param boolean $index
|
18 |
+
* @param boolean $escaped
|
19 |
+
*/
|
20 |
+
public function __construct($string, $index, $escaped){
|
21 |
+
$this->escaped = $escaped;
|
22 |
+
$this->expression = $string;
|
23 |
+
$this->index = $index;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function compile(){
|
27 |
+
return new Less_Tree_Anonymous('/* Sorry, can not do JavaScript evaluation in PHP... :( */');
|
28 |
+
}
|
29 |
+
|
30 |
+
}
|
base/inc/lib/Less/Tree/Keyword.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Keyword
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Keyword extends Less_Tree{
|
10 |
+
|
11 |
+
public $value;
|
12 |
+
public $type = 'Keyword';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @param string $value
|
16 |
+
*/
|
17 |
+
public function __construct($value){
|
18 |
+
$this->value = $value;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function compile(){
|
22 |
+
return $this;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @see Less_Tree::genCSS
|
27 |
+
*/
|
28 |
+
public function genCSS( $output ){
|
29 |
+
|
30 |
+
if( $this->value === '%') {
|
31 |
+
throw new Less_Exception_Compiler("Invalid % without number");
|
32 |
+
}
|
33 |
+
|
34 |
+
$output->add( $this->value );
|
35 |
+
}
|
36 |
+
|
37 |
+
public function compare($other) {
|
38 |
+
if ($other instanceof Less_Tree_Keyword) {
|
39 |
+
return $other->value === $this->value ? 0 : 1;
|
40 |
+
} else {
|
41 |
+
return -1;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
base/inc/lib/Less/Tree/Media.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Media
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Media extends Less_Tree{
|
10 |
+
|
11 |
+
public $features;
|
12 |
+
public $rules;
|
13 |
+
public $index;
|
14 |
+
public $currentFileInfo;
|
15 |
+
public $isReferenced;
|
16 |
+
public $type = 'Media';
|
17 |
+
|
18 |
+
public function __construct($value = array(), $features = array(), $index = null, $currentFileInfo = null ){
|
19 |
+
|
20 |
+
$this->index = $index;
|
21 |
+
$this->currentFileInfo = $currentFileInfo;
|
22 |
+
|
23 |
+
$selectors = $this->emptySelectors();
|
24 |
+
|
25 |
+
$this->features = new Less_Tree_Value($features);
|
26 |
+
|
27 |
+
$this->rules = array(new Less_Tree_Ruleset($selectors, $value));
|
28 |
+
$this->rules[0]->allowImports = true;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function accept( $visitor ){
|
32 |
+
$this->features = $visitor->visitObj($this->features);
|
33 |
+
$this->rules = $visitor->visitArray($this->rules);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @see Less_Tree::genCSS
|
38 |
+
*/
|
39 |
+
public function genCSS( $output ){
|
40 |
+
|
41 |
+
$output->add( '@media ', $this->currentFileInfo, $this->index );
|
42 |
+
$this->features->genCSS( $output );
|
43 |
+
Less_Tree::outputRuleset( $output, $this->rules);
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
public function compile($env) {
|
48 |
+
|
49 |
+
$media = new Less_Tree_Media(array(), array(), $this->index, $this->currentFileInfo );
|
50 |
+
|
51 |
+
$strictMathBypass = false;
|
52 |
+
if( Less_Parser::$options['strictMath'] === false) {
|
53 |
+
$strictMathBypass = true;
|
54 |
+
Less_Parser::$options['strictMath'] = true;
|
55 |
+
}
|
56 |
+
|
57 |
+
$media->features = $this->features->compile($env);
|
58 |
+
|
59 |
+
if( $strictMathBypass ){
|
60 |
+
Less_Parser::$options['strictMath'] = false;
|
61 |
+
}
|
62 |
+
|
63 |
+
$env->mediaPath[] = $media;
|
64 |
+
$env->mediaBlocks[] = $media;
|
65 |
+
|
66 |
+
array_unshift($env->frames, $this->rules[0]);
|
67 |
+
$media->rules = array($this->rules[0]->compile($env));
|
68 |
+
array_shift($env->frames);
|
69 |
+
|
70 |
+
array_pop($env->mediaPath);
|
71 |
+
|
72 |
+
return !$env->mediaPath ? $media->compileTop($env) : $media->compileNested($env);
|
73 |
+
}
|
74 |
+
|
75 |
+
public function variable($name) {
|
76 |
+
return $this->rules[0]->variable($name);
|
77 |
+
}
|
78 |
+
|
79 |
+
public function find($selector) {
|
80 |
+
return $this->rules[0]->find($selector, $this);
|
81 |
+
}
|
82 |
+
|
83 |
+
public function emptySelectors(){
|
84 |
+
$el = new Less_Tree_Element('','&', $this->index, $this->currentFileInfo );
|
85 |
+
$sels = array( new Less_Tree_Selector(array($el), array(), null, $this->index, $this->currentFileInfo) );
|
86 |
+
$sels[0]->mediaEmpty = true;
|
87 |
+
return $sels;
|
88 |
+
}
|
89 |
+
|
90 |
+
public function markReferenced(){
|
91 |
+
$this->rules[0]->markReferenced();
|
92 |
+
$this->isReferenced = true;
|
93 |
+
Less_Tree::ReferencedArray($this->rules[0]->rules);
|
94 |
+
}
|
95 |
+
|
96 |
+
// evaltop
|
97 |
+
public function compileTop($env) {
|
98 |
+
$result = $this;
|
99 |
+
|
100 |
+
if (count($env->mediaBlocks) > 1) {
|
101 |
+
$selectors = $this->emptySelectors();
|
102 |
+
$result = new Less_Tree_Ruleset($selectors, $env->mediaBlocks);
|
103 |
+
$result->multiMedia = true;
|
104 |
+
}
|
105 |
+
|
106 |
+
$env->mediaBlocks = array();
|
107 |
+
$env->mediaPath = array();
|
108 |
+
|
109 |
+
return $result;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function compileNested($env) {
|
113 |
+
$path = array_merge($env->mediaPath, array($this));
|
114 |
+
|
115 |
+
// Extract the media-query conditions separated with `,` (OR).
|
116 |
+
foreach ($path as $key => $p) {
|
117 |
+
$value = $p->features instanceof Less_Tree_Value ? $p->features->value : $p->features;
|
118 |
+
$path[$key] = is_array($value) ? $value : array($value);
|
119 |
+
}
|
120 |
+
|
121 |
+
// Trace all permutations to generate the resulting media-query.
|
122 |
+
//
|
123 |
+
// (a, b and c) with nested (d, e) ->
|
124 |
+
// a and d
|
125 |
+
// a and e
|
126 |
+
// b and c and d
|
127 |
+
// b and c and e
|
128 |
+
|
129 |
+
$permuted = $this->permute($path);
|
130 |
+
$expressions = array();
|
131 |
+
foreach($permuted as $path){
|
132 |
+
|
133 |
+
for( $i=0, $len=count($path); $i < $len; $i++){
|
134 |
+
$path[$i] = Less_Parser::is_method($path[$i], 'toCSS') ? $path[$i] : new Less_Tree_Anonymous($path[$i]);
|
135 |
+
}
|
136 |
+
|
137 |
+
for( $i = count($path) - 1; $i > 0; $i-- ){
|
138 |
+
array_splice($path, $i, 0, array(new Less_Tree_Anonymous('and')));
|
139 |
+
}
|
140 |
+
|
141 |
+
$expressions[] = new Less_Tree_Expression($path);
|
142 |
+
}
|
143 |
+
$this->features = new Less_Tree_Value($expressions);
|
144 |
+
|
145 |
+
|
146 |
+
|
147 |
+
// Fake a tree-node that doesn't output anything.
|
148 |
+
return new Less_Tree_Ruleset(array(), array());
|
149 |
+
}
|
150 |
+
|
151 |
+
public function permute($arr) {
|
152 |
+
if (!$arr)
|
153 |
+
return array();
|
154 |
+
|
155 |
+
if (count($arr) == 1)
|
156 |
+
return $arr[0];
|
157 |
+
|
158 |
+
$result = array();
|
159 |
+
$rest = $this->permute(array_slice($arr, 1));
|
160 |
+
foreach ($rest as $r) {
|
161 |
+
foreach ($arr[0] as $a) {
|
162 |
+
$result[] = array_merge(
|
163 |
+
is_array($a) ? $a : array($a),
|
164 |
+
is_array($r) ? $r : array($r)
|
165 |
+
);
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
return $result;
|
170 |
+
}
|
171 |
+
|
172 |
+
public function bubbleSelectors($selectors) {
|
173 |
+
|
174 |
+
if( !$selectors) return;
|
175 |
+
|
176 |
+
$this->rules = array(new Less_Tree_Ruleset( $selectors, array($this->rules[0])));
|
177 |
+
}
|
178 |
+
|
179 |
+
}
|
base/inc/lib/Less/Tree/Mixin/Call.php
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class Less_Tree_Mixin_Call extends Less_Tree{
|
5 |
+
|
6 |
+
public $selector;
|
7 |
+
public $arguments;
|
8 |
+
public $index;
|
9 |
+
public $currentFileInfo;
|
10 |
+
|
11 |
+
public $important;
|
12 |
+
public $type = 'MixinCall';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* less.js: tree.mixin.Call
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
public function __construct($elements, $args, $index, $currentFileInfo, $important = false){
|
19 |
+
$this->selector = new Less_Tree_Selector($elements);
|
20 |
+
$this->arguments = $args;
|
21 |
+
$this->index = $index;
|
22 |
+
$this->currentFileInfo = $currentFileInfo;
|
23 |
+
$this->important = $important;
|
24 |
+
}
|
25 |
+
|
26 |
+
//function accept($visitor){
|
27 |
+
// $this->selector = $visitor->visit($this->selector);
|
28 |
+
// $this->arguments = $visitor->visit($this->arguments);
|
29 |
+
//}
|
30 |
+
|
31 |
+
|
32 |
+
public function compile($env){
|
33 |
+
|
34 |
+
$rules = array();
|
35 |
+
$match = false;
|
36 |
+
$isOneFound = false;
|
37 |
+
$candidates = array();
|
38 |
+
$defaultUsed = false;
|
39 |
+
$conditionResult = array();
|
40 |
+
|
41 |
+
$args = array();
|
42 |
+
foreach($this->arguments as $a){
|
43 |
+
$args[] = array('name'=> $a['name'], 'value' => $a['value']->compile($env) );
|
44 |
+
}
|
45 |
+
|
46 |
+
foreach($env->frames as $frame){
|
47 |
+
|
48 |
+
$mixins = $frame->find($this->selector);
|
49 |
+
|
50 |
+
if( !$mixins ){
|
51 |
+
continue;
|
52 |
+
}
|
53 |
+
|
54 |
+
$isOneFound = true;
|
55 |
+
$defNone = 0;
|
56 |
+
$defTrue = 1;
|
57 |
+
$defFalse = 2;
|
58 |
+
|
59 |
+
// To make `default()` function independent of definition order we have two "subpasses" here.
|
60 |
+
// At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),
|
61 |
+
// and build candidate list with corresponding flags. Then, when we know all possible matches,
|
62 |
+
// we make a final decision.
|
63 |
+
|
64 |
+
$mixins_len = count($mixins);
|
65 |
+
for( $m = 0; $m < $mixins_len; $m++ ){
|
66 |
+
$mixin = $mixins[$m];
|
67 |
+
|
68 |
+
if( $this->IsRecursive( $env, $mixin ) ){
|
69 |
+
continue;
|
70 |
+
}
|
71 |
+
|
72 |
+
if( $mixin->matchArgs($args, $env) ){
|
73 |
+
|
74 |
+
$candidate = array('mixin' => $mixin, 'group' => $defNone);
|
75 |
+
|
76 |
+
if( $mixin instanceof Less_Tree_Ruleset ){
|
77 |
+
|
78 |
+
for( $f = 0; $f < 2; $f++ ){
|
79 |
+
Less_Tree_DefaultFunc::value($f);
|
80 |
+
$conditionResult[$f] = $mixin->matchCondition( $args, $env);
|
81 |
+
}
|
82 |
+
if( $conditionResult[0] || $conditionResult[1] ){
|
83 |
+
if( $conditionResult[0] != $conditionResult[1] ){
|
84 |
+
$candidate['group'] = $conditionResult[1] ? $defTrue : $defFalse;
|
85 |
+
}
|
86 |
+
|
87 |
+
$candidates[] = $candidate;
|
88 |
+
}
|
89 |
+
}else{
|
90 |
+
$candidates[] = $candidate;
|
91 |
+
}
|
92 |
+
|
93 |
+
$match = true;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
Less_Tree_DefaultFunc::reset();
|
98 |
+
|
99 |
+
|
100 |
+
$count = array(0, 0, 0);
|
101 |
+
for( $m = 0; $m < count($candidates); $m++ ){
|
102 |
+
$count[ $candidates[$m]['group'] ]++;
|
103 |
+
}
|
104 |
+
|
105 |
+
if( $count[$defNone] > 0 ){
|
106 |
+
$defaultResult = $defFalse;
|
107 |
+
} else {
|
108 |
+
$defaultResult = $defTrue;
|
109 |
+
if( ($count[$defTrue] + $count[$defFalse]) > 1 ){
|
110 |
+
throw new Exception( 'Ambiguous use of `default()` found when matching for `' . $this->format($args) . '`' );
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
$candidates_length = count($candidates);
|
116 |
+
$length_1 = ($candidates_length == 1);
|
117 |
+
|
118 |
+
for( $m = 0; $m < $candidates_length; $m++){
|
119 |
+
$candidate = $candidates[$m]['group'];
|
120 |
+
if( ($candidate === $defNone) || ($candidate === $defaultResult) ){
|
121 |
+
try{
|
122 |
+
$mixin = $candidates[$m]['mixin'];
|
123 |
+
if( !($mixin instanceof Less_Tree_Mixin_Definition) ){
|
124 |
+
$mixin = new Less_Tree_Mixin_Definition('', array(), $mixin->rules, null, false);
|
125 |
+
$mixin->originalRuleset = $mixins[$m]->originalRuleset;
|
126 |
+
}
|
127 |
+
$rules = array_merge($rules, $mixin->evalCall($env, $args, $this->important)->rules);
|
128 |
+
} catch (Exception $e) {
|
129 |
+
//throw new Less_Exception_Compiler($e->getMessage(), $e->index, null, $this->currentFileInfo['filename']);
|
130 |
+
throw new Less_Exception_Compiler($e->getMessage(), null, null, $this->currentFileInfo);
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
if( $match ){
|
136 |
+
if( !$this->currentFileInfo || !isset($this->currentFileInfo['reference']) || !$this->currentFileInfo['reference'] ){
|
137 |
+
Less_Tree::ReferencedArray($rules);
|
138 |
+
}
|
139 |
+
|
140 |
+
return $rules;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
if( $isOneFound ){
|
145 |
+
throw new Less_Exception_Compiler('No matching definition was found for `'.$this->Format( $args ).'`', null, $this->index, $this->currentFileInfo);
|
146 |
+
|
147 |
+
}else{
|
148 |
+
throw new Less_Exception_Compiler(trim($this->selector->toCSS()) . " is undefined in ".$this->currentFileInfo['filename'], null, $this->index);
|
149 |
+
}
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Format the args for use in exception messages
|
155 |
+
*
|
156 |
+
*/
|
157 |
+
private function Format($args){
|
158 |
+
$message = array();
|
159 |
+
if( $args ){
|
160 |
+
foreach($args as $a){
|
161 |
+
$argValue = '';
|
162 |
+
if( $a['name'] ){
|
163 |
+
$argValue .= $a['name'] . ':';
|
164 |
+
}
|
165 |
+
if( is_object($a['value']) ){
|
166 |
+
$argValue .= $a['value']->toCSS();
|
167 |
+
}else{
|
168 |
+
$argValue .= '???';
|
169 |
+
}
|
170 |
+
$message[] = $argValue;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
return implode(', ',$message);
|
174 |
+
}
|
175 |
+
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Are we in a recursive mixin call?
|
179 |
+
*
|
180 |
+
* @return bool
|
181 |
+
*/
|
182 |
+
private function IsRecursive( $env, $mixin ){
|
183 |
+
|
184 |
+
foreach($env->frames as $recur_frame){
|
185 |
+
if( !($mixin instanceof Less_Tree_Mixin_Definition) ){
|
186 |
+
|
187 |
+
if( $mixin === $recur_frame ){
|
188 |
+
return true;
|
189 |
+
}
|
190 |
+
|
191 |
+
if( isset($recur_frame->originalRuleset) && $mixin->ruleset_id === $recur_frame->originalRuleset ){
|
192 |
+
return true;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
return false;
|
198 |
+
}
|
199 |
+
|
200 |
+
}
|
201 |
+
|
202 |
+
|
base/inc/lib/Less/Tree/Mixin/Definition.php
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Less_Tree_Mixin_Definition extends Less_Tree_Ruleset{
|
4 |
+
public $name;
|
5 |
+
public $selectors;
|
6 |
+
public $params;
|
7 |
+
public $arity = 0;
|
8 |
+
public $rules;
|
9 |
+
public $lookups = array();
|
10 |
+
public $required = 0;
|
11 |
+
public $frames = array();
|
12 |
+
public $condition;
|
13 |
+
public $variadic;
|
14 |
+
public $type = 'MixinDefinition';
|
15 |
+
|
16 |
+
|
17 |
+
// less.js : /lib/less/tree/mixin.js : tree.mixin.Definition
|
18 |
+
public function __construct($name, $params, $rules, $condition, $variadic = false, $frames = array() ){
|
19 |
+
$this->name = $name;
|
20 |
+
$this->selectors = array(new Less_Tree_Selector(array( new Less_Tree_Element(null, $name))));
|
21 |
+
|
22 |
+
$this->params = $params;
|
23 |
+
$this->condition = $condition;
|
24 |
+
$this->variadic = $variadic;
|
25 |
+
$this->rules = $rules;
|
26 |
+
|
27 |
+
if( $params ){
|
28 |
+
$this->arity = count($params);
|
29 |
+
foreach( $params as $p ){
|
30 |
+
if (! isset($p['name']) || ($p['name'] && !isset($p['value']))) {
|
31 |
+
$this->required++;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
$this->frames = $frames;
|
37 |
+
$this->SetRulesetIndex();
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
//function accept( $visitor ){
|
43 |
+
// $this->params = $visitor->visit($this->params);
|
44 |
+
// $this->rules = $visitor->visit($this->rules);
|
45 |
+
// $this->condition = $visitor->visit($this->condition);
|
46 |
+
//}
|
47 |
+
|
48 |
+
|
49 |
+
public function toCSS(){
|
50 |
+
return '';
|
51 |
+
}
|
52 |
+
|
53 |
+
// less.js : /lib/less/tree/mixin.js : tree.mixin.Definition.evalParams
|
54 |
+
public function compileParams($env, $mixinFrames, $args = array() , &$evaldArguments = array() ){
|
55 |
+
$frame = new Less_Tree_Ruleset(null, array());
|
56 |
+
$params = $this->params;
|
57 |
+
$mixinEnv = null;
|
58 |
+
$argsLength = 0;
|
59 |
+
|
60 |
+
if( $args ){
|
61 |
+
$argsLength = count($args);
|
62 |
+
for($i = 0; $i < $argsLength; $i++ ){
|
63 |
+
$arg = $args[$i];
|
64 |
+
|
65 |
+
if( $arg && $arg['name'] ){
|
66 |
+
$isNamedFound = false;
|
67 |
+
|
68 |
+
foreach($params as $j => $param){
|
69 |
+
if( !isset($evaldArguments[$j]) && $arg['name'] === $params[$j]['name']) {
|
70 |
+
$evaldArguments[$j] = $arg['value']->compile($env);
|
71 |
+
array_unshift($frame->rules, new Less_Tree_Rule( $arg['name'], $arg['value']->compile($env) ) );
|
72 |
+
$isNamedFound = true;
|
73 |
+
break;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
if ($isNamedFound) {
|
77 |
+
array_splice($args, $i, 1);
|
78 |
+
$i--;
|
79 |
+
$argsLength--;
|
80 |
+
continue;
|
81 |
+
} else {
|
82 |
+
throw new Less_Exception_Compiler("Named argument for " . $this->name .' '.$args[$i]['name'] . ' not found');
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
$argIndex = 0;
|
89 |
+
foreach($params as $i => $param){
|
90 |
+
|
91 |
+
if ( isset($evaldArguments[$i]) ){ continue; }
|
92 |
+
|
93 |
+
$arg = null;
|
94 |
+
if( isset($args[$argIndex]) ){
|
95 |
+
$arg = $args[$argIndex];
|
96 |
+
}
|
97 |
+
|
98 |
+
if (isset($param['name']) && $param['name']) {
|
99 |
+
|
100 |
+
if( isset($param['variadic']) ){
|
101 |
+
$varargs = array();
|
102 |
+
for ($j = $argIndex; $j < $argsLength; $j++) {
|
103 |
+
$varargs[] = $args[$j]['value']->compile($env);
|
104 |
+
}
|
105 |
+
$expression = new Less_Tree_Expression($varargs);
|
106 |
+
array_unshift($frame->rules, new Less_Tree_Rule($param['name'], $expression->compile($env)));
|
107 |
+
}else{
|
108 |
+
$val = ($arg && $arg['value']) ? $arg['value'] : false;
|
109 |
+
|
110 |
+
if ($val) {
|
111 |
+
$val = $val->compile($env);
|
112 |
+
} else if ( isset($param['value']) ) {
|
113 |
+
|
114 |
+
if( !$mixinEnv ){
|
115 |
+
$mixinEnv = new Less_Environment();
|
116 |
+
$mixinEnv->frames = array_merge( array($frame), $mixinFrames);
|
117 |
+
}
|
118 |
+
|
119 |
+
$val = $param['value']->compile($mixinEnv);
|
120 |
+
$frame->resetCache();
|
121 |
+
} else {
|
122 |
+
throw new Less_Exception_Compiler("Wrong number of arguments for " . $this->name . " (" . $argsLength . ' for ' . $this->arity . ")");
|
123 |
+
}
|
124 |
+
|
125 |
+
array_unshift($frame->rules, new Less_Tree_Rule($param['name'], $val));
|
126 |
+
$evaldArguments[$i] = $val;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( isset($param['variadic']) && $args) {
|
131 |
+
for ($j = $argIndex; $j < $argsLength; $j++) {
|
132 |
+
$evaldArguments[$j] = $args[$j]['value']->compile($env);
|
133 |
+
}
|
134 |
+
}
|
135 |
+
$argIndex++;
|
136 |
+
}
|
137 |
+
|
138 |
+
ksort($evaldArguments);
|
139 |
+
$evaldArguments = array_values($evaldArguments);
|
140 |
+
|
141 |
+
return $frame;
|
142 |
+
}
|
143 |
+
|
144 |
+
public function compile($env) {
|
145 |
+
if( $this->frames ){
|
146 |
+
return new Less_Tree_Mixin_Definition($this->name, $this->params, $this->rules, $this->condition, $this->variadic, $this->frames );
|
147 |
+
}
|
148 |
+
return new Less_Tree_Mixin_Definition($this->name, $this->params, $this->rules, $this->condition, $this->variadic, $env->frames );
|
149 |
+
}
|
150 |
+
|
151 |
+
public function evalCall($env, $args = NULL, $important = NULL) {
|
152 |
+
|
153 |
+
Less_Environment::$mixin_stack++;
|
154 |
+
|
155 |
+
$_arguments = array();
|
156 |
+
|
157 |
+
if( $this->frames ){
|
158 |
+
$mixinFrames = array_merge($this->frames, $env->frames);
|
159 |
+
}else{
|
160 |
+
$mixinFrames = $env->frames;
|
161 |
+
}
|
162 |
+
|
163 |
+
$frame = $this->compileParams($env, $mixinFrames, $args, $_arguments);
|
164 |
+
|
165 |
+
$ex = new Less_Tree_Expression($_arguments);
|
166 |
+
array_unshift($frame->rules, new Less_Tree_Rule('@arguments', $ex->compile($env)));
|
167 |
+
|
168 |
+
|
169 |
+
$ruleset = new Less_Tree_Ruleset(null, $this->rules);
|
170 |
+
$ruleset->originalRuleset = $this->ruleset_id;
|
171 |
+
|
172 |
+
|
173 |
+
$ruleSetEnv = new Less_Environment();
|
174 |
+
$ruleSetEnv->frames = array_merge( array($this, $frame), $mixinFrames );
|
175 |
+
$ruleset = $ruleset->compile( $ruleSetEnv );
|
176 |
+
|
177 |
+
if( $important ){
|
178 |
+
$ruleset = $ruleset->makeImportant();
|
179 |
+
}
|
180 |
+
|
181 |
+
Less_Environment::$mixin_stack--;
|
182 |
+
|
183 |
+
return $ruleset;
|
184 |
+
}
|
185 |
+
|
186 |
+
|
187 |
+
public function matchCondition($args, $env) {
|
188 |
+
|
189 |
+
if( !$this->condition ){
|
190 |
+
return true;
|
191 |
+
}
|
192 |
+
|
193 |
+
// set array to prevent error on array_merge
|
194 |
+
if(!is_array($this->frames)) {
|
195 |
+
$this->frames = array();
|
196 |
+
}
|
197 |
+
|
198 |
+
$frame = $this->compileParams($env, array_merge($this->frames,$env->frames), $args );
|
199 |
+
|
200 |
+
$compile_env = new Less_Environment();
|
201 |
+
$compile_env->frames = array_merge(
|
202 |
+
array($frame) // the parameter variables
|
203 |
+
, $this->frames // the parent namespace/mixin frames
|
204 |
+
, $env->frames // the current environment frames
|
205 |
+
);
|
206 |
+
|
207 |
+
$compile_env->functions = $env->functions;
|
208 |
+
|
209 |
+
return (bool)$this->condition->compile($compile_env);
|
210 |
+
}
|
211 |
+
|
212 |
+
public function matchArgs($args, $env = NULL){
|
213 |
+
$argsLength = count($args);
|
214 |
+
|
215 |
+
if( !$this->variadic ){
|
216 |
+
if( $argsLength < $this->required ){
|
217 |
+
return false;
|
218 |
+
}
|
219 |
+
if( $argsLength > count($this->params) ){
|
220 |
+
return false;
|
221 |
+
}
|
222 |
+
}else{
|
223 |
+
if( $argsLength < ($this->required - 1)){
|
224 |
+
return false;
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
$len = min($argsLength, $this->arity);
|
229 |
+
|
230 |
+
for( $i = 0; $i < $len; $i++ ){
|
231 |
+
if( !isset($this->params[$i]['name']) && !isset($this->params[$i]['variadic']) ){
|
232 |
+
if( $args[$i]['value']->compile($env)->toCSS() != $this->params[$i]['value']->compile($env)->toCSS() ){
|
233 |
+
return false;
|
234 |
+
}
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
return true;
|
239 |
+
}
|
240 |
+
|
241 |
+
}
|
base/inc/lib/Less/Tree/NameValue.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* A simple css name-value pair
|
5 |
+
* ex: width:100px;
|
6 |
+
*
|
7 |
+
* In bootstrap, there are about 600-1,000 simple name-value pairs (depending on how forgiving the match is) -vs- 6,020 dynamic rules (Less_Tree_Rule)
|
8 |
+
* Using the name-value object can speed up bootstrap compilation slightly, but it breaks color keyword interpretation: color:red -> color:#FF0000;
|
9 |
+
*
|
10 |
+
* @package Less
|
11 |
+
* @subpackage tree
|
12 |
+
*/
|
13 |
+
class Less_Tree_NameValue extends Less_Tree{
|
14 |
+
|
15 |
+
public $name;
|
16 |
+
public $value;
|
17 |
+
public $index;
|
18 |
+
public $currentFileInfo;
|
19 |
+
public $type = 'NameValue';
|
20 |
+
public $important = '';
|
21 |
+
|
22 |
+
public function __construct($name, $value = null, $index = null, $currentFileInfo = null ){
|
23 |
+
$this->name = $name;
|
24 |
+
$this->value = $value;
|
25 |
+
$this->index = $index;
|
26 |
+
$this->currentFileInfo = $currentFileInfo;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function genCSS( $output ){
|
30 |
+
|
31 |
+
$output->add(
|
32 |
+
$this->name
|
33 |
+
. Less_Environment::$_outputMap[': ']
|
34 |
+
. $this->value
|
35 |
+
. $this->important
|
36 |
+
. (((Less_Environment::$lastRule && Less_Parser::$options['compress'])) ? "" : ";")
|
37 |
+
, $this->currentFileInfo, $this->index);
|
38 |
+
}
|
39 |
+
|
40 |
+
public function compile ($env){
|
41 |
+
return $this;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function makeImportant(){
|
45 |
+
$new = new Less_Tree_NameValue($this->name, $this->value, $this->index, $this->currentFileInfo);
|
46 |
+
$new->important = ' !important';
|
47 |
+
return $new;
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
}
|
base/inc/lib/Less/Tree/Negative.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Negative
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Negative extends Less_Tree{
|
10 |
+
|
11 |
+
public $value;
|
12 |
+
public $type = 'Negative';
|
13 |
+
|
14 |
+
public function __construct($node){
|
15 |
+
$this->value = $node;
|
16 |
+
}
|
17 |
+
|
18 |
+
//function accept($visitor) {
|
19 |
+
// $this->value = $visitor->visit($this->value);
|
20 |
+
//}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @see Less_Tree::genCSS
|
24 |
+
*/
|
25 |
+
public function genCSS( $output ){
|
26 |
+
$output->add( '-' );
|
27 |
+
$this->value->genCSS( $output );
|
28 |
+
}
|
29 |
+
|
30 |
+
public function compile($env) {
|
31 |
+
if( Less_Environment::isMathOn() ){
|
32 |
+
$ret = new Less_Tree_Operation('*', array( new Less_Tree_Dimension(-1), $this->value ) );
|
33 |
+
return $ret->compile($env);
|
34 |
+
}
|
35 |
+
return new Less_Tree_Negative( $this->value->compile($env) );
|
36 |
+
}
|
37 |
+
}
|
base/inc/lib/Less/Tree/Operation.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Operation
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Operation extends Less_Tree{
|
10 |
+
|
11 |
+
public $op;
|
12 |
+
public $operands;
|
13 |
+
public $isSpaced;
|
14 |
+
public $type = 'Operation';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @param string $op
|
18 |
+
*/
|
19 |
+
public function __construct($op, $operands, $isSpaced = false){
|
20 |
+
$this->op = trim($op);
|
21 |
+
$this->operands = $operands;
|
22 |
+
$this->isSpaced = $isSpaced;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function accept($visitor) {
|
26 |
+
$this->operands = $visitor->visitArray($this->operands);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function compile($env){
|
30 |
+
$a = $this->operands[0]->compile($env);
|
31 |
+
$b = $this->operands[1]->compile($env);
|
32 |
+
|
33 |
+
|
34 |
+
if( Less_Environment::isMathOn() ){
|
35 |
+
|
36 |
+
if( $a instanceof Less_Tree_Dimension && $b instanceof Less_Tree_Color ){
|
37 |
+
$a = $a->toColor();
|
38 |
+
|
39 |
+
}elseif( $b instanceof Less_Tree_Dimension && $a instanceof Less_Tree_Color ){
|
40 |
+
$b = $b->toColor();
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
if( !method_exists($a,'operate') ){
|
45 |
+
throw new Less_Exception_Compiler("Operation on an invalid type");
|
46 |
+
}
|
47 |
+
|
48 |
+
return $a->operate( $this->op, $b);
|
49 |
+
}
|
50 |
+
|
51 |
+
return new Less_Tree_Operation($this->op, array($a, $b), $this->isSpaced );
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @see Less_Tree::genCSS
|
57 |
+
*/
|
58 |
+
public function genCSS( $output ){
|
59 |
+
$this->operands[0]->genCSS( $output );
|
60 |
+
if( $this->isSpaced ){
|
61 |
+
$output->add( " " );
|
62 |
+
}
|
63 |
+
$output->add( $this->op );
|
64 |
+
if( $this->isSpaced ){
|
65 |
+
$output->add( ' ' );
|
66 |
+
}
|
67 |
+
$this->operands[1]->genCSS( $output );
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
base/inc/lib/Less/Tree/Paren.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Paren
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Paren extends Less_Tree{
|
10 |
+
|
11 |
+
public $value;
|
12 |
+
public $type = 'Paren';
|
13 |
+
|
14 |
+
public function __construct($value) {
|
15 |
+
$this->value = $value;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function accept($visitor){
|
19 |
+
$this->value = $visitor->visitObj($this->value);
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @see Less_Tree::genCSS
|
24 |
+
*/
|
25 |
+
public function genCSS( $output ){
|
26 |
+
$output->add( '(' );
|
27 |
+
$this->value->genCSS( $output );
|
28 |
+
$output->add( ')' );
|
29 |
+
}
|
30 |
+
|
31 |
+
public function compile($env) {
|
32 |
+
return new Less_Tree_Paren($this->value->compile($env));
|
33 |
+
}
|
34 |
+
|
35 |
+
}
|
base/inc/lib/Less/Tree/Quoted.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Quoted
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Quoted extends Less_Tree{
|
10 |
+
public $escaped;
|
11 |
+
public $value;
|
12 |
+
public $quote;
|
13 |
+
public $index;
|
14 |
+
public $currentFileInfo;
|
15 |
+
public $type = 'Quoted';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param string $str
|
19 |
+
*/
|
20 |
+
public function __construct($str, $content = '', $escaped = false, $index = false, $currentFileInfo = null ){
|
21 |
+
$this->escaped = $escaped;
|
22 |
+
$this->value = $content;
|
23 |
+
if( $str ){
|
24 |
+
$this->quote = $str[0];
|
25 |
+
}
|
26 |
+
$this->index = $index;
|
27 |
+
$this->currentFileInfo = $currentFileInfo;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @see Less_Tree::genCSS
|
32 |
+
*/
|
33 |
+
public function genCSS( $output ){
|
34 |
+
if( !$this->escaped ){
|
35 |
+
$output->add( $this->quote, $this->currentFileInfo, $this->index );
|
36 |
+
}
|
37 |
+
$output->add( $this->value );
|
38 |
+
if( !$this->escaped ){
|
39 |
+
$output->add( $this->quote );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
public function compile($env){
|
44 |
+
|
45 |
+
$value = $this->value;
|
46 |
+
if( preg_match_all('/`([^`]+)`/', $this->value, $matches) ){
|
47 |
+
foreach($matches as $i => $match){
|
48 |
+
$js = new Less_Tree_JavaScript($matches[1], $this->index, true);
|
49 |
+
$js = $js->compile()->value;
|
50 |
+
$value = str_replace($matches[0][$i], $js, $value);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
if( preg_match_all('/@\{([\w-]+)\}/',$value,$matches) ){
|
55 |
+
foreach($matches[1] as $i => $match){
|
56 |
+
$v = new Less_Tree_Variable('@' . $match, $this->index, $this->currentFileInfo );
|
57 |
+
$v = $v->compile($env);
|
58 |
+
$v = ($v instanceof Less_Tree_Quoted) ? $v->value : $v->toCSS();
|
59 |
+
$value = str_replace($matches[0][$i], $v, $value);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
return new Less_Tree_Quoted($this->quote . $value . $this->quote, $value, $this->escaped, $this->index, $this->currentFileInfo);
|
64 |
+
}
|
65 |
+
|
66 |
+
public function compare($x) {
|
67 |
+
|
68 |
+
if( !Less_Parser::is_method($x, 'toCSS') ){
|
69 |
+
return -1;
|
70 |
+
}
|
71 |
+
|
72 |
+
$left = $this->toCSS();
|
73 |
+
$right = $x->toCSS();
|
74 |
+
|
75 |
+
if ($left === $right) {
|
76 |
+
return 0;
|
77 |
+
}
|
78 |
+
|
79 |
+
return $left < $right ? -1 : 1;
|
80 |
+
}
|
81 |
+
}
|
base/inc/lib/Less/Tree/Rule.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Rule
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Rule extends Less_Tree{
|
10 |
+
|
11 |
+
public $name;
|
12 |
+
public $value;
|
13 |
+
public $important;
|
14 |
+
public $merge;
|
15 |
+
public $index;
|
16 |
+
public $inline;
|
17 |
+
public $variable;
|
18 |
+
public $currentFileInfo;
|
19 |
+
public $type = 'Rule';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @param string $important
|
23 |
+
*/
|
24 |
+
public function __construct($name, $value = null, $important = null, $merge = null, $index = null, $currentFileInfo = null, $inline = false){
|
25 |
+
$this->name = $name;
|
26 |
+
$this->value = ($value instanceof Less_Tree_Value || $value instanceof Less_Tree_Ruleset) ? $value : new Less_Tree_Value(array($value));
|
27 |
+
$this->important = $important ? ' ' . trim($important) : '';
|
28 |
+
$this->merge = $merge;
|
29 |
+
$this->index = $index;
|
30 |
+
$this->currentFileInfo = $currentFileInfo;
|
31 |
+
$this->inline = $inline;
|
32 |
+
$this->variable = ( is_string($name) && $name[0] === '@');
|
33 |
+
}
|
34 |
+
|
35 |
+
public function accept($visitor) {
|
36 |
+
$this->value = $visitor->visitObj( $this->value );
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @see Less_Tree::genCSS
|
41 |
+
*/
|
42 |
+
public function genCSS( $output ){
|
43 |
+
|
44 |
+
$output->add( $this->name . Less_Environment::$_outputMap[': '], $this->currentFileInfo, $this->index);
|
45 |
+
try{
|
46 |
+
$this->value->genCSS( $output);
|
47 |
+
|
48 |
+
}catch( Less_Exception_Parser $e ){
|
49 |
+
$e->index = $this->index;
|
50 |
+
$e->currentFile = $this->currentFileInfo;
|
51 |
+
throw $e;
|
52 |
+
}
|
53 |
+
$output->add( $this->important . (($this->inline || (Less_Environment::$lastRule && Less_Parser::$options['compress'])) ? "" : ";"), $this->currentFileInfo, $this->index);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function compile ($env){
|
57 |
+
|
58 |
+
$name = $this->name;
|
59 |
+
if( is_array($name) ){
|
60 |
+
// expand 'primitive' name directly to get
|
61 |
+
// things faster (~10% for benchmark.less):
|
62 |
+
if( count($name) === 1 && $name[0] instanceof Less_Tree_Keyword ){
|
63 |
+
$name = $name[0]->value;
|
64 |
+
}else{
|
65 |
+
$name = $this->CompileName($env,$name);
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
$strictMathBypass = Less_Parser::$options['strictMath'];
|
70 |
+
if( $name === "font" && !Less_Parser::$options['strictMath'] ){
|
71 |
+
Less_Parser::$options['strictMath'] = true;
|
72 |
+
}
|
73 |
+
|
74 |
+
try {
|
75 |
+
$evaldValue = $this->value->compile($env);
|
76 |
+
|
77 |
+
if( !$this->variable && $evaldValue->type === "DetachedRuleset") {
|
78 |
+
throw new Less_Exception_Compiler("Rulesets cannot be evaluated on a property.", null, $this->index, $this->currentFileInfo);
|
79 |
+
}
|
80 |
+
|
81 |
+
if( Less_Environment::$mixin_stack ){
|
82 |
+
$return = new Less_Tree_Rule($name, $evaldValue, $this->important, $this->merge, $this->index, $this->currentFileInfo, $this->inline);
|
83 |
+
}else{
|
84 |
+
$this->name = $name;
|
85 |
+
$this->value = $evaldValue;
|
86 |
+
$return = $this;
|
87 |
+
}
|
88 |
+
|
89 |
+
}catch( Less_Exception_Parser $e ){
|
90 |
+
if( !is_numeric($e->index) ){
|
91 |
+
$e->index = $this->index;
|
92 |
+
$e->currentFile = $this->currentFileInfo;
|
93 |
+
}
|
94 |
+
throw $e;
|
95 |
+
}
|
96 |
+
|
97 |
+
Less_Parser::$options['strictMath'] = $strictMathBypass;
|
98 |
+
|
99 |
+
return $return;
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
public function CompileName( $env, $name ){
|
104 |
+
$output = new Less_Output();
|
105 |
+
foreach($name as $n){
|
106 |
+
$n->compile($env)->genCSS($output);
|
107 |
+
}
|
108 |
+
return $output->toString();
|
109 |
+
}
|
110 |
+
|
111 |
+
public function makeImportant(){
|
112 |
+
return new Less_Tree_Rule($this->name, $this->value, '!important', $this->merge, $this->index, $this->currentFileInfo, $this->inline);
|
113 |
+
}
|
114 |
+
|
115 |
+
}
|
base/inc/lib/Less/Tree/Ruleset.php
ADDED
@@ -0,0 +1,643 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Ruleset
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Ruleset extends Less_Tree{
|
10 |
+
|
11 |
+
protected $lookups;
|
12 |
+
public $_variables;
|
13 |
+
public $_rulesets;
|
14 |
+
|
15 |
+
public $strictImports;
|
16 |
+
|
17 |
+
public $selectors;
|
18 |
+
public $rules;
|
19 |
+
public $root;
|
20 |
+
public $allowImports;
|
21 |
+
public $paths;
|
22 |
+
public $firstRoot;
|
23 |
+
public $type = 'Ruleset';
|
24 |
+
public $multiMedia;
|
25 |
+
public $allExtends;
|
26 |
+
|
27 |
+
public $ruleset_id;
|
28 |
+
public $originalRuleset;
|
29 |
+
|
30 |
+
public $first_oelements;
|
31 |
+
|
32 |
+
public function SetRulesetIndex(){
|
33 |
+
$this->ruleset_id = Less_Parser::$next_id++;
|
34 |
+
$this->originalRuleset = $this->ruleset_id;
|
35 |
+
|
36 |
+
if( $this->selectors ){
|
37 |
+
foreach($this->selectors as $sel){
|
38 |
+
if( $sel->_oelements ){
|
39 |
+
$this->first_oelements[$sel->_oelements[0]] = true;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
public function __construct($selectors, $rules, $strictImports = null){
|
46 |
+
$this->selectors = $selectors;
|
47 |
+
$this->rules = $rules;
|
48 |
+
$this->lookups = array();
|
49 |
+
$this->strictImports = $strictImports;
|
50 |
+
$this->SetRulesetIndex();
|
51 |
+
}
|
52 |
+
|
53 |
+
public function accept( $visitor ){
|
54 |
+
if( $this->paths ){
|
55 |
+
$paths_len = count($this->paths);
|
56 |
+
for($i = 0,$paths_len; $i < $paths_len; $i++ ){
|
57 |
+
$this->paths[$i] = $visitor->visitArray($this->paths[$i]);
|
58 |
+
}
|
59 |
+
}elseif( $this->selectors ){
|
60 |
+
$this->selectors = $visitor->visitArray($this->selectors);
|
61 |
+
}
|
62 |
+
|
63 |
+
if( $this->rules ){
|
64 |
+
$this->rules = $visitor->visitArray($this->rules);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public function compile($env){
|
69 |
+
|
70 |
+
$ruleset = $this->PrepareRuleset($env);
|
71 |
+
|
72 |
+
|
73 |
+
// Store the frames around mixin definitions,
|
74 |
+
// so they can be evaluated like closures when the time comes.
|
75 |
+
$rsRuleCnt = count($ruleset->rules);
|
76 |
+
for( $i = 0; $i < $rsRuleCnt; $i++ ){
|
77 |
+
if( $ruleset->rules[$i] instanceof Less_Tree_Mixin_Definition || $ruleset->rules[$i] instanceof Less_Tree_DetachedRuleset ){
|
78 |
+
$ruleset->rules[$i] = $ruleset->rules[$i]->compile($env);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
$mediaBlockCount = 0;
|
83 |
+
if( $env instanceof Less_Environment ){
|
84 |
+
$mediaBlockCount = count($env->mediaBlocks);
|
85 |
+
}
|
86 |
+
|
87 |
+
// Evaluate mixin calls.
|
88 |
+
$this->EvalMixinCalls( $ruleset, $env, $rsRuleCnt );
|
89 |
+
|
90 |
+
|
91 |
+
// Evaluate everything else
|
92 |
+
for( $i=0; $i<$rsRuleCnt; $i++ ){
|
93 |
+
if(! ($ruleset->rules[$i] instanceof Less_Tree_Mixin_Definition || $ruleset->rules[$i] instanceof Less_Tree_DetachedRuleset) ){
|
94 |
+
$ruleset->rules[$i] = $ruleset->rules[$i]->compile($env);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
// Evaluate everything else
|
99 |
+
for( $i=0; $i<$rsRuleCnt; $i++ ){
|
100 |
+
$rule = $ruleset->rules[$i];
|
101 |
+
|
102 |
+
// for rulesets, check if it is a css guard and can be removed
|
103 |
+
if( $rule instanceof Less_Tree_Ruleset && $rule->selectors && count($rule->selectors) === 1 ){
|
104 |
+
|
105 |
+
// check if it can be folded in (e.g. & where)
|
106 |
+
if( $rule->selectors[0]->isJustParentSelector() ){
|
107 |
+
array_splice($ruleset->rules,$i--,1);
|
108 |
+
$rsRuleCnt--;
|
109 |
+
|
110 |
+
for($j = 0; $j < count($rule->rules); $j++ ){
|
111 |
+
$subRule = $rule->rules[$j];
|
112 |
+
if( !($subRule instanceof Less_Tree_Rule) || !$subRule->variable ){
|
113 |
+
array_splice($ruleset->rules, ++$i, 0, array($subRule));
|
114 |
+
$rsRuleCnt++;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
}
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
// Pop the stack
|
124 |
+
$env->shiftFrame();
|
125 |
+
|
126 |
+
if ($mediaBlockCount) {
|
127 |
+
$len = count($env->mediaBlocks);
|
128 |
+
for($i = $mediaBlockCount; $i < $len; $i++ ){
|
129 |
+
$env->mediaBlocks[$i]->bubbleSelectors($ruleset->selectors);
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
return $ruleset;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Compile Less_Tree_Mixin_Call objects
|
138 |
+
*
|
139 |
+
* @param Less_Tree_Ruleset $ruleset
|
140 |
+
* @param integer $rsRuleCnt
|
141 |
+
*/
|
142 |
+
private function EvalMixinCalls( $ruleset, $env, &$rsRuleCnt ){
|
143 |
+
for($i=0; $i < $rsRuleCnt; $i++){
|
144 |
+
$rule = $ruleset->rules[$i];
|
145 |
+
|
146 |
+
if( $rule instanceof Less_Tree_Mixin_Call ){
|
147 |
+
$rule = $rule->compile($env);
|
148 |
+
|
149 |
+
$temp = array();
|
150 |
+
foreach($rule as $r){
|
151 |
+
if( ($r instanceof Less_Tree_Rule) && $r->variable ){
|
152 |
+
// do not pollute the scope if the variable is
|
153 |
+
// already there. consider returning false here
|
154 |
+
// but we need a way to "return" variable from mixins
|
155 |
+
if( !$ruleset->variable($r->name) ){
|
156 |
+
$temp[] = $r;
|
157 |
+
}
|
158 |
+
}else{
|
159 |
+
$temp[] = $r;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
$temp_count = count($temp)-1;
|
163 |
+
array_splice($ruleset->rules, $i, 1, $temp);
|
164 |
+
$rsRuleCnt += $temp_count;
|
165 |
+
$i += $temp_count;
|
166 |
+
$ruleset->resetCache();
|
167 |
+
|
168 |
+
}elseif( $rule instanceof Less_Tree_RulesetCall ){
|
169 |
+
|
170 |
+
$rule = $rule->compile($env);
|
171 |
+
$rules = array();
|
172 |
+
foreach($rule->rules as $r){
|
173 |
+
if( ($r instanceof Less_Tree_Rule) && $r->variable ){
|
174 |
+
continue;
|
175 |
+
}
|
176 |
+
$rules[] = $r;
|
177 |
+
}
|
178 |
+
|
179 |
+
array_splice($ruleset->rules, $i, 1, $rules);
|
180 |
+
$temp_count = count($rules);
|
181 |
+
$rsRuleCnt += $temp_count - 1;
|
182 |
+
$i += $temp_count-1;
|
183 |
+
$ruleset->resetCache();
|
184 |
+
}
|
185 |
+
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Compile the selectors and create a new ruleset object for the compile() method
|
192 |
+
*
|
193 |
+
*/
|
194 |
+
private function PrepareRuleset($env){
|
195 |
+
|
196 |
+
$hasOnePassingSelector = false;
|
197 |
+
$selectors = array();
|
198 |
+
if( $this->selectors ){
|
199 |
+
Less_Tree_DefaultFunc::error("it is currently only allowed in parametric mixin guards,");
|
200 |
+
|
201 |
+
foreach($this->selectors as $s){
|
202 |
+
$selector = $s->compile($env);
|
203 |
+
$selectors[] = $selector;
|
204 |
+
if( $selector->evaldCondition ){
|
205 |
+
$hasOnePassingSelector = true;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
Less_Tree_DefaultFunc::reset();
|
210 |
+
} else {
|
211 |
+
$hasOnePassingSelector = true;
|
212 |
+
}
|
213 |
+
|
214 |
+
if( $this->rules && $hasOnePassingSelector ){
|
215 |
+
$rules = $this->rules;
|
216 |
+
}else{
|
217 |
+
$rules = array();
|
218 |
+
}
|
219 |
+
|
220 |
+
$ruleset = new Less_Tree_Ruleset($selectors, $rules, $this->strictImports);
|
221 |
+
|
222 |
+
$ruleset->originalRuleset = $this->ruleset_id;
|
223 |
+
|
224 |
+
$ruleset->root = $this->root;
|
225 |
+
$ruleset->firstRoot = $this->firstRoot;
|
226 |
+
$ruleset->allowImports = $this->allowImports;
|
227 |
+
|
228 |
+
|
229 |
+
// push the current ruleset to the frames stack
|
230 |
+
$env->unshiftFrame($ruleset);
|
231 |
+
|
232 |
+
|
233 |
+
// Evaluate imports
|
234 |
+
if( $ruleset->root || $ruleset->allowImports || !$ruleset->strictImports ){
|
235 |
+
$ruleset->evalImports($env);
|
236 |
+
}
|
237 |
+
|
238 |
+
return $ruleset;
|
239 |
+
}
|
240 |
+
|
241 |
+
function evalImports($env) {
|
242 |
+
|
243 |
+
$rules_len = count($this->rules);
|
244 |
+
for($i=0; $i < $rules_len; $i++){
|
245 |
+
$rule = $this->rules[$i];
|
246 |
+
|
247 |
+
if( $rule instanceof Less_Tree_Import ){
|
248 |
+
$rules = $rule->compile($env);
|
249 |
+
if( is_array($rules) ){
|
250 |
+
array_splice($this->rules, $i, 1, $rules);
|
251 |
+
$temp_count = count($rules)-1;
|
252 |
+
$i += $temp_count;
|
253 |
+
$rules_len += $temp_count;
|
254 |
+
}else{
|
255 |
+
array_splice($this->rules, $i, 1, array($rules));
|
256 |
+
}
|
257 |
+
|
258 |
+
$this->resetCache();
|
259 |
+
}
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
function makeImportant(){
|
264 |
+
|
265 |
+
$important_rules = array();
|
266 |
+
foreach($this->rules as $rule){
|
267 |
+
if( $rule instanceof Less_Tree_Rule || $rule instanceof Less_Tree_Ruleset || $rule instanceof Less_Tree_NameValue ){
|
268 |
+
$important_rules[] = $rule->makeImportant();
|
269 |
+
}else{
|
270 |
+
$important_rules[] = $rule;
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
return new Less_Tree_Ruleset($this->selectors, $important_rules, $this->strictImports );
|
275 |
+
}
|
276 |
+
|
277 |
+
public function matchArgs($args){
|
278 |
+
return !$args;
|
279 |
+
}
|
280 |
+
|
281 |
+
// lets you call a css selector with a guard
|
282 |
+
public function matchCondition( $args, $env ){
|
283 |
+
$lastSelector = end($this->selectors);
|
284 |
+
|
285 |
+
if( !$lastSelector->evaldCondition ){
|
286 |
+
return false;
|
287 |
+
}
|
288 |
+
if( $lastSelector->condition && !$lastSelector->condition->compile( $env->copyEvalEnv( $env->frames ) ) ){
|
289 |
+
return false;
|
290 |
+
}
|
291 |
+
return true;
|
292 |
+
}
|
293 |
+
|
294 |
+
function resetCache(){
|
295 |
+
$this->_rulesets = null;
|
296 |
+
$this->_variables = null;
|
297 |
+
$this->lookups = array();
|
298 |
+
}
|
299 |
+
|
300 |
+
public function variables(){
|
301 |
+
$this->_variables = array();
|
302 |
+
foreach( $this->rules as $r){
|
303 |
+
if ($r instanceof Less_Tree_Rule && $r->variable === true) {
|
304 |
+
$this->_variables[$r->name] = $r;
|
305 |
+
}
|
306 |
+
}
|
307 |
+
}
|
308 |
+
|
309 |
+
public function variable($name){
|
310 |
+
|
311 |
+
if( is_null($this->_variables) ){
|
312 |
+
$this->variables();
|
313 |
+
}
|
314 |
+
return isset($this->_variables[$name]) ? $this->_variables[$name] : null;
|
315 |
+
}
|
316 |
+
|
317 |
+
public function find( $selector, $self = null ){
|
318 |
+
|
319 |
+
$key = implode(' ',$selector->_oelements);
|
320 |
+
|
321 |
+
if( !isset($this->lookups[$key]) ){
|
322 |
+
|
323 |
+
if( !$self ){
|
324 |
+
$self = $this->ruleset_id;
|
325 |
+
}
|
326 |
+
|
327 |
+
$this->lookups[$key] = array();
|
328 |
+
|
329 |
+
$first_oelement = $selector->_oelements[0];
|
330 |
+
|
331 |
+
foreach($this->rules as $rule){
|
332 |
+
if( $rule instanceof Less_Tree_Ruleset && $rule->ruleset_id != $self ){
|
333 |
+
|
334 |
+
if( isset($rule->first_oelements[$first_oelement]) ){
|
335 |
+
|
336 |
+
foreach( $rule->selectors as $ruleSelector ){
|
337 |
+
$match = $selector->match($ruleSelector);
|
338 |
+
if( $match ){
|
339 |
+
if( $selector->elements_len > $match ){
|
340 |
+
$this->lookups[$key] = array_merge($this->lookups[$key], $rule->find( new Less_Tree_Selector(array_slice($selector->elements, $match)), $self));
|
341 |
+
} else {
|
342 |
+
$this->lookups[$key][] = $rule;
|
343 |
+
}
|
344 |
+
break;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
}
|
350 |
+
}
|
351 |
+
|
352 |
+
return $this->lookups[$key];
|
353 |
+
}
|
354 |
+
|
355 |
+
|
356 |
+
/**
|
357 |
+
* @see Less_Tree::genCSS
|
358 |
+
*/
|
359 |
+
public function genCSS( $output ){
|
360 |
+
|
361 |
+
if( !$this->root ){
|
362 |
+
Less_Environment::$tabLevel++;
|
363 |
+
}
|
364 |
+
|
365 |
+
$tabRuleStr = $tabSetStr = '';
|
366 |
+
if( !Less_Parser::$options['compress'] ){
|
367 |
+
if( Less_Environment::$tabLevel ){
|
368 |
+
$tabRuleStr = "\n".str_repeat( Less_Parser::$options['indentation'] , Less_Environment::$tabLevel );
|
369 |
+
$tabSetStr = "\n".str_repeat( Less_Parser::$options['indentation'] , Less_Environment::$tabLevel-1 );
|
370 |
+
}else{
|
371 |
+
$tabSetStr = $tabRuleStr = "\n";
|
372 |
+
}
|
373 |
+
}
|
374 |
+
|
375 |
+
|
376 |
+
$ruleNodes = array();
|
377 |
+
$rulesetNodes = array();
|
378 |
+
foreach($this->rules as $rule){
|
379 |
+
|
380 |
+
$class = get_class($rule);
|
381 |
+
if( ($class === 'Less_Tree_Media') || ($class === 'Less_Tree_Directive') || ($this->root && $class === 'Less_Tree_Comment') || ($class === 'Less_Tree_Ruleset' && $rule->rules) ){
|
382 |
+
$rulesetNodes[] = $rule;
|
383 |
+
}else{
|
384 |
+
$ruleNodes[] = $rule;
|
385 |
+
}
|
386 |
+
}
|
387 |
+
|
388 |
+
// If this is the root node, we don't render
|
389 |
+
// a selector, or {}.
|
390 |
+
if( !$this->root ){
|
391 |
+
|
392 |
+
/*
|
393 |
+
debugInfo = tree.debugInfo(env, this, tabSetStr);
|
394 |
+
|
395 |
+
if (debugInfo) {
|
396 |
+
output.add(debugInfo);
|
397 |
+
output.add(tabSetStr);
|
398 |
+
}
|
399 |
+
*/
|
400 |
+
|
401 |
+
$paths_len = count($this->paths);
|
402 |
+
for( $i = 0; $i < $paths_len; $i++ ){
|
403 |
+
$path = $this->paths[$i];
|
404 |
+
$firstSelector = true;
|
405 |
+
|
406 |
+
foreach($path as $p){
|
407 |
+
$p->genCSS( $output, $firstSelector );
|
408 |
+
$firstSelector = false;
|
409 |
+
}
|
410 |
+
|
411 |
+
if( $i + 1 < $paths_len ){
|
412 |
+
$output->add( ',' . $tabSetStr );
|
413 |
+
}
|
414 |
+
}
|
415 |
+
|
416 |
+
$output->add( (Less_Parser::$options['compress'] ? '{' : " {") . $tabRuleStr );
|
417 |
+
}
|
418 |
+
|
419 |
+
// Compile rules and rulesets
|
420 |
+
$ruleNodes_len = count($ruleNodes);
|
421 |
+
$rulesetNodes_len = count($rulesetNodes);
|
422 |
+
for( $i = 0; $i < $ruleNodes_len; $i++ ){
|
423 |
+
$rule = $ruleNodes[$i];
|
424 |
+
|
425 |
+
// @page{ directive ends up with root elements inside it, a mix of rules and rulesets
|
426 |
+
// In this instance we do not know whether it is the last property
|
427 |
+
if( $i + 1 === $ruleNodes_len && (!$this->root || $rulesetNodes_len === 0 || $this->firstRoot ) ){
|
428 |
+
Less_Environment::$lastRule = true;
|
429 |
+
}
|
430 |
+
|
431 |
+
$rule->genCSS( $output );
|
432 |
+
|
433 |
+
if( !Less_Environment::$lastRule ){
|
434 |
+
$output->add( $tabRuleStr );
|
435 |
+
}else{
|
436 |
+
Less_Environment::$lastRule = false;
|
437 |
+
}
|
438 |
+
}
|
439 |
+
|
440 |
+
if( !$this->root ){
|
441 |
+
$output->add( $tabSetStr . '}' );
|
442 |
+
Less_Environment::$tabLevel--;
|
443 |
+
}
|
444 |
+
|
445 |
+
$firstRuleset = true;
|
446 |
+
$space = ($this->root ? $tabRuleStr : $tabSetStr);
|
447 |
+
for( $i = 0; $i < $rulesetNodes_len; $i++ ){
|
448 |
+
|
449 |
+
if( $ruleNodes_len && $firstRuleset ){
|
450 |
+
$output->add( $space );
|
451 |
+
}elseif( !$firstRuleset ){
|
452 |
+
$output->add( $space );
|
453 |
+
}
|
454 |
+
$firstRuleset = false;
|
455 |
+
$rulesetNodes[$i]->genCSS( $output);
|
456 |
+
}
|
457 |
+
|
458 |
+
if( !Less_Parser::$options['compress'] && $this->firstRoot ){
|
459 |
+
$output->add( "\n" );
|
460 |
+
}
|
461 |
+
|
462 |
+
}
|
463 |
+
|
464 |
+
|
465 |
+
function markReferenced(){
|
466 |
+
if( !$this->selectors ){
|
467 |
+
return;
|
468 |
+
}
|
469 |
+
foreach($this->selectors as $selector){
|
470 |
+
$selector->markReferenced();
|
471 |
+
}
|
472 |
+
}
|
473 |
+
|
474 |
+
public function joinSelectors( $context, $selectors ){
|
475 |
+
$paths = array();
|
476 |
+
if( is_array($selectors) ){
|
477 |
+
foreach($selectors as $selector) {
|
478 |
+
$this->joinSelector( $paths, $context, $selector);
|
479 |
+
}
|
480 |
+
}
|
481 |
+
return $paths;
|
482 |
+
}
|
483 |
+
|
484 |
+
public function joinSelector( &$paths, $context, $selector){
|
485 |
+
|
486 |
+
$hasParentSelector = false;
|
487 |
+
|
488 |
+
foreach($selector->elements as $el) {
|
489 |
+
if( $el->value === '&') {
|
490 |
+
$hasParentSelector = true;
|
491 |
+
}
|
492 |
+
}
|
493 |
+
|
494 |
+
if( !$hasParentSelector ){
|
495 |
+
if( $context ){
|
496 |
+
foreach($context as $context_el){
|
497 |
+
$paths[] = array_merge($context_el, array($selector) );
|
498 |
+
}
|
499 |
+
}else {
|
500 |
+
$paths[] = array($selector);
|
501 |
+
}
|
502 |
+
return;
|
503 |
+
}
|
504 |
+
|
505 |
+
|
506 |
+
// The paths are [[Selector]]
|
507 |
+
// The first list is a list of comma separated selectors
|
508 |
+
// The inner list is a list of inheritance separated selectors
|
509 |
+
// e.g.
|
510 |
+
// .a, .b {
|
511 |
+
// .c {
|
512 |
+
// }
|
513 |
+
// }
|
514 |
+
// == [[.a] [.c]] [[.b] [.c]]
|
515 |
+
//
|
516 |
+
|
517 |
+
// the elements from the current selector so far
|
518 |
+
$currentElements = array();
|
519 |
+
// the current list of new selectors to add to the path.
|
520 |
+
// We will build it up. We initiate it with one empty selector as we "multiply" the new selectors
|
521 |
+
// by the parents
|
522 |
+
$newSelectors = array(array());
|
523 |
+
|
524 |
+
|
525 |
+
foreach( $selector->elements as $el){
|
526 |
+
|
527 |
+
// non parent reference elements just get added
|
528 |
+
if( $el->value !== '&' ){
|
529 |
+
$currentElements[] = $el;
|
530 |
+
} else {
|
531 |
+
// the new list of selectors to add
|
532 |
+
$selectorsMultiplied = array();
|
533 |
+
|
534 |
+
// merge the current list of non parent selector elements
|
535 |
+
// on to the current list of selectors to add
|
536 |
+
if( $currentElements ){
|
537 |
+
$this->mergeElementsOnToSelectors( $currentElements, $newSelectors);
|
538 |
+
}
|
539 |
+
|
540 |
+
// loop through our current selectors
|
541 |
+
foreach($newSelectors as $sel){
|
542 |
+
|
543 |
+
// if we don't have any parent paths, the & might be in a mixin so that it can be used
|
544 |
+
// whether there are parents or not
|
545 |
+
if( !$context ){
|
546 |
+
// the combinator used on el should now be applied to the next element instead so that
|
547 |
+
// it is not lost
|
548 |
+
if( $sel ){
|
549 |
+
$sel[0]->elements = array_slice($sel[0]->elements,0);
|
550 |
+
$sel[0]->elements[] = new Less_Tree_Element($el->combinator, '', $el->index, $el->currentFileInfo );
|
551 |
+
}
|
552 |
+
$selectorsMultiplied[] = $sel;
|
553 |
+
}else {
|
554 |
+
|
555 |
+
// and the parent selectors
|
556 |
+
foreach($context as $parentSel){
|
557 |
+
// We need to put the current selectors
|
558 |
+
// then join the last selector's elements on to the parents selectors
|
559 |
+
|
560 |
+
// our new selector path
|
561 |
+
$newSelectorPath = array();
|
562 |
+
// selectors from the parent after the join
|
563 |
+
$afterParentJoin = array();
|
564 |
+
$newJoinedSelectorEmpty = true;
|
565 |
+
|
566 |
+
//construct the joined selector - if & is the first thing this will be empty,
|
567 |
+
// if not newJoinedSelector will be the last set of elements in the selector
|
568 |
+
if( $sel ){
|
569 |
+
$newSelectorPath = $sel;
|
570 |
+
$lastSelector = array_pop($newSelectorPath);
|
571 |
+
$newJoinedSelector = $selector->createDerived( array_slice($lastSelector->elements,0) );
|
572 |
+
$newJoinedSelectorEmpty = false;
|
573 |
+
}
|
574 |
+
else {
|
575 |
+
$newJoinedSelector = $selector->createDerived(array());
|
576 |
+
}
|
577 |
+
|
578 |
+
//put together the parent selectors after the join
|
579 |
+
if ( count($parentSel) > 1) {
|
580 |
+
$afterParentJoin = array_merge($afterParentJoin, array_slice($parentSel,1) );
|
581 |
+
}
|
582 |
+
|
583 |
+
if ( $parentSel ){
|
584 |
+
$newJoinedSelectorEmpty = false;
|
585 |
+
|
586 |
+
// join the elements so far with the first part of the parent
|
587 |
+
$newJoinedSelector->elements[] = new Less_Tree_Element( $el->combinator, $parentSel[0]->elements[0]->value, $el->index, $el->currentFileInfo);
|
588 |
+
|
589 |
+
$newJoinedSelector->elements = array_merge( $newJoinedSelector->elements, array_slice($parentSel[0]->elements, 1) );
|
590 |
+
}
|
591 |
+
|
592 |
+
if (!$newJoinedSelectorEmpty) {
|
593 |
+
// now add the joined selector
|
594 |
+
$newSelectorPath[] = $newJoinedSelector;
|
595 |
+
}
|
596 |
+
|
597 |
+
// and the rest of the parent
|
598 |
+
$newSelectorPath = array_merge($newSelectorPath, $afterParentJoin);
|
599 |
+
|
600 |
+
// add that to our new set of selectors
|
601 |
+
$selectorsMultiplied[] = $newSelectorPath;
|
602 |
+
}
|
603 |
+
}
|
604 |
+
}
|
605 |
+
|
606 |
+
// our new selectors has been multiplied, so reset the state
|
607 |
+
$newSelectors = $selectorsMultiplied;
|
608 |
+
$currentElements = array();
|
609 |
+
}
|
610 |
+
}
|
611 |
+
|
612 |
+
// if we have any elements left over (e.g. .a& .b == .b)
|
613 |
+
// add them on to all the current selectors
|
614 |
+
if( $currentElements ){
|
615 |
+
$this->mergeElementsOnToSelectors($currentElements, $newSelectors);
|
616 |
+
}
|
617 |
+
foreach( $newSelectors as $new_sel){
|
618 |
+
if( $new_sel ){
|
619 |
+
$paths[] = $new_sel;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
}
|
623 |
+
|
624 |
+
function mergeElementsOnToSelectors( $elements, &$selectors){
|
625 |
+
|
626 |
+
if( !$selectors ){
|
627 |
+
$selectors[] = array( new Less_Tree_Selector($elements) );
|
628 |
+
return;
|
629 |
+
}
|
630 |
+
|
631 |
+
|
632 |
+
foreach( $selectors as &$sel){
|
633 |
+
|
634 |
+
// if the previous thing in sel is a parent this needs to join on to it
|
635 |
+
if( $sel ){
|
636 |
+
$last = count($sel)-1;
|
637 |
+
$sel[$last] = $sel[$last]->createDerived( array_merge($sel[$last]->elements, $elements) );
|
638 |
+
}else{
|
639 |
+
$sel[] = new Less_Tree_Selector( $elements );
|
640 |
+
}
|
641 |
+
}
|
642 |
+
}
|
643 |
+
}
|
base/inc/lib/Less/Tree/RulesetCall.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* RulesetCall
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_RulesetCall extends Less_Tree{
|
10 |
+
|
11 |
+
public $variable;
|
12 |
+
public $type = "RulesetCall";
|
13 |
+
|
14 |
+
public function __construct($variable){
|
15 |
+
$this->variable = $variable;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function accept($visitor) {}
|
19 |
+
|
20 |
+
public function compile( $env ){
|
21 |
+
$variable = new Less_Tree_Variable($this->variable);
|
22 |
+
$detachedRuleset = $variable->compile($env);
|
23 |
+
return $detachedRuleset->callEval($env);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
base/inc/lib/Less/Tree/Selector.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Selector
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Selector extends Less_Tree{
|
10 |
+
|
11 |
+
public $elements;
|
12 |
+
public $condition;
|
13 |
+
public $extendList = array();
|
14 |
+
public $_css;
|
15 |
+
public $index;
|
16 |
+
public $evaldCondition = false;
|
17 |
+
public $type = 'Selector';
|
18 |
+
public $currentFileInfo = array();
|
19 |
+
public $isReferenced;
|
20 |
+
public $mediaEmpty;
|
21 |
+
|
22 |
+
public $elements_len = 0;
|
23 |
+
|
24 |
+
public $_oelements;
|
25 |
+
public $_oelements_len;
|
26 |
+
public $cacheable = true;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @param boolean $isReferenced
|
30 |
+
*/
|
31 |
+
public function __construct( $elements, $extendList = array() , $condition = null, $index=null, $currentFileInfo=null, $isReferenced=null ){
|
32 |
+
|
33 |
+
$this->elements = $elements;
|
34 |
+
$this->elements_len = count($elements);
|
35 |
+
$this->extendList = $extendList;
|
36 |
+
$this->condition = $condition;
|
37 |
+
if( $currentFileInfo ){
|
38 |
+
$this->currentFileInfo = $currentFileInfo;
|
39 |
+
}
|
40 |
+
$this->isReferenced = $isReferenced;
|
41 |
+
if( !$condition ){
|
42 |
+
$this->evaldCondition = true;
|
43 |
+
}
|
44 |
+
|
45 |
+
$this->CacheElements();
|
46 |
+
}
|
47 |
+
|
48 |
+
public function accept($visitor) {
|
49 |
+
$this->elements = $visitor->visitArray($this->elements);
|
50 |
+
$this->extendList = $visitor->visitArray($this->extendList);
|
51 |
+
if( $this->condition ){
|
52 |
+
$this->condition = $visitor->visitObj($this->condition);
|
53 |
+
}
|
54 |
+
|
55 |
+
if( $visitor instanceof Less_Visitor_extendFinder ){
|
56 |
+
$this->CacheElements();
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
public function createDerived( $elements, $extendList = null, $evaldCondition = null ){
|
61 |
+
$newSelector = new Less_Tree_Selector( $elements, ($extendList ? $extendList : $this->extendList), null, $this->index, $this->currentFileInfo, $this->isReferenced);
|
62 |
+
$newSelector->evaldCondition = $evaldCondition ? $evaldCondition : $this->evaldCondition;
|
63 |
+
return $newSelector;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
public function match( $other ){
|
68 |
+
|
69 |
+
if( !$other->_oelements || ($this->elements_len < $other->_oelements_len) ){
|
70 |
+
return 0;
|
71 |
+
}
|
72 |
+
|
73 |
+
for( $i = 0; $i < $other->_oelements_len; $i++ ){
|
74 |
+
if( $this->elements[$i]->value !== $other->_oelements[$i]) {
|
75 |
+
return 0;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
return $other->_oelements_len; // return number of matched elements
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
public function CacheElements(){
|
84 |
+
|
85 |
+
$this->_oelements = array();
|
86 |
+
$css = '';
|
87 |
+
|
88 |
+
foreach($this->elements as $v){
|
89 |
+
|
90 |
+
$css .= $v->combinator;
|
91 |
+
if( !$v->value_is_object ){
|
92 |
+
$css .= $v->value;
|
93 |
+
continue;
|
94 |
+
}
|
95 |
+
|
96 |
+
if( !property_exists($v->value,'value') || !is_string($v->value->value) ){
|
97 |
+
$this->cacheable = false;
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
$css .= $v->value->value;
|
101 |
+
}
|
102 |
+
|
103 |
+
$this->_oelements_len = preg_match_all('/[,&#\.\w-](?:[\w-]|(?:\\\\.))*/', $css, $matches);
|
104 |
+
if( $this->_oelements_len ){
|
105 |
+
$this->_oelements = $matches[0];
|
106 |
+
|
107 |
+
if( $this->_oelements[0] === '&' ){
|
108 |
+
array_shift($this->_oelements);
|
109 |
+
$this->_oelements_len--;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
public function isJustParentSelector(){
|
115 |
+
return !$this->mediaEmpty &&
|
116 |
+
count($this->elements) === 1 &&
|
117 |
+
$this->elements[0]->value === '&' &&
|
118 |
+
($this->elements[0]->combinator === ' ' || $this->elements[0]->combinator === '');
|
119 |
+
}
|
120 |
+
|
121 |
+
public function compile($env) {
|
122 |
+
|
123 |
+
$elements = array();
|
124 |
+
foreach($this->elements as $el){
|
125 |
+
$elements[] = $el->compile($env);
|
126 |
+
}
|
127 |
+
|
128 |
+
$extendList = array();
|
129 |
+
foreach($this->extendList as $el){
|
130 |
+
$extendList[] = $el->compile($el);
|
131 |
+
}
|
132 |
+
|
133 |
+
$evaldCondition = false;
|
134 |
+
if( $this->condition ){
|
135 |
+
$evaldCondition = $this->condition->compile($env);
|
136 |
+
}
|
137 |
+
|
138 |
+
return $this->createDerived( $elements, $extendList, $evaldCondition );
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
/**
|
143 |
+
* @see Less_Tree::genCSS
|
144 |
+
*/
|
145 |
+
public function genCSS( $output, $firstSelector = true ){
|
146 |
+
|
147 |
+
if( !$firstSelector && $this->elements[0]->combinator === "" ){
|
148 |
+
$output->add(' ', $this->currentFileInfo, $this->index);
|
149 |
+
}
|
150 |
+
|
151 |
+
foreach($this->elements as $element){
|
152 |
+
$element->genCSS( $output );
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
public function markReferenced(){
|
157 |
+
$this->isReferenced = true;
|
158 |
+
}
|
159 |
+
|
160 |
+
public function getIsReferenced(){
|
161 |
+
return !isset($this->currentFileInfo['reference']) || !$this->currentFileInfo['reference'] || $this->isReferenced;
|
162 |
+
}
|
163 |
+
|
164 |
+
public function getIsOutput(){
|
165 |
+
return $this->evaldCondition;
|
166 |
+
}
|
167 |
+
|
168 |
+
}
|
base/inc/lib/Less/Tree/UnicodeDescriptor.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* UnicodeDescriptor
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_UnicodeDescriptor extends Less_Tree{
|
10 |
+
|
11 |
+
public $value;
|
12 |
+
public $type = 'UnicodeDescriptor';
|
13 |
+
|
14 |
+
public function __construct($value){
|
15 |
+
$this->value = $value;
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @see Less_Tree::genCSS
|
20 |
+
*/
|
21 |
+
public function genCSS( $output ){
|
22 |
+
$output->add( $this->value );
|
23 |
+
}
|
24 |
+
|
25 |
+
public function compile(){
|
26 |
+
return $this;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
base/inc/lib/Less/Tree/Unit.php
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unit
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Unit extends Less_Tree{
|
10 |
+
|
11 |
+
var $numerator = array();
|
12 |
+
var $denominator = array();
|
13 |
+
public $backupUnit;
|
14 |
+
public $type = 'Unit';
|
15 |
+
|
16 |
+
public function __construct($numerator = array(), $denominator = array(), $backupUnit = null ){
|
17 |
+
$this->numerator = $numerator;
|
18 |
+
$this->denominator = $denominator;
|
19 |
+
$this->backupUnit = $backupUnit;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function __clone(){
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @see Less_Tree::genCSS
|
27 |
+
*/
|
28 |
+
public function genCSS( $output ){
|
29 |
+
|
30 |
+
if( $this->numerator ){
|
31 |
+
$output->add( $this->numerator[0] );
|
32 |
+
}elseif( $this->denominator ){
|
33 |
+
$output->add( $this->denominator[0] );
|
34 |
+
}elseif( !Less_Parser::$options['strictUnits'] && $this->backupUnit ){
|
35 |
+
$output->add( $this->backupUnit );
|
36 |
+
return ;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
public function toString(){
|
41 |
+
$returnStr = implode('*',$this->numerator);
|
42 |
+
foreach($this->denominator as $d){
|
43 |
+
$returnStr .= '/'.$d;
|
44 |
+
}
|
45 |
+
return $returnStr;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function __toString(){
|
49 |
+
return $this->toString();
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
/**
|
54 |
+
* @param Less_Tree_Unit $other
|
55 |
+
*/
|
56 |
+
public function compare($other) {
|
57 |
+
return $this->is( $other->toString() ) ? 0 : -1;
|
58 |
+
}
|
59 |
+
|
60 |
+
public function is($unitString){
|
61 |
+
return $this->toString() === $unitString;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function isLength(){
|
65 |
+
$css = $this->toCSS();
|
66 |
+
return !!preg_match('/px|em|%|in|cm|mm|pc|pt|ex/',$css);
|
67 |
+
}
|
68 |
+
|
69 |
+
public function isAngle() {
|
70 |
+
return isset( Less_Tree_UnitConversions::$angle[$this->toCSS()] );
|
71 |
+
}
|
72 |
+
|
73 |
+
public function isEmpty(){
|
74 |
+
return !$this->numerator && !$this->denominator;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function isSingular() {
|
78 |
+
return count($this->numerator) <= 1 && !$this->denominator;
|
79 |
+
}
|
80 |
+
|
81 |
+
|
82 |
+
public function usedUnits(){
|
83 |
+
$result = array();
|
84 |
+
|
85 |
+
foreach(Less_Tree_UnitConversions::$groups as $groupName){
|
86 |
+
$group = Less_Tree_UnitConversions::${$groupName};
|
87 |
+
|
88 |
+
foreach($this->numerator as $atomicUnit){
|
89 |
+
if( isset($group[$atomicUnit]) && !isset($result[$groupName]) ){
|
90 |
+
$result[$groupName] = $atomicUnit;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
foreach($this->denominator as $atomicUnit){
|
95 |
+
if( isset($group[$atomicUnit]) && !isset($result[$groupName]) ){
|
96 |
+
$result[$groupName] = $atomicUnit;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
return $result;
|
102 |
+
}
|
103 |
+
|
104 |
+
public function cancel(){
|
105 |
+
$counter = array();
|
106 |
+
$backup = null;
|
107 |
+
|
108 |
+
foreach($this->numerator as $atomicUnit){
|
109 |
+
if( !$backup ){
|
110 |
+
$backup = $atomicUnit;
|
111 |
+
}
|
112 |
+
$counter[$atomicUnit] = ( isset($counter[$atomicUnit]) ? $counter[$atomicUnit] : 0) + 1;
|
113 |
+
}
|
114 |
+
|
115 |
+
foreach($this->denominator as $atomicUnit){
|
116 |
+
if( !$backup ){
|
117 |
+
$backup = $atomicUnit;
|
118 |
+
}
|
119 |
+
$counter[$atomicUnit] = ( isset($counter[$atomicUnit]) ? $counter[$atomicUnit] : 0) - 1;
|
120 |
+
}
|
121 |
+
|
122 |
+
$this->numerator = array();
|
123 |
+
$this->denominator = array();
|
124 |
+
|
125 |
+
foreach($counter as $atomicUnit => $count){
|
126 |
+
if( $count > 0 ){
|
127 |
+
for( $i = 0; $i < $count; $i++ ){
|
128 |
+
$this->numerator[] = $atomicUnit;
|
129 |
+
}
|
130 |
+
}elseif( $count < 0 ){
|
131 |
+
for( $i = 0; $i < -$count; $i++ ){
|
132 |
+
$this->denominator[] = $atomicUnit;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
if( !$this->numerator && !$this->denominator && $backup ){
|
138 |
+
$this->backupUnit = $backup;
|
139 |
+
}
|
140 |
+
|
141 |
+
sort($this->numerator);
|
142 |
+
sort($this->denominator);
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
+
}
|
147 |
+
|
base/inc/lib/Less/Tree/UnitConversions.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* UnitConversions
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_UnitConversions{
|
10 |
+
|
11 |
+
public static $groups = array('length','duration','angle');
|
12 |
+
|
13 |
+
public static $length = array(
|
14 |
+
'm'=> 1,
|
15 |
+
'cm'=> 0.01,
|
16 |
+
'mm'=> 0.001,
|
17 |
+
'in'=> 0.0254,
|
18 |
+
'px'=> 0.000264583, // 0.0254 / 96,
|
19 |
+
'pt'=> 0.000352778, // 0.0254 / 72,
|
20 |
+
'pc'=> 0.004233333, // 0.0254 / 72 * 12
|
21 |
+
);
|
22 |
+
|
23 |
+
public static $duration = array(
|
24 |
+
's'=> 1,
|
25 |
+
'ms'=> 0.001
|
26 |
+
);
|
27 |
+
|
28 |
+
public static $angle = array(
|
29 |
+
'rad' => 0.1591549430919, // 1/(2*M_PI),
|
30 |
+
'deg' => 0.002777778, // 1/360,
|
31 |
+
'grad'=> 0.0025, // 1/400,
|
32 |
+
'turn'=> 1
|
33 |
+
);
|
34 |
+
|
35 |
+
}
|
base/inc/lib/Less/Tree/Url.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Url
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Url extends Less_Tree{
|
10 |
+
|
11 |
+
public $attrs;
|
12 |
+
public $value;
|
13 |
+
public $currentFileInfo;
|
14 |
+
public $isEvald;
|
15 |
+
public $type = 'Url';
|
16 |
+
|
17 |
+
public function __construct($value, $currentFileInfo = null, $isEvald = null){
|
18 |
+
$this->value = $value;
|
19 |
+
$this->currentFileInfo = $currentFileInfo;
|
20 |
+
$this->isEvald = $isEvald;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function accept( $visitor ){
|
24 |
+
$this->value = $visitor->visitObj($this->value);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @see Less_Tree::genCSS
|
29 |
+
*/
|
30 |
+
public function genCSS( $output ){
|
31 |
+
$output->add( 'url(' );
|
32 |
+
$this->value->genCSS( $output );
|
33 |
+
$output->add( ')' );
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @param Less_Functions $ctx
|
38 |
+
*/
|
39 |
+
public function compile($ctx){
|
40 |
+
$val = $this->value->compile($ctx);
|
41 |
+
|
42 |
+
if( !$this->isEvald ){
|
43 |
+
// Add the base path if the URL is relative
|
44 |
+
if( Less_Parser::$options['relativeUrls']
|
45 |
+
&& $this->currentFileInfo
|
46 |
+
&& is_string($val->value)
|
47 |
+
&& Less_Environment::isPathRelative($val->value)
|
48 |
+
){
|
49 |
+
$rootpath = $this->currentFileInfo['uri_root'];
|
50 |
+
if ( !$val->quote ){
|
51 |
+
$rootpath = preg_replace('/[\(\)\'"\s]/', '\\$1', $rootpath );
|
52 |
+
}
|
53 |
+
$val->value = $rootpath . $val->value;
|
54 |
+
}
|
55 |
+
|
56 |
+
$val->value = Less_Environment::normalizePath( $val->value);
|
57 |
+
}
|
58 |
+
|
59 |
+
// Add cache buster if enabled
|
60 |
+
if( Less_Parser::$options['urlArgs'] ){
|
61 |
+
if( !preg_match('/^\s*data:/',$val->value) ){
|
62 |
+
$delimiter = strpos($val->value,'?') === false ? '?' : '&';
|
63 |
+
$urlArgs = $delimiter . Less_Parser::$options['urlArgs'];
|
64 |
+
$hash_pos = strpos($val->value,'#');
|
65 |
+
if( $hash_pos !== false ){
|
66 |
+
$val->value = substr_replace($val->value,$urlArgs, $hash_pos, 0);
|
67 |
+
} else {
|
68 |
+
$val->value .= $urlArgs;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
return new Less_Tree_URL($val, $this->currentFileInfo, true);
|
74 |
+
}
|
75 |
+
|
76 |
+
}
|
base/inc/lib/Less/Tree/Value.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Value
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Value extends Less_Tree{
|
10 |
+
|
11 |
+
public $type = 'Value';
|
12 |
+
public $value;
|
13 |
+
|
14 |
+
public function __construct($value){
|
15 |
+
$this->value = $value;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function accept($visitor) {
|
19 |
+
$this->value = $visitor->visitArray($this->value);
|
20 |
+
}
|
21 |
+
|
22 |
+
public function compile($env){
|
23 |
+
|
24 |
+
$ret = array();
|
25 |
+
$i = 0;
|
26 |
+
foreach($this->value as $i => $v){
|
27 |
+
$ret[] = $v->compile($env);
|
28 |
+
}
|
29 |
+
if( $i > 0 ){
|
30 |
+
return new Less_Tree_Value($ret);
|
31 |
+
}
|
32 |
+
return $ret[0];
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @see Less_Tree::genCSS
|
37 |
+
*/
|
38 |
+
function genCSS( $output ){
|
39 |
+
$len = count($this->value);
|
40 |
+
for($i = 0; $i < $len; $i++ ){
|
41 |
+
$this->value[$i]->genCSS( $output );
|
42 |
+
if( $i+1 < $len ){
|
43 |
+
$output->add( Less_Environment::$_outputMap[','] );
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
base/inc/lib/Less/Tree/Variable.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Variable
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage tree
|
8 |
+
*/
|
9 |
+
class Less_Tree_Variable extends Less_Tree{
|
10 |
+
|
11 |
+
public $name;
|
12 |
+
public $index;
|
13 |
+
public $currentFileInfo;
|
14 |
+
public $evaluating = false;
|
15 |
+
public $type = 'Variable';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param string $name
|
19 |
+
*/
|
20 |
+
public function __construct($name, $index = null, $currentFileInfo = null) {
|
21 |
+
$this->name = $name;
|
22 |
+
$this->index = $index;
|
23 |
+
$this->currentFileInfo = $currentFileInfo;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function compile($env) {
|
27 |
+
|
28 |
+
if( $this->name[1] === '@' ){
|
29 |
+
$v = new Less_Tree_Variable(substr($this->name, 1), $this->index + 1, $this->currentFileInfo);
|
30 |
+
$name = '@' . $v->compile($env)->value;
|
31 |
+
}else{
|
32 |
+
$name = $this->name;
|
33 |
+
}
|
34 |
+
|
35 |
+
if ($this->evaluating) {
|
36 |
+
throw new Less_Exception_Compiler("Recursive variable definition for " . $name, null, $this->index, $this->currentFileInfo);
|
37 |
+
}
|
38 |
+
|
39 |
+
$this->evaluating = true;
|
40 |
+
|
41 |
+
foreach($env->frames as $frame){
|
42 |
+
if( $v = $frame->variable($name) ){
|
43 |
+
$r = $v->value->compile($env);
|
44 |
+
$this->evaluating = false;
|
45 |
+
return $r;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
throw new Less_Exception_Compiler("variable " . $name . " is undefined in file ".$this->currentFileInfo["filename"], null, $this->index, $this->currentFileInfo);
|
50 |
+
}
|
51 |
+
|
52 |
+
}
|
base/inc/lib/Less/Version.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Release numbers
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage version
|
8 |
+
*/
|
9 |
+
class Less_Version{
|
10 |
+
|
11 |
+
const version = '1.7.0.13'; // The current build number of less.php
|
12 |
+
const less_version = '2.5.3'; // The less.js version that this build should be compatible with
|
13 |
+
const cache_version = '253'; // The parser cache version
|
14 |
+
|
15 |
+
}
|
base/inc/lib/Less/Visitor.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Visitor
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage visitor
|
8 |
+
*/
|
9 |
+
class Less_Visitor{
|
10 |
+
|
11 |
+
protected $methods = array();
|
12 |
+
protected $_visitFnCache = array();
|
13 |
+
|
14 |
+
public function __construct(){
|
15 |
+
$this->_visitFnCache = get_class_methods(get_class($this));
|
16 |
+
$this->_visitFnCache = array_flip($this->_visitFnCache);
|
17 |
+
}
|
18 |
+
|
19 |
+
public function visitObj( $node ){
|
20 |
+
|
21 |
+
$funcName = 'visit'.$node->type;
|
22 |
+
if( isset($this->_visitFnCache[$funcName]) ){
|
23 |
+
|
24 |
+
$visitDeeper = true;
|
25 |
+
$this->$funcName( $node, $visitDeeper );
|
26 |
+
|
27 |
+
if( $visitDeeper ){
|
28 |
+
$node->accept($this);
|
29 |
+
}
|
30 |
+
|
31 |
+
$funcName = $funcName . "Out";
|
32 |
+
if( isset($this->_visitFnCache[$funcName]) ){
|
33 |
+
$this->$funcName( $node );
|
34 |
+
}
|
35 |
+
|
36 |
+
}else{
|
37 |
+
$node->accept($this);
|
38 |
+
}
|
39 |
+
|
40 |
+
return $node;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function visitArray( $nodes ){
|
44 |
+
|
45 |
+
array_map( array($this,'visitObj'), $nodes);
|
46 |
+
return $nodes;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
base/inc/lib/Less/Visitor/extendFinder.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Extend Finder Visitor
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage visitor
|
8 |
+
*/
|
9 |
+
class Less_Visitor_extendFinder extends Less_Visitor{
|
10 |
+
|
11 |
+
public $contexts = array();
|
12 |
+
public $allExtendsStack;
|
13 |
+
public $foundExtends;
|
14 |
+
|
15 |
+
public function __construct(){
|
16 |
+
$this->contexts = array();
|
17 |
+
$this->allExtendsStack = array(array());
|
18 |
+
parent::__construct();
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @param Less_Tree_Ruleset $root
|
23 |
+
*/
|
24 |
+
public function run($root){
|
25 |
+
$root = $this->visitObj($root);
|
26 |
+
$root->allExtends =& $this->allExtendsStack[0];
|
27 |
+
return $root;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function visitRule($ruleNode, &$visitDeeper ){
|
31 |
+
$visitDeeper = false;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function visitMixinDefinition( $mixinDefinitionNode, &$visitDeeper ){
|
35 |
+
$visitDeeper = false;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function visitRuleset($rulesetNode){
|
39 |
+
|
40 |
+
if( $rulesetNode->root ){
|
41 |
+
return;
|
42 |
+
}
|
43 |
+
|
44 |
+
$allSelectorsExtendList = array();
|
45 |
+
|
46 |
+
// get &:extend(.a); rules which apply to all selectors in this ruleset
|
47 |
+
if( $rulesetNode->rules ){
|
48 |
+
foreach($rulesetNode->rules as $rule){
|
49 |
+
if( $rule instanceof Less_Tree_Extend ){
|
50 |
+
$allSelectorsExtendList[] = $rule;
|
51 |
+
$rulesetNode->extendOnEveryPath = true;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
// now find every selector and apply the extends that apply to all extends
|
58 |
+
// and the ones which apply to an individual extend
|
59 |
+
foreach($rulesetNode->paths as $selectorPath){
|
60 |
+
$selector = end($selectorPath); //$selectorPath[ count($selectorPath)-1];
|
61 |
+
|
62 |
+
$j = 0;
|
63 |
+
foreach($selector->extendList as $extend){
|
64 |
+
$this->allExtendsStackPush($rulesetNode, $selectorPath, $extend, $j);
|
65 |
+
}
|
66 |
+
foreach($allSelectorsExtendList as $extend){
|
67 |
+
$this->allExtendsStackPush($rulesetNode, $selectorPath, $extend, $j);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
$this->contexts[] = $rulesetNode->selectors;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function allExtendsStackPush($rulesetNode, $selectorPath, $extend, &$j){
|
75 |
+
$this->foundExtends = true;
|
76 |
+
$extend = clone $extend;
|
77 |
+
$extend->findSelfSelectors( $selectorPath );
|
78 |
+
$extend->ruleset = $rulesetNode;
|
79 |
+
if( $j === 0 ){
|
80 |
+
$extend->firstExtendOnThisSelectorPath = true;
|
81 |
+
}
|
82 |
+
|
83 |
+
$end_key = count($this->allExtendsStack)-1;
|
84 |
+
$this->allExtendsStack[$end_key][] = $extend;
|
85 |
+
$j++;
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
public function visitRulesetOut( $rulesetNode ){
|
90 |
+
if( !is_object($rulesetNode) || !$rulesetNode->root ){
|
91 |
+
array_pop($this->contexts);
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
public function visitMedia( $mediaNode ){
|
96 |
+
$mediaNode->allExtends = array();
|
97 |
+
$this->allExtendsStack[] =& $mediaNode->allExtends;
|
98 |
+
}
|
99 |
+
|
100 |
+
public function visitMediaOut(){
|
101 |
+
array_pop($this->allExtendsStack);
|
102 |
+
}
|
103 |
+
|
104 |
+
public function visitDirective( $directiveNode ){
|
105 |
+
$directiveNode->allExtends = array();
|
106 |
+
$this->allExtendsStack[] =& $directiveNode->allExtends;
|
107 |
+
}
|
108 |
+
|
109 |
+
public function visitDirectiveOut(){
|
110 |
+
array_pop($this->allExtendsStack);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
|
base/inc/lib/Less/Visitor/import.php
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
class Less_Visitor_import extends Less_VisitorReplacing{
|
5 |
+
|
6 |
+
public $_visitor;
|
7 |
+
public $_importer;
|
8 |
+
public $importCount;
|
9 |
+
|
10 |
+
function __construct( $evalEnv ){
|
11 |
+
$this->env = $evalEnv;
|
12 |
+
$this->importCount = 0;
|
13 |
+
parent::__construct();
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
function run( $root ){
|
18 |
+
$root = $this->visitObj($root);
|
19 |
+
$this->isFinished = true;
|
20 |
+
|
21 |
+
//if( $this->importCount === 0) {
|
22 |
+
// $this->_finish();
|
23 |
+
//}
|
24 |
+
}
|
25 |
+
|
26 |
+
function visitImport($importNode, &$visitDeeper ){
|
27 |
+
$importVisitor = $this;
|
28 |
+
$inlineCSS = $importNode->options['inline'];
|
29 |
+
|
30 |
+
if( !$importNode->css || $inlineCSS ){
|
31 |
+
$evaldImportNode = $importNode->compileForImport($this->env);
|
32 |
+
|
33 |
+
if( $evaldImportNode && (!$evaldImportNode->css || $inlineCSS) ){
|
34 |
+
$importNode = $evaldImportNode;
|
35 |
+
$this->importCount++;
|
36 |
+
$env = clone $this->env;
|
37 |
+
|
38 |
+
if( (isset($importNode->options['multiple']) && $importNode->options['multiple']) ){
|
39 |
+
$env->importMultiple = true;
|
40 |
+
}
|
41 |
+
|
42 |
+
//get path & uri
|
43 |
+
$path_and_uri = null;
|
44 |
+
if( is_callable(Less_Parser::$options['import_callback']) ){
|
45 |
+
$path_and_uri = call_user_func(Less_Parser::$options['import_callback'],$importNode);
|
46 |
+
}
|
47 |
+
|
48 |
+
if( !$path_and_uri ){
|
49 |
+
$path_and_uri = $importNode->PathAndUri();
|
50 |
+
}
|
51 |
+
|
52 |
+
if( $path_and_uri ){
|
53 |
+
list($full_path, $uri) = $path_and_uri;
|
54 |
+
}else{
|
55 |
+
$full_path = $uri = $importNode->getPath();
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
//import once
|
60 |
+
if( $importNode->skip( $full_path, $env) ){
|
61 |
+
return array();
|
62 |
+
}
|
63 |
+
|
64 |
+
if( $importNode->options['inline'] ){
|
65 |
+
//todo needs to reference css file not import
|
66 |
+
//$contents = new Less_Tree_Anonymous($importNode->root, 0, array('filename'=>$importNode->importedFilename), true );
|
67 |
+
|
68 |
+
Less_Parser::AddParsedFile($full_path);
|
69 |
+
$contents = new Less_Tree_Anonymous( file_get_contents($full_path), 0, array(), true );
|
70 |
+
|
71 |
+
if( $importNode->features ){
|
72 |
+
return new Less_Tree_Media( array($contents), $importNode->features->value );
|
73 |
+
}
|
74 |
+
|
75 |
+
return array( $contents );
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
// css ?
|
80 |
+
if( $importNode->css ){
|
81 |
+
$features = ( $importNode->features ? $importNode->features->compile($env) : null );
|
82 |
+
return new Less_Tree_Import( $importNode->compilePath( $env), $features, $importNode->options, $this->index);
|
83 |
+
}
|
84 |
+
|
85 |
+
return $importNode->ParseImport( $full_path, $uri, $env );
|
86 |
+
}
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
$visitDeeper = false;
|
91 |
+
return $importNode;
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
function visitRule( $ruleNode, &$visitDeeper ){
|
96 |
+
$visitDeeper = false;
|
97 |
+
return $ruleNode;
|
98 |
+
}
|
99 |
+
|
100 |
+
function visitDirective($directiveNode, $visitArgs){
|
101 |
+
array_unshift($this->env->frames,$directiveNode);
|
102 |
+
return $directiveNode;
|
103 |
+
}
|
104 |
+
|
105 |
+
function visitDirectiveOut($directiveNode) {
|
106 |
+
array_shift($this->env->frames);
|
107 |
+
}
|
108 |
+
|
109 |
+
function visitMixinDefinition($mixinDefinitionNode, $visitArgs) {
|
110 |
+
array_unshift($this->env->frames,$mixinDefinitionNode);
|
111 |
+
return $mixinDefinitionNode;
|
112 |
+
}
|
113 |
+
|
114 |
+
function visitMixinDefinitionOut($mixinDefinitionNode) {
|
115 |
+
array_shift($this->env->frames);
|
116 |
+
}
|
117 |
+
|
118 |
+
function visitRuleset($rulesetNode, $visitArgs) {
|
119 |
+
array_unshift($this->env->frames,$rulesetNode);
|
120 |
+
return $rulesetNode;
|
121 |
+
}
|
122 |
+
|
123 |
+
function visitRulesetOut($rulesetNode) {
|
124 |
+
array_shift($this->env->frames);
|
125 |
+
}
|
126 |
+
|
127 |
+
function visitMedia($mediaNode, $visitArgs) {
|
128 |
+
array_unshift($this->env->frames, $mediaNode->ruleset);
|
129 |
+
return $mediaNode;
|
130 |
+
}
|
131 |
+
|
132 |
+
function visitMediaOut($mediaNode) {
|
133 |
+
array_shift($this->env->frames);
|
134 |
+
}
|
135 |
+
|
136 |
+
}
|
137 |
+
*/
|
138 |
+
|
139 |
+
|
base/inc/lib/Less/Visitor/joinSelector.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Join Selector Visitor
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage visitor
|
8 |
+
*/
|
9 |
+
class Less_Visitor_joinSelector extends Less_Visitor{
|
10 |
+
|
11 |
+
public $contexts = array( array() );
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @param Less_Tree_Ruleset $root
|
15 |
+
*/
|
16 |
+
public function run( $root ){
|
17 |
+
return $this->visitObj($root);
|
18 |
+
}
|
19 |
+
|
20 |
+
public function visitRule( $ruleNode, &$visitDeeper ){
|
21 |
+
$visitDeeper = false;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function visitMixinDefinition( $mixinDefinitionNode, &$visitDeeper ){
|
25 |
+
$visitDeeper = false;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function visitRuleset( $rulesetNode ){
|
29 |
+
|
30 |
+
$paths = array();
|
31 |
+
|
32 |
+
if( !$rulesetNode->root ){
|
33 |
+
$selectors = array();
|
34 |
+
|
35 |
+
if( $rulesetNode->selectors && $rulesetNode->selectors ){
|
36 |
+
foreach($rulesetNode->selectors as $selector){
|
37 |
+
if( $selector->getIsOutput() ){
|
38 |
+
$selectors[] = $selector;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
if( !$selectors ){
|
44 |
+
$rulesetNode->selectors = null;
|
45 |
+
$rulesetNode->rules = null;
|
46 |
+
}else{
|
47 |
+
$context = end($this->contexts); //$context = $this->contexts[ count($this->contexts) - 1];
|
48 |
+
$paths = $rulesetNode->joinSelectors( $context, $selectors);
|
49 |
+
}
|
50 |
+
|
51 |
+
$rulesetNode->paths = $paths;
|
52 |
+
}
|
53 |
+
|
54 |
+
$this->contexts[] = $paths; //different from less.js. Placed after joinSelectors() so that $this->contexts will get correct $paths
|
55 |
+
}
|
56 |
+
|
57 |
+
public function visitRulesetOut(){
|
58 |
+
array_pop($this->contexts);
|
59 |
+
}
|
60 |
+
|
61 |
+
public function visitMedia($mediaNode) {
|
62 |
+
$context = end($this->contexts); //$context = $this->contexts[ count($this->contexts) - 1];
|
63 |
+
|
64 |
+
if( !count($context) || (is_object($context[0]) && $context[0]->multiMedia) ){
|
65 |
+
$mediaNode->rules[0]->root = true;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
}
|
70 |
+
|
base/inc/lib/Less/Visitor/processExtends.php
ADDED
@@ -0,0 +1,469 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Process Extends Visitor
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage visitor
|
8 |
+
*/
|
9 |
+
class Less_Visitor_processExtends extends Less_Visitor{
|
10 |
+
|
11 |
+
public $allExtendsStack;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @param Less_Tree_Ruleset $root
|
15 |
+
*/
|
16 |
+
public function run( $root ){
|
17 |
+
$extendFinder = new Less_Visitor_extendFinder();
|
18 |
+
$extendFinder->run( $root );
|
19 |
+
if( !$extendFinder->foundExtends){
|
20 |
+
return $root;
|
21 |
+
}
|
22 |
+
|
23 |
+
$root->allExtends = $this->doExtendChaining( $root->allExtends, $root->allExtends);
|
24 |
+
|
25 |
+
$this->allExtendsStack = array();
|
26 |
+
$this->allExtendsStack[] = &$root->allExtends;
|
27 |
+
|
28 |
+
return $this->visitObj( $root );
|
29 |
+
}
|
30 |
+
|
31 |
+
private function doExtendChaining( $extendsList, $extendsListTarget, $iterationCount = 0){
|
32 |
+
//
|
33 |
+
// chaining is different from normal extension.. if we extend an extend then we are not just copying, altering and pasting
|
34 |
+
// the selector we would do normally, but we are also adding an extend with the same target selector
|
35 |
+
// this means this new extend can then go and alter other extends
|
36 |
+
//
|
37 |
+
// this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors
|
38 |
+
// this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already processed if
|
39 |
+
// we look at each selector at a time, as is done in visitRuleset
|
40 |
+
|
41 |
+
$extendsToAdd = array();
|
42 |
+
|
43 |
+
|
44 |
+
//loop through comparing every extend with every target extend.
|
45 |
+
// a target extend is the one on the ruleset we are looking at copy/edit/pasting in place
|
46 |
+
// e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one
|
47 |
+
// and the second is the target.
|
48 |
+
// the separation into two lists allows us to process a subset of chains with a bigger set, as is the
|
49 |
+
// case when processing media queries
|
50 |
+
for( $extendIndex = 0, $extendsList_len = count($extendsList); $extendIndex < $extendsList_len; $extendIndex++ ){
|
51 |
+
for( $targetExtendIndex = 0; $targetExtendIndex < count($extendsListTarget); $targetExtendIndex++ ){
|
52 |
+
|
53 |
+
$extend = $extendsList[$extendIndex];
|
54 |
+
$targetExtend = $extendsListTarget[$targetExtendIndex];
|
55 |
+
|
56 |
+
// look for circular references
|
57 |
+
if( in_array($targetExtend->object_id, $extend->parent_ids,true) ){
|
58 |
+
continue;
|
59 |
+
}
|
60 |
+
|
61 |
+
// find a match in the target extends self selector (the bit before :extend)
|
62 |
+
$selectorPath = array( $targetExtend->selfSelectors[0] );
|
63 |
+
$matches = $this->findMatch( $extend, $selectorPath);
|
64 |
+
|
65 |
+
|
66 |
+
if( $matches ){
|
67 |
+
|
68 |
+
// we found a match, so for each self selector..
|
69 |
+
foreach($extend->selfSelectors as $selfSelector ){
|
70 |
+
|
71 |
+
|
72 |
+
// process the extend as usual
|
73 |
+
$newSelector = $this->extendSelector( $matches, $selectorPath, $selfSelector);
|
74 |
+
|
75 |
+
// but now we create a new extend from it
|
76 |
+
$newExtend = new Less_Tree_Extend( $targetExtend->selector, $targetExtend->option, 0);
|
77 |
+
$newExtend->selfSelectors = $newSelector;
|
78 |
+
|
79 |
+
// add the extend onto the list of extends for that selector
|
80 |
+
end($newSelector)->extendList = array($newExtend);
|
81 |
+
//$newSelector[ count($newSelector)-1]->extendList = array($newExtend);
|
82 |
+
|
83 |
+
// record that we need to add it.
|
84 |
+
$extendsToAdd[] = $newExtend;
|
85 |
+
$newExtend->ruleset = $targetExtend->ruleset;
|
86 |
+
|
87 |
+
//remember its parents for circular references
|
88 |
+
$newExtend->parent_ids = array_merge($newExtend->parent_ids,$targetExtend->parent_ids,$extend->parent_ids);
|
89 |
+
|
90 |
+
// only process the selector once.. if we have :extend(.a,.b) then multiple
|
91 |
+
// extends will look at the same selector path, so when extending
|
92 |
+
// we know that any others will be duplicates in terms of what is added to the css
|
93 |
+
if( $targetExtend->firstExtendOnThisSelectorPath ){
|
94 |
+
$newExtend->firstExtendOnThisSelectorPath = true;
|
95 |
+
$targetExtend->ruleset->paths[] = $newSelector;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
if( $extendsToAdd ){
|
103 |
+
// try to detect circular references to stop a stack overflow.
|
104 |
+
// may no longer be needed. $this->extendChainCount++;
|
105 |
+
if( $iterationCount > 100) {
|
106 |
+
|
107 |
+
try{
|
108 |
+
$selectorOne = $extendsToAdd[0]->selfSelectors[0]->toCSS();
|
109 |
+
$selectorTwo = $extendsToAdd[0]->selector->toCSS();
|
110 |
+
}catch(Exception $e){
|
111 |
+
$selectorOne = "{unable to calculate}";
|
112 |
+
$selectorTwo = "{unable to calculate}";
|
113 |
+
}
|
114 |
+
|
115 |
+
throw new Less_Exception_Parser("extend circular reference detected. One of the circular extends is currently:" . $selectorOne . ":extend(" . $selectorTwo . ")");
|
116 |
+
}
|
117 |
+
|
118 |
+
// now process the new extends on the existing rules so that we can handle a extending b extending c ectending d extending e...
|
119 |
+
$extendsToAdd = $this->doExtendChaining( $extendsToAdd, $extendsListTarget, $iterationCount+1);
|
120 |
+
}
|
121 |
+
|
122 |
+
return array_merge($extendsList, $extendsToAdd);
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
protected function visitRule( $ruleNode, &$visitDeeper ){
|
127 |
+
$visitDeeper = false;
|
128 |
+
}
|
129 |
+
|
130 |
+
protected function visitMixinDefinition( $mixinDefinitionNode, &$visitDeeper ){
|
131 |
+
$visitDeeper = false;
|
132 |
+
}
|
133 |
+
|
134 |
+
protected function visitSelector( $selectorNode, &$visitDeeper ){
|
135 |
+
$visitDeeper = false;
|
136 |
+
}
|
137 |
+
|
138 |
+
protected function visitRuleset($rulesetNode){
|
139 |
+
|
140 |
+
|
141 |
+
if( $rulesetNode->root ){
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
|
145 |
+
$allExtends = end($this->allExtendsStack);
|
146 |
+
$paths_len = count($rulesetNode->paths);
|
147 |
+
|
148 |
+
// look at each selector path in the ruleset, find any extend matches and then copy, find and replace
|
149 |
+
foreach($allExtends as $allExtend){
|
150 |
+
for($pathIndex = 0; $pathIndex < $paths_len; $pathIndex++ ){
|
151 |
+
|
152 |
+
// extending extends happens initially, before the main pass
|
153 |
+
if( isset($rulesetNode->extendOnEveryPath) && $rulesetNode->extendOnEveryPath ){
|
154 |
+
continue;
|
155 |
+
}
|
156 |
+
|
157 |
+
$selectorPath = $rulesetNode->paths[$pathIndex];
|
158 |
+
|
159 |
+
if( end($selectorPath)->extendList ){
|
160 |
+
continue;
|
161 |
+
}
|
162 |
+
|
163 |
+
$this->ExtendMatch( $rulesetNode, $allExtend, $selectorPath);
|
164 |
+
|
165 |
+
}
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
private function ExtendMatch( $rulesetNode, $extend, $selectorPath ){
|
171 |
+
$matches = $this->findMatch($extend, $selectorPath);
|
172 |
+
|
173 |
+
if( $matches ){
|
174 |
+
foreach($extend->selfSelectors as $selfSelector ){
|
175 |
+
$rulesetNode->paths[] = $this->extendSelector($matches, $selectorPath, $selfSelector);
|
176 |
+
}
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
private function findMatch($extend, $haystackSelectorPath ){
|
183 |
+
|
184 |
+
|
185 |
+
if( !$this->HasMatches($extend, $haystackSelectorPath) ){
|
186 |
+
return false;
|
187 |
+
}
|
188 |
+
|
189 |
+
|
190 |
+
//
|
191 |
+
// look through the haystack selector path to try and find the needle - extend.selector
|
192 |
+
// returns an array of selector matches that can then be replaced
|
193 |
+
//
|
194 |
+
$needleElements = $extend->selector->elements;
|
195 |
+
$potentialMatches = array();
|
196 |
+
$potentialMatches_len = 0;
|
197 |
+
$potentialMatch = null;
|
198 |
+
$matches = array();
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
// loop through the haystack elements
|
203 |
+
$haystack_path_len = count($haystackSelectorPath);
|
204 |
+
for($haystackSelectorIndex = 0; $haystackSelectorIndex < $haystack_path_len; $haystackSelectorIndex++ ){
|
205 |
+
$hackstackSelector = $haystackSelectorPath[$haystackSelectorIndex];
|
206 |
+
|
207 |
+
$haystack_elements_len = count($hackstackSelector->elements);
|
208 |
+
for($hackstackElementIndex = 0; $hackstackElementIndex < $haystack_elements_len; $hackstackElementIndex++ ){
|
209 |
+
|
210 |
+
$haystackElement = $hackstackSelector->elements[$hackstackElementIndex];
|
211 |
+
|
212 |
+
// if we allow elements before our match we can add a potential match every time. otherwise only at the first element.
|
213 |
+
if( $extend->allowBefore || ($haystackSelectorIndex === 0 && $hackstackElementIndex === 0) ){
|
214 |
+
$potentialMatches[] = array('pathIndex'=> $haystackSelectorIndex, 'index'=> $hackstackElementIndex, 'matched'=> 0, 'initialCombinator'=> $haystackElement->combinator);
|
215 |
+
$potentialMatches_len++;
|
216 |
+
}
|
217 |
+
|
218 |
+
for($i = 0; $i < $potentialMatches_len; $i++ ){
|
219 |
+
|
220 |
+
$potentialMatch = &$potentialMatches[$i];
|
221 |
+
$potentialMatch = $this->PotentialMatch( $potentialMatch, $needleElements, $haystackElement, $hackstackElementIndex );
|
222 |
+
|
223 |
+
|
224 |
+
// if we are still valid and have finished, test whether we have elements after and whether these are allowed
|
225 |
+
if( $potentialMatch && $potentialMatch['matched'] === $extend->selector->elements_len ){
|
226 |
+
$potentialMatch['finished'] = true;
|
227 |
+
|
228 |
+
if( !$extend->allowAfter && ($hackstackElementIndex+1 < $haystack_elements_len || $haystackSelectorIndex+1 < $haystack_path_len) ){
|
229 |
+
$potentialMatch = null;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
// if null we remove, if not, we are still valid, so either push as a valid match or continue
|
234 |
+
if( $potentialMatch ){
|
235 |
+
if( $potentialMatch['finished'] ){
|
236 |
+
$potentialMatch['length'] = $extend->selector->elements_len;
|
237 |
+
$potentialMatch['endPathIndex'] = $haystackSelectorIndex;
|
238 |
+
$potentialMatch['endPathElementIndex'] = $hackstackElementIndex + 1; // index after end of match
|
239 |
+
$potentialMatches = array(); // we don't allow matches to overlap, so start matching again
|
240 |
+
$potentialMatches_len = 0;
|
241 |
+
$matches[] = $potentialMatch;
|
242 |
+
}
|
243 |
+
continue;
|
244 |
+
}
|
245 |
+
|
246 |
+
array_splice($potentialMatches, $i, 1);
|
247 |
+
$potentialMatches_len--;
|
248 |
+
$i--;
|
249 |
+
}
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
return $matches;
|
254 |
+
}
|
255 |
+
|
256 |
+
|
257 |
+
// Before going through all the nested loops, lets check to see if a match is possible
|
258 |
+
// Reduces Bootstrap 3.1 compile time from ~6.5s to ~5.6s
|
259 |
+
private function HasMatches($extend, $haystackSelectorPath){
|
260 |
+
|
261 |
+
if( !$extend->selector->cacheable ){
|
262 |
+
return true;
|
263 |
+
}
|
264 |
+
|
265 |
+
$first_el = $extend->selector->_oelements[0];
|
266 |
+
|
267 |
+
foreach($haystackSelectorPath as $hackstackSelector){
|
268 |
+
if( !$hackstackSelector->cacheable ){
|
269 |
+
return true;
|
270 |
+
}
|
271 |
+
|
272 |
+
if( in_array($first_el, $hackstackSelector->_oelements) ){
|
273 |
+
return true;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
return false;
|
278 |
+
}
|
279 |
+
|
280 |
+
|
281 |
+
/**
|
282 |
+
* @param integer $hackstackElementIndex
|
283 |
+
*/
|
284 |
+
private function PotentialMatch( $potentialMatch, $needleElements, $haystackElement, $hackstackElementIndex ){
|
285 |
+
|
286 |
+
|
287 |
+
if( $potentialMatch['matched'] > 0 ){
|
288 |
+
|
289 |
+
// selectors add " " onto the first element. When we use & it joins the selectors together, but if we don't
|
290 |
+
// then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to work out
|
291 |
+
// what the resulting combinator will be
|
292 |
+
$targetCombinator = $haystackElement->combinator;
|
293 |
+
if( $targetCombinator === '' && $hackstackElementIndex === 0 ){
|
294 |
+
$targetCombinator = ' ';
|
295 |
+
}
|
296 |
+
|
297 |
+
if( $needleElements[ $potentialMatch['matched'] ]->combinator !== $targetCombinator ){
|
298 |
+
return null;
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
// if we don't match, null our match to indicate failure
|
303 |
+
if( !$this->isElementValuesEqual( $needleElements[$potentialMatch['matched'] ]->value, $haystackElement->value) ){
|
304 |
+
return null;
|
305 |
+
}
|
306 |
+
|
307 |
+
$potentialMatch['finished'] = false;
|
308 |
+
$potentialMatch['matched']++;
|
309 |
+
|
310 |
+
return $potentialMatch;
|
311 |
+
}
|
312 |
+
|
313 |
+
|
314 |
+
private function isElementValuesEqual( $elementValue1, $elementValue2 ){
|
315 |
+
|
316 |
+
if( $elementValue1 === $elementValue2 ){
|
317 |
+
return true;
|
318 |
+
}
|
319 |
+
|
320 |
+
if( is_string($elementValue1) || is_string($elementValue2) ) {
|
321 |
+
return false;
|
322 |
+
}
|
323 |
+
|
324 |
+
if( $elementValue1 instanceof Less_Tree_Attribute ){
|
325 |
+
return $this->isAttributeValuesEqual( $elementValue1, $elementValue2 );
|
326 |
+
}
|
327 |
+
|
328 |
+
$elementValue1 = $elementValue1->value;
|
329 |
+
if( $elementValue1 instanceof Less_Tree_Selector ){
|
330 |
+
return $this->isSelectorValuesEqual( $elementValue1, $elementValue2 );
|
331 |
+
}
|
332 |
+
|
333 |
+
return false;
|
334 |
+
}
|
335 |
+
|
336 |
+
|
337 |
+
/**
|
338 |
+
* @param Less_Tree_Selector $elementValue1
|
339 |
+
*/
|
340 |
+
private function isSelectorValuesEqual( $elementValue1, $elementValue2 ){
|
341 |
+
|
342 |
+
$elementValue2 = $elementValue2->value;
|
343 |
+
if( !($elementValue2 instanceof Less_Tree_Selector) || $elementValue1->elements_len !== $elementValue2->elements_len ){
|
344 |
+
return false;
|
345 |
+
}
|
346 |
+
|
347 |
+
for( $i = 0; $i < $elementValue1->elements_len; $i++ ){
|
348 |
+
|
349 |
+
if( $elementValue1->elements[$i]->combinator !== $elementValue2->elements[$i]->combinator ){
|
350 |
+
if( $i !== 0 || ($elementValue1->elements[$i]->combinator || ' ') !== ($elementValue2->elements[$i]->combinator || ' ') ){
|
351 |
+
return false;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
if( !$this->isElementValuesEqual($elementValue1->elements[$i]->value, $elementValue2->elements[$i]->value) ){
|
356 |
+
return false;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
|
360 |
+
return true;
|
361 |
+
}
|
362 |
+
|
363 |
+
|
364 |
+
/**
|
365 |
+
* @param Less_Tree_Attribute $elementValue1
|
366 |
+
*/
|
367 |
+
private function isAttributeValuesEqual( $elementValue1, $elementValue2 ){
|
368 |
+
|
369 |
+
if( $elementValue1->op !== $elementValue2->op || $elementValue1->key !== $elementValue2->key ){
|
370 |
+
return false;
|
371 |
+
}
|
372 |
+
|
373 |
+
if( !$elementValue1->value || !$elementValue2->value ){
|
374 |
+
if( $elementValue1->value || $elementValue2->value ) {
|
375 |
+
return false;
|
376 |
+
}
|
377 |
+
return true;
|
378 |
+
}
|
379 |
+
|
380 |
+
$elementValue1 = ($elementValue1->value->value ? $elementValue1->value->value : $elementValue1->value );
|
381 |
+
$elementValue2 = ($elementValue2->value->value ? $elementValue2->value->value : $elementValue2->value );
|
382 |
+
|
383 |
+
return $elementValue1 === $elementValue2;
|
384 |
+
}
|
385 |
+
|
386 |
+
|
387 |
+
private function extendSelector($matches, $selectorPath, $replacementSelector){
|
388 |
+
|
389 |
+
//for a set of matches, replace each match with the replacement selector
|
390 |
+
|
391 |
+
$currentSelectorPathIndex = 0;
|
392 |
+
$currentSelectorPathElementIndex = 0;
|
393 |
+
$path = array();
|
394 |
+
$selectorPath_len = count($selectorPath);
|
395 |
+
|
396 |
+
for($matchIndex = 0, $matches_len = count($matches); $matchIndex < $matches_len; $matchIndex++ ){
|
397 |
+
|
398 |
+
|
399 |
+
$match = $matches[$matchIndex];
|
400 |
+
$selector = $selectorPath[ $match['pathIndex'] ];
|
401 |
+
|
402 |
+
$firstElement = new Less_Tree_Element(
|
403 |
+
$match['initialCombinator'],
|
404 |
+
$replacementSelector->elements[0]->value,
|
405 |
+
$replacementSelector->elements[0]->index,
|
406 |
+
$replacementSelector->elements[0]->currentFileInfo
|
407 |
+
);
|
408 |
+
|
409 |
+
if( $match['pathIndex'] > $currentSelectorPathIndex && $currentSelectorPathElementIndex > 0 ){
|
410 |
+
$last_path = end($path);
|
411 |
+
$last_path->elements = array_merge( $last_path->elements, array_slice( $selectorPath[$currentSelectorPathIndex]->elements, $currentSelectorPathElementIndex));
|
412 |
+
$currentSelectorPathElementIndex = 0;
|
413 |
+
$currentSelectorPathIndex++;
|
414 |
+
}
|
415 |
+
|
416 |
+
$newElements = array_merge(
|
417 |
+
array_slice($selector->elements, $currentSelectorPathElementIndex, ($match['index'] - $currentSelectorPathElementIndex) ) // last parameter of array_slice is different than the last parameter of javascript's slice
|
418 |
+
, array($firstElement)
|
419 |
+
, array_slice($replacementSelector->elements,1)
|
420 |
+
);
|
421 |
+
|
422 |
+
if( $currentSelectorPathIndex === $match['pathIndex'] && $matchIndex > 0 ){
|
423 |
+
$last_key = count($path)-1;
|
424 |
+
$path[$last_key]->elements = array_merge($path[$last_key]->elements,$newElements);
|
425 |
+
}else{
|
426 |
+
$path = array_merge( $path, array_slice( $selectorPath, $currentSelectorPathIndex, $match['pathIndex'] ));
|
427 |
+
$path[] = new Less_Tree_Selector( $newElements );
|
428 |
+
}
|
429 |
+
|
430 |
+
$currentSelectorPathIndex = $match['endPathIndex'];
|
431 |
+
$currentSelectorPathElementIndex = $match['endPathElementIndex'];
|
432 |
+
if( $currentSelectorPathElementIndex >= count($selectorPath[$currentSelectorPathIndex]->elements) ){
|
433 |
+
$currentSelectorPathElementIndex = 0;
|
434 |
+
$currentSelectorPathIndex++;
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
+
if( $currentSelectorPathIndex < $selectorPath_len && $currentSelectorPathElementIndex > 0 ){
|
439 |
+
$last_path = end($path);
|
440 |
+
$last_path->elements = array_merge( $last_path->elements, array_slice($selectorPath[$currentSelectorPathIndex]->elements, $currentSelectorPathElementIndex));
|
441 |
+
$currentSelectorPathIndex++;
|
442 |
+
}
|
443 |
+
|
444 |
+
$slice_len = $selectorPath_len - $currentSelectorPathIndex;
|
445 |
+
$path = array_merge($path, array_slice($selectorPath, $currentSelectorPathIndex, $slice_len));
|
446 |
+
|
447 |
+
return $path;
|
448 |
+
}
|
449 |
+
|
450 |
+
|
451 |
+
protected function visitMedia( $mediaNode ){
|
452 |
+
$newAllExtends = array_merge( $mediaNode->allExtends, end($this->allExtendsStack) );
|
453 |
+
$this->allExtendsStack[] = $this->doExtendChaining($newAllExtends, $mediaNode->allExtends);
|
454 |
+
}
|
455 |
+
|
456 |
+
protected function visitMediaOut(){
|
457 |
+
array_pop( $this->allExtendsStack );
|
458 |
+
}
|
459 |
+
|
460 |
+
protected function visitDirective( $directiveNode ){
|
461 |
+
$newAllExtends = array_merge( $directiveNode->allExtends, end($this->allExtendsStack) );
|
462 |
+
$this->allExtendsStack[] = $this->doExtendChaining($newAllExtends, $directiveNode->allExtends);
|
463 |
+
}
|
464 |
+
|
465 |
+
protected function visitDirectiveOut(){
|
466 |
+
array_pop($this->allExtendsStack);
|
467 |
+
}
|
468 |
+
|
469 |
+
}
|
base/inc/lib/Less/Visitor/toCSS.php
ADDED
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* toCSS Visitor
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage visitor
|
8 |
+
*/
|
9 |
+
class Less_Visitor_toCSS extends Less_VisitorReplacing{
|
10 |
+
|
11 |
+
private $charset;
|
12 |
+
|
13 |
+
public function __construct(){
|
14 |
+
parent::__construct();
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param Less_Tree_Ruleset $root
|
19 |
+
*/
|
20 |
+
public function run( $root ){
|
21 |
+
return $this->visitObj($root);
|
22 |
+
}
|
23 |
+
|
24 |
+
public function visitRule( $ruleNode ){
|
25 |
+
if( $ruleNode->variable ){
|
26 |
+
return array();
|
27 |
+
}
|
28 |
+
return $ruleNode;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function visitMixinDefinition($mixinNode){
|
32 |
+
// mixin definitions do not get eval'd - this means they keep state
|
33 |
+
// so we have to clear that state here so it isn't used if toCSS is called twice
|
34 |
+
$mixinNode->frames = array();
|
35 |
+
return array();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function visitExtend(){
|
39 |
+
return array();
|
40 |
+
}
|
41 |
+
|
42 |
+
public function visitComment( $commentNode ){
|
43 |
+
if( $commentNode->isSilent() ){
|
44 |
+
return array();
|
45 |
+
}
|
46 |
+
return $commentNode;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function visitMedia( $mediaNode, &$visitDeeper ){
|
50 |
+
$mediaNode->accept($this);
|
51 |
+
$visitDeeper = false;
|
52 |
+
|
53 |
+
if( !$mediaNode->rules ){
|
54 |
+
return array();
|
55 |
+
}
|
56 |
+
return $mediaNode;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function visitDirective( $directiveNode ){
|
60 |
+
if( isset($directiveNode->currentFileInfo['reference']) && (!property_exists($directiveNode,'isReferenced') || !$directiveNode->isReferenced) ){
|
61 |
+
return array();
|
62 |
+
}
|
63 |
+
if( $directiveNode->name === '@charset' ){
|
64 |
+
// Only output the debug info together with subsequent @charset definitions
|
65 |
+
// a comment (or @media statement) before the actual @charset directive would
|
66 |
+
// be considered illegal css as it has to be on the first line
|
67 |
+
if( isset($this->charset) && $this->charset ){
|
68 |
+
|
69 |
+
//if( $directiveNode->debugInfo ){
|
70 |
+
// $comment = new Less_Tree_Comment('/* ' . str_replace("\n",'',$directiveNode->toCSS())." */\n");
|
71 |
+
// $comment->debugInfo = $directiveNode->debugInfo;
|
72 |
+
// return $this->visit($comment);
|
73 |
+
//}
|
74 |
+
|
75 |
+
|
76 |
+
return array();
|
77 |
+
}
|
78 |
+
$this->charset = true;
|
79 |
+
}
|
80 |
+
return $directiveNode;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function checkPropertiesInRoot( $rulesetNode ){
|
84 |
+
|
85 |
+
if( !$rulesetNode->firstRoot ){
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
|
89 |
+
foreach($rulesetNode->rules as $ruleNode){
|
90 |
+
if( $ruleNode instanceof Less_Tree_Rule && !$ruleNode->variable ){
|
91 |
+
$msg = "properties must be inside selector blocks, they cannot be in the root. Index ".$ruleNode->index.($ruleNode->currentFileInfo ? (' Filename: '.$ruleNode->currentFileInfo['filename']) : null);
|
92 |
+
throw new Less_Exception_Compiler($msg);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
public function visitRuleset( $rulesetNode, &$visitDeeper ){
|
99 |
+
|
100 |
+
$visitDeeper = false;
|
101 |
+
|
102 |
+
$this->checkPropertiesInRoot( $rulesetNode );
|
103 |
+
|
104 |
+
if( $rulesetNode->root ){
|
105 |
+
return $this->visitRulesetRoot( $rulesetNode );
|
106 |
+
}
|
107 |
+
|
108 |
+
$rulesets = array();
|
109 |
+
$rulesetNode->paths = $this->visitRulesetPaths($rulesetNode);
|
110 |
+
|
111 |
+
|
112 |
+
// Compile rules and rulesets
|
113 |
+
$nodeRuleCnt = $rulesetNode->rules?count($rulesetNode->rules):0;
|
114 |
+
for( $i = 0; $i < $nodeRuleCnt; ){
|
115 |
+
$rule = $rulesetNode->rules[$i];
|
116 |
+
|
117 |
+
if( property_exists($rule,'rules') ){
|
118 |
+
// visit because we are moving them out from being a child
|
119 |
+
$rulesets[] = $this->visitObj($rule);
|
120 |
+
array_splice($rulesetNode->rules,$i,1);
|
121 |
+
$nodeRuleCnt--;
|
122 |
+
continue;
|
123 |
+
}
|
124 |
+
$i++;
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
// accept the visitor to remove rules and refactor itself
|
129 |
+
// then we can decide now whether we want it or not
|
130 |
+
if( $nodeRuleCnt > 0 ){
|
131 |
+
$rulesetNode->accept($this);
|
132 |
+
|
133 |
+
if( $rulesetNode->rules ){
|
134 |
+
|
135 |
+
if( count($rulesetNode->rules) > 1 ){
|
136 |
+
$this->_mergeRules( $rulesetNode->rules );
|
137 |
+
$this->_removeDuplicateRules( $rulesetNode->rules );
|
138 |
+
}
|
139 |
+
|
140 |
+
// now decide whether we keep the ruleset
|
141 |
+
if( $rulesetNode->paths ){
|
142 |
+
//array_unshift($rulesets, $rulesetNode);
|
143 |
+
array_splice($rulesets,0,0,array($rulesetNode));
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
if( count($rulesets) === 1 ){
|
151 |
+
return $rulesets[0];
|
152 |
+
}
|
153 |
+
return $rulesets;
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Helper function for visitiRuleset
|
159 |
+
*
|
160 |
+
* return array|Less_Tree_Ruleset
|
161 |
+
*/
|
162 |
+
private function visitRulesetRoot( $rulesetNode ){
|
163 |
+
$rulesetNode->accept( $this );
|
164 |
+
if( $rulesetNode->firstRoot || $rulesetNode->rules ){
|
165 |
+
return $rulesetNode;
|
166 |
+
}
|
167 |
+
return array();
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Helper function for visitRuleset()
|
173 |
+
*
|
174 |
+
* @return array
|
175 |
+
*/
|
176 |
+
private function visitRulesetPaths($rulesetNode){
|
177 |
+
|
178 |
+
$paths = array();
|
179 |
+
foreach($rulesetNode->paths as $p){
|
180 |
+
if( $p[0]->elements[0]->combinator === ' ' ){
|
181 |
+
$p[0]->elements[0]->combinator = '';
|
182 |
+
}
|
183 |
+
|
184 |
+
foreach($p as $pi){
|
185 |
+
if( $pi->getIsReferenced() && $pi->getIsOutput() ){
|
186 |
+
$paths[] = $p;
|
187 |
+
break;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
return $paths;
|
193 |
+
}
|
194 |
+
|
195 |
+
protected function _removeDuplicateRules( &$rules ){
|
196 |
+
// remove duplicates
|
197 |
+
$ruleCache = array();
|
198 |
+
for( $i = count($rules)-1; $i >= 0 ; $i-- ){
|
199 |
+
$rule = $rules[$i];
|
200 |
+
if( $rule instanceof Less_Tree_Rule || $rule instanceof Less_Tree_NameValue ){
|
201 |
+
|
202 |
+
if( !isset($ruleCache[$rule->name]) ){
|
203 |
+
$ruleCache[$rule->name] = $rule;
|
204 |
+
}else{
|
205 |
+
$ruleList =& $ruleCache[$rule->name];
|
206 |
+
|
207 |
+
if( $ruleList instanceof Less_Tree_Rule || $ruleList instanceof Less_Tree_NameValue ){
|
208 |
+
$ruleList = $ruleCache[$rule->name] = array( $ruleCache[$rule->name]->toCSS() );
|
209 |
+
}
|
210 |
+
|
211 |
+
$ruleCSS = $rule->toCSS();
|
212 |
+
if( array_search($ruleCSS,$ruleList) !== false ){
|
213 |
+
array_splice($rules,$i,1);
|
214 |
+
}else{
|
215 |
+
$ruleList[] = $ruleCSS;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
}
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
protected function _mergeRules( &$rules ){
|
223 |
+
$groups = array();
|
224 |
+
|
225 |
+
//obj($rules);
|
226 |
+
|
227 |
+
$rules_len = count($rules);
|
228 |
+
for( $i = 0; $i < $rules_len; $i++ ){
|
229 |
+
$rule = $rules[$i];
|
230 |
+
|
231 |
+
if( ($rule instanceof Less_Tree_Rule) && $rule->merge ){
|
232 |
+
|
233 |
+
$key = $rule->name;
|
234 |
+
if( $rule->important ){
|
235 |
+
$key .= ',!';
|
236 |
+
}
|
237 |
+
|
238 |
+
if( !isset($groups[$key]) ){
|
239 |
+
$groups[$key] = array();
|
240 |
+
}else{
|
241 |
+
array_splice($rules, $i--, 1);
|
242 |
+
$rules_len--;
|
243 |
+
}
|
244 |
+
|
245 |
+
$groups[$key][] = $rule;
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
foreach($groups as $parts){
|
251 |
+
|
252 |
+
if( count($parts) > 1 ){
|
253 |
+
$rule = $parts[0];
|
254 |
+
$spacedGroups = array();
|
255 |
+
$lastSpacedGroup = array();
|
256 |
+
$parts_mapped = array();
|
257 |
+
foreach($parts as $p){
|
258 |
+
if( $p->merge === '+' ){
|
259 |
+
if( $lastSpacedGroup ){
|
260 |
+
$spacedGroups[] = self::toExpression($lastSpacedGroup);
|
261 |
+
}
|
262 |
+
$lastSpacedGroup = array();
|
263 |
+
}
|
264 |
+
$lastSpacedGroup[] = $p;
|
265 |
+
}
|
266 |
+
|
267 |
+
$spacedGroups[] = self::toExpression($lastSpacedGroup);
|
268 |
+
$rule->value = self::toValue($spacedGroups);
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
}
|
273 |
+
|
274 |
+
public static function toExpression($values){
|
275 |
+
$mapped = array();
|
276 |
+
foreach($values as $p){
|
277 |
+
$mapped[] = $p->value;
|
278 |
+
}
|
279 |
+
return new Less_Tree_Expression( $mapped );
|
280 |
+
}
|
281 |
+
|
282 |
+
public static function toValue($values){
|
283 |
+
//return new Less_Tree_Value($values); ??
|
284 |
+
|
285 |
+
$mapped = array();
|
286 |
+
foreach($values as $p){
|
287 |
+
$mapped[] = $p;
|
288 |
+
}
|
289 |
+
return new Less_Tree_Value($mapped);
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
base/inc/lib/Less/VisitorReplacing.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Replacing Visitor
|
5 |
+
*
|
6 |
+
* @package Less
|
7 |
+
* @subpackage visitor
|
8 |
+
*/
|
9 |
+
class Less_VisitorReplacing extends Less_Visitor{
|
10 |
+
|
11 |
+
public function visitObj( $node ){
|
12 |
+
|
13 |
+
$funcName = 'visit'.$node->type;
|
14 |
+
if( isset($this->_visitFnCache[$funcName]) ){
|
15 |
+
|
16 |
+
$visitDeeper = true;
|
17 |
+
$node = $this->$funcName( $node, $visitDeeper );
|
18 |
+
|
19 |
+
if( $node ){
|
20 |
+
if( $visitDeeper && is_object($node) ){
|
21 |
+
$node->accept($this);
|
22 |
+
}
|
23 |
+
|
24 |
+
$funcName = $funcName . "Out";
|
25 |
+
if( isset($this->_visitFnCache[$funcName]) ){
|
26 |
+
$this->$funcName( $node );
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
}else{
|
31 |
+
$node->accept($this);
|
32 |
+
}
|
33 |
+
|
34 |
+
return $node;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function visitArray( $nodes ){
|
38 |
+
|
39 |
+
$newNodes = array();
|
40 |
+
foreach($nodes as $node){
|
41 |
+
$evald = $this->visitObj($node);
|
42 |
+
if( $evald ){
|
43 |
+
if( is_array($evald) ){
|
44 |
+
self::flatten($evald,$newNodes);
|
45 |
+
}else{
|
46 |
+
$newNodes[] = $evald;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
return $newNodes;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function flatten( $arr, &$out ){
|
54 |
+
|
55 |
+
foreach($arr as $item){
|
56 |
+
if( !is_array($item) ){
|
57 |
+
$out[] = $item;
|
58 |
+
continue;
|
59 |
+
}
|
60 |
+
|
61 |
+
foreach($item as $nestedItem){
|
62 |
+
if( is_array($nestedItem) ){
|
63 |
+
self::flatten( $nestedItem, $out);
|
64 |
+
}else{
|
65 |
+
$out[] = $nestedItem;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
return $out;
|
71 |
+
}
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
|
base/inc/post-selector.php
CHANGED
@@ -1,37 +1,13 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
'modal' => file_get_contents( plugin_dir_path(SOW_BUNDLE_BASE_FILE).'base/tpl/posts-selector/modal.html' ),
|
12 |
-
'postSummary' => file_get_contents( plugin_dir_path(SOW_BUNDLE_BASE_FILE).'base/tpl/posts-selector/post.html' ),
|
13 |
-
'foundPosts' => '<div class="sow-post-count-message">' . sprintf( __('This query returns <a href="#" class="preview-query-posts">%s posts</a>.', 'so-widgets-bundle'), '<%= foundPosts %>') . '</div>',
|
14 |
-
'fields' => siteorigin_widget_post_selector_form_fields(),
|
15 |
-
'selector' => file_get_contents( plugin_dir_path(SOW_BUNDLE_BASE_FILE).'base/tpl/posts-selector/selector.html' ),
|
16 |
-
) );
|
17 |
-
|
18 |
-
wp_localize_script( 'siteorigin-widget-admin-posts-selector', 'sowPostsSelectorVars', array(
|
19 |
-
'modalTitle' => __('Select posts', 'so-widgets-bundle'),
|
20 |
-
) );
|
21 |
-
}
|
22 |
-
}
|
23 |
-
|
24 |
-
function siteorigin_widget_post_selector_admin_form_field( $value, $field_name ) {
|
25 |
-
?>
|
26 |
-
<input type="hidden" value="<?php echo esc_attr( $value ) ?>" name="<?php echo $field_name ?>" class="siteorigin-widget-input" />
|
27 |
-
<a href="#" class="sow-select-posts button button-secondary">
|
28 |
-
<span class="sow-current-count"><?php echo esc_html( siteorigin_widget_post_selector_count_posts( $value ) )?></span>
|
29 |
-
<?php esc_html_e( 'Build posts query', 'so-widgets-bundle' ) ?>
|
30 |
-
</a>
|
31 |
-
<?php
|
32 |
-
}
|
33 |
-
|
34 |
-
function siteorigin_widget_post_selector_process_query($query){
|
35 |
$query = wp_parse_args($query,
|
36 |
array(
|
37 |
'post_status' => 'publish',
|
@@ -70,8 +46,29 @@ function siteorigin_widget_post_selector_process_query($query){
|
|
70 |
}
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
if ( ! empty( $query['date_query'] ) ) {
|
74 |
-
$query['date_query']
|
75 |
}
|
76 |
|
77 |
if ( ! empty( $query['sticky'] ) ) {
|
@@ -79,10 +76,6 @@ function siteorigin_widget_post_selector_process_query($query){
|
|
79 |
case 'ignore' :
|
80 |
$query['ignore_sticky_posts'] = 1;
|
81 |
break;
|
82 |
-
//TODO: Revisit this. Not sure if it makes sense to have this as an option in a separate dropdown, but am
|
83 |
-
//TODO: trying to stay as close as possible to Page Builder Post Loop widget post selection options.
|
84 |
-
//TODO: It's probably better in the long run to make this work well and just cope with issues that come up in
|
85 |
-
//TODO: Page Builder Post Loop migrations until it dies.
|
86 |
case 'only' :
|
87 |
$post_in = empty( $query['post__in'] ) ? array() : $query['post__in'];
|
88 |
$query['post__in'] = array_merge( $post_in, get_option( 'sticky_posts' ) );
|
@@ -93,7 +86,7 @@ function siteorigin_widget_post_selector_process_query($query){
|
|
93 |
}
|
94 |
unset( $query['sticky'] );
|
95 |
}
|
96 |
-
|
97 |
// Exclude the current post (if applicable) to avoid any issues associated with showing the same post again
|
98 |
if( get_the_id() != false ){
|
99 |
$query['post__not_in'][] = get_the_id();
|
@@ -103,7 +96,7 @@ function siteorigin_widget_post_selector_process_query($query){
|
|
103 |
$query = wp_parse_args( $query['additional'], $query );
|
104 |
unset( $query['additional'] );
|
105 |
|
106 |
-
// If post_not_in is set, we need to convert it to an array to avoid issues with the query.
|
107 |
if( !empty( $query['post__not_in'] ) && !is_array( $query['post__not_in'] ) ){
|
108 |
$query['post__not_in'] = explode( ',', $query['post__not_in'] );
|
109 |
$query['post__not_in'] = array_map( 'intval', $query['post__not_in'] );
|
@@ -113,100 +106,6 @@ function siteorigin_widget_post_selector_process_query($query){
|
|
113 |
return apply_filters( 'siteorigin_widgets_posts_selector_query', $query );
|
114 |
}
|
115 |
|
116 |
-
function siteorigin_widget_post_selector_form_fields(){
|
117 |
-
$return = array();
|
118 |
-
|
119 |
-
// The post type field
|
120 |
-
$return['post_type'] = '';
|
121 |
-
$return['post_type'] .= '<label><span>' . __('Post type', 'so-widgets-bundle') . '</span>';
|
122 |
-
$return['post_type'] .= '<select name="post_type" multiple>';
|
123 |
-
$return['post_type'] .= '<option value="_all">' . __('All', 'so-widgets-bundle') . '</option>';
|
124 |
-
foreach( get_post_types( array( 'public' => true ), 'objects' ) as $id => $type ) {
|
125 |
-
if(!empty($type->labels->name)) {
|
126 |
-
$post_types[$id] = $type->labels->name;
|
127 |
-
$return['post_type'] .= '<option value="' . $id . '">' . $type->labels->name . '</option>';
|
128 |
-
}
|
129 |
-
}
|
130 |
-
$return['post_type'] .= '</select></label>';
|
131 |
-
|
132 |
-
// The field for specifying individual posts
|
133 |
-
$return['post__in'] = '';
|
134 |
-
$return['post__in'] .= '<label><span>' . __('Post in', 'so-widgets-bundle') . '</span>';
|
135 |
-
$return['post__in'] .= '<input type="text" name="post__in" class="" />';
|
136 |
-
$return['post__in'] .= ' <a href="#" class="sow-select-posts button button-small">' . __('Select posts', 'so-widgets-bundle') . '</a>';
|
137 |
-
$return['post__in'] .= '</label>';
|
138 |
-
|
139 |
-
// The taxonomy field
|
140 |
-
$return['tax_query'] = '';
|
141 |
-
$return['tax_query'] .= '<label><span>' . __('Taxonomies', 'so-widgets-bundle') . '</span>';
|
142 |
-
$return['tax_query'] .= '<input type="text" name="tax_query" class="" placeholder="search" />';
|
143 |
-
$return['tax_query'] .= '</label>';
|
144 |
-
|
145 |
-
$return['date_query'] = '';
|
146 |
-
$return['date_query'] .= '<label><span>' . __('Date range', 'so-widgets-bundle') . '</span>';
|
147 |
-
$return['date_query'] .= __( 'From', 'so-widgets-bundle' );
|
148 |
-
$return['date_query'] .= '<input type="date" name="after" class="" />';
|
149 |
-
$return['date_query'] .= __( 'To', 'so-widgets-bundle' );
|
150 |
-
$return['date_query'] .= '<input type="date" name="before" class="" />';
|
151 |
-
$return['date_query'] .= '<small>' . __('In the format \'yyyy-mm-dd\'.', 'so-widgets-bundle') . '</small>';
|
152 |
-
$return['date_query'] .= '</label>';
|
153 |
-
|
154 |
-
|
155 |
-
// The order by field
|
156 |
-
$return['orderby'] = '';
|
157 |
-
$return['orderby'] .= '<label><span>' . __('Order by', 'so-widgets-bundle') . '</span>';
|
158 |
-
$return['orderby'] .= '<select name="orderby">';
|
159 |
-
$orderby = array(
|
160 |
-
'none' => __('No order', 'so-widgets-bundle'),
|
161 |
-
'ID' => __('Post ID', 'so-widgets-bundle'),
|
162 |
-
'author' => __('Author', 'so-widgets-bundle'),
|
163 |
-
'title' => __('Title', 'so-widgets-bundle'),
|
164 |
-
'date' => __('Published date', 'so-widgets-bundle'),
|
165 |
-
'modified' => __('Modified date', 'so-widgets-bundle'),
|
166 |
-
'parent' => __('By parent', 'so-widgets-bundle'),
|
167 |
-
'rand' => __('Random order', 'so-widgets-bundle'),
|
168 |
-
'comment_count' => __('Comment count', 'so-widgets-bundle'),
|
169 |
-
'menu_order' => __('Menu order', 'so-widgets-bundle'),
|
170 |
-
'meta_value' => __('By meta value', 'so-widgets-bundle'),
|
171 |
-
'meta_value_num' => __('By numeric meta value', 'so-widgets-bundle'),
|
172 |
-
'post__in' => __('By include order', 'so-widgets-bundle'),
|
173 |
-
);
|
174 |
-
foreach($orderby as $id => $v) {
|
175 |
-
$return['orderby'] .= '<option value="' . $id . '">' . $v . '</option>';
|
176 |
-
}
|
177 |
-
$return['orderby'] .= '</select>';
|
178 |
-
$return['orderby'] .= '<input type="hidden" name="order" />';
|
179 |
-
$return['orderby'] .= '<span class="sow-order-button sow-order-button-desc"></span>';
|
180 |
-
$return['orderby'] .= '</label>';
|
181 |
-
|
182 |
-
$return['posts_per_page'] = '';
|
183 |
-
$return['posts_per_page'] .= '<label><span>' . __('Posts per page', 'so-widgets-bundle') . '</span>';
|
184 |
-
$return['posts_per_page'] .= '<input type="number" name="posts_per_page" class="" />';
|
185 |
-
$return['posts_per_page'] .= '</label>';
|
186 |
-
|
187 |
-
|
188 |
-
$return['sticky'] = '';
|
189 |
-
$return['sticky'] .= '<label><span>' . __('Sticky posts', 'so-widgets-bundle') . '</span>';
|
190 |
-
$return['sticky'] .= '<select name="sticky">';
|
191 |
-
$sticky = array(
|
192 |
-
'' => __('Default', 'so-widgets-bundle'),
|
193 |
-
'ignore' => __('Ignore sticky', 'so-widgets-bundle'),
|
194 |
-
'exclude' => __('Exclude sticky', 'so-widgets-bundle'),
|
195 |
-
'only' => __('Only sticky', 'so-widgets-bundle'),
|
196 |
-
);
|
197 |
-
foreach($sticky as $id => $v) {
|
198 |
-
$return['sticky'] .= '<option value="' . $id . '">' . $v . '</option>';
|
199 |
-
}
|
200 |
-
$return['sticky'] .= '</select></label>';
|
201 |
-
|
202 |
-
$return['additional'] = '';
|
203 |
-
$return['additional'] .= '<label><span>' . __('Additional', 'so-widgets-bundle') . '</span>';
|
204 |
-
$return['additional'] .= '<input type="text" name="additional" class="" />';
|
205 |
-
$return['additional'] .= '<small>' . __('Additional query arguments. See <a href="http://codex.wordpress.org/Function_Reference/query_posts" target="_blank">query_posts</a>.', 'so-widgets-bundle') . '</small>';
|
206 |
-
$return['additional'] .= '</label>';
|
207 |
-
|
208 |
-
return $return;
|
209 |
-
}
|
210 |
|
211 |
/**
|
212 |
* Just return a comma separated list of all available post types.
|
@@ -228,105 +127,8 @@ function siteorigin_widget_post_selector_all_post_types(){
|
|
228 |
* @param $query
|
229 |
* @return int
|
230 |
*/
|
231 |
-
function siteorigin_widget_post_selector_count_posts($query){
|
232 |
$query = siteorigin_widget_post_selector_process_query( $query );
|
233 |
$posts = new WP_Query($query);
|
234 |
return $posts->found_posts;
|
235 |
}
|
236 |
-
|
237 |
-
/**
|
238 |
-
* The get posts ajax action
|
239 |
-
*/
|
240 |
-
function siteorigin_widget_post_selector_get_posts_action(){
|
241 |
-
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
242 |
-
|
243 |
-
$query = siteorigin_widget_post_selector_process_query( stripslashes( $_POST['query'] ) );
|
244 |
-
|
245 |
-
if(!empty($_POST['ignore_pagination'])) {
|
246 |
-
$query['posts_per_page'] = 100;
|
247 |
-
}
|
248 |
-
|
249 |
-
$posts = new WP_Query($query);
|
250 |
-
|
251 |
-
// Create the result
|
252 |
-
$result = array(
|
253 |
-
'found_posts' => $posts->found_posts,
|
254 |
-
'posts' => array()
|
255 |
-
);
|
256 |
-
|
257 |
-
foreach($posts->posts as $post) {
|
258 |
-
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) );
|
259 |
-
|
260 |
-
$result['posts'][] = array(
|
261 |
-
'title' => $post->post_title,
|
262 |
-
'id' => $post->ID,
|
263 |
-
'thumbnail' => !empty($thumbnail) ? $thumbnail[0] : plugin_dir_url(__FILE__).'../css/img/thumbnail-placeholder.png',
|
264 |
-
'editUrl' => admin_url( 'post.php?post=' . $post->ID . '&action=edit')
|
265 |
-
);
|
266 |
-
}
|
267 |
-
|
268 |
-
header('content-type: application/json');
|
269 |
-
echo json_encode($result);
|
270 |
-
|
271 |
-
exit();
|
272 |
-
}
|
273 |
-
add_action('wp_ajax_sow_get_posts', 'siteorigin_widget_post_selector_get_posts_action');
|
274 |
-
|
275 |
-
/**
|
276 |
-
* The action handler for searching posts by title
|
277 |
-
*/
|
278 |
-
function siteorigin_widget_post_selector_post_search_action(){
|
279 |
-
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
280 |
-
$term = !empty($_GET['term']) ? stripslashes($_GET['term']) : '';
|
281 |
-
$type = !empty($_GET['type']) ? stripslashes($_GET['type']) : '_all';
|
282 |
-
if($type == '_all') $type = siteorigin_widget_post_selector_all_post_types();
|
283 |
-
|
284 |
-
$type = explode(',', $type);
|
285 |
-
|
286 |
-
$results = array();
|
287 |
-
$r = new WP_Query( array('s' => $term, 'post_status' => 'publish', 'posts_per_page' => 20, 'post_type' => $type) );
|
288 |
-
foreach($r->posts as $post) {
|
289 |
-
$results[] = array(
|
290 |
-
'label' => $post->post_title,
|
291 |
-
'value' => $post->ID,
|
292 |
-
);
|
293 |
-
}
|
294 |
-
|
295 |
-
header('content-type:application/json');
|
296 |
-
echo json_encode($results);
|
297 |
-
exit();
|
298 |
-
|
299 |
-
}
|
300 |
-
add_action('wp_ajax_sow_search_posts', 'siteorigin_widget_post_selector_post_search_action');
|
301 |
-
|
302 |
-
/**
|
303 |
-
* The action handler for searching taxonomy terms
|
304 |
-
*/
|
305 |
-
function siteorigin_widget_post_selector_search_taxonomy_terms(){
|
306 |
-
if ( empty( $_REQUEST['_widgets_nonce'] ) || !wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) return;
|
307 |
-
global $wpdb;
|
308 |
-
$term = !empty($_GET['term']) ? stripslashes($_GET['term']) : '';
|
309 |
-
$term = trim($term, '%');
|
310 |
-
|
311 |
-
$return = array();
|
312 |
-
|
313 |
-
$query = $wpdb->prepare("
|
314 |
-
SELECT terms.term_id, terms.slug, terms.name, termtaxonomy.taxonomy
|
315 |
-
FROM $wpdb->terms AS terms
|
316 |
-
JOIN $wpdb->term_taxonomy AS termtaxonomy ON terms.term_id = termtaxonomy.term_id
|
317 |
-
WHERE
|
318 |
-
terms.name LIKE '%s'
|
319 |
-
", '%'.$term.'%');
|
320 |
-
|
321 |
-
foreach($wpdb->get_results($query) as $result) {
|
322 |
-
$return[] = array(
|
323 |
-
'label' => $result->taxonomy.': '.$result->name,
|
324 |
-
'value' => $result->taxonomy.':'.$result->slug,
|
325 |
-
);
|
326 |
-
}
|
327 |
-
|
328 |
-
header('content-type:application/json');
|
329 |
-
echo json_encode($return);
|
330 |
-
exit();
|
331 |
-
}
|
332 |
-
add_action('wp_ajax_sow_search_terms', 'siteorigin_widget_post_selector_search_taxonomy_terms');
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Filter a query created from the post selector field into an array that will work properly with get_posts
|
5 |
+
*
|
6 |
+
* @param $query
|
7 |
+
*
|
8 |
+
* @return mixed
|
9 |
+
*/
|
10 |
+
function siteorigin_widget_post_selector_process_query( $query ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
$query = wp_parse_args($query,
|
12 |
array(
|
13 |
'post_status' => 'publish',
|
46 |
}
|
47 |
}
|
48 |
|
49 |
+
if ( isset( $query['date_type'] ) && $query['date_type'] == 'relative' ) {
|
50 |
+
|
51 |
+
$date_query_rel = json_decode(
|
52 |
+
stripslashes( $query['date_query_relative'] ),
|
53 |
+
true
|
54 |
+
);
|
55 |
+
$value_after = new DateTime(
|
56 |
+
$date_query_rel['from']['value'] . ' ' . $date_query_rel['from']['unit'] . ' ago'
|
57 |
+
);
|
58 |
+
$value['after'] = $value_after->format( 'Y-m-d' );
|
59 |
+
$value_before = new DateTime(
|
60 |
+
$date_query_rel['to']['value'] . ' ' . $date_query_rel['to']['unit'] . ' ago'
|
61 |
+
);
|
62 |
+
$value['before'] = $value_before->format( 'Y-m-d' );
|
63 |
+
$query['date_query'] = $value;
|
64 |
+
unset( $query['date_type'] );
|
65 |
+
unset( $query['date_query_relative'] );
|
66 |
+
} else if ( ! empty( $query['date_query'] ) ) {
|
67 |
+
$query['date_query'] = json_decode( stripslashes( $query['date_query'] ), true );
|
68 |
+
}
|
69 |
+
|
70 |
if ( ! empty( $query['date_query'] ) ) {
|
71 |
+
$query['date_query']['inclusive'] = true;
|
72 |
}
|
73 |
|
74 |
if ( ! empty( $query['sticky'] ) ) {
|
76 |
case 'ignore' :
|
77 |
$query['ignore_sticky_posts'] = 1;
|
78 |
break;
|
|
|
|
|
|
|
|
|
79 |
case 'only' :
|
80 |
$post_in = empty( $query['post__in'] ) ? array() : $query['post__in'];
|
81 |
$query['post__in'] = array_merge( $post_in, get_option( 'sticky_posts' ) );
|
86 |
}
|
87 |
unset( $query['sticky'] );
|
88 |
}
|
89 |
+
|
90 |
// Exclude the current post (if applicable) to avoid any issues associated with showing the same post again
|
91 |
if( get_the_id() != false ){
|
92 |
$query['post__not_in'][] = get_the_id();
|
96 |
$query = wp_parse_args( $query['additional'], $query );
|
97 |
unset( $query['additional'] );
|
98 |
|
99 |
+
// If post_not_in is set, we need to convert it to an array to avoid issues with the query.
|
100 |
if( !empty( $query['post__not_in'] ) && !is_array( $query['post__not_in'] ) ){
|
101 |
$query['post__not_in'] = explode( ',', $query['post__not_in'] );
|
102 |
$query['post__not_in'] = array_map( 'intval', $query['post__not_in'] );
|
106 |
return apply_filters( 'siteorigin_widgets_posts_selector_query', $query );
|
107 |
}
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
/**
|
111 |
* Just return a comma separated list of all available post types.
|
127 |
* @param $query
|
128 |
* @return int
|
129 |
*/
|
130 |
+
function siteorigin_widget_post_selector_count_posts( $query ) {
|
131 |
$query = siteorigin_widget_post_selector_process_query( $query );
|
132 |
$posts = new WP_Query($query);
|
133 |
return $posts->found_posts;
|
134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base/js/admin.js
CHANGED
@@ -1,743 +1,728 @@
|
|
|
|
1 |
|
2 |
-
|
3 |
-
|
4 |
-
(function($){
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
var postTypes = $contentSearchInput.data('postTypes');
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
// Create a new modal window
|
479 |
-
var modal = $( $('#so-widgets-bundle-tpl-preview-dialog').html().trim() ).appendTo('body');
|
480 |
-
modal.find('input[name="data"]').val( JSON.stringify(data) );
|
481 |
-
modal.find('input[name="class"]').val( $el.data('class') );
|
482 |
-
modal.find('iframe').on('load', function(){
|
483 |
-
$(this).css('visibility', 'visible');
|
484 |
-
});
|
485 |
-
modal.find('form').submit();
|
486 |
-
|
487 |
-
modal.find('.close').click(function(){
|
488 |
-
modal.remove();
|
489 |
-
});
|
490 |
-
});
|
491 |
-
};
|
492 |
-
|
493 |
-
$.fn.sowSetupRepeater = function(){
|
494 |
-
|
495 |
-
return $(this).each( function(i, el){
|
496 |
-
var $el = $(el);
|
497 |
-
var $items = $el.find('.siteorigin-widget-field-repeater-items');
|
498 |
-
var name = $el.data('repeater-name');
|
499 |
-
|
500 |
-
$items.bind('updateFieldPositions', function(){
|
501 |
-
var $$ = $(this);
|
502 |
-
var $rptrItems = $$.find('> .siteorigin-widget-field-repeater-item');
|
503 |
-
|
504 |
-
// Set the position for the repeater items
|
505 |
-
$rptrItems.each(function(i, el){
|
506 |
-
$(el).find('.siteorigin-widget-input').each(function(j, input){
|
507 |
-
var pos = $(input).data('repeater-positions');
|
508 |
-
if( typeof pos === 'undefined' ) {
|
509 |
-
pos = {};
|
510 |
-
}
|
511 |
-
|
512 |
-
pos[name] = i;
|
513 |
-
$(input).data('repeater-positions', pos);
|
514 |
-
});
|
515 |
-
});
|
516 |
-
|
517 |
-
// Update the field names for all the input items
|
518 |
-
$$.find('.siteorigin-widget-input').each(function(i, input){
|
519 |
-
var pos = $(input).data('repeater-positions');
|
520 |
-
var $in = $(input);
|
521 |
-
|
522 |
-
if(typeof pos !== 'undefined') {
|
523 |
-
var newName = $in.attr('data-original-name');
|
524 |
-
|
525 |
-
if( ! newName ) {
|
526 |
-
$in.attr( 'data-original-name', $in.attr('name') );
|
527 |
-
newName = $in.attr('name');
|
528 |
-
}
|
529 |
-
if( ! newName ) {
|
530 |
-
return;
|
531 |
-
}
|
532 |
-
|
533 |
-
if( pos ) {
|
534 |
-
for( var k in pos ) {
|
535 |
-
newName = newName.replace('#' + k + '#', pos[k] );
|
536 |
-
}
|
537 |
-
}
|
538 |
-
$in.attr('name', newName);
|
539 |
-
}
|
540 |
-
});
|
541 |
-
|
542 |
-
if( ! $$.data('initialSetup') ) {
|
543 |
// Setup default checked values, now that we've updated input names.
|
544 |
// Without this radio inputs in repeaters will be rendered as if they all belong to the same group.
|
545 |
-
$$.find('.siteorigin-widget-input').each(function(i, input) {
|
546 |
var $in = $(input);
|
547 |
$in.prop('checked', $in.prop('defaultChecked'));
|
548 |
});
|
549 |
$$.data('initialSetup', true);
|
550 |
}
|
551 |
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
$(window).resize();
|
579 |
-
});
|
580 |
-
} );
|
581 |
-
|
582 |
-
$el.find('> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand').click( function(e){
|
583 |
-
e.preventDefault();
|
584 |
-
$el.closest('.siteorigin-widget-field-repeater').find('> .siteorigin-widget-field-repeateritems-').slideToggle('fast', function() {
|
585 |
$(window).resize();
|
586 |
});
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
$(window).resize();
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
|
|
|
|
|
|
|
|
734 |
var idRegExp;
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
// Radio inputs are slightly different because there are multiple `input` elements for
|
739 |
// a single field, i.e. multiple `inputs` for selecting a single value.
|
740 |
-
if(
|
741 |
// Radio inputs have their position appended to the id.
|
742 |
idBase = id.replace(/-\d+-\d+$/, '');
|
743 |
var radioIdBase = id.replace(/-\d+$/, '');
|
@@ -745,19 +730,19 @@
|
|
745 |
var radioNames = {};
|
746 |
newIds[idBase] = $form
|
747 |
// find all inputs containing idBase in their id attribute
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
}
|
762 |
var newRadioIdBase = idBase + '-' + newIds[idBase];
|
763 |
newId = newRadioIdBase + id.match(/-\d+$/)[0];
|
@@ -770,233 +755,463 @@
|
|
770 |
}
|
771 |
newId = idBase + '-' + newIds[idBase]++;
|
772 |
}
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
895 |
|
896 |
})(jQuery);
|
897 |
|
898 |
var sowEmitters = {
|
899 |
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1002 |
};
|
|
|
|
1 |
+
/* globals wp, jQuery, _, soWidgets, confirm, tinymce, sowbForms */
|
2 |
|
3 |
+
var sowbForms = window.sowbForms || {};
|
4 |
+
|
5 |
+
(function ($) {
|
6 |
+
|
7 |
+
$.fn.sowSetupForm = function () {
|
8 |
+
|
9 |
+
return $(this).each(function (i, el) {
|
10 |
+
var $el = $(el),
|
11 |
+
$mainForm,
|
12 |
+
formId,
|
13 |
+
formInitializing = true;
|
14 |
+
|
15 |
+
// Skip this if the widget has any fields with an __i__
|
16 |
+
var $inputs = $el.find('input[name]');
|
17 |
+
if ($inputs.length && $inputs.attr('name').indexOf('__i__') !== -1) {
|
18 |
+
return this;
|
19 |
+
}
|
20 |
+
|
21 |
+
// Skip this if we've already set up the form
|
22 |
+
if ( $el.is('.siteorigin-widget-form-main') ) {
|
23 |
+
if ($el.data('sow-form-setup') === true) {
|
24 |
+
return true;
|
25 |
+
}
|
26 |
+
// If we're in the main widgets interface and the form isn't visible and it isn't contained in a
|
27 |
+
// panels dialog (when using the Layout Builder widget), don't worry about setting it up.
|
28 |
+
if ($('body').hasClass('widgets-php') && !$el.is(':visible') && $el.closest('.panel-dialog').length === 0) {
|
29 |
+
return true;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Listen for a state change event if this is the main form wrapper
|
33 |
+
$el.on('sowstatechange', function (e, incomingGroup, incomingState) {
|
34 |
+
|
35 |
+
// Find all wrappers that have state handlers on them
|
36 |
+
$el.find('[data-state-handler]').each(function () {
|
37 |
+
var $$ = $(this);
|
38 |
+
// Create a copy of the current state handlers. Add in initial handlers if the form is initializing.
|
39 |
+
var handler = $.extend({}, $$.data('state-handler'), formInitializing ? $$.data('state-handler-initial') : {});
|
40 |
+
if (Object.keys(handler).length === 0) {
|
41 |
+
return true;
|
42 |
+
}
|
43 |
+
|
44 |
+
// We need to figure out what the incoming state is
|
45 |
+
var handlerStateParts, handlerState, thisHandler, $$f, runHandler, handlerStateNames;
|
46 |
+
|
47 |
+
// Indicates if the handler has run
|
48 |
+
var handlerRun = {};
|
49 |
+
|
50 |
+
var repeaterIndex = sowbForms.getRepeaterId($$);
|
51 |
+
if (repeaterIndex !== false) {
|
52 |
+
var repeaterHandler = {};
|
53 |
+
for (var state in handler) {
|
54 |
+
repeaterHandler[state.replace('{$repeater}', repeaterIndex)] = handler[state];
|
55 |
+
}
|
56 |
+
handler = repeaterHandler;
|
57 |
+
}
|
58 |
+
|
59 |
+
// Go through all the handlers
|
60 |
+
for (var state in handler) {
|
61 |
+
runHandler = false;
|
62 |
+
|
63 |
+
// Parse the handler state parts
|
64 |
+
handlerStateParts = state.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/);
|
65 |
+
if (handlerStateParts === null) {
|
66 |
+
// Skip this if there's a problem with the state parts
|
67 |
+
continue;
|
68 |
+
}
|
69 |
+
|
70 |
+
handlerState = {
|
71 |
+
'group': 'default',
|
72 |
+
'name': '',
|
73 |
+
'multi': false
|
74 |
+
};
|
75 |
+
|
76 |
+
// Assign the handlerState attributes based on the parsed state
|
77 |
+
if (handlerStateParts[2] !== undefined) {
|
78 |
+
handlerState.group = handlerStateParts[1];
|
79 |
+
handlerState.name = handlerStateParts[3];
|
80 |
+
}
|
81 |
+
else {
|
82 |
+
handlerState.name = handlerStateParts[0];
|
83 |
+
}
|
84 |
+
handlerState.multi = (handlerStateParts[4] !== undefined);
|
85 |
+
|
86 |
+
if (handlerState.group === '_else') {
|
87 |
+
// This is the special case of an group else handler
|
88 |
+
// Always run if no handlers from the current group have been run yet
|
89 |
+
handlerState.group = handlerState.name;
|
90 |
+
handlerState.name = '';
|
91 |
+
|
92 |
+
// We will run this handler because none have run for it yet
|
93 |
+
runHandler = ( handlerState.group === incomingGroup && typeof handlerRun[handlerState.group] === 'undefined' );
|
94 |
+
}
|
95 |
+
else {
|
96 |
+
// Evaluate if we're in the current state
|
97 |
+
handlerStateNames = handlerState.name.split(',').map(function (a) {
|
98 |
+
return a.trim()
|
99 |
+
});
|
100 |
+
for (var i = 0; i < handlerStateNames.length; i++) {
|
101 |
+
runHandler = (handlerState.group === incomingGroup && handlerStateNames[i] === incomingState);
|
102 |
+
if (runHandler) break;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
// Run the handler if previous checks have determined we should
|
107 |
+
if (runHandler) {
|
108 |
+
thisHandler = handler[state];
|
109 |
+
|
110 |
+
// Now we can handle the the handler
|
111 |
+
if (!handlerState.multi) {
|
112 |
+
thisHandler = [thisHandler];
|
113 |
+
}
|
114 |
+
|
115 |
+
for (var i = 0; i < thisHandler.length; i++) {
|
116 |
+
// Choose the item we'll be acting on here
|
117 |
+
if (typeof thisHandler[i][1] !== 'undefined' && Boolean(thisHandler[i][1])) {
|
118 |
+
// thisHandler[i][1] is the sub selector
|
119 |
+
$$f = $$.find(thisHandler[i][1]);
|
120 |
+
}
|
121 |
+
else {
|
122 |
+
$$f = $$;
|
123 |
+
}
|
124 |
+
|
125 |
+
// Call the function on the wrapper we've selected
|
126 |
+
$$f[thisHandler[i][0]].apply($$f, typeof thisHandler[i][2] !== 'undefined' ? thisHandler[i][2] : []);
|
127 |
+
|
128 |
+
}
|
129 |
+
|
130 |
+
// Store that we've run a handler
|
131 |
+
handlerRun[handlerState.group] = true;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
});
|
136 |
+
});
|
137 |
+
|
138 |
+
// Lets set up the preview
|
139 |
+
$el.sowSetupPreview();
|
140 |
+
$mainForm = $el;
|
141 |
+
|
142 |
+
var $teaser = $el.find('.siteorigin-widget-teaser');
|
143 |
+
$teaser.find('.dashicons-dismiss').click(function () {
|
144 |
+
var $$ = $(this);
|
145 |
+
$.get($$.data('dismiss-url'));
|
146 |
+
|
147 |
+
$teaser.slideUp('normal', function () {
|
148 |
+
$teaser.remove();
|
149 |
+
});
|
150 |
+
});
|
151 |
+
|
152 |
+
var _sow_form_id = $el.find( '> .siteorigin-widgets-form-id' ).val();
|
153 |
+
var $timestampField = $el.find( '> .siteorigin-widgets-form-timestamp' );
|
154 |
+
var _sow_form_timestamp = parseInt( $timestampField.val() || 0 );
|
155 |
+
var data = JSON.parse( sessionStorage.getItem( _sow_form_id ) );
|
156 |
+
if ( data ) {
|
157 |
+
if ( data['_sow_form_timestamp'] > _sow_form_timestamp ) {
|
158 |
+
var $newerNotification = $( '<div class="siteorigin-widget-form-notification">' +
|
159 |
+
'<span>' + soWidgets.backup.newerVersion + '</span>' +
|
160 |
+
'<a class="button button-small so-backup-restore">' + soWidgets.backup.restore + '</a>' +
|
161 |
+
'<a class="button button-small so-backup-dismiss">' + soWidgets.backup.dismiss + '</a>' +
|
162 |
+
'<div><small>' + soWidgets.backup.replaceWarning + '</small></div>' +
|
163 |
+
'</div>' );
|
164 |
+
$el.prepend( $newerNotification );
|
165 |
+
|
166 |
+
$newerNotification.find( '.so-backup-restore' ).click( function () {
|
167 |
+
sowbForms.setWidgetFormValues( $mainForm, data );
|
168 |
+
$newerNotification.slideUp( 'fast', function () {
|
169 |
+
$newerNotification.remove();
|
170 |
+
} );
|
171 |
+
} );
|
172 |
+
$newerNotification.find( '.so-backup-dismiss' ).click( function () {
|
173 |
+
$newerNotification.slideUp( 'fast', function () {
|
174 |
+
sessionStorage.removeItem( _sow_form_id );
|
175 |
+
$newerNotification.remove();
|
176 |
+
} );
|
177 |
+
} );
|
178 |
+
} else {
|
179 |
+
sessionStorage.removeItem( _sow_form_id );
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
$el.change( function () {
|
184 |
+
$timestampField.val( new Date().getTime() );
|
185 |
+
var data = sowbForms.getWidgetFormValues( $el );
|
186 |
+
sessionStorage.setItem( _sow_form_id, JSON.stringify( data ) );
|
187 |
+
} );
|
188 |
+
}
|
189 |
+
else {
|
190 |
+
$mainForm = $el.closest('.siteorigin-widget-form-main');
|
191 |
+
}
|
192 |
+
formId = $mainForm.find('> .siteorigin-widgets-form-id').val();
|
193 |
+
|
194 |
+
// Find any field or sub widget fields.
|
195 |
+
var $fields = $el.find('> .siteorigin-widget-field');
|
196 |
+
|
197 |
+
// Process any sub sections
|
198 |
+
$fields.find('> .siteorigin-widget-section').sowSetupForm();
|
199 |
+
|
200 |
+
// Process any sub widgets whose fields aren't contained in a section
|
201 |
+
$fields.filter('.siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))').sowSetupForm();
|
202 |
+
|
203 |
+
// Store the field names
|
204 |
+
$fields.find('.siteorigin-widget-input').each(function (i, input) {
|
205 |
+
if ($(input).data('original-name') === null) {
|
206 |
+
$(input).data('original-name', $(input).attr('name'));
|
207 |
+
}
|
208 |
+
});
|
209 |
+
|
210 |
+
// Setup all the repeaters
|
211 |
+
$fields.find('> .siteorigin-widget-field-repeater').sowSetupRepeater();
|
212 |
+
|
213 |
+
// For any repeater items currently in existence
|
214 |
+
$el.find('.siteorigin-widget-field-repeater-item').sowSetupRepeaterItems();
|
215 |
+
|
216 |
+
// Set up any color fields
|
217 |
+
$fields.find('> .siteorigin-widget-input-color').each(function () {
|
218 |
+
var colorField = $(this);
|
219 |
+
var colorFieldOptions = {
|
220 |
+
change: function (event, ui) {
|
221 |
+
setTimeout(function () {
|
222 |
+
$(event.target).trigger('change');
|
223 |
+
}, 100);
|
224 |
+
}
|
225 |
+
};
|
226 |
+
if (colorField.data('defaultColor')) {
|
227 |
+
colorFieldOptions.defaultColor = colorField.data('defaultColor');
|
228 |
+
}
|
229 |
+
colorField.wpColorPicker(colorFieldOptions);
|
230 |
+
});
|
231 |
+
|
232 |
+
///////////////////////////////////////
|
233 |
+
// Handle the sections
|
234 |
+
var expandContainer = function () {
|
235 |
+
var $$ = $(this);
|
236 |
+
$(this).toggleClass('siteorigin-widget-section-visible');
|
237 |
+
$(this).siblings('.siteorigin-widget-section').slideToggle(function () {
|
238 |
+
$(window).resize();
|
239 |
+
$(this).find('> .siteorigin-widget-field-container-state').val($(this).is(':visible') ? 'open' : 'closed');
|
240 |
+
});
|
241 |
+
};
|
242 |
+
$fields.filter('.siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section').find('> label').click(expandContainer);
|
243 |
+
$fields.filter('.siteorigin-widget-field-type-posts').find('.posts-container-label-wrapper').click(expandContainer);
|
244 |
+
|
245 |
+
///////////////////////////////////////
|
246 |
+
// Handle the slider fields
|
247 |
+
|
248 |
+
$fields.filter('.siteorigin-widget-field-type-slider').each(function () {
|
249 |
+
var $$ = $(this);
|
250 |
+
var $input = $$.find('input[type="number"]');
|
251 |
+
var $c = $$.find('.siteorigin-widget-value-slider');
|
252 |
+
|
253 |
+
$c.slider({
|
254 |
+
max: parseInt($input.attr('max')),
|
255 |
+
min: parseInt($input.attr('min')),
|
256 |
+
value: parseInt($input.val()),
|
257 |
+
slide: function (event, ui) {
|
258 |
+
$input.val( parseInt( ui.value ) );
|
259 |
+
$input.trigger( 'change' );
|
260 |
+
},
|
261 |
+
change: function( event, ui ) {
|
262 |
+
$$.find('.siteorigin-widget-slider-value').html(ui.value);
|
263 |
+
},
|
264 |
+
});
|
265 |
+
$input.change(function(event, data) {
|
266 |
+
if ( ! ( data && data.silent ) ) {
|
267 |
+
$c.slider( 'value', parseInt( $input.val() ) );
|
268 |
+
}
|
269 |
+
});
|
270 |
+
});
|
271 |
+
|
272 |
+
///////////////////////////////////////
|
273 |
+
// Setup the URL fields
|
274 |
+
|
275 |
+
$fields.filter('.siteorigin-widget-field-type-link').each(function () {
|
276 |
+
var $$ = $(this);
|
277 |
+
|
278 |
+
// Function that refreshes the list of
|
279 |
+
var request = null;
|
280 |
+
var refreshList = function () {
|
281 |
+
if (request !== null) {
|
282 |
+
request.abort();
|
283 |
+
}
|
284 |
+
|
285 |
+
var $contentSearchInput = $$.find('.content-text-search');
|
286 |
+
var query = $contentSearchInput.val();
|
287 |
var postTypes = $contentSearchInput.data('postTypes');
|
288 |
|
289 |
+
var $ul = $$.find('ul.posts').empty().addClass('loading');
|
290 |
+
$.get(
|
291 |
+
soWidgets.ajaxurl,
|
292 |
+
{action: 'so_widgets_search_posts', query: query, postTypes: postTypes},
|
293 |
+
function (data) {
|
294 |
+
for (var i = 0; i < data.length; i++) {
|
295 |
+
if (data[i].label === '') {
|
296 |
+
data[i].label = ' ';
|
297 |
+
}
|
298 |
+
|
299 |
+
// Add all the post items
|
300 |
+
$ul.append(
|
301 |
+
$('<li>')
|
302 |
+
.addClass('post')
|
303 |
+
.html(data[i].label + '<span>(' + data[i].type + ')</span>')
|
304 |
+
.data(data[i])
|
305 |
+
);
|
306 |
+
}
|
307 |
+
$ul.removeClass('loading');
|
308 |
+
}
|
309 |
+
);
|
310 |
+
};
|
311 |
+
|
312 |
+
// Toggle display of the existing content
|
313 |
+
$$.find('.select-content-button, .button-close').click(function (e) {
|
314 |
+
e.preventDefault();
|
315 |
+
|
316 |
+
$(this).blur();
|
317 |
+
var $s = $$.find('.existing-content-selector');
|
318 |
+
$s.toggle();
|
319 |
+
|
320 |
+
if ($s.is(':visible') && $s.find('ul.posts li').length === 0) {
|
321 |
+
refreshList();
|
322 |
+
}
|
323 |
+
|
324 |
+
});
|
325 |
+
|
326 |
+
// Clicking on one of the url items
|
327 |
+
$$.on('click', '.posts li', function (e) {
|
328 |
+
e.preventDefault();
|
329 |
+
var $li = $(this);
|
330 |
+
$$.find('input.siteorigin-widget-input').val('post: ' + $li.data('value'));
|
331 |
+
$$.find('.existing-content-selector').toggle();
|
332 |
+
});
|
333 |
+
|
334 |
+
var interval = null;
|
335 |
+
$$.find('.content-text-search').keyup(function () {
|
336 |
+
if (interval !== null) {
|
337 |
+
clearTimeout(interval);
|
338 |
+
}
|
339 |
+
|
340 |
+
interval = setTimeout(function () {
|
341 |
+
refreshList();
|
342 |
+
}, 500);
|
343 |
+
});
|
344 |
+
});
|
345 |
+
|
346 |
+
///////////////////////////////////////
|
347 |
+
// Setup the Builder fields
|
348 |
+
if (typeof jQuery.fn.soPanelsSetupBuilderWidget !== 'undefined') {
|
349 |
+
$fields.filter('.siteorigin-widget-field-type-builder').each(function () {
|
350 |
+
var $$ = $(this);
|
351 |
+
$$.find('> .siteorigin-page-builder-field').soPanelsSetupBuilderWidget();
|
352 |
+
});
|
353 |
+
}
|
354 |
+
|
355 |
+
///////////////////////////////////////
|
356 |
+
// Now lets handle the state emitters
|
357 |
+
|
358 |
+
var stateEmitterChangeHandler = function () {
|
359 |
+
var $$ = $(this);
|
360 |
+
|
361 |
+
// These emitters can either be an array or a
|
362 |
+
var emitters = $$.closest('[data-state-emitter]').data('state-emitter');
|
363 |
+
|
364 |
+
if (typeof emitters !== 'undefined') {
|
365 |
+
var handleStateEmitter = function (emitter, currentStates) {
|
366 |
+
if (typeof sowEmitters[emitter.callback] === 'undefined' || emitter.callback.substr(0, 1) === '_') {
|
367 |
+
// Skip if the function doesn't exist, or it starts with an underscore (internal functions).
|
368 |
+
return currentStates;
|
369 |
+
}
|
370 |
+
|
371 |
+
// Check if this is inside a repeater
|
372 |
+
var repeaterIndex = sowbForms.getRepeaterId($$);
|
373 |
+
if (repeaterIndex !== false) {
|
374 |
+
emitter.args = emitter.args.map(function (a) {
|
375 |
+
return a.replace('{$repeater}', repeaterIndex);
|
376 |
+
});
|
377 |
+
}
|
378 |
+
|
379 |
+
var val = $$.is('[type="checkbox"]') ? $$.is(':checked') : $$.val();
|
380 |
+
// Return an array that has the new states added to the array
|
381 |
+
return $.extend(currentStates, sowEmitters[emitter.callback](val, emitter.args));
|
382 |
+
};
|
383 |
+
|
384 |
+
// Run the states through the state emitters
|
385 |
+
var states = {'default': ''};
|
386 |
+
|
387 |
+
// Go through the array of emitters
|
388 |
+
if (typeof emitters.length === 'undefined') {
|
389 |
+
emitters = [emitters];
|
390 |
+
}
|
391 |
+
|
392 |
+
for (var i = 0; i < emitters.length; i++) {
|
393 |
+
states = handleStateEmitter(emitters[i], states);
|
394 |
+
}
|
395 |
+
|
396 |
+
// Check which states have changed and trigger appropriate sowstatechange
|
397 |
+
var formStates = $mainForm.data('states');
|
398 |
+
if (typeof formStates === 'undefined') {
|
399 |
+
formStates = {'default': ''};
|
400 |
+
}
|
401 |
+
for (var k in states) {
|
402 |
+
if (typeof formStates[k] === 'undefined' || states[k] !== formStates[k]) {
|
403 |
+
// If the state is different from the original formStates, then trigger a state change
|
404 |
+
formStates[k] = states[k];
|
405 |
+
$mainForm.trigger('sowstatechange', [k, states[k]]);
|
406 |
+
}
|
407 |
+
}
|
408 |
+
|
409 |
+
// Store the form states back in the form
|
410 |
+
$mainForm.data('states', formStates);
|
411 |
+
}
|
412 |
+
};
|
413 |
+
|
414 |
+
$fields.filter('[data-state-emitter]').each(function () {
|
415 |
+
|
416 |
+
// Listen for any change events on an emitter field
|
417 |
+
$(this).find('.siteorigin-widget-input').on('keyup change', stateEmitterChangeHandler);
|
418 |
+
|
419 |
+
// Trigger initial state emitter changes
|
420 |
+
$(this).find('.siteorigin-widget-input').each(function () {
|
421 |
+
var $$ = $(this);
|
422 |
+
if ($$.is(':radio')) {
|
423 |
+
// Only checked radio inputs must have change events
|
424 |
+
if ($$.is(':checked')) {
|
425 |
+
stateEmitterChangeHandler.call($$[0]);
|
426 |
+
}
|
427 |
+
}
|
428 |
+
else {
|
429 |
+
stateEmitterChangeHandler.call($$[0]);
|
430 |
+
}
|
431 |
+
});
|
432 |
+
|
433 |
+
});
|
434 |
+
|
435 |
+
// Give plugins a chance to influence the form
|
436 |
+
$el.trigger('sowsetupform', $fields).data('sow-form-setup', true);
|
437 |
+
|
438 |
+
$fields.trigger('sowsetupformfield');
|
439 |
+
|
440 |
+
$el.find('.siteorigin-widget-field-repeater-item').trigger('updateFieldPositions');
|
441 |
+
|
442 |
+
/////////////////////////////
|
443 |
+
// The end of the form setup.
|
444 |
+
/////////////////////////////
|
445 |
+
|
446 |
+
formInitializing = false;
|
447 |
+
});
|
448 |
+
};
|
449 |
+
|
450 |
+
$.fn.sowSetupPreview = function () {
|
451 |
+
var $el = $(this);
|
452 |
+
var previewButton = $el.siblings('.siteorigin-widget-preview');
|
453 |
+
|
454 |
+
previewButton.find('> a').click(function (e) {
|
455 |
+
e.preventDefault();
|
456 |
+
|
457 |
+
var data = sowbForms.getWidgetFormValues($el);
|
458 |
+
|
459 |
+
// Create a new modal window
|
460 |
+
var modal = $($('#so-widgets-bundle-tpl-preview-dialog').html().trim()).appendTo('body');
|
461 |
+
modal.find('input[name="data"]').val(JSON.stringify(data));
|
462 |
+
modal.find('input[name="class"]').val($el.data('class'));
|
463 |
+
modal.find('iframe').on('load', function () {
|
464 |
+
$(this).css('visibility', 'visible');
|
465 |
+
});
|
466 |
+
modal.find('form').submit();
|
467 |
+
|
468 |
+
modal.find('.close').click(function () {
|
469 |
+
modal.remove();
|
470 |
+
});
|
471 |
+
});
|
472 |
+
};
|
473 |
+
|
474 |
+
$.fn.sowSetupRepeater = function () {
|
475 |
+
|
476 |
+
return $(this).each(function (i, el) {
|
477 |
+
var $el = $(el);
|
478 |
+
var $items = $el.find('.siteorigin-widget-field-repeater-items');
|
479 |
+
var name = $el.data('repeater-name');
|
480 |
+
|
481 |
+
$items.bind('updateFieldPositions', function () {
|
482 |
+
var $$ = $(this);
|
483 |
+
var $rptrItems = $$.find('> .siteorigin-widget-field-repeater-item');
|
484 |
+
|
485 |
+
// Set the position for the repeater items
|
486 |
+
$rptrItems.each(function (i, el) {
|
487 |
+
$(el).find('.siteorigin-widget-input').each(function (j, input) {
|
488 |
+
var pos = $(input).data('repeater-positions');
|
489 |
+
if (typeof pos === 'undefined') {
|
490 |
+
pos = {};
|
491 |
+
}
|
492 |
+
|
493 |
+
pos[name] = i;
|
494 |
+
$(input).data('repeater-positions', pos);
|
495 |
+
});
|
496 |
+
});
|
497 |
+
|
498 |
+
// Update the field names for all the input items
|
499 |
+
$$.find('.siteorigin-widget-input').each(function (i, input) {
|
500 |
+
var pos = $(input).data('repeater-positions');
|
501 |
+
var $in = $(input);
|
502 |
+
|
503 |
+
if (typeof pos !== 'undefined') {
|
504 |
+
var newName = $in.attr('data-original-name');
|
505 |
+
|
506 |
+
if (!newName) {
|
507 |
+
$in.attr('data-original-name', $in.attr('name'));
|
508 |
+
newName = $in.attr('name');
|
509 |
+
}
|
510 |
+
if (!newName) {
|
511 |
+
return;
|
512 |
+
}
|
513 |
+
|
514 |
+
if (pos) {
|
515 |
+
for (var k in pos) {
|
516 |
+
newName = newName.replace('#' + k + '#', pos[k]);
|
517 |
+
}
|
518 |
+
}
|
519 |
+
$in.attr('name', newName);
|
520 |
+
}
|
521 |
+
});
|
522 |
+
|
523 |
+
if (!$$.data('initialSetup')) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
// Setup default checked values, now that we've updated input names.
|
525 |
// Without this radio inputs in repeaters will be rendered as if they all belong to the same group.
|
526 |
+
$$.find('.siteorigin-widget-input').each(function (i, input) {
|
527 |
var $in = $(input);
|
528 |
$in.prop('checked', $in.prop('defaultChecked'));
|
529 |
});
|
530 |
$$.data('initialSetup', true);
|
531 |
}
|
532 |
|
533 |
+
//Setup scrolling.
|
534 |
+
var scrollCount = $el.data('scroll-count') ? parseInt($el.data('scroll-count')) : 0;
|
535 |
+
if (scrollCount > 0 && $rptrItems.length > scrollCount) {
|
536 |
+
var itemHeight = $rptrItems.first().outerHeight();
|
537 |
+
$$.css('max-height', itemHeight * scrollCount).css('overflow', 'auto');
|
538 |
+
}
|
539 |
+
else {
|
540 |
+
//TODO: Check whether there was a value before overriding and set it back to that.
|
541 |
+
$$.css('max-height', '').css('overflow', '');
|
542 |
+
}
|
543 |
+
});
|
544 |
+
|
545 |
+
$items.sortable({
|
546 |
+
handle: '.siteorigin-widget-field-repeater-item-top',
|
547 |
+
items: '> .siteorigin-widget-field-repeater-item',
|
548 |
+
update: function () {
|
549 |
+
$items.trigger('updateFieldPositions');
|
550 |
+
}
|
551 |
+
});
|
552 |
+
$items.trigger('updateFieldPositions');
|
553 |
+
|
554 |
+
$el.find('> .siteorigin-widget-field-repeater-add').disableSelection().click(function (e) {
|
555 |
+
e.preventDefault();
|
556 |
+
$el.closest('.siteorigin-widget-field-repeater')
|
557 |
+
.sowAddRepeaterItem()
|
558 |
+
.find('> .siteorigin-widget-field-repeater-items').slideDown('fast', function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
559 |
$(window).resize();
|
560 |
});
|
561 |
+
});
|
562 |
+
|
563 |
+
$el.find('> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand').click(function (e) {
|
564 |
+
e.preventDefault();
|
565 |
+
$el.closest('.siteorigin-widget-field-repeater').find('> .siteorigin-widget-field-repeateritems-').slideToggle('fast', function () {
|
566 |
+
$(window).resize();
|
567 |
+
});
|
568 |
+
});
|
569 |
+
});
|
570 |
+
};
|
571 |
+
|
572 |
+
$.fn.sowAddRepeaterItem = function () {
|
573 |
+
return $(this).each(function (i, el) {
|
574 |
+
|
575 |
+
var $el = $(el);
|
576 |
+
var $nextIndex = $el.find('> .siteorigin-widget-field-repeater-items').children().length + 1;
|
577 |
+
|
578 |
+
// Create an object with the repeater html so we can make some changes to it.
|
579 |
+
var repeaterObject = $('<div>' + $el.find('> .siteorigin-widget-field-repeater-item-html').html() + '</div>');
|
580 |
+
repeaterObject.find('.siteorigin-widget-input[data-name]').each(function () {
|
581 |
+
var $$ = $(this);
|
582 |
+
// Skip out items that are themselves inside repeater HTML wrappers
|
583 |
+
if ($$.closest('.siteorigin-widget-field-repeater-item-html').length === 0) {
|
584 |
+
$$.attr('name', $(this).data('name'));
|
585 |
+
}
|
586 |
+
});
|
587 |
+
var repeaterHtml = repeaterObject.html().replace(/_id_/g, $nextIndex);
|
588 |
+
|
589 |
+
var readonly = typeof $el.attr('readonly') !== 'undefined';
|
590 |
+
var item = $('<div class="siteorigin-widget-field-repeater-item ui-draggable" />')
|
591 |
+
.append(
|
592 |
+
$('<div class="siteorigin-widget-field-repeater-item-top" />')
|
593 |
+
.append(
|
594 |
+
$('<div class="siteorigin-widget-field-expand" />')
|
595 |
+
)
|
596 |
+
.append(
|
597 |
+
readonly ? '' : $('<div class="siteorigin-widget-field-copy" />')
|
598 |
+
)
|
599 |
+
.append(
|
600 |
+
readonly ? '' : $('<div class="siteorigin-widget-field-remove" />')
|
601 |
+
)
|
602 |
+
.append($('<h4 />').html($el.data('item-name')))
|
603 |
+
)
|
604 |
+
.append(
|
605 |
+
$('<div class="siteorigin-widget-field-repeater-item-form" />')
|
606 |
+
.html(repeaterHtml)
|
607 |
+
);
|
608 |
+
|
609 |
+
// Add the item and refresh
|
610 |
+
$el.find('> .siteorigin-widget-field-repeater-items').append(item).sortable("refresh").trigger('updateFieldPositions');
|
611 |
+
item.sowSetupRepeaterItems();
|
612 |
+
item.hide().slideDown('fast', function () {
|
613 |
+
$(window).resize();
|
614 |
+
});
|
615 |
+
|
616 |
+
});
|
617 |
+
};
|
618 |
+
|
619 |
+
$.fn.sowRemoveRepeaterItem = function () {
|
620 |
+
return $(this).each(function (i, el) {
|
621 |
+
var $itemsContainer = $(this).closest('.siteorigin-widget-field-repeater-items');
|
622 |
+
$(this).remove();
|
623 |
+
$itemsContainer.sortable("refresh").trigger('updateFieldPositions');
|
624 |
+
});
|
625 |
+
};
|
626 |
+
|
627 |
+
$.fn.sowSetupRepeaterItems = function () {
|
628 |
+
return $(this).each(function (i, el) {
|
629 |
+
var $el = $(el);
|
630 |
+
|
631 |
+
if (typeof $el.data('sowrepeater-actions-setup') === 'undefined') {
|
632 |
+
var $parentRepeater = $el.closest('.siteorigin-widget-field-repeater');
|
633 |
+
var itemTop = $el.find('> .siteorigin-widget-field-repeater-item-top');
|
634 |
+
var itemLabel = $parentRepeater.data('item-label');
|
635 |
+
if (itemLabel && itemLabel.selector) {
|
636 |
+
var updateLabel = function () {
|
637 |
+
var functionName = ( itemLabel.hasOwnProperty('valueMethod') && itemLabel.valueMethod ) ? itemLabel.valueMethod : 'val';
|
638 |
+
var txt = $el.find(itemLabel.selector)[functionName]();
|
639 |
+
if (txt) {
|
640 |
+
if (txt.length > 80) {
|
641 |
+
txt = txt.substr(0, 79) + '...';
|
642 |
+
}
|
643 |
+
itemTop.find('h4').text(txt);
|
644 |
+
}
|
645 |
+
};
|
646 |
+
updateLabel();
|
647 |
+
var eventName = ( itemLabel.hasOwnProperty('updateEvent') && itemLabel.updateEvent ) ? itemLabel.updateEvent : 'change';
|
648 |
+
$el.bind(eventName, updateLabel);
|
649 |
+
}
|
650 |
+
|
651 |
+
itemTop.click(function (e) {
|
652 |
+
if (e.target.className === "siteorigin-widget-field-remove" || e.target.className === "siteorigin-widget-field-copy") {
|
653 |
+
return;
|
654 |
+
}
|
655 |
+
e.preventDefault();
|
656 |
+
$(this).closest('.siteorigin-widget-field-repeater-item').find('.siteorigin-widget-field-repeater-item-form').eq(0).slideToggle('fast', function () {
|
657 |
$(window).resize();
|
658 |
+
if ($(this).is(':visible')) {
|
659 |
+
$(this).trigger('slideToggleOpenComplete');
|
660 |
+
}
|
661 |
+
else {
|
662 |
+
$(this).trigger('slideToggleCloseComplete');
|
663 |
+
}
|
664 |
+
});
|
665 |
+
});
|
666 |
+
|
667 |
+
itemTop.find('.siteorigin-widget-field-remove').click(function (e, params) {
|
668 |
+
e.preventDefault();
|
669 |
+
var $s = $( this ).closest( '.siteorigin-widget-field-repeater-items' );
|
670 |
+
var $item = $( this ).closest( '.siteorigin-widget-field-repeater-item' );
|
671 |
+
var removeItem = function () {
|
672 |
+
$item.remove();
|
673 |
+
$s.sortable( "refresh" ).trigger( 'updateFieldPositions' );
|
674 |
+
$( window ).resize();
|
675 |
+
};
|
676 |
+
if ( params && params.silent ) {
|
677 |
+
removeItem();
|
678 |
+
} else if ( confirm( soWidgets.sure ) ) {
|
679 |
+
$item.slideUp('fast', removeItem );
|
680 |
+
}
|
681 |
+
});
|
682 |
+
itemTop.find('.siteorigin-widget-field-copy').click(function (e) {
|
683 |
+
e.preventDefault();
|
684 |
+
var $form = $(this).closest('.siteorigin-widget-form-main');
|
685 |
+
var $item = $(this).closest('.siteorigin-widget-field-repeater-item');
|
686 |
+
var $copyItem = $item.clone();
|
687 |
+
var $items = $item.closest('.siteorigin-widget-field-repeater-items');
|
688 |
+
//var $nextIndex = $item.index()+1;
|
689 |
+
var $nextIndex = $items.children().length;
|
690 |
+
var newIds = {};
|
691 |
+
|
692 |
+
$copyItem.find('*[name]').each(function () {
|
693 |
+
var $inputElement = $(this);
|
694 |
+
var id = $inputElement.attr('id');
|
695 |
+
var nm = $inputElement.attr('name');
|
696 |
+
// TinyMCE field :/
|
697 |
+
if ($inputElement.is('textarea') && $inputElement.parent().is('.wp-editor-container') && typeof tinymce != 'undefined') {
|
698 |
+
$inputElement.parent().empty().append($inputElement);
|
699 |
+
$inputElement.css('display', '');
|
700 |
+
var curEd = tinymce.get(id);
|
701 |
+
if (curEd) {
|
702 |
+
$inputElement.val(curEd.getContent());
|
703 |
+
}
|
704 |
+
}
|
705 |
+
// Color field :/
|
706 |
+
else if ($inputElement.is('.wp-color-picker')) {
|
707 |
+
var $wpPickerContainer = $inputElement.closest('.wp-picker-container');
|
708 |
+
var $soWidgetField = $inputElement.closest('.siteorigin-widget-field');
|
709 |
+
$wpPickerContainer.remove();
|
710 |
+
$soWidgetField.append($inputElement.remove());
|
711 |
+
}
|
712 |
+
else {
|
713 |
+
var $originalInput = $item.find('[name="' + nm + '"]');
|
714 |
+
if ($originalInput.length && $originalInput.val() != null) {
|
715 |
+
$inputElement.val($originalInput.val());
|
716 |
+
}
|
717 |
+
}
|
718 |
+
if (id) {
|
719 |
var idRegExp;
|
720 |
+
var idBase;
|
721 |
+
var newId;
|
722 |
+
|
723 |
// Radio inputs are slightly different because there are multiple `input` elements for
|
724 |
// a single field, i.e. multiple `inputs` for selecting a single value.
|
725 |
+
if ($inputElement.is('[type="radio"]')) {
|
726 |
// Radio inputs have their position appended to the id.
|
727 |
idBase = id.replace(/-\d+-\d+$/, '');
|
728 |
var radioIdBase = id.replace(/-\d+$/, '');
|
730 |
var radioNames = {};
|
731 |
newIds[idBase] = $form
|
732 |
// find all inputs containing idBase in their id attribute
|
733 |
+
.find('.siteorigin-widget-input[id^=' + idBase + ']')
|
734 |
+
// exclude inputs from templates
|
735 |
+
.not('[id*=_id_]')
|
736 |
+
// reduce to one element per radio input group.
|
737 |
+
.filter(function (index, element) {
|
738 |
+
var eltName = $(element).attr('name');
|
739 |
+
if (radioNames[eltName]) {
|
740 |
+
return false;
|
741 |
+
} else {
|
742 |
+
radioNames[eltName] = true;
|
743 |
+
return true;
|
744 |
+
}
|
745 |
+
}).length + 1;
|
746 |
}
|
747 |
var newRadioIdBase = idBase + '-' + newIds[idBase];
|
748 |
newId = newRadioIdBase + id.match(/-\d+$/)[0];
|
755 |
}
|
756 |
newId = idBase + '-' + newIds[idBase]++;
|
757 |
}
|
758 |
+
|
759 |
+
$inputElement.attr('id', newId);
|
760 |
+
$copyItem.find('label[for=' + id + ']').attr('for', newId);
|
761 |
+
$copyItem.find('[id*=' + id + ']').each(function () {
|
762 |
+
var oldIdAttr = $(this).attr('id');
|
763 |
+
var newIdAttr = oldIdAttr.replace(id, newId);
|
764 |
+
$(this).attr('id', newIdAttr);
|
765 |
+
});
|
766 |
+
if (typeof tinymce !== 'undefined' && tinymce.get(newId)) {
|
767 |
+
tinymce.get(newId).remove();
|
768 |
+
}
|
769 |
+
}
|
770 |
+
var nestLevel = $item.parents('.siteorigin-widget-field-repeater').length;
|
771 |
+
var $body = $('body');
|
772 |
+
if (($body.hasClass('wp-customizer') || $body.hasClass('widgets-php')) && $el.closest('.panel-dialog').length === 0) {
|
773 |
+
nestLevel += 1;
|
774 |
+
}
|
775 |
+
var newName = nm.replace(new RegExp('((?:.*?\\[\\d+\\]){' + (nestLevel - 1).toString() + '})?(.*?\\[)\\d+(\\])'), '$1$2' + $nextIndex.toString() + '$3');
|
776 |
+
$inputElement.attr('name', newName);
|
777 |
+
$inputElement.data('original-name', newName);
|
778 |
+
});
|
779 |
+
|
780 |
+
//$item.after($copyItem);
|
781 |
+
//$items.sortable( "refresh").trigger('updateFieldPositions');
|
782 |
+
$items.append($copyItem).sortable("refresh").trigger('updateFieldPositions');
|
783 |
+
$copyItem.sowSetupRepeaterItems();
|
784 |
+
$copyItem.hide().slideDown('fast', function () {
|
785 |
+
$(window).resize();
|
786 |
+
});
|
787 |
+
});
|
788 |
+
|
789 |
+
$el.find('> .siteorigin-widget-field-repeater-item-form').sowSetupForm();
|
790 |
+
|
791 |
+
$el.data('sowrepeater-actions-setup', true);
|
792 |
+
}
|
793 |
+
});
|
794 |
+
};
|
795 |
+
|
796 |
+
// Widgets Bundle utility functions
|
797 |
+
/**
|
798 |
+
* Get the unique index of a repeater item.
|
799 |
+
*
|
800 |
+
* @param $el
|
801 |
+
* @return {*}
|
802 |
+
*/
|
803 |
+
sowbForms.getRepeaterId = function ($el) {
|
804 |
+
if (typeof this.id === 'undefined') {
|
805 |
+
this.id = 1;
|
806 |
+
}
|
807 |
+
|
808 |
+
var $r = $el.closest('.siteorigin-widget-field-repeater-item');
|
809 |
+
if ($r.length) {
|
810 |
+
var itemId = $r.data('item-id');
|
811 |
+
if (itemId === undefined) {
|
812 |
+
itemId = this.id++;
|
813 |
+
}
|
814 |
+
$r.data('item-id', itemId);
|
815 |
+
|
816 |
+
return itemId;
|
817 |
+
}
|
818 |
+
else {
|
819 |
+
return false;
|
820 |
+
}
|
821 |
+
};
|
822 |
+
|
823 |
+
/**
|
824 |
+
* Retrieve a variable for a field with the given identifier, elementName.
|
825 |
+
*
|
826 |
+
* @return {*}
|
827 |
+
* @param widgetClass The class name of the widget for which to retrieve a variable.
|
828 |
+
* @param elementName The name of the field for which to retrieve a variable.
|
829 |
+
* @param key The name of the variable to retrieve.
|
830 |
+
*/
|
831 |
+
sowbForms.getWidgetFieldVariable = function (widgetClass, elementName, key) {
|
832 |
+
var widgetVars = window.sow_field_javascript_variables[widgetClass];
|
833 |
+
// Get rid of any index placeholders
|
834 |
+
elementName = elementName.replace(/\[#.*?#\]/g, '');
|
835 |
+
var variablePath = /[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(elementName)[1];
|
836 |
+
var variablePathParts = variablePath.split('][');
|
837 |
+
var elementVars = variablePathParts.length ? widgetVars : null;
|
838 |
+
while (variablePathParts.length) {
|
839 |
+
elementVars = elementVars[variablePathParts.shift()];
|
840 |
+
}
|
841 |
+
return elementVars[key];
|
842 |
+
};
|
843 |
+
|
844 |
+
sowbForms.fetchWidgetVariable = function (key, widget, callback) {
|
845 |
+
window.sowVars = window.sowVars || {};
|
846 |
+
|
847 |
+
if (typeof window.sowVars[widget] === 'undefined') {
|
848 |
+
$.post(
|
849 |
+
soWidgets.ajaxurl,
|
850 |
+
{'action': 'sow_get_javascript_variables', 'widget': widget, 'key': key},
|
851 |
+
function (result) {
|
852 |
+
window.sowVars[widget] = result;
|
853 |
+
callback(window.sowVars[widget][key]);
|
854 |
+
}
|
855 |
+
);
|
856 |
+
}
|
857 |
+
else {
|
858 |
+
callback(window.sowVars[widget][key]);
|
859 |
+
}
|
860 |
+
};
|
861 |
+
|
862 |
+
sowbForms.getWidgetFormValues = function ( formContainer ) {
|
863 |
+
|
864 |
+
if ( _.isUndefined( formContainer ) ) {
|
865 |
+
return null;
|
866 |
+
}
|
867 |
+
|
868 |
+
var data = {};
|
869 |
+
|
870 |
+
formContainer.find('*[name]').each(function () {
|
871 |
+
var $$ = $(this);
|
872 |
+
|
873 |
+
try {
|
874 |
+
var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec( $$.attr( 'name' ) );
|
875 |
+
|
876 |
+
if ( _.isEmpty( name ) ) {
|
877 |
+
return true;
|
878 |
+
}
|
879 |
+
|
880 |
+
// Create an array with the parts of the name
|
881 |
+
name = name[1];
|
882 |
+
var parts = name.split( '][' );
|
883 |
+
|
884 |
+
// Make sure we either have numbers or strings
|
885 |
+
parts = parts.map( function ( e ) {
|
886 |
+
if ( ! isNaN( parseFloat( e ) ) && isFinite( e ) ) {
|
887 |
+
return parseInt( e );
|
888 |
+
}
|
889 |
+
else {
|
890 |
+
return e;
|
891 |
+
}
|
892 |
+
} );
|
893 |
+
|
894 |
+
var sub = data;
|
895 |
+
var fieldValue = null;
|
896 |
+
|
897 |
+
var fieldType = _.isString( $$.attr( 'type' ) ) ? $$.attr( 'type' ).toLowerCase() : null;
|
898 |
+
|
899 |
+
if ( fieldType === 'checkbox' ) {
|
900 |
+
if ( $$.is( ':checked' ) ) {
|
901 |
+
fieldValue = $$.val() !== '' ? $$.val() : true;
|
902 |
+
} else {
|
903 |
+
fieldValue = false;
|
904 |
+
}
|
905 |
+
} else if ( fieldType === 'radio' ) {
|
906 |
+
if ( $$.is( ':checked' ) ) {
|
907 |
+
fieldValue = $$.val();
|
908 |
+
} else {
|
909 |
+
return;
|
910 |
+
}
|
911 |
+
} else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
|
912 |
+
// This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
|
913 |
+
var editor = null;
|
914 |
+
if ( typeof tinyMCE !== 'undefined' ) {
|
915 |
+
editor = tinyMCE.get( $$.attr( 'id' ) );
|
916 |
+
}
|
917 |
+
|
918 |
+
if ( editor !== null && typeof( editor.getContent ) === "function" && !editor.isHidden() ) {
|
919 |
+
fieldValue = editor.getContent();
|
920 |
+
}
|
921 |
+
else {
|
922 |
+
fieldValue = $$.val();
|
923 |
+
}
|
924 |
+
} else if ( $$.prop( 'tagName' ) === 'SELECT' ) {
|
925 |
+
var selected = $$.find( 'option:selected' );
|
926 |
+
|
927 |
+
if ( selected.length === 1 ) {
|
928 |
+
fieldValue = $$.find( 'option:selected' ).val();
|
929 |
+
}
|
930 |
+
else if ( selected.length > 1 ) {
|
931 |
+
// This is a mutli-select field
|
932 |
+
fieldValue = _.map( $$.find( 'option:selected' ), function ( n, i ) {
|
933 |
+
return $( n ).val();
|
934 |
+
} );
|
935 |
+
}
|
936 |
+
|
937 |
+
} else {
|
938 |
+
fieldValue = $$.val();
|
939 |
+
}
|
940 |
+
|
941 |
+
for ( var i = 0; i < parts.length; i++ ) {
|
942 |
+
if ( i === parts.length - 1 ) {
|
943 |
+
if ( parts[i] === '' ) {
|
944 |
+
// This needs to be an array
|
945 |
+
sub.push( fieldValue );
|
946 |
+
} else {
|
947 |
+
sub[ parts[ i ] ] = fieldValue;
|
948 |
+
}
|
949 |
+
}
|
950 |
+
else {
|
951 |
+
if ( _.isUndefined( sub[ parts[ i ] ] ) ) {
|
952 |
+
// We assume that a numeric key means it's an array. (or empty string??)
|
953 |
+
if ( _.isNumber( parts[ i + 1 ] ) || parts[ i + 1 ] === '' ) {
|
954 |
+
sub[ parts[ i ] ] = [];
|
955 |
+
} else {
|
956 |
+
sub[ parts[ i ] ] = {};
|
957 |
+
}
|
958 |
+
}
|
959 |
+
// Go deeper into the data and continue
|
960 |
+
sub = sub[ parts[ i ] ];
|
961 |
+
}
|
962 |
+
}
|
963 |
+
} catch ( error ) {
|
964 |
+
console.error( 'Field [' + $$.attr( 'name' ) + '] could not be processed and was skipped - ' + error.message );
|
965 |
+
}
|
966 |
+
});
|
967 |
+
return data;
|
968 |
+
};
|
969 |
+
|
970 |
+
sowbForms.setWidgetFormValues = function (formContainer, data) {
|
971 |
+
|
972 |
+
// First check if this form has any repeaters.
|
973 |
+
var depth = 0;
|
974 |
+
var updateRepeaterChildren = function ( formParent, formData ) {
|
975 |
+
if ( ++depth === 10 ) {
|
976 |
+
return;
|
977 |
+
}
|
978 |
+
// Only direct child fields which are repeaters.
|
979 |
+
formParent.find( '> .siteorigin-widget-field-type-repeater' ).each( function () {
|
980 |
+
var $repeater = $( this ).find( '> .siteorigin-widget-field-repeater' );
|
981 |
+
var repeaterName = $repeater.data( 'repeaterName' );
|
982 |
+
var repeaterData = formData.hasOwnProperty( repeaterName ) ? formData[ repeaterName ] : null;
|
983 |
+
if ( ! repeaterData || ! Array.isArray( repeaterData ) || repeaterData.length === 0 ) {
|
984 |
+
return;
|
985 |
+
}
|
986 |
+
// Check that the number of child items matches the number of data items.
|
987 |
+
var repeaterChildren = $repeater.find( '> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item' );
|
988 |
+
var numItems = repeaterData.length;
|
989 |
+
var numChildren = repeaterChildren.length;
|
990 |
+
if ( numItems > numChildren ) {
|
991 |
+
// If data items > child items, create extra child items.
|
992 |
+
for ( var i = 0; i < numItems - numChildren; i++) {
|
993 |
+
$repeater.find( '> .siteorigin-widget-field-repeater-add' ).click();
|
994 |
+
}
|
995 |
+
|
996 |
+
} else if ( numItems < numChildren ) {
|
997 |
+
// If child items > data items, remove extra child items.
|
998 |
+
for ( var j = numItems; j < numChildren; j++) {
|
999 |
+
var $child = $( repeaterChildren.eq( j ) );
|
1000 |
+
$child.find( '> .siteorigin-widget-field-repeater-item-top' )
|
1001 |
+
.find( '.siteorigin-widget-field-remove' )
|
1002 |
+
.trigger( 'click', { silent: true } );
|
1003 |
+
}
|
1004 |
+
}
|
1005 |
+
repeaterChildren = $repeater.find( '> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item' );
|
1006 |
+
for ( var k = 0; k < repeaterChildren.length; k++ ) {
|
1007 |
+
repeaterChildren.eq( k ).find( '> .siteorigin-widget-field-repeater-item-form' );
|
1008 |
+
updateRepeaterChildren(
|
1009 |
+
repeaterChildren.eq( k ).find( '> .siteorigin-widget-field-repeater-item-form' ),
|
1010 |
+
repeaterData[ k ]
|
1011 |
+
);
|
1012 |
+
}
|
1013 |
+
} );
|
1014 |
+
};
|
1015 |
+
|
1016 |
+
updateRepeaterChildren(formContainer, data);
|
1017 |
+
|
1018 |
+
formContainer.find('*[name]').each(function () {
|
1019 |
+
var $$ = $(this);
|
1020 |
+
var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec($$.attr('name'));
|
1021 |
+
|
1022 |
+
if (name === undefined) {
|
1023 |
+
return true;
|
1024 |
+
}
|
1025 |
+
|
1026 |
+
name = name[1];
|
1027 |
+
var parts = name.split('][');
|
1028 |
+
|
1029 |
+
// Make sure we either have numbers or strings
|
1030 |
+
parts = parts.map( function ( e ) {
|
1031 |
+
if ( !isNaN( parseFloat( e ) ) && isFinite( e ) ) {
|
1032 |
+
return parseInt( e );
|
1033 |
+
} else {
|
1034 |
+
return e;
|
1035 |
+
}
|
1036 |
+
} );
|
1037 |
+
|
1038 |
+
var sub = data;
|
1039 |
+
var value;
|
1040 |
+
for (var i = 0; i < parts.length; i++) {
|
1041 |
+
|
1042 |
+
if (i === parts.length - 1) {
|
1043 |
+
value = sub[ parts[ i ] ];
|
1044 |
+
} else {
|
1045 |
+
sub = sub[ parts[ i ] ];
|
1046 |
+
}
|
1047 |
+
}
|
1048 |
+
|
1049 |
+
// This is the end, so we need to set the value on the field here.
|
1050 |
+
if ( $$.attr( 'type' ) === 'checkbox' ) {
|
1051 |
+
$$.prop( 'checked', value );
|
1052 |
+
} else if ( $$.attr( 'type' ) === 'radio' ) {
|
1053 |
+
$$.prop( 'checked', value === $$.val() );
|
1054 |
+
} else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
|
1055 |
+
// This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
|
1056 |
+
var editor = null;
|
1057 |
+
if ( typeof tinyMCE !== 'undefined' ) {
|
1058 |
+
editor = tinyMCE.get( $$.attr( 'id' ) );
|
1059 |
+
}
|
1060 |
+
|
1061 |
+
if ( editor !== null && typeof( editor.getContent ) === "function" && ! editor.isHidden() ) {
|
1062 |
+
editor.setContent( value );
|
1063 |
+
}
|
1064 |
+
else {
|
1065 |
+
$$.val( value );
|
1066 |
+
}
|
1067 |
+
}
|
1068 |
+
else {
|
1069 |
+
$$.val( value );
|
1070 |
+
}
|
1071 |
+
|
1072 |
+
$$.trigger( 'change' );
|
1073 |
+
|
1074 |
+
});
|
1075 |
+
};
|
1076 |
+
|
1077 |
+
// When we click on a widget top
|
1078 |
+
$('.widgets-holder-wrap').on('click', '.widget:has(.siteorigin-widget-form-main) .widget-top', function () {
|
1079 |
+
var $$ = $(this).closest('.widget').find('.siteorigin-widget-form-main');
|
1080 |
+
setTimeout(function () {
|
1081 |
+
$$.sowSetupForm();
|
1082 |
+
}, 200);
|
1083 |
+
});
|
1084 |
+
|
1085 |
+
if ($('body').hasClass('wp-customizer')) {
|
1086 |
+
// Setup new widgets when they're added in the customizer interface
|
1087 |
+
$(document).on('widget-added', function (e, widget) {
|
1088 |
+
widget.find('.siteorigin-widget-form').sowSetupForm();
|
1089 |
+
});
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
// When we open a Page Builder widget dialog
|
1093 |
+
$(document).on('dialogopen', function (e) {
|
1094 |
+
$(e.target).find('.siteorigin-widget-form-main').sowSetupForm();
|
1095 |
+
});
|
1096 |
+
|
1097 |
+
$(function () {
|
1098 |
+
$(document).trigger('sowadminloaded');
|
1099 |
+
});
|
1100 |
|
1101 |
})(jQuery);
|
1102 |
|
1103 |
var sowEmitters = {
|
1104 |
|
1105 |
+
/**
|
1106 |
+
* Find the group/state and an extra match part.
|
1107 |
+
*
|
1108 |
+
* @param arg
|
1109 |
+
* @param matchPart
|
1110 |
+
* @return {*}
|
1111 |
+
*/
|
1112 |
+
'_match': function (arg, matchPart) {
|
1113 |
+
if (typeof matchPart === 'undefined') {
|
1114 |
+
matchPart = '.*';
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
// Create the regular expression to match the group/state and extra match
|
1118 |
+
var exp = new RegExp('^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *(' + matchPart + ') *$');
|
1119 |
+
var m = exp.exec(arg);
|
1120 |
+
|
1121 |
+
if (m === null) {
|
1122 |
+
return false;
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
var state = '';
|
1126 |
+
var group = 'default';
|
1127 |
+
|
1128 |
+
if (m[3] !== undefined) {
|
1129 |
+
group = m[1];
|
1130 |
+
state = m[3];
|
1131 |
+
}
|
1132 |
+
else {
|
1133 |
+
state = m[1];
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
return {
|
1137 |
+
'match': m[4].trim(),
|
1138 |
+
'group': group,
|
1139 |
+
'state': state
|
1140 |
+
};
|
1141 |
+
},
|
1142 |
+
|
1143 |
+
'_checker': function (val, args, matchPart, callback) {
|
1144 |
+
var returnStates = {};
|
1145 |
+
if (typeof args.length === 'undefined') {
|
1146 |
+
args = [args];
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
var m;
|
1150 |
+
for (var i = 0; i < args.length; i++) {
|
1151 |
+
m = sowEmitters._match(args[i], matchPart);
|
1152 |
+
if (m === false) {
|
1153 |
+
continue;
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
if (m.match === '_true' || callback(val, args, m.match)) {
|
1157 |
+
returnStates[m.group] = m.state;
|
1158 |
+
}
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
return returnStates;
|
1162 |
+
},
|
1163 |
+
|
1164 |
+
/**
|
1165 |
+
* A very simple state emitter that simply sets the given group the value
|
1166 |
+
*
|
1167 |
+
*
|
1168 |
+
* @param val
|
1169 |
+
* @param args
|
1170 |
+
* @returns {{}}
|
1171 |
+
*/
|
1172 |
+
'select': function (val, args) {
|
1173 |
+
if (typeof args.length === 'undefined') {
|
1174 |
+
args = [args];
|
1175 |
+
}
|
1176 |
+
|
1177 |
+
var returnGroups = {};
|
1178 |
+
for (var i = 0; i < args.length; i++) {
|
1179 |
+
if (args[i] === '') {
|
1180 |
+
args[i] = 'default';
|
1181 |
+
}
|
1182 |
+
returnGroups[args[i]] = val;
|
1183 |
+
}
|
1184 |
+
|
1185 |
+
return returnGroups;
|
1186 |
+
},
|
1187 |
+
|
1188 |
+
/**
|
1189 |
+
* The conditional state emitter uses eval to check a given conditional argument.
|
1190 |
+
*
|
1191 |
+
* @param val
|
1192 |
+
* @param args
|
1193 |
+
* @return {{}}
|
1194 |
+
*/
|
1195 |
+
'conditional': function (val, args) {
|
1196 |
+
return sowEmitters._checker(val, args, '[^;{}]*', function (val, args, match) {
|
1197 |
+
return eval(match);
|
1198 |
+
});
|
1199 |
+
},
|
1200 |
+
|
1201 |
+
/**
|
1202 |
+
* The in state emitter checks if the value is in an array of functions
|
1203 |
+
*
|
1204 |
+
* @param val
|
1205 |
+
* @param args
|
1206 |
+
* @return {{}}
|
1207 |
+
*/
|
1208 |
+
'in': function (val, args) {
|
1209 |
+
return sowEmitters._checker(val, args, '[^;{}]*', function (val, args, match) {
|
1210 |
+
return match.split(',').map(function (s) {
|
1211 |
+
return s.trim();
|
1212 |
+
}).indexOf(val) !== -1;
|
1213 |
+
});
|
1214 |
+
}
|
1215 |
};
|
1216 |
+
|
1217 |
+
window.sowbForms = sowbForms;
|
base/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,r,a=e(t),s=!0,o=a.find("input[name]");if(o.length&&o.attr("name").indexOf("__i__")!==-1)return this;if(a.is(".siteorigin-widget-form-main")){if(a.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!a.is(":visible")&&0===a.closest(".panel-dialog").length)return!0;a.on("sowstatechange",function(i,t,n){a.find("[data-state-handler]").each(function(){var i=e(this),r=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(r).length)return!0;var a,o,d,l,f,g,p={},c=window.sowForms.getRepeaterId(i);if(c!==!1){var u={};for(var w in r)u[w.replace("{$repeater}",c)]=r[w];r=u}for(var w in r)if(f=!1,a=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==a){if(o={group:"default",name:"",multi:!1},void 0!==a[2]?(o.group=a[1],o.name=a[3]):o.name=a[0],o.multi=void 0!==a[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof p[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var m=0;m<g.length&&!(f=o.group===t&&g[m]===n);m++);}if(f){d=r[w],o.multi||(d=[d]);for(var m=0;m<d.length;m++)l="undefined"!=typeof d[m][1]&&Boolean(d[m][1])?i.find(d[m][1]):i,l[d[m][0]].apply(l,"undefined"!=typeof d[m][2]?d[m][2]:[]);p[o.group]=!0}}})}),a.sowSetupPreview(),n=a;var d=a.find(".siteorigin-widget-teaser");d.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),console.log(i.data("dismiss-url")),d.slideUp("normal",function(){d.remove()})})}else n=a.closest(".siteorigin-widget-form-main");r=n.find("> .siteorigin-widgets-form-id").val();var l=a.find("> .siteorigin-widget-field");l.find("> .siteorigin-widget-section").sowSetupForm(),l.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),l.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),l.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),a.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),l.find("> .siteorigin-widget-input-color").each(function(){var i=e(this),t={change:function(i,t){setTimeout(function(){e(i.target).trigger("change")},100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}),l.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})}),l.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,n){t.val(parseInt(n.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(n.value)}})}),l.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search"),r=n.val(),a=n.data("postTypes"),s=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:a},function(i){for(var t=0;t<i.length;t++)""===i[t].post_title&&(i[t].post_title=" "),s.append(e("<li>").addClass("post").html(i[t].post_title+"<span>("+i[t].post_type+")</span>").data(i[t]));s.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var r=i.find(".existing-content-selector");r.toggle(),r.is(":visible")&&0===r.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("ID")),i.find(".existing-content-selector").toggle()});var r=null;i.find(".content-text-search").keyup(function(){null!==r&&clearTimeout(r),r=setTimeout(function(){n()},500)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&l.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});var f=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var r=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var r=window.sowForms.getRepeaterId(i);r!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",r)}));var a=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(n,sowEmitters[t.callback](a,t.args))},a={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=r(t[s],a);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in a)"undefined"!=typeof o[d]&&a[d]===o[d]||(o[d]=a[d],n.trigger("sowstatechange",[d,a[d]]));n.data("states",o)}};l.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",f),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&f.call(i[0]):f.call(i[0])})}),a.trigger("sowsetupform",l).data("sow-form-setup",!0),l.trigger("sowsetupformfield"),a.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n={};i.find("*[name]").each(function(){var i=e(this),t=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===t)return!0;t=t[1];var r=t.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var a=n,s=0;s<r.length;s++)if(s===r.length-1)if("checkbox"===i.attr("type"))i.is(":checked")?a[r[s]]=""===i.val()||i.val():a[r[s]]=!1;else if("radio"===i.attr("type"))i.is(":checked")&&(a[r[s]]=""===i.val()||i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var o=null;"undefined"!=typeof tinyMCE&&(o=tinyMCE.get(i.attr("id"))),null===o||"function"!=typeof o.getContent||o.isHidden()?a[r[s]]=i.val():a[r[s]]=o.getContent()}else a[r[s]]=i.val();else"undefined"==typeof a[r[s]]&&(a[r[s]]={}),a=a[r[s]]});var r=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");r.find('input[name="data"]').val(JSON.stringify(n)),r.find('input[name="class"]').val(i.data("class")),r.find("iframe").on("load",function(){e(this).css("visibility","visible")}),r.find("form").submit(),r.find(".close").click(function(){r.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),r=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");r.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var r=e(n).data("repeater-positions");"undefined"==typeof r&&(r={}),r[a]=i,e(n).data("repeater-positions",r)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),r=e(t);if("undefined"!=typeof n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}}),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t);n.prop("checked",n.prop("defaultChecked"))}),i.data("initialSetup",!0));var r=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(r>0&&t.length>r){var s=t.first().outerHeight();i.css("max-height",s*r).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),r.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){r.trigger("updateFieldPositions")}}),r.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),r=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find("[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=a.html().replace(/_id_/g,r),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var r=n.closest(".siteorigin-widget-field-repeater"),a=n.find("> .siteorigin-widget-field-repeater-item-top"),s=r.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(window).resize(),e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i){if(i.preventDefault(),confirm(soWidgets.sure)){var t=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).closest(".siteorigin-widget-field-repeater-item").slideUp("fast",function(){e(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()})}}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=r.clone(),s=r.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),p=i.closest(".siteorigin-widget-field");g.remove(),p.append(i.remove())}else{var c=r.find('[name="'+l+'"]');c.length&&null!=c.val()&&i.val(c.val())}if(s){var u,w,m;if(i.is('[type="radio"]')){w=s.replace(/-\d+-\d+$/,"");var h=s.replace(/-\d+$/,"");if(!d[w]){var v={};d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").filter(function(i,t){var n=e(t).attr("name");return!v[n]&&(v[n]=!0,!0)}).length+1}var y=w+"-"+d[w];m=y+s.match(/-\d+$/)[0],a.find("label[for="+h+"]").attr("for",y)}else u=new RegExp("-\\d+$"),w=s.replace(u,""),d[w]||(d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").length+1),m=w+"-"+d[w]++;i.attr("id",m),a.find("label[for="+s+"]").attr("for",m),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,m);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var b=r.parents(".siteorigin-widget-field-repeater").length,_=e("body");(_.hasClass("wp-customizer")||_.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(b+=1);var k=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(b-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",k),i.data("original-name",k)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})};var i={getRepeaterId:function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},getWidgetFieldVariable:function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var r=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=r.split("]["),s=a.length?n:null;a.length;)s=s[a.shift()];return s[t]},fetchWidgetVariable:function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])}};window.sowForms=i,e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var r="",a="default";return void 0!==n[3]?(a=n[1],r=n[3]):r=n[1],{match:n[4].trim(),group:a,state:r}},_checker:function(e,i,t,n){var r={};"undefined"==typeof i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)a=sowEmitters._match(i[s],t),a!==!1&&("_true"===a.match||n(e,i,a.match))&&(r[a.group]=a.state);return r},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return t.split(",").map(function(e){return e.trim()}).indexOf(e)!==-1})}};
|
1 |
+
var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,r,a=e(t),s=!0,o=a.find("input[name]");if(o.length&&o.attr("name").indexOf("__i__")!==-1)return this;if(a.is(".siteorigin-widget-form-main")){if(a.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!a.is(":visible")&&0===a.closest(".panel-dialog").length)return!0;a.on("sowstatechange",function(i,t,n){a.find("[data-state-handler]").each(function(){var i=e(this),r=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(r).length)return!0;var a,o,d,l,f,g,p={},c=sowbForms.getRepeaterId(i);if(c!==!1){var u={};for(var m in r)u[m.replace("{$repeater}",c)]=r[m];r=u}for(var m in r)if(f=!1,a=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==a){if(o={group:"default",name:"",multi:!1},void 0!==a[2]?(o.group=a[1],o.name=a[3]):o.name=a[0],o.multi=void 0!==a[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof p[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var w=0;w<g.length&&!(f=o.group===t&&g[w]===n);w++);}if(f){d=r[m],o.multi||(d=[d]);for(var w=0;w<d.length;w++)l="undefined"!=typeof d[w][1]&&Boolean(d[w][1])?i.find(d[w][1]):i,l[d[w][0]].apply(l,"undefined"!=typeof d[w][2]?d[w][2]:[]);p[o.group]=!0}}})}),a.sowSetupPreview(),n=a;var d=a.find(".siteorigin-widget-teaser");d.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",function(){d.remove()})});var l=a.find("> .siteorigin-widgets-form-id").val(),f=a.find("> .siteorigin-widgets-form-timestamp"),g=parseInt(f.val()||0),p=JSON.parse(sessionStorage.getItem(l));if(p)if(p._sow_form_timestamp>g){var c=e('<div class="siteorigin-widget-form-notification"><span>'+soWidgets.backup.newerVersion+'</span><a class="button button-small so-backup-restore">'+soWidgets.backup.restore+'</a><a class="button button-small so-backup-dismiss">'+soWidgets.backup.dismiss+"</a><div><small>"+soWidgets.backup.replaceWarning+"</small></div></div>");a.prepend(c),c.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(n,p),c.slideUp("fast",function(){c.remove()})}),c.find(".so-backup-dismiss").click(function(){c.slideUp("fast",function(){sessionStorage.removeItem(l),c.remove()})})}else sessionStorage.removeItem(l);a.change(function(){f.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(a);sessionStorage.setItem(l,JSON.stringify(e))})}else n=a.closest(".siteorigin-widget-form-main");r=n.find("> .siteorigin-widgets-form-id").val();var u=a.find("> .siteorigin-widget-field");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),u.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),u.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),a.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),u.find("> .siteorigin-widget-input-color").each(function(){var i=e(this),t={change:function(i,t){setTimeout(function(){e(i.target).trigger("change")},100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)});var m=function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})};u.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(m),u.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(m),u.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,i){t.val(parseInt(i.value)),t.trigger("change")},change:function(e,t){i.find(".siteorigin-widget-slider-value").html(t.value)}}),t.change(function(e,i){i&&i.silent||n.slider("value",parseInt(t.val()))})}),u.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search"),r=n.val(),a=n.data("postTypes"),s=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:a},function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label=" "),s.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));s.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var r=i.find(".existing-content-selector");r.toggle(),r.is(":visible")&&0===r.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("value")),i.find(".existing-content-selector").toggle()});var r=null;i.find(".content-text-search").keyup(function(){null!==r&&clearTimeout(r),r=setTimeout(function(){n()},500)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&u.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});var w=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var r=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var r=sowbForms.getRepeaterId(i);r!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",r)}));var a=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(n,sowEmitters[t.callback](a,t.args))},a={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=r(t[s],a);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in a)"undefined"!=typeof o[d]&&a[d]===o[d]||(o[d]=a[d],n.trigger("sowstatechange",[d,a[d]]));n.data("states",o)}};u.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",w),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&w.call(i[0]):w.call(i[0])})}),a.trigger("sowsetupform",u).data("sow-form-setup",!0),u.trigger("sowsetupformfield"),a.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n=sowbForms.getWidgetFormValues(i),r=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");r.find('input[name="data"]').val(JSON.stringify(n)),r.find('input[name="class"]').val(i.data("class")),r.find("iframe").on("load",function(){e(this).css("visibility","visible")}),r.find("form").submit(),r.find(".close").click(function(){r.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),r=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");r.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var r=e(n).data("repeater-positions");"undefined"==typeof r&&(r={}),r[a]=i,e(n).data("repeater-positions",r)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),r=e(t);if("undefined"!=typeof n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}}),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t);n.prop("checked",n.prop("defaultChecked"))}),i.data("initialSetup",!0));var r=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(r>0&&t.length>r){var s=t.first().outerHeight();i.css("max-height",s*r).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),r.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){r.trigger("updateFieldPositions")}}),r.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),r=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=a.html().replace(/_id_/g,r),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var r=n.closest(".siteorigin-widget-field-repeater"),a=n.find("> .siteorigin-widget-field-repeater-item-top"),s=r.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(window).resize(),e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i,t){i.preventDefault();var n=e(this).closest(".siteorigin-widget-field-repeater-items"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=function(){r.remove(),n.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()};t&&t.silent?a():confirm(soWidgets.sure)&&r.slideUp("fast",a)}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=r.clone(),s=r.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),p=i.closest(".siteorigin-widget-field");g.remove(),p.append(i.remove())}else{var c=r.find('[name="'+l+'"]');c.length&&null!=c.val()&&i.val(c.val())}if(s){var u,m,w;if(i.is('[type="radio"]')){m=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[m]){var h={};d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").filter(function(i,t){var n=e(t).attr("name");return!h[n]&&(h[n]=!0,!0)}).length+1}var b=m+"-"+d[m];w=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else u=new RegExp("-\\d+$"),m=s.replace(u,""),d[m]||(d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").length+1),w=m+"-"+d[m]++;i.attr("id",w),a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var y=r.parents(".siteorigin-widget-field-repeater").length,k=e("body");(k.hasClass("wp-customizer")||k.hasClass("widgets-php"))&&0===n.closest(".panel-dialog").length&&(y+=1);var F=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(y-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",F),i.data("original-name",F)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})},sowbForms.getRepeaterId=function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var r=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=r.split("]["),s=a.length?n:null;a.length;)s=s[a.shift()];return s[t]},sowbForms.fetchWidgetVariable=function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each(function(){var i=e(this);try{var n=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(n))return!0;n=n[1];var r=n.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),function(i,t){return e(i).val()}))}else s=i.val();for(var f=0;f<r.length;f++)f===r.length-1?""===r[f]?a.push(s):a[r[f]]=s:(_.isUndefined(a[r[f]])&&(_.isNumber(r[f+1])||""===r[f+1]?a[r[f]]=[]:a[r[f]]={}),a=a[r[f]])}catch(g){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+g.message)}}),t},sowbForms.setWidgetFormValues=function(i,t){var n=0,r=function(i,t){10!==++n&&i.find("> .siteorigin-widget-field-type-repeater").each(function(){var i=e(this).find("> .siteorigin-widget-field-repeater"),n=i.data("repeaterName"),a=t.hasOwnProperty(n)?t[n]:null;if(a&&Array.isArray(a)&&0!==a.length){var s=i.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),o=a.length,d=s.length;if(o>d)for(var l=0;l<o-d;l++)i.find("> .siteorigin-widget-field-repeater-add").click();else if(o<d)for(var f=o;f<d;f++){var g=e(s.eq(f));g.find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}s=i.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var p=0;p<s.length;p++)s.eq(p).find("> .siteorigin-widget-field-repeater-item-form"),r(s.eq(p).find("> .siteorigin-widget-field-repeater-item-form"),a[p])}})};r(i,t),i.find("*[name]").each(function(){var i=e(this),n=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===n)return!0;n=n[1];var r=n.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var a,s=t,o=0;o<r.length;o++)o===r.length-1?a=s[r[o]]:s=s[r[o]];if("checkbox"===i.attr("type"))i.prop("checked",a);else if("radio"===i.attr("type"))i.prop("checked",a===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),null===d||"function"!=typeof d.getContent||d.isHidden()?i.val(a):d.setContent(a)}else i.val(a);i.trigger("change")})},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var r="",a="default";return void 0!==n[3]?(a=n[1],r=n[3]):r=n[1],{match:n[4].trim(),group:a,state:r}},_checker:function(e,i,t,n){var r={};"undefined"==typeof i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)a=sowEmitters._match(i[s],t),a!==!1&&("_true"===a.match||n(e,i,a.match))&&(r[a.group]=a.state);return r},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return t.split(",").map(function(e){return e.trim()}).indexOf(e)!==-1})}};window.sowbForms=sowbForms;
|
base/js/meta-box-manager.js
CHANGED
@@ -1,63 +1,63 @@
|
|
1 |
/* globals jQuery */
|
2 |
|
3 |
//Catch Update button click and transform widgets post meta data before event is propagated.
|
4 |
-
(function($){
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
})(jQuery);
|
1 |
/* globals jQuery */
|
2 |
|
3 |
//Catch Update button click and transform widgets post meta data before event is propagated.
|
4 |
+
(function ($) {
|
5 |
+
$('#publish').click(
|
6 |
+
function (event) {
|
7 |
+
var data = {};
|
8 |
+
var $el = $('#siteorigin-widgets-meta-box');
|
9 |
+
// This uses the exact same code to extract the model from the view as in the admin.js so could do with some refactoring.
|
10 |
+
$el.find('*[name]').each(function () {
|
11 |
+
var $$ = $(this);
|
12 |
+
var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec($$.attr('name'));
|
13 |
|
14 |
+
if (!name) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
|
18 |
+
name = name[1];
|
19 |
+
var parts = name.split('][');
|
20 |
|
21 |
+
// Make sure we either have numbers or strings
|
22 |
+
parts = parts.map(function (e) {
|
23 |
+
if (!isNaN(parseFloat(e)) && isFinite(e)) {
|
24 |
+
return parseInt(e);
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
return e;
|
28 |
+
}
|
29 |
+
});
|
30 |
|
31 |
+
var sub = data;
|
32 |
+
for (var i = 0; i < parts.length; i++) {
|
33 |
+
if (i === parts.length - 1) {
|
34 |
+
// This is the end, so we need to store the actual field value here
|
35 |
+
if ($$.attr('type') === 'checkbox') {
|
36 |
+
if ($$.is(':checked')) {
|
37 |
+
sub[parts[i]] = $$.val() !== '' ? $$.val() : true;
|
38 |
+
} else {
|
39 |
+
sub[parts[i]] = false;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
else if ($$.attr('type') === 'radio') {
|
43 |
+
if ($$.is(':checked')) {
|
44 |
+
sub[parts[i]] = $$.val() !== '' ? $$.val() : true;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
else {
|
48 |
+
sub[parts[i]] = $$.val();
|
49 |
+
}
|
50 |
+
}
|
51 |
+
else {
|
52 |
+
if (typeof sub[parts[i]] === 'undefined') {
|
53 |
+
sub[parts[i]] = {};
|
54 |
+
}
|
55 |
+
// Go deeper into the data and continue
|
56 |
+
sub = sub[parts[i]];
|
57 |
+
}
|
58 |
+
}
|
59 |
+
});
|
60 |
+
$el.find('input[name="widget_post_meta"]').val(JSON.stringify(data));
|
61 |
+
}
|
62 |
+
);
|
63 |
})(jQuery);
|
base/siteorigin-widget.class.php
CHANGED
@@ -91,6 +91,18 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
91 |
return method_exists( $this, 'initialize_form' ) ? $this->initialize_form() : array();
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
/**
|
95 |
* Check if a child widget implements a specific form type.
|
96 |
*
|
@@ -121,7 +133,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
121 |
function form_options( $parent = false ) {
|
122 |
if( empty( $this->form_options ) ) {
|
123 |
// If the widget doesn't have form_options defined from the constructor, then it might be defining them in the get_widget_form function
|
124 |
-
$this->form_options = $this->
|
125 |
}
|
126 |
|
127 |
$form_options = $this->modify_form( $this->form_options );
|
@@ -143,7 +155,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
143 |
*/
|
144 |
public function widget( $args, $instance ) {
|
145 |
if( empty( $this->form_options ) ) {
|
146 |
-
$form_options = $this->
|
147 |
}
|
148 |
else {
|
149 |
$form_options = $this->modify_form( $this->form_options );
|
@@ -251,7 +263,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
251 |
*/
|
252 |
function generate_and_enqueue_instance_styles( $instance ) {
|
253 |
if( empty( $form_options ) ) {
|
254 |
-
$form_options = $this->
|
255 |
}
|
256 |
else {
|
257 |
$form_options = $this->modify_form( $this->form_options );
|
@@ -384,6 +396,9 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
384 |
if ( empty( $instance[$id] ) ) {
|
385 |
if( ! empty( $field['default'] ) ) {
|
386 |
$instance[$id] = $field['default'];
|
|
|
|
|
|
|
387 |
}
|
388 |
}
|
389 |
}
|
@@ -453,6 +468,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
453 |
}
|
454 |
?>
|
455 |
<input type="hidden" name="<?php echo $this->get_field_name('_sow_form_id') ?>" value="<?php echo esc_attr( $instance['_sow_form_id'] ) ?>" class="siteorigin-widgets-form-id" />
|
|
|
456 |
</div>
|
457 |
<div class="siteorigin-widget-form-no-styles">
|
458 |
<?php $this->scripts_loading_message() ?>
|
@@ -549,11 +565,26 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
549 |
|
550 |
wp_enqueue_script( 'wp-color-picker' );
|
551 |
wp_enqueue_media();
|
552 |
-
wp_enqueue_script(
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
|
554 |
wp_localize_script( 'siteorigin-widget-admin', 'soWidgets', array(
|
555 |
'ajaxurl' => wp_nonce_url( admin_url('admin-ajax.php'), 'widgets_action', '_widgets_nonce' ),
|
556 |
-
'sure' => __('Are you sure?', 'so-widgets-bundle')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
) );
|
558 |
|
559 |
global $wp_customize;
|
@@ -565,10 +596,6 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
565 |
}
|
566 |
}
|
567 |
|
568 |
-
if( $this->using_posts_selector() ) {
|
569 |
-
siteorigin_widget_post_selector_enqueue_admin_scripts();
|
570 |
-
}
|
571 |
-
|
572 |
if( !empty( $form_type ) && $this->has_form( $form_type ) ) {
|
573 |
// Enqueue field scripts for the given form type
|
574 |
$form_options = $this->get_form( $form_type );
|
@@ -627,22 +654,6 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
627 |
do_action('siteorigin_widgets_footer_admin_templates');
|
628 |
}
|
629 |
|
630 |
-
/**
|
631 |
-
* Checks if the current widget is using a posts selector in the main form.
|
632 |
-
*
|
633 |
-
* @return bool
|
634 |
-
*/
|
635 |
-
function using_posts_selector(){
|
636 |
-
if( empty( $this->form_options ) ) {
|
637 |
-
$this->form_options = $this->form_options();
|
638 |
-
}
|
639 |
-
|
640 |
-
foreach($this->form_options as $field) {
|
641 |
-
if(!empty($field['type']) && $field['type'] == 'posts') return true;
|
642 |
-
}
|
643 |
-
return false;
|
644 |
-
}
|
645 |
-
|
646 |
/**
|
647 |
* Update the widget instance.
|
648 |
*
|
@@ -747,9 +758,15 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
747 |
|
748 |
$style = $this->get_style_name($instance);
|
749 |
$hash = $this->get_style_hash( $instance );
|
750 |
-
$name = $this->id_base.'-'.$style.'-'.$hash
|
751 |
-
|
752 |
-
$wp_filesystem->delete($upload_dir['basedir'] . '/siteorigin-widgets/'
|
|
|
|
|
|
|
|
|
|
|
|
|
753 |
}
|
754 |
}
|
755 |
|
91 |
return method_exists( $this, 'initialize_form' ) ? $this->initialize_form() : array();
|
92 |
}
|
93 |
|
94 |
+
private function get_cached_widget_form() {
|
95 |
+
$cache_key = $this->id_base . '_form';
|
96 |
+
$form_options = wp_cache_get( $cache_key, 'siteorigin_widgets' );
|
97 |
+
|
98 |
+
if ( empty( $form_options ) ) {
|
99 |
+
$form_options = $this->get_widget_form();
|
100 |
+
wp_cache_set( $cache_key, $form_options, 'siteorigin_widgets' );
|
101 |
+
}
|
102 |
+
|
103 |
+
return $form_options;
|
104 |
+
}
|
105 |
+
|
106 |
/**
|
107 |
* Check if a child widget implements a specific form type.
|
108 |
*
|
133 |
function form_options( $parent = false ) {
|
134 |
if( empty( $this->form_options ) ) {
|
135 |
// If the widget doesn't have form_options defined from the constructor, then it might be defining them in the get_widget_form function
|
136 |
+
$this->form_options = $this->get_cached_widget_form();
|
137 |
}
|
138 |
|
139 |
$form_options = $this->modify_form( $this->form_options );
|
155 |
*/
|
156 |
public function widget( $args, $instance ) {
|
157 |
if( empty( $this->form_options ) ) {
|
158 |
+
$form_options = $this->get_cached_widget_form();
|
159 |
}
|
160 |
else {
|
161 |
$form_options = $this->modify_form( $this->form_options );
|
263 |
*/
|
264 |
function generate_and_enqueue_instance_styles( $instance ) {
|
265 |
if( empty( $form_options ) ) {
|
266 |
+
$form_options = $this->get_cached_widget_form();
|
267 |
}
|
268 |
else {
|
269 |
$form_options = $this->modify_form( $this->form_options );
|
396 |
if ( empty( $instance[$id] ) ) {
|
397 |
if( ! empty( $field['default'] ) ) {
|
398 |
$instance[$id] = $field['default'];
|
399 |
+
} else {
|
400 |
+
// If no default order is specified, just use the order of the options.
|
401 |
+
$instance[$id] = array_keys( $field['options'] );
|
402 |
}
|
403 |
}
|
404 |
}
|
468 |
}
|
469 |
?>
|
470 |
<input type="hidden" name="<?php echo $this->get_field_name('_sow_form_id') ?>" value="<?php echo esc_attr( $instance['_sow_form_id'] ) ?>" class="siteorigin-widgets-form-id" />
|
471 |
+
<input type="hidden" name="<?php echo $this->get_field_name('_sow_form_timestamp') ?>" value="<?php echo ! empty( $instance['_sow_form_timestamp'] ) ? esc_attr( $instance['_sow_form_timestamp'] ) : '' ?>" class="siteorigin-widgets-form-timestamp" />
|
472 |
</div>
|
473 |
<div class="siteorigin-widget-form-no-styles">
|
474 |
<?php $this->scripts_loading_message() ?>
|
565 |
|
566 |
wp_enqueue_script( 'wp-color-picker' );
|
567 |
wp_enqueue_media();
|
568 |
+
wp_enqueue_script(
|
569 |
+
'siteorigin-widget-admin',
|
570 |
+
plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'base/js/admin' . SOW_BUNDLE_JS_SUFFIX . '.js',
|
571 |
+
array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-slider', 'underscore' ),
|
572 |
+
SOW_BUNDLE_VERSION,
|
573 |
+
true
|
574 |
+
);
|
575 |
|
576 |
wp_localize_script( 'siteorigin-widget-admin', 'soWidgets', array(
|
577 |
'ajaxurl' => wp_nonce_url( admin_url('admin-ajax.php'), 'widgets_action', '_widgets_nonce' ),
|
578 |
+
'sure' => __('Are you sure?', 'so-widgets-bundle'),
|
579 |
+
'backup' => array(
|
580 |
+
'newerVersion' => __( "There is a newer version of this widget's content available.", 'so-widgets-bundle' ),
|
581 |
+
'restore' => __( 'Restore', 'so-widgets-bundle' ),
|
582 |
+
'dismiss' => __( 'Dismiss', 'so-widgets-bundle' ),
|
583 |
+
'replaceWarning' => sprintf(
|
584 |
+
__( 'Clicking %s will replace the current widget contents. You can revert by refreshing the page before updating.', 'so-widgets-bundle' ),
|
585 |
+
'<em>' . __( 'Restore', 'so-widgets-bundle' ) . '</em>'
|
586 |
+
),
|
587 |
+
),
|
588 |
) );
|
589 |
|
590 |
global $wp_customize;
|
596 |
}
|
597 |
}
|
598 |
|
|
|
|
|
|
|
|
|
599 |
if( !empty( $form_type ) && $this->has_form( $form_type ) ) {
|
600 |
// Enqueue field scripts for the given form type
|
601 |
$form_options = $this->get_form( $form_type );
|
654 |
do_action('siteorigin_widgets_footer_admin_templates');
|
655 |
}
|
656 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
657 |
/**
|
658 |
* Update the widget instance.
|
659 |
*
|
758 |
|
759 |
$style = $this->get_style_name($instance);
|
760 |
$hash = $this->get_style_hash( $instance );
|
761 |
+
$name = $this->id_base.'-'.$style.'-'.$hash;
|
762 |
+
|
763 |
+
$wp_filesystem->delete($upload_dir['basedir'] . '/siteorigin-widgets/' . $name . '.css');
|
764 |
+
if ( in_array( $name, $this->generated_css ) ) {
|
765 |
+
$index = array_search( $name, $this->generated_css );
|
766 |
+
unset( $this->generated_css[$index] );
|
767 |
+
//Reindex array
|
768 |
+
$this->generated_css = array_values( $this->generated_css );
|
769 |
+
}
|
770 |
}
|
771 |
}
|
772 |
|
compat/builders.php
CHANGED
@@ -8,4 +8,8 @@ return array(
|
|
8 |
'name' => __( 'Elementor', 'so-widgets-bundle' ),
|
9 |
'file_path' => plugin_dir_path( __FILE__ ) . 'elementor/elementor.php',
|
10 |
),
|
|
|
|
|
|
|
|
|
11 |
);
|
8 |
'name' => __( 'Elementor', 'so-widgets-bundle' ),
|
9 |
'file_path' => plugin_dir_path( __FILE__ ) . 'elementor/elementor.php',
|
10 |
),
|
11 |
+
'visual_composer' => array(
|
12 |
+
'name' => __( 'Visual Composer', 'so-widgets-bundle' ),
|
13 |
+
'file_path' => plugin_dir_path( __FILE__ ) . 'visual-composer/visual-composer.php',
|
14 |
+
),
|
15 |
);
|
compat/compat.php
CHANGED
@@ -4,6 +4,7 @@ class SiteOrigin_Widgets_Bundle_Compatibility {
|
|
4 |
|
5 |
const BEAVER_BUILDER = 'Beaver Builder';
|
6 |
const ELEMENTOR = 'Elementor';
|
|
|
7 |
|
8 |
/**
|
9 |
* Get the singleton instance
|
@@ -43,6 +44,9 @@ class SiteOrigin_Widgets_Bundle_Compatibility {
|
|
43 |
case self::ELEMENTOR:
|
44 |
return class_exists( 'Elementor\\Plugin', false );
|
45 |
break;
|
|
|
|
|
|
|
46 |
}
|
47 |
}
|
48 |
|
4 |
|
5 |
const BEAVER_BUILDER = 'Beaver Builder';
|
6 |
const ELEMENTOR = 'Elementor';
|
7 |
+
const VISUAL_COMPOSER = 'Visual Composer';
|
8 |
|
9 |
/**
|
10 |
* Get the singleton instance
|
44 |
case self::ELEMENTOR:
|
45 |
return class_exists( 'Elementor\\Plugin', false );
|
46 |
break;
|
47 |
+
case self::VISUAL_COMPOSER:
|
48 |
+
return class_exists( 'Vc_Manager' );
|
49 |
+
break;
|
50 |
}
|
51 |
}
|
52 |
|
compat/elementor/styles.css
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form {
|
2 |
min-width: inherit;
|
3 |
/* Button styles copied from wp-core for default UI look. */
|
@@ -54,9 +63,15 @@
|
|
54 |
}
|
55 |
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit {
|
56 |
min-width: inherit;
|
57 |
-
width:
|
58 |
margin-left: 1px;
|
59 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field .siteorigin-widget-field-type-slider input[type="number"] {
|
61 |
display: none !important;
|
62 |
}
|
1 |
+
body #elementor-editor-wrapper .elementor-panel {
|
2 |
+
min-width: 400px;
|
3 |
+
}
|
4 |
+
body.elementor-editor-preview #elementor-editor-wrapper #elementor-panel {
|
5 |
+
left: -400px;
|
6 |
+
}
|
7 |
+
body.elementor-editor-active #elementor-editor-wrapper #elementor-preview {
|
8 |
+
left: 400px;
|
9 |
+
}
|
10 |
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form {
|
11 |
min-width: inherit;
|
12 |
/* Button styles copied from wp-core for default UI look. */
|
63 |
}
|
64 |
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit {
|
65 |
min-width: inherit;
|
66 |
+
width: 32%;
|
67 |
margin-left: 1px;
|
68 |
}
|
69 |
+
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-posts select[multiple] {
|
70 |
+
height: inherit;
|
71 |
+
}
|
72 |
+
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-posts .siteorigin-widget-field-type-date-range > div input[type="text"].datepicker {
|
73 |
+
width: 100%;
|
74 |
+
}
|
75 |
.elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field .siteorigin-widget-field-type-slider input[type="number"] {
|
76 |
display: none !important;
|
77 |
}
|
compat/visual-composer/front_enqueue_js.js
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( function ( $ ) {
|
2 |
+
var ajaxData = vc.EditElementPanelView.prototype.ajaxData;
|
3 |
+
vc.EditElementPanelView.prototype.ajaxData = function() {
|
4 |
+
if ( this.model.get( 'shortcode' ) === 'siteorigin_widget_vc' && this.model.get( 'from_content' ) ) {
|
5 |
+
var widgetData = this.model.get( 'params' ).so_widget_data;
|
6 |
+
// Need to add slashes for frontend the first time after data is parsed from content, due to shortcode
|
7 |
+
// processing removing slashes.
|
8 |
+
widgetData = widgetData.replace( /\\/g, '\\\\' );
|
9 |
+
this.model.set( 'params', { so_widget_data: widgetData } );
|
10 |
+
this.model.unset( 'from_content' );
|
11 |
+
}
|
12 |
+
return ajaxData.apply( this );
|
13 |
+
};
|
14 |
+
|
15 |
+
} );
|
compat/visual-composer/front_enqueue_js.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(function(t){var e=vc.EditElementPanelView.prototype.ajaxData;vc.EditElementPanelView.prototype.ajaxData=function(){if("siteorigin_widget_vc"===this.model.get("shortcode")&&this.model.get("from_content")){var t=this.model.get("params").so_widget_data;t=t.replace(/\\/g,"\\\\"),this.model.set("params",{so_widget_data:t}),this.model.unset("from_content")}return e.apply(this)}});
|
compat/visual-composer/siteorigin_widget_vc_template.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( empty( $atts ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
+
$widget_settings = $this->get_widget_settings( $atts );
|
6 |
+
$this->render_widget( $widget_settings['widget_class'], $widget_settings['widget_data'] );
|
compat/visual-composer/sowb-vc-widget.js
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* globals jQuery, sowbForms, confirm, soWidgetsVC */
|
2 |
+
var sowbForms = window.sowbForms || {};
|
3 |
+
|
4 |
+
sowbForms.setupVcWidgetForm = function () {
|
5 |
+
var $ = jQuery;
|
6 |
+
var $widgetDropdown = $( '[name="so_widget_class"]' );
|
7 |
+
var $formContainer = $( '.siteorigin_widget_form_container' );
|
8 |
+
var formDirty = false;
|
9 |
+
$formContainer.on( 'change', '.siteorigin-widget-field', function () {
|
10 |
+
formDirty = true;
|
11 |
+
var widgetData = sowbForms.getWidgetFormValues( $formContainer );
|
12 |
+
var widgetClass = $widgetDropdown.val();
|
13 |
+
|
14 |
+
var jsonString = JSON.stringify( { widget_class: widgetClass, widget_data: widgetData } );
|
15 |
+
jsonString = jsonString.replace( /\\/g, '\\\\' );
|
16 |
+
$( '[name="so_widget_data"]' ).val( jsonString );
|
17 |
+
} );
|
18 |
+
|
19 |
+
var prevWidget;
|
20 |
+
$widgetDropdown.mousedown( function () {
|
21 |
+
prevWidget = $widgetDropdown.find( 'option:selected' );
|
22 |
+
} );
|
23 |
+
|
24 |
+
$widgetDropdown.on( 'change', function ( event ) {
|
25 |
+
if ( formDirty && !confirm( soWidgetsVC.confirmChangeWidget ) ) {
|
26 |
+
prevWidget.attr( 'selected', true );
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
|
30 |
+
formDirty = false;
|
31 |
+
|
32 |
+
var widget = $widgetDropdown.val();
|
33 |
+
|
34 |
+
var data = {
|
35 |
+
'action': 'sowb_vc_widget_render_form',
|
36 |
+
'widget': widget,
|
37 |
+
};
|
38 |
+
|
39 |
+
$.post(
|
40 |
+
soWidgetsVC.ajaxUrl,
|
41 |
+
data,
|
42 |
+
function ( result ) {
|
43 |
+
$formContainer.html( result );
|
44 |
+
// To ensure data is updated.
|
45 |
+
$formContainer.trigger( 'change' );
|
46 |
+
},
|
47 |
+
'html'
|
48 |
+
);
|
49 |
+
} );
|
50 |
+
vc.atts.sowb_json_escaped = {
|
51 |
+
parse: function ( param ) {
|
52 |
+
var $field = this.content().find( '.wpb_vc_param_value[name=' + param.param_name + ']' );
|
53 |
+
// We double encode in the front end to prevent accidental decoding when the content is set on the
|
54 |
+
// WP visual editor.
|
55 |
+
return _.escape( _.escape( $field.val().toString() ).replace( /\[/g, '[' ).replace( /\]/g, ']' ) );
|
56 |
+
},
|
57 |
+
render: function ( param, value ) {
|
58 |
+
return _.unescape( _.unescape( value ) ).replace( /[/g, '[' ).replace( /]/g, ']' );
|
59 |
+
}
|
60 |
+
};
|
61 |
+
vc.events.on( "shortcodeView:updated:siteorigin_widget_vc", function () {
|
62 |
+
|
63 |
+
if ( typeof vc.frame_window !== 'undefined' && typeof vc.frame_window.sowb !== 'undefined' ) {
|
64 |
+
|
65 |
+
// Have to use jQuery from iframe window for triggered events to be detected there.
|
66 |
+
var $ = vc.frame_window.jQuery;
|
67 |
+
var sowb = vc.frame_window.sowb;
|
68 |
+
|
69 |
+
// Trigger Widgets Bundle widgets to setup
|
70 |
+
$( sowb ).trigger( 'setup_widgets' );
|
71 |
+
}
|
72 |
+
} );
|
73 |
+
|
74 |
+
};
|
75 |
+
|
76 |
+
jQuery( function ( $ ) {
|
77 |
+
sowbForms.setupVcWidgetForm();
|
78 |
+
} );
|
79 |
+
|
80 |
+
window.sowbForms = sowbForms;
|
compat/visual-composer/sowb-vc-widget.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var e=jQuery,o=e('[name="so_widget_class"]'),n=e(".siteorigin_widget_form_container"),t=!1;n.on("change",".siteorigin-widget-field",function(){t=!0;var i=sowbForms.getWidgetFormValues(n),r=o.val(),a=JSON.stringify({widget_class:r,widget_data:i});a=a.replace(/\\/g,"\\\\"),e('[name="so_widget_data"]').val(a)});var i;o.mousedown(function(){i=o.find("option:selected")}),o.on("change",function(r){if(t&&!confirm(soWidgetsVC.confirmChangeWidget))return void i.attr("selected",!0);t=!1;var a=o.val(),s={action:"sowb_vc_widget_render_form",widget:a};e.post(soWidgetsVC.ajaxUrl,s,function(e){n.html(e),n.trigger("change")},"html")}),vc.atts.sowb_json_escaped={parse:function(e){var o=this.content().find(".wpb_vc_param_value[name="+e.param_name+"]");return _.escape(_.escape(o.val().toString()).replace(/\[/g,"[").replace(/\]/g,"]"))},render:function(e,o){return _.unescape(_.unescape(o)).replace(/[/g,"[").replace(/]/g,"]")}},vc.events.on("shortcodeView:updated:siteorigin_widget_vc",function(){if("undefined"!=typeof vc.frame_window&&"undefined"!=typeof vc.frame_window.sowb){var e=vc.frame_window.jQuery,o=vc.frame_window.sowb;e(o).trigger("setup_widgets")}})},jQuery(function(e){sowbForms.setupVcWidgetForm()}),window.sowbForms=sowbForms;
|
compat/visual-composer/styles.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.siteorigin-widget-form .siteorigin-widget-field input {
|
2 |
+
margin: 1px;
|
3 |
+
padding: 2px 5px;
|
4 |
+
}
|
5 |
+
.siteorigin-widget-form .siteorigin-widget-field input[type="radio"] {
|
6 |
+
width: inherit;
|
7 |
+
}
|
8 |
+
.siteorigin-widget-form .siteorigin-widget-field select {
|
9 |
+
padding: 2px;
|
10 |
+
height: 28px;
|
11 |
+
width: inherit;
|
12 |
+
margin: 1px;
|
13 |
+
}
|
14 |
+
.vc_element-icon.so-widget-icon {
|
15 |
+
background-size: cover;
|
16 |
+
background-image: url("../../base/css/img/bundle-icon.png");
|
17 |
+
}
|
compat/visual-composer/visual-composer.php
ADDED
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class SiteOrigin_Widgets_Bundle_Visual_Composer {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Get the singleton instance
|
7 |
+
*
|
8 |
+
* @return SiteOrigin_Widgets_Bundle_Visual_Composer
|
9 |
+
*/
|
10 |
+
public static function single() {
|
11 |
+
static $single;
|
12 |
+
|
13 |
+
return empty( $single ) ? $single = new self() : $single;
|
14 |
+
}
|
15 |
+
|
16 |
+
function __construct() {
|
17 |
+
add_action( 'vc_after_init', array( $this, 'init' ) );
|
18 |
+
|
19 |
+
add_action( 'admin_print_scripts-post-new.php', array( $this, 'enqueue_active_widgets_scripts' ) );
|
20 |
+
add_action( 'admin_print_scripts-post.php', array( $this, 'enqueue_active_widgets_scripts' ) );
|
21 |
+
|
22 |
+
add_action( 'wp_ajax_sowb_vc_widget_render_form', array( $this, 'sowb_vc_widget_render_form' ) );
|
23 |
+
|
24 |
+
add_filter( 'siteorigin_widgets_form_show_preview_button', '__return_false' );
|
25 |
+
|
26 |
+
add_filter( 'content_save_pre', array( $this, 'update_widget_data' ) );
|
27 |
+
}
|
28 |
+
|
29 |
+
function init() {
|
30 |
+
|
31 |
+
vc_add_shortcode_param(
|
32 |
+
'sowb_json_escaped',
|
33 |
+
array( $this, 'siteorigin_widget_form' ),
|
34 |
+
plugin_dir_url( __FILE__ ) . 'sowb-vc-widget' . SOW_BUNDLE_JS_SUFFIX . '.js'
|
35 |
+
);
|
36 |
+
|
37 |
+
$settings = array(
|
38 |
+
'name' => __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
|
39 |
+
'base' => 'siteorigin_widget_vc',
|
40 |
+
'category' => __( 'SiteOrigin Widgets', 'so-widgets-bundle' ),
|
41 |
+
'icon' => 'so-widget-icon',
|
42 |
+
'description' => __( 'Allows you to add any active SiteOrigin Widgets Bundle widgets.', 'so-widgets-bundle' ),
|
43 |
+
// element description in add elements view
|
44 |
+
'show_settings_on_create' => true,
|
45 |
+
'weight' => - 5,
|
46 |
+
// Depends on ordering in list, Higher weight first
|
47 |
+
'html_template' => dirname( __FILE__ ) . '/siteorigin_widget_vc_template.php',
|
48 |
+
'admin_enqueue_css' => preg_replace( '/\s/', '%20', plugins_url( 'styles.css', __FILE__ ) ),
|
49 |
+
'front_enqueue_css' => preg_replace( '/\s/', '%20', plugins_url( 'styles.css', __FILE__ ) ),
|
50 |
+
'front_enqueue_js' => preg_replace( '/\s/', '%20', plugins_url( 'front_enqueue_js.js', __FILE__ ) ),
|
51 |
+
'params' => array(
|
52 |
+
array(
|
53 |
+
'type' => 'sowb_json_escaped',
|
54 |
+
'heading' => __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
|
55 |
+
'param_name' => 'so_widget_data',
|
56 |
+
),
|
57 |
+
)
|
58 |
+
);
|
59 |
+
vc_map( $settings );
|
60 |
+
}
|
61 |
+
|
62 |
+
function enqueue_active_widgets_scripts() {
|
63 |
+
|
64 |
+
global $wp_widget_factory;
|
65 |
+
|
66 |
+
foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
|
67 |
+
if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
|
68 |
+
/* @var $widget_obj SiteOrigin_Widget */
|
69 |
+
ob_start();
|
70 |
+
$widget_obj->form( array() );
|
71 |
+
ob_clean();
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
wp_localize_script( 'siteorigin-widget-admin', 'soWidgetsVC', array(
|
76 |
+
'ajaxUrl' => wp_nonce_url( admin_url( 'admin-ajax.php' ), 'sowb_vc_widget_render_form', '_sowbnonce' ),
|
77 |
+
'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
|
78 |
+
) );
|
79 |
+
}
|
80 |
+
|
81 |
+
function siteorigin_widget_form( $settings, $value ) {
|
82 |
+
$so_widget_names = array();
|
83 |
+
|
84 |
+
global $wp_widget_factory;
|
85 |
+
foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
|
86 |
+
if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
|
87 |
+
$so_widget_names[ $class ] = preg_replace( '/^SiteOrigin /', '', $widget_obj->name );
|
88 |
+
}
|
89 |
+
}
|
90 |
+
asort( $so_widget_names );
|
91 |
+
|
92 |
+
/* @var $select SiteOrigin_Widget_Field_Select */
|
93 |
+
$select = new SiteOrigin_Widget_Field_Select(
|
94 |
+
'so_widget_class',
|
95 |
+
'so_widget_class',
|
96 |
+
'so_widget_class',
|
97 |
+
array(
|
98 |
+
'type' => 'select',
|
99 |
+
'options' => $so_widget_names,
|
100 |
+
)
|
101 |
+
);
|
102 |
+
|
103 |
+
global $wp_widget_factory;
|
104 |
+
|
105 |
+
$parsed_value = json_decode( html_entity_decode( stripslashes( $value ) ), true );
|
106 |
+
if ( empty( $parsed_value ) ) {
|
107 |
+
//Get the first value as the default.
|
108 |
+
reset( $so_widget_names );
|
109 |
+
$widget_class = key( $so_widget_names );
|
110 |
+
} else {
|
111 |
+
$widget_class = $parsed_value['widget_class'];
|
112 |
+
}
|
113 |
+
|
114 |
+
$widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
|
115 |
+
|
116 |
+
ob_start();
|
117 |
+
$select->render( $widget_class ); ?>
|
118 |
+
<input type="hidden" name="so_widget_data" class="wpb_vc_param_value" value="<?php echo esc_attr( $value ); ?>">
|
119 |
+
<div class="siteorigin_widget_form_container">
|
120 |
+
<?php
|
121 |
+
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
|
122 |
+
/* @var $widget SiteOrigin_Widget */
|
123 |
+
$widget->form( $parsed_value['widget_data'] );
|
124 |
+
}
|
125 |
+
?>
|
126 |
+
</div>
|
127 |
+
<?php
|
128 |
+
return ob_get_clean();
|
129 |
+
}
|
130 |
+
|
131 |
+
function sowb_vc_widget_render_form() {
|
132 |
+
if ( empty( $_REQUEST['widget'] ) ) {
|
133 |
+
wp_die();
|
134 |
+
}
|
135 |
+
if ( empty( $_REQUEST['_sowbnonce'] ) || ! wp_verify_nonce( $_REQUEST['_sowbnonce'], 'sowb_vc_widget_render_form' ) ) {
|
136 |
+
wp_die();
|
137 |
+
}
|
138 |
+
|
139 |
+
$request = array_map( 'stripslashes_deep', $_REQUEST );
|
140 |
+
$widget_class = $request['widget'];
|
141 |
+
|
142 |
+
global $wp_widget_factory;
|
143 |
+
|
144 |
+
$widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
|
145 |
+
|
146 |
+
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
|
147 |
+
/* @var $widget SiteOrigin_Widget */
|
148 |
+
$widget->form( array() );
|
149 |
+
}
|
150 |
+
|
151 |
+
wp_die();
|
152 |
+
}
|
153 |
+
|
154 |
+
function update_widget_data( $content ) {
|
155 |
+
|
156 |
+
$content = preg_replace_callback(
|
157 |
+
'/\[siteorigin_widget_vc [^\]]*\]/',
|
158 |
+
array( $this, 'update_shortcode' ),
|
159 |
+
$content
|
160 |
+
);
|
161 |
+
|
162 |
+
return $content;
|
163 |
+
}
|
164 |
+
|
165 |
+
function update_shortcode( $shortcode ) {
|
166 |
+
|
167 |
+
preg_match(
|
168 |
+
'/so_widget_data="([^"]*)"/',
|
169 |
+
stripslashes( stripslashes( $shortcode[0] ) ),
|
170 |
+
$widget_json
|
171 |
+
);
|
172 |
+
|
173 |
+
// We double encode in the front end to prevent accidental decoding when the content is set on the
|
174 |
+
// WP visual editor.
|
175 |
+
$widget_json = html_entity_decode( html_entity_decode( $widget_json[1] ) );
|
176 |
+
|
177 |
+
$widget_atts = json_decode( $widget_json, true );
|
178 |
+
|
179 |
+
global $wp_widget_factory;
|
180 |
+
|
181 |
+
$widget = ! empty( $wp_widget_factory->widgets[ $widget_atts['widget_class'] ] ) ? $wp_widget_factory->widgets[ $widget_atts['widget_class'] ] : false;
|
182 |
+
|
183 |
+
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
|
184 |
+
/* @var $widget SiteOrigin_Widget */
|
185 |
+
$widget_atts['widget_data'] = $widget->update( $widget_atts['widget_data'], $widget_atts['widget_data'] );
|
186 |
+
}
|
187 |
+
|
188 |
+
$widget_json = json_encode( $widget_atts );
|
189 |
+
|
190 |
+
$widget_json = htmlentities( htmlentities( $widget_json ) );
|
191 |
+
|
192 |
+
$widget_json = str_replace(
|
193 |
+
array( '[', ']' ),
|
194 |
+
array( '[', ']' ),
|
195 |
+
$widget_json
|
196 |
+
);
|
197 |
+
|
198 |
+
$slashed = addslashes( 'so_widget_data="' . addslashes( $widget_json ) . '"' );
|
199 |
+
|
200 |
+
preg_replace( '/so_widget_data="([^"]*)"/', $slashed, $shortcode );
|
201 |
+
|
202 |
+
return '[siteorigin_widget_vc ' . $slashed . ']';
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
SiteOrigin_Widgets_Bundle_Visual_Composer::single();
|
207 |
+
|
208 |
+
if ( class_exists( 'WPBakeryShortCode' ) ) {
|
209 |
+
class WPBakeryShortCode_SiteOrigin_Widget_VC extends WPBakeryShortCode {
|
210 |
+
public function __construct( $settings ) {
|
211 |
+
parent::__construct( $settings );
|
212 |
+
}
|
213 |
+
|
214 |
+
public function contentInline( $atts, $content ) {
|
215 |
+
if ( empty( $atts ) ) {
|
216 |
+
return '';
|
217 |
+
}
|
218 |
+
$widget_settings = $this->get_widget_settings( $atts );
|
219 |
+
ob_start();
|
220 |
+
$instance = $this->update_widget( $widget_settings['widget_class'], $widget_settings['widget_data'] );
|
221 |
+
$this->render_widget( $widget_settings['widget_class'], $instance );
|
222 |
+
|
223 |
+
return ob_get_clean();
|
224 |
+
}
|
225 |
+
|
226 |
+
public function get_widget_settings( $atts ) {
|
227 |
+
if ( empty( $atts ) || empty( $atts['so_widget_data'] ) ) {
|
228 |
+
return array();
|
229 |
+
}
|
230 |
+
$unesc = $atts['so_widget_data'];
|
231 |
+
return json_decode( $unesc, true );
|
232 |
+
}
|
233 |
+
|
234 |
+
private function get_so_widget( $widget_class ) {
|
235 |
+
global $wp_widget_factory;
|
236 |
+
|
237 |
+
$widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
|
238 |
+
|
239 |
+
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
|
240 |
+
/* @var $widget SiteOrigin_Widget */
|
241 |
+
return $widget;
|
242 |
+
} else {
|
243 |
+
return null;
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
public function render_widget( $widget_class, $widget_instance ) {
|
248 |
+
|
249 |
+
if ( empty( $widget_instance ) ) {
|
250 |
+
return;
|
251 |
+
}
|
252 |
+
|
253 |
+
/* @var $widget SiteOrigin_Widget */
|
254 |
+
$widget = $this->get_so_widget( $widget_class );
|
255 |
+
|
256 |
+
if ( ! empty( $widget ) ) {
|
257 |
+
$widget->widget( array(), $widget_instance );
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
public function update_widget( $widget_class, $widget_instance ) {
|
262 |
+
|
263 |
+
if ( empty( $widget_instance ) ) {
|
264 |
+
return;
|
265 |
+
}
|
266 |
+
|
267 |
+
/* @var $widget SiteOrigin_Widget */
|
268 |
+
$widget = $this->get_so_widget( $widget_class );
|
269 |
+
|
270 |
+
if ( ! empty( $widget ) ) {
|
271 |
+
return $widget->update( $widget_instance, $widget_instance );
|
272 |
+
} else {
|
273 |
+
return $widget_instance;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* @param $atts
|
279 |
+
*
|
280 |
+
* @return array
|
281 |
+
*/
|
282 |
+
protected function prepareAtts( $atts ) {
|
283 |
+
$return = array();
|
284 |
+
if ( is_array( $atts ) ) {
|
285 |
+
foreach ( $atts as $key => $val ) {
|
286 |
+
// We double encode in the front end to prevent accidental decoding when the content is set on the
|
287 |
+
// WP visual editor.
|
288 |
+
$return[ $key ] = html_entity_decode( html_entity_decode( $val ) );
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
return $return;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
} // End Class
|
296 |
+
|
icons/fontawesome/filter.php
CHANGED
@@ -3,6 +3,10 @@
|
|
3 |
function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
4 |
return array_merge($icons, array(
|
5 |
'500px' => '',
|
|
|
|
|
|
|
|
|
6 |
'adjust' => '',
|
7 |
'adn' => '',
|
8 |
'align-center' => '',
|
@@ -11,6 +15,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
11 |
'align-right' => '',
|
12 |
'amazon' => '',
|
13 |
'ambulance' => '',
|
|
|
14 |
'anchor' => '',
|
15 |
'android' => '',
|
16 |
'angellist' => '',
|
@@ -41,17 +46,24 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
41 |
'arrows-alt' => '',
|
42 |
'arrows-h' => '',
|
43 |
'arrows-v' => '',
|
|
|
|
|
44 |
'asterisk' => '',
|
45 |
'at' => '',
|
|
|
46 |
'automobile' => '',
|
47 |
'backward' => '',
|
48 |
'balance-scale' => '',
|
49 |
'ban' => '',
|
|
|
50 |
'bank' => '',
|
51 |
'bar-chart' => '',
|
52 |
'bar-chart-o' => '',
|
53 |
'barcode' => '',
|
54 |
'bars' => '',
|
|
|
|
|
|
|
55 |
'battery-0' => '',
|
56 |
'battery-1' => '',
|
57 |
'battery-2' => '',
|
@@ -77,12 +89,16 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
77 |
'bitbucket-square' => '',
|
78 |
'bitcoin' => '',
|
79 |
'black-tie' => '',
|
|
|
|
|
|
|
80 |
'bold' => '',
|
81 |
'bolt' => '',
|
82 |
'bomb' => '',
|
83 |
'book' => '',
|
84 |
'bookmark' => '',
|
85 |
'bookmark-o' => '',
|
|
|
86 |
'briefcase' => '',
|
87 |
'btc' => '',
|
88 |
'bug' => '',
|
@@ -155,6 +171,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
155 |
'code' => '',
|
156 |
'code-fork' => '',
|
157 |
'codepen' => '',
|
|
|
158 |
'coffee' => '',
|
159 |
'cog' => '',
|
160 |
'cogs' => '',
|
@@ -173,6 +190,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
173 |
'copyright' => '',
|
174 |
'creative-commons' => '',
|
175 |
'credit-card' => '',
|
|
|
176 |
'crop' => '',
|
177 |
'crosshairs' => '',
|
178 |
'css3' => '',
|
@@ -183,6 +201,8 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
183 |
'dashboard' => '',
|
184 |
'dashcube' => '',
|
185 |
'database' => '',
|
|
|
|
|
186 |
'dedent' => '',
|
187 |
'delicious' => '',
|
188 |
'desktop' => '',
|
@@ -193,17 +213,25 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
193 |
'dot-circle-o' => '',
|
194 |
'download' => '',
|
195 |
'dribbble' => '',
|
|
|
|
|
196 |
'dropbox' => '',
|
197 |
'drupal' => '',
|
|
|
198 |
'edit' => '',
|
|
|
199 |
'eject' => '',
|
200 |
'ellipsis-h' => '',
|
201 |
'ellipsis-v' => '',
|
202 |
'empire' => '',
|
203 |
'envelope' => '',
|
204 |
'envelope-o' => '',
|
|
|
|
|
205 |
'envelope-square' => '',
|
|
|
206 |
'eraser' => '',
|
|
|
207 |
'eur' => '',
|
208 |
'euro' => '',
|
209 |
'exchange' => '',
|
@@ -217,6 +245,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
217 |
'eye' => '',
|
218 |
'eye-slash' => '',
|
219 |
'eyedropper' => '',
|
|
|
220 |
'facebook' => '',
|
221 |
'facebook-f' => '',
|
222 |
'facebook-official' => '',
|
@@ -251,6 +280,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
251 |
'fire' => '',
|
252 |
'fire-extinguisher' => '',
|
253 |
'firefox' => '',
|
|
|
254 |
'flag' => '',
|
255 |
'flag-checkered' => '',
|
256 |
'flag-o' => '',
|
@@ -263,10 +293,13 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
263 |
'folder-open' => '',
|
264 |
'folder-open-o' => '',
|
265 |
'font' => '',
|
|
|
266 |
'fonticons' => '',
|
|
|
267 |
'forumbee' => '',
|
268 |
'forward' => '',
|
269 |
'foursquare' => '',
|
|
|
270 |
'frown-o' => '',
|
271 |
'futbol-o' => '',
|
272 |
'gamepad' => '',
|
@@ -285,15 +318,21 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
285 |
'github' => '',
|
286 |
'github-alt' => '',
|
287 |
'github-square' => '',
|
|
|
288 |
'gittip' => '',
|
289 |
'glass' => '',
|
|
|
|
|
290 |
'globe' => '',
|
291 |
'google' => '',
|
292 |
'google-plus' => '',
|
|
|
|
|
293 |
'google-plus-square' => '',
|
294 |
'google-wallet' => '',
|
295 |
'graduation-cap' => '',
|
296 |
'gratipay' => '',
|
|
|
297 |
'group' => '',
|
298 |
'h-square' => '',
|
299 |
'hacker-news' => '',
|
@@ -310,6 +349,9 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
310 |
'hand-scissors-o' => '',
|
311 |
'hand-spock-o' => '',
|
312 |
'hand-stop-o' => '',
|
|
|
|
|
|
|
313 |
'hdd-o' => '',
|
314 |
'header' => '',
|
315 |
'headphones' => '',
|
@@ -331,8 +373,12 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
331 |
'houzz' => '',
|
332 |
'html5' => '',
|
333 |
'i-cursor' => '',
|
|
|
|
|
|
|
334 |
'ils' => '',
|
335 |
'image' => '',
|
|
|
336 |
'inbox' => '',
|
337 |
'indent' => '',
|
338 |
'industry' => '',
|
@@ -370,6 +416,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
370 |
'link' => '',
|
371 |
'linkedin' => '',
|
372 |
'linkedin-square' => '',
|
|
|
373 |
'linux' => '',
|
374 |
'list' => '',
|
375 |
'list-alt' => '',
|
@@ -381,6 +428,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
381 |
'long-arrow-left' => '',
|
382 |
'long-arrow-right' => '',
|
383 |
'long-arrow-up' => '',
|
|
|
384 |
'magic' => '',
|
385 |
'magnet' => '',
|
386 |
'mail-forward' => '',
|
@@ -401,16 +449,20 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
401 |
'meanpath' => '',
|
402 |
'medium' => '',
|
403 |
'medkit' => '',
|
|
|
404 |
'meh-o' => '',
|
405 |
'mercury' => '',
|
|
|
406 |
'microphone' => '',
|
407 |
'microphone-slash' => '',
|
408 |
'minus' => '',
|
409 |
'minus-circle' => '',
|
410 |
'minus-square' => '',
|
411 |
'minus-square-o' => '',
|
|
|
412 |
'mobile' => '',
|
413 |
'mobile-phone' => '',
|
|
|
414 |
'money' => '',
|
415 |
'moon-o' => '',
|
416 |
'mortar-board' => '',
|
@@ -437,11 +489,14 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
437 |
'paragraph' => '',
|
438 |
'paste' => '',
|
439 |
'pause' => '',
|
|
|
|
|
440 |
'paw' => '',
|
441 |
'paypal' => '',
|
442 |
'pencil' => '',
|
443 |
'pencil-square' => '',
|
444 |
'pencil-square-o' => '',
|
|
|
445 |
'phone' => '',
|
446 |
'phone-square' => '',
|
447 |
'photo' => '',
|
@@ -462,20 +517,26 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
462 |
'plus-circle' => '',
|
463 |
'plus-square' => '',
|
464 |
'plus-square-o' => '',
|
|
|
465 |
'power-off' => '',
|
466 |
'print' => '',
|
|
|
467 |
'puzzle-piece' => '',
|
468 |
'qq' => '',
|
469 |
'qrcode' => '',
|
470 |
'question' => '',
|
471 |
'question-circle' => '',
|
|
|
|
|
472 |
'quote-left' => '',
|
473 |
'quote-right' => '',
|
474 |
'ra' => '',
|
475 |
'random' => '',
|
|
|
476 |
'rebel' => '',
|
477 |
'recycle' => '',
|
478 |
'reddit' => '',
|
|
|
479 |
'reddit-square' => '',
|
480 |
'refresh' => '',
|
481 |
'registered' => '',
|
@@ -485,6 +546,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
485 |
'repeat' => '',
|
486 |
'reply' => '',
|
487 |
'reply-all' => '',
|
|
|
488 |
'retweet' => '',
|
489 |
'rmb' => '',
|
490 |
'road' => '',
|
@@ -497,9 +559,11 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
497 |
'rub' => '',
|
498 |
'ruble' => '',
|
499 |
'rupee' => '',
|
|
|
500 |
'safari' => '',
|
501 |
'save' => '',
|
502 |
'scissors' => '',
|
|
|
503 |
'search' => '',
|
504 |
'search-minus' => '',
|
505 |
'search-plus' => '',
|
@@ -517,10 +581,15 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
517 |
'shield' => '',
|
518 |
'ship' => '',
|
519 |
'shirtsinbulk' => '',
|
|
|
|
|
520 |
'shopping-cart' => '',
|
|
|
521 |
'sign-in' => '',
|
|
|
522 |
'sign-out' => '',
|
523 |
'signal' => '',
|
|
|
524 |
'simplybuilt' => '',
|
525 |
'sitemap' => '',
|
526 |
'skyatlas' => '',
|
@@ -532,6 +601,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
532 |
'snapchat' => '',
|
533 |
'snapchat-ghost' => '',
|
534 |
'snapchat-square' => '',
|
|
|
535 |
'soccer-ball-o' => '',
|
536 |
'sort' => '',
|
537 |
'sort-alpha-asc' => '',
|
@@ -567,6 +637,8 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
567 |
'sticky-note' => '',
|
568 |
'sticky-note-o' => '',
|
569 |
'stop' => '',
|
|
|
|
|
570 |
'street-view' => '',
|
571 |
'strikethrough' => '',
|
572 |
'stumbleupon' => '',
|
@@ -575,6 +647,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
575 |
'subway' => '',
|
576 |
'suitcase' => '',
|
577 |
'sun-o' => '',
|
|
|
578 |
'superscript' => '',
|
579 |
'support' => '',
|
580 |
'table' => '',
|
@@ -584,6 +657,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
584 |
'tags' => '',
|
585 |
'tasks' => '',
|
586 |
'taxi' => '',
|
|
|
587 |
'television' => '',
|
588 |
'tencent-weibo' => '',
|
589 |
'terminal' => '',
|
@@ -592,6 +666,18 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
592 |
'th' => '',
|
593 |
'th-large' => '',
|
594 |
'th-list' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
595 |
'thumb-tack' => '',
|
596 |
'thumbs-down' => '',
|
597 |
'thumbs-o-down' => '',
|
@@ -601,6 +687,8 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
601 |
'times' => '',
|
602 |
'times-circle' => '',
|
603 |
'times-circle-o' => '',
|
|
|
|
|
604 |
'tint' => '',
|
605 |
'toggle-down' => '',
|
606 |
'toggle-left' => '',
|
@@ -631,28 +719,38 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
631 |
'umbrella' => '',
|
632 |
'underline' => '',
|
633 |
'undo' => '',
|
|
|
634 |
'university' => '',
|
635 |
'unlink' => '',
|
636 |
'unlock' => '',
|
637 |
'unlock-alt' => '',
|
638 |
'unsorted' => '',
|
639 |
'upload' => '',
|
|
|
640 |
'usd' => '',
|
641 |
'user' => '',
|
|
|
|
|
642 |
'user-md' => '',
|
|
|
643 |
'user-plus' => '',
|
644 |
'user-secret' => '',
|
645 |
'user-times' => '',
|
646 |
'users' => '',
|
|
|
|
|
647 |
'venus' => '',
|
648 |
'venus-double' => '',
|
649 |
'venus-mars' => '',
|
650 |
'viacoin' => '',
|
|
|
|
|
651 |
'video-camera' => '',
|
652 |
'vimeo' => '',
|
653 |
'vimeo-square' => '',
|
654 |
'vine' => '',
|
655 |
'vk' => '',
|
|
|
656 |
'volume-down' => '',
|
657 |
'volume-off' => '',
|
658 |
'volume-up' => '',
|
@@ -662,11 +760,20 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
662 |
'weixin' => '',
|
663 |
'whatsapp' => '',
|
664 |
'wheelchair' => '',
|
|
|
665 |
'wifi' => '',
|
666 |
'wikipedia-w' => '',
|
|
|
|
|
|
|
|
|
|
|
667 |
'windows' => '',
|
668 |
'won' => '',
|
669 |
'wordpress' => '',
|
|
|
|
|
|
|
670 |
'wrench' => '',
|
671 |
'xing' => '',
|
672 |
'xing-square' => '',
|
@@ -677,6 +784,7 @@ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
|
677 |
'yc-square' => '',
|
678 |
'yelp' => '',
|
679 |
'yen' => '',
|
|
|
680 |
'youtube' => '',
|
681 |
'youtube-play' => '',
|
682 |
'youtube-square' => '',
|
3 |
function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
4 |
return array_merge($icons, array(
|
5 |
'500px' => '',
|
6 |
+
'address-book' => '',
|
7 |
+
'address-book-o' => '',
|
8 |
+
'address-card' => '',
|
9 |
+
'address-card-o' => '',
|
10 |
'adjust' => '',
|
11 |
'adn' => '',
|
12 |
'align-center' => '',
|
15 |
'align-right' => '',
|
16 |
'amazon' => '',
|
17 |
'ambulance' => '',
|
18 |
+
'american-sign-language-interpreting' => '',
|
19 |
'anchor' => '',
|
20 |
'android' => '',
|
21 |
'angellist' => '',
|
46 |
'arrows-alt' => '',
|
47 |
'arrows-h' => '',
|
48 |
'arrows-v' => '',
|
49 |
+
'asl-interpreting' => '',
|
50 |
+
'assistive-listening-systems' => '',
|
51 |
'asterisk' => '',
|
52 |
'at' => '',
|
53 |
+
'audio-description' => '',
|
54 |
'automobile' => '',
|
55 |
'backward' => '',
|
56 |
'balance-scale' => '',
|
57 |
'ban' => '',
|
58 |
+
'bandcamp' => '',
|
59 |
'bank' => '',
|
60 |
'bar-chart' => '',
|
61 |
'bar-chart-o' => '',
|
62 |
'barcode' => '',
|
63 |
'bars' => '',
|
64 |
+
'bath' => '',
|
65 |
+
'bathtub' => '',
|
66 |
+
'battery' => '',
|
67 |
'battery-0' => '',
|
68 |
'battery-1' => '',
|
69 |
'battery-2' => '',
|
89 |
'bitbucket-square' => '',
|
90 |
'bitcoin' => '',
|
91 |
'black-tie' => '',
|
92 |
+
'blind' => '',
|
93 |
+
'bluetooth' => '',
|
94 |
+
'bluetooth-b' => '',
|
95 |
'bold' => '',
|
96 |
'bolt' => '',
|
97 |
'bomb' => '',
|
98 |
'book' => '',
|
99 |
'bookmark' => '',
|
100 |
'bookmark-o' => '',
|
101 |
+
'braille' => '',
|
102 |
'briefcase' => '',
|
103 |
'btc' => '',
|
104 |
'bug' => '',
|
171 |
'code' => '',
|
172 |
'code-fork' => '',
|
173 |
'codepen' => '',
|
174 |
+
'codiepie' => '',
|
175 |
'coffee' => '',
|
176 |
'cog' => '',
|
177 |
'cogs' => '',
|
190 |
'copyright' => '',
|
191 |
'creative-commons' => '',
|
192 |
'credit-card' => '',
|
193 |
+
'credit-card-alt' => '',
|
194 |
'crop' => '',
|
195 |
'crosshairs' => '',
|
196 |
'css3' => '',
|
201 |
'dashboard' => '',
|
202 |
'dashcube' => '',
|
203 |
'database' => '',
|
204 |
+
'deaf' => '',
|
205 |
+
'deafness' => '',
|
206 |
'dedent' => '',
|
207 |
'delicious' => '',
|
208 |
'desktop' => '',
|
213 |
'dot-circle-o' => '',
|
214 |
'download' => '',
|
215 |
'dribbble' => '',
|
216 |
+
'drivers-license' => '',
|
217 |
+
'drivers-license-o' => '',
|
218 |
'dropbox' => '',
|
219 |
'drupal' => '',
|
220 |
+
'edge' => '',
|
221 |
'edit' => '',
|
222 |
+
'eercast' => '',
|
223 |
'eject' => '',
|
224 |
'ellipsis-h' => '',
|
225 |
'ellipsis-v' => '',
|
226 |
'empire' => '',
|
227 |
'envelope' => '',
|
228 |
'envelope-o' => '',
|
229 |
+
'envelope-open' => '',
|
230 |
+
'envelope-open-o' => '',
|
231 |
'envelope-square' => '',
|
232 |
+
'envira' => '',
|
233 |
'eraser' => '',
|
234 |
+
'etsy' => '',
|
235 |
'eur' => '',
|
236 |
'euro' => '',
|
237 |
'exchange' => '',
|
245 |
'eye' => '',
|
246 |
'eye-slash' => '',
|
247 |
'eyedropper' => '',
|
248 |
+
'fa' => '',
|
249 |
'facebook' => '',
|
250 |
'facebook-f' => '',
|
251 |
'facebook-official' => '',
|
280 |
'fire' => '',
|
281 |
'fire-extinguisher' => '',
|
282 |
'firefox' => '',
|
283 |
+
'first-order' => '',
|
284 |
'flag' => '',
|
285 |
'flag-checkered' => '',
|
286 |
'flag-o' => '',
|
293 |
'folder-open' => '',
|
294 |
'folder-open-o' => '',
|
295 |
'font' => '',
|
296 |
+
'font-awesome' => '',
|
297 |
'fonticons' => '',
|
298 |
+
'fort-awesome' => '',
|
299 |
'forumbee' => '',
|
300 |
'forward' => '',
|
301 |
'foursquare' => '',
|
302 |
+
'free-code-camp' => '',
|
303 |
'frown-o' => '',
|
304 |
'futbol-o' => '',
|
305 |
'gamepad' => '',
|
318 |
'github' => '',
|
319 |
'github-alt' => '',
|
320 |
'github-square' => '',
|
321 |
+
'gitlab' => '',
|
322 |
'gittip' => '',
|
323 |
'glass' => '',
|
324 |
+
'glide' => '',
|
325 |
+
'glide-g' => '',
|
326 |
'globe' => '',
|
327 |
'google' => '',
|
328 |
'google-plus' => '',
|
329 |
+
'google-plus-circle' => '',
|
330 |
+
'google-plus-official' => '',
|
331 |
'google-plus-square' => '',
|
332 |
'google-wallet' => '',
|
333 |
'graduation-cap' => '',
|
334 |
'gratipay' => '',
|
335 |
+
'grav' => '',
|
336 |
'group' => '',
|
337 |
'h-square' => '',
|
338 |
'hacker-news' => '',
|
349 |
'hand-scissors-o' => '',
|
350 |
'hand-spock-o' => '',
|
351 |
'hand-stop-o' => '',
|
352 |
+
'handshake-o' => '',
|
353 |
+
'hard-of-hearing' => '',
|
354 |
+
'hashtag' => '',
|
355 |
'hdd-o' => '',
|
356 |
'header' => '',
|
357 |
'headphones' => '',
|
373 |
'houzz' => '',
|
374 |
'html5' => '',
|
375 |
'i-cursor' => '',
|
376 |
+
'id-badge' => '',
|
377 |
+
'id-card' => '',
|
378 |
+
'id-card-o' => '',
|
379 |
'ils' => '',
|
380 |
'image' => '',
|
381 |
+
'imdb' => '',
|
382 |
'inbox' => '',
|
383 |
'indent' => '',
|
384 |
'industry' => '',
|
416 |
'link' => '',
|
417 |
'linkedin' => '',
|
418 |
'linkedin-square' => '',
|
419 |
+
'linode' => '',
|
420 |
'linux' => '',
|
421 |
'list' => '',
|
422 |
'list-alt' => '',
|
428 |
'long-arrow-left' => '',
|
429 |
'long-arrow-right' => '',
|
430 |
'long-arrow-up' => '',
|
431 |
+
'low-vision' => '',
|
432 |
'magic' => '',
|
433 |
'magnet' => '',
|
434 |
'mail-forward' => '',
|
449 |
'meanpath' => '',
|
450 |
'medium' => '',
|
451 |
'medkit' => '',
|
452 |
+
'meetup' => '',
|
453 |
'meh-o' => '',
|
454 |
'mercury' => '',
|
455 |
+
'microchip' => '',
|
456 |
'microphone' => '',
|
457 |
'microphone-slash' => '',
|
458 |
'minus' => '',
|
459 |
'minus-circle' => '',
|
460 |
'minus-square' => '',
|
461 |
'minus-square-o' => '',
|
462 |
+
'mixcloud' => '',
|
463 |
'mobile' => '',
|
464 |
'mobile-phone' => '',
|
465 |
+
'modx' => '',
|
466 |
'money' => '',
|
467 |
'moon-o' => '',
|
468 |
'mortar-board' => '',
|
489 |
'paragraph' => '',
|
490 |
'paste' => '',
|
491 |
'pause' => '',
|
492 |
+
'pause-circle' => '',
|
493 |
+
'pause-circle-o' => '',
|
494 |
'paw' => '',
|
495 |
'paypal' => '',
|
496 |
'pencil' => '',
|
497 |
'pencil-square' => '',
|
498 |
'pencil-square-o' => '',
|
499 |
+
'percent' => '',
|
500 |
'phone' => '',
|
501 |
'phone-square' => '',
|
502 |
'photo' => '',
|
517 |
'plus-circle' => '',
|
518 |
'plus-square' => '',
|
519 |
'plus-square-o' => '',
|
520 |
+
'podcast' => '',
|
521 |
'power-off' => '',
|
522 |
'print' => '',
|
523 |
+
'product-hunt' => '',
|
524 |
'puzzle-piece' => '',
|
525 |
'qq' => '',
|
526 |
'qrcode' => '',
|
527 |
'question' => '',
|
528 |
'question-circle' => '',
|
529 |
+
'question-circle-o' => '',
|
530 |
+
'quora' => '',
|
531 |
'quote-left' => '',
|
532 |
'quote-right' => '',
|
533 |
'ra' => '',
|
534 |
'random' => '',
|
535 |
+
'ravelry' => '',
|
536 |
'rebel' => '',
|
537 |
'recycle' => '',
|
538 |
'reddit' => '',
|
539 |
+
'reddit-alien' => '',
|
540 |
'reddit-square' => '',
|
541 |
'refresh' => '',
|
542 |
'registered' => '',
|
546 |
'repeat' => '',
|
547 |
'reply' => '',
|
548 |
'reply-all' => '',
|
549 |
+
'resistance' => '',
|
550 |
'retweet' => '',
|
551 |
'rmb' => '',
|
552 |
'road' => '',
|
559 |
'rub' => '',
|
560 |
'ruble' => '',
|
561 |
'rupee' => '',
|
562 |
+
's15' => '',
|
563 |
'safari' => '',
|
564 |
'save' => '',
|
565 |
'scissors' => '',
|
566 |
+
'scribd' => '',
|
567 |
'search' => '',
|
568 |
'search-minus' => '',
|
569 |
'search-plus' => '',
|
581 |
'shield' => '',
|
582 |
'ship' => '',
|
583 |
'shirtsinbulk' => '',
|
584 |
+
'shopping-bag' => '',
|
585 |
+
'shopping-basket' => '',
|
586 |
'shopping-cart' => '',
|
587 |
+
'shower' => '',
|
588 |
'sign-in' => '',
|
589 |
+
'sign-language' => '',
|
590 |
'sign-out' => '',
|
591 |
'signal' => '',
|
592 |
+
'signing' => '',
|
593 |
'simplybuilt' => '',
|
594 |
'sitemap' => '',
|
595 |
'skyatlas' => '',
|
601 |
'snapchat' => '',
|
602 |
'snapchat-ghost' => '',
|
603 |
'snapchat-square' => '',
|
604 |
+
'snowflake-o' => '',
|
605 |
'soccer-ball-o' => '',
|
606 |
'sort' => '',
|
607 |
'sort-alpha-asc' => '',
|
637 |
'sticky-note' => '',
|
638 |
'sticky-note-o' => '',
|
639 |
'stop' => '',
|
640 |
+
'stop-circle' => '',
|
641 |
+
'stop-circle-o' => '',
|
642 |
'street-view' => '',
|
643 |
'strikethrough' => '',
|
644 |
'stumbleupon' => '',
|
647 |
'subway' => '',
|
648 |
'suitcase' => '',
|
649 |
'sun-o' => '',
|
650 |
+
'superpowers' => '',
|
651 |
'superscript' => '',
|
652 |
'support' => '',
|
653 |
'table' => '',
|
657 |
'tags' => '',
|
658 |
'tasks' => '',
|
659 |
'taxi' => '',
|
660 |
+
'telegram' => '',
|
661 |
'television' => '',
|
662 |
'tencent-weibo' => '',
|
663 |
'terminal' => '',
|
666 |
'th' => '',
|
667 |
'th-large' => '',
|
668 |
'th-list' => '',
|
669 |
+
'themeisle' => '',
|
670 |
+
'thermometer' => '',
|
671 |
+
'thermometer-0' => '',
|
672 |
+
'thermometer-1' => '',
|
673 |
+
'thermometer-2' => '',
|
674 |
+
'thermometer-3' => '',
|
675 |
+
'thermometer-4' => '',
|
676 |
+
'thermometer-empty' => '',
|
677 |
+
'thermometer-full' => '',
|
678 |
+
'thermometer-half' => '',
|
679 |
+
'thermometer-quarter' => '',
|
680 |
+
'thermometer-three-quarters' => '',
|
681 |
'thumb-tack' => '',
|
682 |
'thumbs-down' => '',
|
683 |
'thumbs-o-down' => '',
|
687 |
'times' => '',
|
688 |
'times-circle' => '',
|
689 |
'times-circle-o' => '',
|
690 |
+
'times-rectangle' => '',
|
691 |
+
'times-rectangle-o' => '',
|
692 |
'tint' => '',
|
693 |
'toggle-down' => '',
|
694 |
'toggle-left' => '',
|
719 |
'umbrella' => '',
|
720 |
'underline' => '',
|
721 |
'undo' => '',
|
722 |
+
'universal-access' => '',
|
723 |
'university' => '',
|
724 |
'unlink' => '',
|
725 |
'unlock' => '',
|
726 |
'unlock-alt' => '',
|
727 |
'unsorted' => '',
|
728 |
'upload' => '',
|
729 |
+
'usb' => '',
|
730 |
'usd' => '',
|
731 |
'user' => '',
|
732 |
+
'user-circle' => '',
|
733 |
+
'user-circle-o' => '',
|
734 |
'user-md' => '',
|
735 |
+
'user-o' => '',
|
736 |
'user-plus' => '',
|
737 |
'user-secret' => '',
|
738 |
'user-times' => '',
|
739 |
'users' => '',
|
740 |
+
'vcard' => '',
|
741 |
+
'vcard-o' => '',
|
742 |
'venus' => '',
|
743 |
'venus-double' => '',
|
744 |
'venus-mars' => '',
|
745 |
'viacoin' => '',
|
746 |
+
'viadeo' => '',
|
747 |
+
'viadeo-square' => '',
|
748 |
'video-camera' => '',
|
749 |
'vimeo' => '',
|
750 |
'vimeo-square' => '',
|
751 |
'vine' => '',
|
752 |
'vk' => '',
|
753 |
+
'volume-control-phone' => '',
|
754 |
'volume-down' => '',
|
755 |
'volume-off' => '',
|
756 |
'volume-up' => '',
|
760 |
'weixin' => '',
|
761 |
'whatsapp' => '',
|
762 |
'wheelchair' => '',
|
763 |
+
'wheelchair-alt' => '',
|
764 |
'wifi' => '',
|
765 |
'wikipedia-w' => '',
|
766 |
+
'window-close' => '',
|
767 |
+
'window-close-o' => '',
|
768 |
+
'window-maximize' => '',
|
769 |
+
'window-minimize' => '',
|
770 |
+
'window-restore' => '',
|
771 |
'windows' => '',
|
772 |
'won' => '',
|
773 |
'wordpress' => '',
|
774 |
+
'wpbeginner' => '',
|
775 |
+
'wpexplorer' => '',
|
776 |
+
'wpforms' => '',
|
777 |
'wrench' => '',
|
778 |
'xing' => '',
|
779 |
'xing-square' => '',
|
784 |
'yc-square' => '',
|
785 |
'yelp' => '',
|
786 |
'yen' => '',
|
787 |
+
'yoast' => '',
|
788 |
'youtube' => '',
|
789 |
'youtube-play' => '',
|
790 |
'youtube-square' => '',
|
icons/fontawesome/font/FontAwesome.otf
CHANGED
Binary file
|
icons/fontawesome/font/fontawesome-webfont.eot
CHANGED
Binary file
|
icons/fontawesome/font/fontawesome-webfont.svg
CHANGED
@@ -1,685 +1,2671 @@
|
|
1 |
<?xml version="1.0" standalone="no"?>
|
2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<svg
|
4 |
-
<metadata
|
|
|
|
|
|
|
|
|
5 |
<defs>
|
6 |
-
<font id="fontawesomeregular" horiz-adv-x="1536" >
|
7 |
-
<font-face units-per-em="1792" ascent="1536" descent="-256" />
|
8 |
-
<missing-glyph horiz-adv-x="448" />
|
9 |
-
<glyph unicode=" " horiz-adv-x="448" />
|
10 |
-
<glyph unicode="	" horiz-adv-x="448" />
|
11 |
-
<glyph unicode=" " horiz-adv-x="448" />
|
12 |
-
<glyph unicode="¨" horiz-adv-x="1792" />
|
13 |
-
<glyph unicode="©" horiz-adv-x="1792" />
|
14 |
-
<glyph unicode="®" horiz-adv-x="1792" />
|
15 |
-
<glyph unicode="´" horiz-adv-x="1792" />
|
16 |
-
<glyph unicode="Æ" horiz-adv-x="1792" />
|
17 |
-
<glyph unicode="Ø" horiz-adv-x="1792" />
|
18 |
-
<glyph unicode=" " horiz-adv-x="768" />
|
19 |
-
<glyph unicode=" " horiz-adv-x="1537" />
|
20 |
-
<glyph unicode=" " horiz-adv-x="768" />
|
21 |
-
<glyph unicode=" " horiz-adv-x="1537" />
|
22 |
-
<glyph unicode=" " horiz-adv-x="512" />
|
23 |
-
<glyph unicode=" " horiz-adv-x="384" />
|
24 |
-
<glyph unicode=" " horiz-adv-x="256" />
|
25 |
-
<glyph unicode=" " horiz-adv-x="256" />
|
26 |
-
<glyph unicode=" " horiz-adv-x="192" />
|
27 |
-
<glyph unicode=" " horiz-adv-x="307" />
|
28 |
-
<glyph unicode=" " horiz-adv-x="85" />
|
29 |
-
<glyph unicode=" " horiz-adv-x="307" />
|
30 |
-
<glyph unicode=" " horiz-adv-x="384" />
|
31 |
-
<glyph unicode="™" horiz-adv-x="1792" />
|
32 |
-
<glyph unicode="∞" horiz-adv-x="1792" />
|
33 |
-
<glyph unicode="≠" horiz-adv-x="1792" />
|
34 |
-
<glyph unicode="◼" horiz-adv-x="500" d="M0 0z" />
|
35 |
-
<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" />
|
36 |
-
<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" />
|
37 |
-
<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" />
|
38 |
-
<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" />
|
39 |
-
<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" />
|
40 |
-
<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" />
|
41 |
-
<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" />
|
42 |
-
<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" />
|
43 |
-
<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" />
|
44 |
-
<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" />
|
45 |
-
<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" />
|
46 |
-
<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" />
|
47 |
-
<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" />
|
48 |
-
<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" />
|
49 |
-
<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" />
|
50 |
-
<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 " />
|
51 |
-
<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" />
|
52 |
-
<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" />
|
53 |
-
<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" />
|
54 |
-
<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" />
|
55 |
-
<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" />
|
56 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z " />
|
57 |
-
<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" />
|
58 |
-
<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" />
|
59 |
-
<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" />
|
60 |
-
<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" />
|
61 |
-
<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" />
|
62 |
-
<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" />
|
63 |
-
<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" />
|
64 |
-
<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" />
|
65 |
-
<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" />
|
66 |
-
<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" />
|
67 |
-
<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" />
|
68 |
-
<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" />
|
69 |
-
<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" />
|
70 |
-
<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" />
|
71 |
-
<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" />
|
72 |
-
<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" />
|
73 |
-
<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" />
|
74 |
-
<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" />
|
75 |
-
<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" />
|
76 |
-
<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" />
|
77 |
-
<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" />
|
78 |
-
<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" />
|
79 |
-
<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" />
|
80 |
-
<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" />
|
81 |
-
<glyph unicode="" horiz-adv-x="1664" d="M725 977l-170 -450q33 0 136.5 -2t160.5 -2q19 0 57 2q-87 253 -184 452zM0 -128l2 79q23 7 56 12.5t57 10.5t49.5 14.5t44.5 29t31 50.5l237 616l280 724h75h53q8 -14 11 -21l205 -480q33 -78 106 -257.5t114 -274.5q15 -34 58 -144.5t72 -168.5q20 -45 35 -57 q19 -15 88 -29.5t84 -20.5q6 -38 6 -57q0 -4 -0.5 -13t-0.5 -13q-63 0 -190 8t-191 8q-76 0 -215 -7t-178 -8q0 43 4 78l131 28q1 0 12.5 2.5t15.5 3.5t14.5 4.5t15 6.5t11 8t9 11t2.5 14q0 16 -31 96.5t-72 177.5t-42 100l-450 2q-26 -58 -76.5 -195.5t-50.5 -162.5 q0 -22 14 -37.5t43.5 -24.5t48.5 -13.5t57 -8.5t41 -4q1 -19 1 -58q0 -9 -2 -27q-58 0 -174.5 10t-174.5 10q-8 0 -26.5 -4t-21.5 -4q-80 -14 -188 -14z" />
|
82 |
-
<glyph unicode="" horiz-adv-x="1408" d="M555 15q74 -32 140 -32q376 0 376 335q0 114 -41 180q-27 44 -61.5 74t-67.5 46.5t-80.5 25t-84 10.5t-94.5 2q-73 0 -101 -10q0 -53 -0.5 -159t-0.5 -158q0 -8 -1 -67.5t-0.5 -96.5t4.5 -83.5t12 -66.5zM541 761q42 -7 109 -7q82 0 143 13t110 44.5t74.5 89.5t25.5 142 q0 70 -29 122.5t-79 82t-108 43.5t-124 14q-50 0 -130 -13q0 -50 4 -151t4 -152q0 -27 -0.5 -80t-0.5 -79q0 -46 1 -69zM0 -128l2 94q15 4 85 16t106 27q7 12 12.5 27t8.5 33.5t5.5 32.5t3 37.5t0.5 34v35.5v30q0 982 -22 1025q-4 8 -22 14.5t-44.5 11t-49.5 7t-48.5 4.5 t-30.5 3l-4 83q98 2 340 11.5t373 9.5q23 0 68.5 -0.5t67.5 -0.5q70 0 136.5 -13t128.5 -42t108 -71t74 -104.5t28 -137.5q0 -52 -16.5 -95.5t-39 -72t-64.5 -57.5t-73 -45t-84 -40q154 -35 256.5 -134t102.5 -248q0 -100 -35 -179.5t-93.5 -130.5t-138 -85.5t-163.5 -48.5 t-176 -14q-44 0 -132 3t-132 3q-106 0 -307 -11t-231 -12z" />
|
83 |
-
<glyph unicode="" horiz-adv-x="1024" d="M0 -126l17 85q6 2 81.5 21.5t111.5 37.5q28 35 41 101q1 7 62 289t114 543.5t52 296.5v25q-24 13 -54.5 18.5t-69.5 8t-58 5.5l19 103q33 -2 120 -6.5t149.5 -7t120.5 -2.5q48 0 98.5 2.5t121 7t98.5 6.5q-5 -39 -19 -89q-30 -10 -101.5 -28.5t-108.5 -33.5 q-8 -19 -14 -42.5t-9 -40t-7.5 -45.5t-6.5 -42q-27 -148 -87.5 -419.5t-77.5 -355.5q-2 -9 -13 -58t-20 -90t-16 -83.5t-6 -57.5l1 -18q17 -4 185 -31q-3 -44 -16 -99q-11 0 -32.5 -1.5t-32.5 -1.5q-29 0 -87 10t-86 10q-138 2 -206 2q-51 0 -143 -9t-121 -11z" />
|
84 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1744 128q33 0 42 -18.5t-11 -44.5l-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-1024h80zM81 1407l54 -27q12 -5 211 -5q44 0 132 2 t132 2q36 0 107.5 -0.5t107.5 -0.5h293q6 0 21 -0.5t20.5 0t16 3t17.5 9t15 17.5l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 48t-14.5 73.5t-7.5 35.5q-6 8 -12 12.5t-15.5 6t-13 2.5t-18 0.5t-16.5 -0.5 q-17 0 -66.5 0.5t-74.5 0.5t-64 -2t-71 -6q-9 -81 -8 -136q0 -94 2 -388t2 -455q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q19 42 19 383q0 101 -3 303t-3 303v117q0 2 0.5 15.5t0.5 25t-1 25.5t-3 24t-5 14q-11 12 -162 12q-33 0 -93 -12t-80 -26q-19 -13 -34 -72.5t-31.5 -111t-42.5 -53.5q-42 26 -56 44v383z" />
|
85 |
-
<glyph unicode="" d="M81 1407l54 -27q12 -5 211 -5q44 0 132 2t132 2q70 0 246.5 1t304.5 0.5t247 -4.5q33 -1 56 31l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 47.5t-15 73.5t-7 36q-10 13 -27 19q-5 2 -66 2q-30 0 -93 1t-103 1 t-94 -2t-96 -7q-9 -81 -8 -136l1 -152v52q0 -55 1 -154t1.5 -180t0.5 -153q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q7 16 11.5 74t6 145.5t1.5 155t-0.5 153.5t-0.5 89q0 7 -2.5 21.5t-2.5 22.5q0 7 0.5 44t1 73t0 76.5t-3 67.5t-6.5 32q-11 12 -162 12q-41 0 -163 -13.5t-138 -24.5q-19 -12 -34 -71.5t-31.5 -111.5t-42.5 -54q-42 26 -56 44v383zM1310 125q12 0 42 -19.5t57.5 -41.5 t59.5 -49t36 -30q26 -21 26 -49t-26 -49q-4 -3 -36 -30t-59.5 -49t-57.5 -41.5t-42 -19.5q-13 0 -20.5 10.5t-10 28.5t-2.5 33.5t1.5 33t1.5 19.5h-1024q0 -2 1.5 -19.5t1.5 -33t-2.5 -33.5t-10 -28.5t-20.5 -10.5q-12 0 -42 19.5t-57.5 41.5t-59.5 49t-36 30q-26 21 -26 49 t26 49q4 3 36 30t59.5 49t57.5 41.5t42 19.5q13 0 20.5 -10.5t10 -28.5t2.5 -33.5t-1.5 -33t-1.5 -19.5h1024q0 2 -1.5 19.5t-1.5 33t2.5 33.5t10 28.5t20.5 10.5z" />
|
86 |
-
<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" />
|
87 |
-
<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" />
|
88 |
-
<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" />
|
89 |
-
<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" />
|
90 |
-
<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" />
|
91 |
-
<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" />
|
92 |
-
<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" />
|
93 |
-
<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" />
|
94 |
-
<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" />
|
95 |
-
<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" />
|
96 |
-
<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" />
|
97 |
-
<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" />
|
98 |
-
<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" />
|
99 |
-
<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" />
|
100 |
-
<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" />
|
101 |
-
<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" />
|
102 |
-
<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" />
|
103 |
-
<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" />
|
104 |
-
<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" />
|
105 |
-
<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" />
|
106 |
-
<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" />
|
107 |
-
<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" />
|
108 |
-
<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" />
|
109 |
-
<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" />
|
110 |
-
<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" />
|
111 |
-
<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" />
|
112 |
-
<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" />
|
113 |
-
<glyph unicode="" horiz-adv-x="1280" d="M1171 1235l-531 -531l531 -531q19 -19 19 -45t-19 -45l-166 -166q-19 -19 -45 -19t-45 19l-742 742q-19 19 -19 45t19 45l742 742q19 19 45 19t45 -19l166 -166q19 -19 19 -45t-19 -45z" />
|
114 |
-
<glyph unicode="" horiz-adv-x="1280" d="M1107 659l-742 -742q-19 -19 -45 -19t-45 19l-166 166q-19 19 -19 45t19 45l531 531l-531 531q-19 19 -19 45t19 45l166 166q19 19 45 19t45 -19l742 -742q19 -19 19 -45t-19 -45z" />
|
115 |
-
<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" />
|
116 |
-
<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" />
|
117 |
-
<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" />
|
118 |
-
<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" />
|
119 |
-
<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" />
|
120 |
-
<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" />
|
121 |
-
<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" />
|
122 |
-
<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" />
|
123 |
-
<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" />
|
124 |
-
<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" />
|
125 |
-
<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" />
|
126 |
-
<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" />
|
127 |
-
<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" />
|
128 |
-
<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" />
|
129 |
-
<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" />
|
130 |
-
<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" />
|
131 |
-
<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" />
|
132 |
-
<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" />
|
133 |
-
<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" />
|
134 |
-
<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" />
|
135 |
-
<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" />
|
136 |
-
<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" />
|
137 |
-
<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" />
|
138 |
-
<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" />
|
139 |
-
<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" />
|
140 |
-
<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 " />
|
141 |
-
<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" />
|
142 |
-
<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" />
|
143 |
-
<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" />
|
144 |
-
<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" />
|
145 |
-
<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" />
|
146 |
-
<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" />
|
147 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1683 205l-166 -165q-19 -19 -45 -19t-45 19l-531 531l-531 -531q-19 -19 -45 -19t-45 19l-166 165q-19 19 -19 45.5t19 45.5l742 741q19 19 45 19t45 -19l742 -741q19 -19 19 -45.5t-19 -45.5z" />
|
148 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1683 728l-742 -741q-19 -19 -45 -19t-45 19l-742 741q-19 19 -19 45.5t19 45.5l166 165q19 19 45 19t45 -19l531 -531l531 531q19 19 45 19t45 -19l166 -165q19 -19 19 -45.5t-19 -45.5z" />
|
149 |
-
<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 " />
|
150 |
-
<glyph unicode="" horiz-adv-x="1664" d="M640 0q0 -52 -38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38t38 -90zM1536 0q0 -52 -38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38t38 -90zM1664 1088v-512q0 -24 -16.5 -42.5t-40.5 -21.5l-1044 -122q13 -60 13 -70q0 -16 -24 -64h920q26 0 45 -19t19 -45 t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 11 8 31.5t16 36t21.5 40t15.5 29.5l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t19.5 -15.5t13 -24.5t8 -26t5.5 -29.5t4.5 -26h1201q26 0 45 -19t19 -45z" />
|
151 |
-
<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" />
|
152 |
-
<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" />
|
153 |
-
<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" />
|
154 |
-
<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" />
|
155 |
-
<glyph unicode="" horiz-adv-x="2048" d="M640 640v-512h-256v512h256zM1024 1152v-1024h-256v1024h256zM2048 0v-128h-2048v1536h128v-1408h1920zM1408 896v-768h-256v768h256zM1792 1280v-1152h-256v1152h256z" />
|
156 |
-
<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" />
|
157 |
-
<glyph unicode="" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-188v595h199l30 232h-229v148q0 56 23.5 84t91.5 28l122 1v207q-63 9 -178 9q-136 0 -217.5 -80t-81.5 -226v-171h-200v-232h200v-595h-532q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960z" />
|
158 |
-
<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" />
|
159 |
-
<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" />
|
160 |
-
<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" />
|
161 |
-
<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" />
|
162 |
-
<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" />
|
163 |
-
<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" />
|
164 |
-
<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" />
|
165 |
-
<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" />
|
166 |
-
<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" />
|
167 |
-
<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" />
|
168 |
-
<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" />
|
169 |
-
<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" />
|
170 |
-
<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" />
|
171 |
-
<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" />
|
172 |
-
<glyph unicode="" d="M519 336q4 6 -3 13q-9 7 -14 2q-4 -6 3 -13q9 -7 14 -2zM491 377q-5 7 -12 4q-6 -4 0 -12q7 -8 12 -5q6 4 0 13zM450 417q2 4 -5 8q-7 2 -8 -2q-3 -5 4 -8q8 -2 9 2zM471 394q2 1 1.5 4.5t-3.5 5.5q-6 7 -10 3t1 -11q6 -6 11 -2zM557 319q2 7 -9 11q-9 3 -13 -4 q-2 -7 9 -11q9 -3 13 4zM599 316q0 8 -12 8q-10 0 -10 -8t11 -8t11 8zM638 323q-2 7 -13 5t-9 -9q2 -8 12 -6t10 10zM1280 640q0 212 -150 362t-362 150t-362 -150t-150 -362q0 -167 98 -300.5t252 -185.5q18 -3 26.5 5t8.5 20q0 52 -1 95q-6 -1 -15.5 -2.5t-35.5 -2t-48 4 t-43.5 20t-29.5 41.5q-23 59 -57 74q-2 1 -4.5 3.5l-8 8t-7 9.5t4 7.5t19.5 3.5q6 0 15 -2t30 -15.5t33 -35.5q16 -28 37.5 -42t43.5 -14t38 3.5t30 9.5q7 47 33 69q-49 6 -86 18.5t-73 39t-55.5 76t-19.5 119.5q0 79 53 137q-24 62 5 136q19 6 54.5 -7.5t60.5 -29.5l26 -16 q58 17 128 17t128 -17q11 7 28.5 18t55.5 26t57 9q29 -74 5 -136q53 -58 53 -137q0 -57 -14 -100.5t-35.5 -70t-53.5 -44.5t-62.5 -26t-68.5 -12q35 -31 35 -95q0 -40 -0.5 -89t-0.5 -51q0 -12 8.5 -20t26.5 -5q154 52 252 185.5t98 300.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" />
|
173 |
-
<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" />
|
174 |
-
<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" />
|
175 |
-
<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" />
|
176 |
-
<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" />
|
177 |
-
<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" />
|
178 |
-
<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" />
|
179 |
-
<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" />
|
180 |
-
<glyph unicode="" horiz-adv-x="1024" d="M959 1524v-264h-157q-86 0 -116 -36t-30 -108v-189h293l-39 -296h-254v-759h-306v759h-255v296h255v218q0 186 104 288.5t277 102.5q147 0 228 -12z" />
|
181 |
-
<glyph unicode="" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -40 7t-13 30q0 3 0.5 76.5t0.5 134.5q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 119 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24 q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-85 13.5q-45 -113 -8 -204q-79 -87 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-39 -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.5 t-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 -88.5t0.5 -54.5q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103zM291 305q3 7 -7 12 q-10 3 -13 -2q-3 -7 7 -12q9 -6 13 2zM322 271q7 5 -2 16q-10 9 -16 3q-7 -5 2 -16q10 -10 16 -3zM352 226q9 7 0 19q-8 13 -17 6q-9 -5 0 -18t17 -7zM394 184q8 8 -4 19q-12 12 -20 3q-9 -8 4 -19q12 -12 20 -3zM451 159q3 11 -13 16q-15 4 -19 -7t13 -15q15 -6 19 6z M514 154q0 13 -17 11q-16 0 -16 -11q0 -13 17 -11q16 0 16 11zM572 164q-2 11 -18 9q-16 -3 -14 -15t18 -8t14 14z" />
|
182 |
-
<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" />
|
183 |
-
<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" />
|
184 |
-
<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" />
|
185 |
-
<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" />
|
186 |
-
<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" />
|
187 |
-
<glyph unicode="" horiz-adv-x="1792" d="M912 -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 16zM246 128h1300q-266 300 -266 832q0 51 -24 105t-69 103t-121.5 80.5t-169.5 31.5t-169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -532 -266 -832z M1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5 t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
|
188 |
-
<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" />
|
189 |
-
<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" />
|
190 |
-
<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" />
|
191 |
-
<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" />
|
192 |
-
<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" />
|
193 |
-
<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" />
|
194 |
-
<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" />
|
195 |
-
<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" />
|
196 |
-
<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" />
|
197 |
-
<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" />
|
198 |
-
<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" />
|
199 |
-
<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" />
|
200 |
-
<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" />
|
201 |
-
<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" />
|
202 |
-
<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 " />
|
203 |
-
<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" />
|
204 |
-
<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" />
|
205 |
-
<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 " />
|
206 |
-
<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" />
|
207 |
-
<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" />
|
208 |
-
<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" />
|
209 |
-
<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" />
|
210 |
-
<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" />
|
211 |
-
<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" />
|
212 |
-
<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" />
|
213 |
-
<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" />
|
214 |
-
<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" />
|
215 |
-
<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" />
|
216 |
-
<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" />
|
217 |
-
<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" />
|
218 |
-
<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" />
|
219 |
-
<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" />
|
220 |
-
<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" />
|
221 |
-
<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" />
|
222 |
-
<glyph unicode="" d="M917 631q0 26 -6 64h-362v-132h217q-3 -24 -16.5 -50t-37.5 -53t-66.5 -44.5t-96.5 -17.5q-99 0 -169 71t-70 171t70 171t169 71q92 0 153 -59l104 101q-108 100 -257 100q-160 0 -272 -112.5t-112 -271.5t112 -271.5t272 -112.5q165 0 266.5 105t101.5 270zM1262 585 h109v110h-109v110h-110v-110h-110v-110h110v-110h110v110zM1536 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" />
|
223 |
-
<glyph unicode="" horiz-adv-x="2304" d="M1437 623q0 -208 -87 -370.5t-248 -254t-369 -91.5q-149 0 -285 58t-234 156t-156 234t-58 285t58 285t156 234t234 156t285 58q286 0 491 -192l-199 -191q-117 113 -292 113q-123 0 -227.5 -62t-165.5 -168.5t-61 -232.5t61 -232.5t165.5 -168.5t227.5 -62 q83 0 152.5 23t114.5 57.5t78.5 78.5t49 83t21.5 74h-416v252h692q12 -63 12 -122zM2304 745v-210h-209v-209h-210v209h-209v210h209v209h210v-209h209z" />
|
224 |
-
<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" />
|
225 |
-
<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" />
|
226 |
-
<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" />
|
227 |
-
<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" />
|
228 |
-
<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" />
|
229 |
-
<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" />
|
230 |
-
<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" />
|
231 |
-
<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" />
|
232 |
-
<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" />
|
233 |
-
<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" />
|
234 |
-
<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" />
|
235 |
-
<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" />
|
236 |
-
<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" />
|
237 |
-
<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" />
|
238 |
-
<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" />
|
239 |
-
<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" />
|
240 |
-
<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" />
|
241 |
-
<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" />
|
242 |
-
<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" />
|
243 |
-
<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" />
|
244 |
-
<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" />
|
245 |
-
<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" />
|
246 |
-
<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" />
|
247 |
-
<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" />
|
248 |
-
<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" />
|
249 |
-
<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" />
|
250 |
-
<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" />
|
251 |
-
<glyph unicode="" horiz-adv-x="1792" d="M912 -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 16zM1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5 t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
|
252 |
-
<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" />
|
253 |
-
<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" />
|
254 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M384 736q0 14 9 23t23 9h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64zM1120 512q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704zM1120 256q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704 q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704z" />
|
255 |
-
<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" />
|
256 |
-
<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" />
|
257 |
-
<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" />
|
258 |
-
<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" />
|
259 |
-
<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" />
|
260 |
-
<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" />
|
261 |
-
<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" />
|
262 |
-
<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" />
|
263 |
-
<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" />
|
264 |
-
<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" />
|
265 |
-
<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" />
|
266 |
-
<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" />
|
267 |
-
<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" />
|
268 |
-
<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" />
|
269 |
-
<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" />
|
270 |
-
<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" />
|
271 |
-
<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" />
|
272 |
-
<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" />
|
273 |
-
<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" />
|
274 |
-
<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" />
|
275 |
-
<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" />
|
276 |
-
<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" />
|
277 |
-
<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" />
|
278 |
-
<glyph unicode="" horiz-adv-x="1792" d="M526 142q0 -53 -37.5 -90.5t-90.5 -37.5q-52 0 -90 38t-38 90q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1024 -64q0 -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 -53 -37.5 -90.5t-90.5 -37.5 t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1522 142q0 -52 -38 -90t-90 -38q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM558 1138q0 -66 -47 -113t-113 -47t-113 47t-47 113t47 113t113 47t113 -47t47 -113z M1728 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.5zM1088 1344q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1618 1138q0 -93 -66 -158.5t-158 -65.5q-93 0 -158.5 65.5t-65.5 158.5 q0 92 65.5 158t158.5 66q92 0 158 -66t66 -158z" />
|
279 |
-
<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" />
|
280 |
-
<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" />
|
281 |
-
<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" />
|
282 |
-
<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" />
|
283 |
-
<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 " />
|
284 |
-
<glyph unicode="" horiz-adv-x="1792" />
|
285 |
-
<glyph unicode="" horiz-adv-x="1792" />
|
286 |
-
<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" />
|
287 |
-
<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" />
|
288 |
-
<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" />
|
289 |
-
<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" />
|
290 |
-
<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" />
|
291 |
-
<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" />
|
292 |
-
<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" />
|
293 |
-
<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" />
|
294 |
-
<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" />
|
295 |
-
<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" />
|
296 |
-
<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" />
|
297 |
-
<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" />
|
298 |
-
<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" />
|
299 |
-
<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" />
|
300 |
-
<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" />
|
301 |
-
<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" />
|
302 |
-
<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" />
|
303 |
-
<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" />
|
304 |
-
<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" />
|
305 |
-
<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" />
|
306 |
-
<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" />
|
307 |
-
<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" />
|
308 |
-
<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" />
|
309 |
-
<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" />
|
310 |
-
<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" />
|
311 |
-
<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" />
|
312 |
-
<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" />
|
313 |
-
<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" />
|
314 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1745 763l-164 -763h-334l178 832q13 56 -15 88q-27 33 -83 33h-169l-204 -953h-334l204 953h-286l-204 -953h-334l204 953l-153 327h1276q101 0 189.5 -40.5t147.5 -113.5q60 -73 81 -168.5t0 -194.5z" />
|
315 |
-
<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" />
|
316 |
-
<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" />
|
317 |
-
<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" />
|
318 |
-
<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" />
|
319 |
-
<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" />
|
320 |
-
<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" />
|
321 |
-
<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" />
|
322 |
-
<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" />
|
323 |
-
<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" />
|
324 |
-
<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" />
|
325 |
-
<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" />
|
326 |
-
<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" />
|
327 |
-
<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" />
|
328 |
-
<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" />
|
329 |
-
<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" />
|
330 |
-
<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" />
|
331 |
-
<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" />
|
332 |
-
<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" />
|
333 |
-
<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" />
|
334 |
-
<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" />
|
335 |
-
<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" />
|
336 |
-
<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" />
|
337 |
-
<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" />
|
338 |
-
<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" />
|
339 |
-
<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" />
|
340 |
-
<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" />
|
341 |
-
<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" />
|
342 |
-
<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" />
|
343 |
-
<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" />
|
344 |
-
<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" />
|
345 |
-
<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" />
|
346 |
-
<glyph unicode="" horiz-adv-x="1280" d="M1043 971q0 100 -65 162t-171 62h-320v-448h320q106 0 171 62t65 162zM1280 971q0 -193 -126.5 -315t-326.5 -122h-340v-118h505q14 0 23 -9t9 -23v-128q0 -14 -9 -23t-23 -9h-505v-192q0 -14 -9.5 -23t-22.5 -9h-167q-14 0 -23 9t-9 23v192h-224q-14 0 -23 9t-9 23v128 q0 14 9 23t23 9h224v118h-224q-14 0 -23 9t-9 23v149q0 13 9 22.5t23 9.5h224v629q0 14 9 23t23 9h539q200 0 326.5 -122t126.5 -315z" />
|
347 |
-
<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" />
|
348 |
-
<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" />
|
349 |
-
<glyph unicode="" d="M1024 1024v472q22 -14 36 -28l408 -408q14 -14 28 -36h-472zM896 992q0 -40 28 -68t68 -28h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544z" />
|
350 |
-
<glyph unicode="" d="M1468 1060q14 -14 28 -36h-472v472q22 -14 36 -28zM992 896h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544q0 -40 28 -68t68 -28zM1152 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23z" />
|
351 |
-
<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" />
|
352 |
-
<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" />
|
353 |
-
<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" />
|
354 |
-
<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" />
|
355 |
-
<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" />
|
356 |
-
<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" />
|
357 |
-
<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" />
|
358 |
-
<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" />
|
359 |
-
<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" />
|
360 |
-
<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" />
|
361 |
-
<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" />
|
362 |
-
<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" />
|
363 |
-
<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" />
|
364 |
-
<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" />
|
365 |
-
<glyph unicode="" d="M1289 -96h-1118v480h-160v-640h1438v640h-160v-480zM347 428l33 157l783 -165l-33 -156zM450 802l67 146l725 -339l-67 -145zM651 1158l102 123l614 -513l-102 -123zM1048 1536l477 -641l-128 -96l-477 641zM330 65v159h800v-159h-800z" />
|
366 |
-
<glyph unicode="" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1162 640q0 -164 -115 -279t-279 -115t-279 115t-115 279t115 279t279 115t279 -115t115 -279zM1270 1050q0 -38 -27 -65t-65 -27t-65 27t-27 65t27 65t65 27t65 -27t27 -65zM768 1270 q-7 0 -76.5 0.5t-105.5 0t-96.5 -3t-103 -10t-71.5 -18.5q-50 -20 -88 -58t-58 -88q-11 -29 -18.5 -71.5t-10 -103t-3 -96.5t0 -105.5t0.5 -76.5t-0.5 -76.5t0 -105.5t3 -96.5t10 -103t18.5 -71.5q20 -50 58 -88t88 -58q29 -11 71.5 -18.5t103 -10t96.5 -3t105.5 0t76.5 0.5 t76.5 -0.5t105.5 0t96.5 3t103 10t71.5 18.5q50 20 88 58t58 88q11 29 18.5 71.5t10 103t3 96.5t0 105.5t-0.5 76.5t0.5 76.5t0 105.5t-3 96.5t-10 103t-18.5 71.5q-20 50 -58 88t-88 58q-29 11 -71.5 18.5t-103 10t-96.5 3t-105.5 0t-76.5 -0.5zM1536 640q0 -229 -5 -317 q-10 -208 -124 -322t-322 -124q-88 -5 -317 -5t-317 5q-208 10 -322 124t-124 322q-5 88 -5 317t5 317q10 208 124 322t322 124q88 5 317 5t317 -5q208 -10 322 -124t124 -322q5 -88 5 -317z" />
|
367 |
-
<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" />
|
368 |
-
<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" />
|
369 |
-
<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" />
|
370 |
-
<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" />
|
371 |
-
<glyph unicode="" horiz-adv-x="1024" d="M944 207l80 -237q-23 -35 -111 -66t-177 -32q-104 -2 -190.5 26t-142.5 74t-95 106t-55.5 120t-16.5 118v544h-168v215q72 26 129 69.5t91 90t58 102t34 99t15 88.5q1 5 4.5 8.5t7.5 3.5h244v-424h333v-252h-334v-518q0 -30 6.5 -56t22.5 -52.5t49.5 -41.5t81.5 -14 q78 2 134 29z" />
|
372 |
-
<glyph unicode="" d="M1136 75l-62 183q-44 -22 -103 -22q-36 -1 -62 10.5t-38.5 31.5t-17.5 40.5t-5 43.5v398h257v194h-256v326h-188q-8 0 -9 -10q-5 -44 -17.5 -87t-39 -95t-77 -95t-118.5 -68v-165h130v-418q0 -57 21.5 -115t65 -111t121 -85.5t176.5 -30.5q69 1 136.5 25t85.5 50z 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" />
|
373 |
-
<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" />
|
374 |
-
<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" />
|
375 |
-
<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" />
|
376 |
-
<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" />
|
377 |
-
<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" />
|
378 |
-
<glyph unicode="" horiz-adv-x="1664" d="M682 530v-651l-682 94v557h682zM682 1273v-659h-682v565zM1664 530v-786l-907 125v661h907zM1664 1408v-794h-907v669z" />
|
379 |
-
<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" />
|
380 |
-
<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" />
|
381 |
-
<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" />
|
382 |
-
<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" />
|
383 |
-
<glyph unicode="" horiz-adv-x="1280" d="M1000 1102l37 194q5 23 -9 40t-35 17h-712q-23 0 -38.5 -17t-15.5 -37v-1101q0 -7 6 -1l291 352q23 26 38 33.5t48 7.5h239q22 0 37 14.5t18 29.5q24 130 37 191q4 21 -11.5 40t-36.5 19h-294q-29 0 -48 19t-19 48v42q0 29 19 47.5t48 18.5h346q18 0 35 13.5t20 29.5z M1227 1324q-15 -73 -53.5 -266.5t-69.5 -350t-35 -173.5q-6 -22 -9 -32.5t-14 -32.5t-24.5 -33t-38.5 -21t-58 -10h-271q-13 0 -22 -10q-8 -9 -426 -494q-22 -25 -58.5 -28.5t-48.5 5.5q-55 22 -55 98v1410q0 55 38 102.5t120 47.5h888q95 0 127 -53t10 -159zM1227 1324 l-158 -790q4 17 35 173.5t69.5 350t53.5 266.5z" />
|
384 |
-
<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" />
|
385 |
-
<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" />
|
386 |
-
<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" />
|
387 |
-
<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" />
|
388 |
-
<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" />
|
389 |
-
<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" />
|
390 |
-
<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" />
|
391 |
-
<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" />
|
392 |
-
<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" />
|
393 |
-
<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" />
|
394 |
-
<glyph unicode="" d="M1133 -34q-171 -94 -368 -94q-196 0 -367 94q138 87 235.5 211t131.5 268q35 -144 132.5 -268t235.5 -211zM638 1394v-485q0 -252 -126.5 -459.5t-330.5 -306.5q-181 215 -181 495q0 187 83.5 349.5t229.5 269.5t325 137zM1536 638q0 -280 -181 -495 q-204 99 -330.5 306.5t-126.5 459.5v485q179 -30 325 -137t229.5 -269.5t83.5 -349.5z" />
|
395 |
-
<glyph unicode="" horiz-adv-x="1408" d="M1402 433q-32 -80 -76 -138t-91 -88.5t-99 -46.5t-101.5 -14.5t-96.5 8.5t-86.5 22t-69.5 27.5t-46 22.5l-17 10q-113 -228 -289.5 -359.5t-384.5 -132.5q-19 0 -32 13t-13 32t13 31.5t32 12.5q173 1 322.5 107.5t251.5 294.5q-36 -14 -72 -23t-83 -13t-91 2.5t-93 28.5 t-92 59t-84.5 100t-74.5 146q114 47 214 57t167.5 -7.5t124.5 -56.5t88.5 -77t56.5 -82q53 131 79 291q-7 -1 -18 -2.5t-46.5 -2.5t-69.5 0.5t-81.5 10t-88.5 23t-84 42.5t-75 65t-54.5 94.5t-28.5 127.5q70 28 133.5 36.5t112.5 -1t92 -30t73.5 -50t56 -61t42 -63t27.5 -56 t16 -39.5l4 -16q12 122 12 195q-8 6 -21.5 16t-49 44.5t-63.5 71.5t-54 93t-33 112.5t12 127t70 138.5q73 -25 127.5 -61.5t84.5 -76.5t48 -85t20.5 -89t-0.5 -85.5t-13 -76.5t-19 -62t-17 -42l-7 -15q1 -5 1 -50.5t-1 -71.5q3 7 10 18.5t30.5 43t50.5 58t71 55.5t91.5 44.5 t112 14.5t132.5 -24q-2 -78 -21.5 -141.5t-50 -104.5t-69.5 -71.5t-81.5 -45.5t-84.5 -24t-80 -9.5t-67.5 1t-46.5 4.5l-17 3q-23 -147 -73 -283q6 7 18 18.5t49.5 41t77.5 52.5t99.5 42t117.5 20t129 -23.5t137 -77.5z" />
|
396 |
-
<glyph unicode="" horiz-adv-x="1280" d="M1259 283v-66q0 -85 -57.5 -144.5t-138.5 -59.5h-57l-260 -269v269h-529q-81 0 -138.5 59.5t-57.5 144.5v66h1238zM1259 609v-255h-1238v255h1238zM1259 937v-255h-1238v255h1238zM1259 1077v-67h-1238v67q0 84 57.5 143.5t138.5 59.5h846q81 0 138.5 -59.5t57.5 -143.5z " />
|
397 |
-
<glyph unicode="" d="M1152 640q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192h-352q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h352v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-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.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
|
398 |
-
<glyph unicode="" d="M1152 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-352v-192q0 -14 -9 -23t-23 -9q-12 0 -24 10l-319 319q-9 9 -9 23t9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h352q13 0 22.5 -9.5t9.5 -22.5zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-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.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
|
399 |
-
<glyph unicode="" d="M1024 960v-640q0 -26 -19 -45t-45 -19q-20 0 -37 12l-448 320q-27 19 -27 52t27 52l448 320q17 12 37 12q26 0 45 -19t19 -45zM1280 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.5z 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" />
|
400 |
-
<glyph unicode="" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM768 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.5 t-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" />
|
401 |
-
<glyph unicode="" horiz-adv-x="1664" d="M1023 349l102 -204q-58 -179 -210 -290t-339 -111q-156 0 -288.5 77.5t-210 210t-77.5 288.5q0 181 104.5 330t274.5 211l17 -131q-122 -54 -195 -165.5t-73 -244.5q0 -185 131.5 -316.5t316.5 -131.5q126 0 232.5 65t165 175.5t49.5 236.5zM1571 249l58 -114l-256 -128 q-13 -7 -29 -7q-40 0 -57 35l-239 477h-472q-24 0 -42.5 16.5t-21.5 40.5l-96 779q-2 16 6 42q14 51 57 82.5t97 31.5q66 0 113 -47t47 -113q0 -69 -52 -117.5t-120 -41.5l37 -289h423v-128h-407l16 -128h455q40 0 57 -35l228 -455z" />
|
402 |
-
<glyph unicode="" d="M1292 898q10 216 -161 222q-231 8 -312 -261q44 19 82 19q85 0 74 -96q-4 -57 -74 -167t-105 -110q-43 0 -82 169q-13 54 -45 255q-30 189 -160 177q-59 -7 -164 -100l-81 -72l-81 -72l52 -67q76 52 87 52q57 0 107 -179q15 -55 45 -164.5t45 -164.5q68 -179 164 -179 q157 0 383 294q220 283 226 444zM1536 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" />
|
403 |
-
<glyph unicode="" horiz-adv-x="1152" d="M1152 704q0 -191 -94.5 -353t-256.5 -256.5t-353 -94.5h-160q-14 0 -23 9t-9 23v611l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v93l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v250q0 14 9 23t23 9h160 q14 0 23 -9t9 -23v-181l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-93l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-487q188 13 318 151t130 328q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
|
404 |
-
<glyph unicode="" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-352v-352q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v352h-352q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h352v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-352h352q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832 q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 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.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
|
405 |
-
<glyph unicode="" horiz-adv-x="2176" d="M620 416q-110 -64 -268 -64h-128v64h-64q-13 0 -22.5 23.5t-9.5 56.5q0 24 7 49q-58 2 -96.5 10.5t-38.5 20.5t38.5 20.5t96.5 10.5q-7 25 -7 49q0 33 9.5 56.5t22.5 23.5h64v64h128q158 0 268 -64h1113q42 -7 106.5 -18t80.5 -14q89 -15 150 -40.5t83.5 -47.5t22.5 -40 t-22.5 -40t-83.5 -47.5t-150 -40.5q-16 -3 -80.5 -14t-106.5 -18h-1113zM1739 668q53 -36 53 -92t-53 -92l81 -30q68 48 68 122t-68 122zM625 400h1015q-217 -38 -456 -80q-57 0 -113 -24t-83 -48l-28 -24l-288 -288q-26 -26 -70.5 -45t-89.5 -19h-96l-93 464h29 q157 0 273 64zM352 816h-29l93 464h96q46 0 90 -19t70 -45l288 -288q4 -4 11 -10.5t30.5 -23t48.5 -29t61.5 -23t72.5 -10.5l456 -80h-1015q-116 64 -273 64z" />
|
406 |
-
<glyph unicode="" horiz-adv-x="1664" d="M1519 760q62 0 103.5 -40.5t41.5 -101.5q0 -97 -93 -130l-172 -59l56 -167q7 -21 7 -47q0 -59 -42 -102t-101 -43q-47 0 -85.5 27t-53.5 72l-55 165l-310 -106l55 -164q8 -24 8 -47q0 -59 -42 -102t-102 -43q-47 0 -85 27t-53 72l-55 163l-153 -53q-29 -9 -50 -9 q-61 0 -101.5 40t-40.5 101q0 47 27.5 85t71.5 53l156 53l-105 313l-156 -54q-26 -8 -48 -8q-60 0 -101 40.5t-41 100.5q0 47 27.5 85t71.5 53l157 53l-53 159q-8 24 -8 47q0 60 42 102.5t102 42.5q47 0 85 -27t53 -72l54 -160l310 105l-54 160q-8 24 -8 47q0 59 42.5 102 t101.5 43q47 0 85.5 -27.5t53.5 -71.5l53 -161l162 55q21 6 43 6q60 0 102.5 -39.5t42.5 -98.5q0 -45 -30 -81.5t-74 -51.5l-157 -54l105 -316l164 56q24 8 46 8zM725 498l310 105l-105 315l-310 -107z" />
|
407 |
-
<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.5h960zM1280 352v436q-31 -35 -64 -55q-34 -22 -132.5 -85t-151.5 -99q-98 -69 -164 -69v0v0q-66 0 -164 69 q-46 32 -141.5 92.5t-142.5 92.5q-12 8 -33 27t-31 27v-436q0 -40 28 -68t68 -28h832q40 0 68 28t28 68zM1280 925q0 41 -27.5 70t-68.5 29h-832q-40 0 -68 -28t-28 -68q0 -37 30.5 -76.5t67.5 -64.5q47 -32 137.5 -89t129.5 -83q3 -2 17 -11.5t21 -14t21 -13t23.5 -13 t21.5 -9.5t22.5 -7.5t20.5 -2.5t20.5 2.5t22.5 7.5t21.5 9.5t23.5 13t21 13t21 14t17 11.5l267 174q35 23 66.5 62.5t31.5 73.5z" />
|
408 |
-
<glyph unicode="" horiz-adv-x="1792" d="M127 640q0 163 67 313l367 -1005q-196 95 -315 281t-119 411zM1415 679q0 -19 -2.5 -38.5t-10 -49.5t-11.5 -44t-17.5 -59t-17.5 -58l-76 -256l-278 826q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-75 1 -202 10q-12 1 -20.5 -5t-11.5 -15t-1.5 -18.5t9 -16.5 t19.5 -8l80 -8l120 -328l-168 -504l-280 832q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-7 0 -23 0.5t-26 0.5q105 160 274.5 253.5t367.5 93.5q147 0 280.5 -53t238.5 -149h-10q-55 0 -92 -40.5t-37 -95.5q0 -12 2 -24t4 -21.5t8 -23t9 -21t12 -22.5t12.5 -21 t14.5 -24t14 -23q63 -107 63 -212zM909 573l237 -647q1 -6 5 -11q-126 -44 -255 -44q-112 0 -217 32zM1570 1009q95 -174 95 -369q0 -209 -104 -385.5t-279 -278.5l235 678q59 169 59 276q0 42 -6 79zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286 t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 -215q173 0 331.5 68t273 182.5t182.5 273t68 331.5t-68 331.5t-182.5 273t-273 182.5t-331.5 68t-331.5 -68t-273 -182.5t-182.5 -273t-68 -331.5t68 -331.5t182.5 -273 t273 -182.5t331.5 -68z" />
|
409 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1086 1536v-1536l-272 -128q-228 20 -414 102t-293 208.5t-107 272.5q0 140 100.5 263.5t275 205.5t391.5 108v-172q-217 -38 -356.5 -150t-139.5 -255q0 -152 154.5 -267t388.5 -145v1360zM1755 954l37 -390l-525 114l147 83q-119 70 -280 99v172q277 -33 481 -157z" />
|
410 |
-
<glyph unicode="" horiz-adv-x="2048" d="M960 1536l960 -384v-128h-128q0 -26 -20.5 -45t-48.5 -19h-1526q-28 0 -48.5 19t-20.5 45h-128v128zM256 896h256v-768h128v768h256v-768h128v768h256v-768h128v768h256v-768h59q28 0 48.5 -19t20.5 -45v-64h-1664v64q0 26 20.5 45t48.5 19h59v768zM1851 -64 q28 0 48.5 -19t20.5 -45v-128h-1920v128q0 26 20.5 45t48.5 19h1782z" />
|
411 |
-
<glyph unicode="" horiz-adv-x="2304" d="M1774 700l18 -316q4 -69 -82 -128t-235 -93.5t-323 -34.5t-323 34.5t-235 93.5t-82 128l18 316l574 -181q22 -7 48 -7t48 7zM2304 1024q0 -23 -22 -31l-1120 -352q-4 -1 -10 -1t-10 1l-652 206q-43 -34 -71 -111.5t-34 -178.5q63 -36 63 -109q0 -69 -58 -107l58 -433 q2 -14 -8 -25q-9 -11 -24 -11h-192q-15 0 -24 11q-10 11 -8 25l58 433q-58 38 -58 107q0 73 65 111q11 207 98 330l-333 104q-22 8 -22 31t22 31l1120 352q4 1 10 1t10 -1l1120 -352q22 -8 22 -31z" />
|
412 |
-
<glyph unicode="" d="M859 579l13 -707q-62 11 -105 11q-41 0 -105 -11l13 707q-40 69 -168.5 295.5t-216.5 374.5t-181 287q58 -15 108 -15q43 0 111 15q63 -111 133.5 -229.5t167 -276.5t138.5 -227q37 61 109.5 177.5t117.5 190t105 176t107 189.5q54 -14 107 -14q56 0 114 14v0 q-28 -39 -60 -88.5t-49.5 -78.5t-56.5 -96t-49 -84q-146 -248 -353 -610z" />
|
413 |
-
<glyph unicode="" d="M768 750h725q12 -67 12 -128q0 -217 -91 -387.5t-259.5 -266.5t-386.5 -96q-157 0 -299 60.5t-245 163.5t-163.5 245t-60.5 299t60.5 299t163.5 245t245 163.5t299 60.5q300 0 515 -201l-209 -201q-123 119 -306 119q-129 0 -238.5 -65t-173.5 -176.5t-64 -243.5 t64 -243.5t173.5 -176.5t238.5 -65q87 0 160 24t120 60t82 82t51.5 87t22.5 78h-436v264z" />
|
414 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1095 369q16 -16 0 -31q-62 -62 -199 -62t-199 62q-16 15 0 31q6 6 15 6t15 -6q48 -49 169 -49q120 0 169 49q6 6 15 6t15 -6zM788 550q0 -37 -26 -63t-63 -26t-63.5 26t-26.5 63q0 38 26.5 64t63.5 26t63 -26.5t26 -63.5zM1183 550q0 -37 -26.5 -63t-63.5 -26t-63 26 t-26 63t26 63.5t63 26.5t63.5 -26t26.5 -64zM1434 670q0 49 -35 84t-85 35t-86 -36q-130 90 -311 96l63 283l200 -45q0 -37 26 -63t63 -26t63.5 26.5t26.5 63.5t-26.5 63.5t-63.5 26.5q-54 0 -80 -50l-221 49q-19 5 -25 -16l-69 -312q-180 -7 -309 -97q-35 37 -87 37 q-50 0 -85 -35t-35 -84q0 -35 18.5 -64t49.5 -44q-6 -27 -6 -56q0 -142 140 -243t337 -101q198 0 338 101t140 243q0 32 -7 57q30 15 48 43.5t18 63.5zM1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191 t348 71t348 -71t286 -191t191 -286t71 -348z" />
|
415 |
-
<glyph unicode="" d="M939 407q13 -13 0 -26q-53 -53 -171 -53t-171 53q-13 13 0 26q5 6 13 6t13 -6q42 -42 145 -42t145 42q5 6 13 6t13 -6zM676 563q0 -31 -23 -54t-54 -23t-54 23t-23 54q0 32 22.5 54.5t54.5 22.5t54.5 -22.5t22.5 -54.5zM1014 563q0 -31 -23 -54t-54 -23t-54 23t-23 54 q0 32 22.5 54.5t54.5 22.5t54.5 -22.5t22.5 -54.5zM1229 666q0 42 -30 72t-73 30q-42 0 -73 -31q-113 78 -267 82l54 243l171 -39q1 -32 23.5 -54t53.5 -22q32 0 54.5 22.5t22.5 54.5t-22.5 54.5t-54.5 22.5q-48 0 -69 -43l-189 42q-17 5 -21 -13l-60 -268q-154 -6 -265 -83 q-30 32 -74 32q-43 0 -73 -30t-30 -72q0 -30 16 -55t42 -38q-5 -25 -5 -48q0 -122 120 -208.5t289 -86.5q170 0 290 86.5t120 208.5q0 25 -6 49q25 13 40.5 37.5t15.5 54.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
|
416 |
-
<glyph unicode="" d="M866 697l90 27v62q0 79 -58 135t-138 56t-138 -55.5t-58 -134.5v-283q0 -20 -14 -33.5t-33 -13.5t-32.5 13.5t-13.5 33.5v120h-151v-122q0 -82 57.5 -139t139.5 -57q81 0 138.5 56.5t57.5 136.5v280q0 19 13.5 33t33.5 14q19 0 32.5 -14t13.5 -33v-54zM1199 502v122h-150 v-126q0 -20 -13.5 -33.5t-33.5 -13.5q-19 0 -32.5 14t-13.5 33v123l-90 -26l-60 28v-123q0 -80 58 -137t139 -57t138.5 57t57.5 139zM1536 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 103 t385.5 -103t279.5 -279.5t103 -385.5z" />
|
417 |
-
<glyph unicode="" horiz-adv-x="1920" d="M1062 824v118q0 42 -30 72t-72 30t-72 -30t-30 -72v-612q0 -175 -126 -299t-303 -124q-178 0 -303.5 125.5t-125.5 303.5v266h328v-262q0 -43 30 -72.5t72 -29.5t72 29.5t30 72.5v620q0 171 126.5 292t301.5 121q176 0 302 -122t126 -294v-136l-195 -58zM1592 602h328 v-266q0 -178 -125.5 -303.5t-303.5 -125.5q-177 0 -303 124.5t-126 300.5v268l131 -61l195 58v-270q0 -42 30 -71.5t72 -29.5t72 29.5t30 71.5v275z" />
|
418 |
-
<glyph unicode="" d="M1472 160v480h-704v704h-480q-93 0 -158.5 -65.5t-65.5 -158.5v-480h704v-704h480q93 0 158.5 65.5t65.5 158.5zM1536 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" />
|
419 |
-
<glyph unicode="" horiz-adv-x="2048" d="M328 1254h204v-983h-532v697h328v286zM328 435v369h-123v-369h123zM614 968v-697h205v697h-205zM614 1254v-204h205v204h-205zM901 968h533v-942h-533v163h328v82h-328v697zM1229 435v369h-123v-369h123zM1516 968h532v-942h-532v163h327v82h-327v697zM1843 435v369h-123 v-369h123z" />
|
420 |
-
<glyph unicode="" d="M1046 516q0 -64 -38 -109t-91 -45q-43 0 -70 15v277q28 17 70 17q53 0 91 -45.5t38 -109.5zM703 944q0 -64 -38 -109.5t-91 -45.5q-43 0 -70 15v277q28 17 70 17q53 0 91 -45t38 -109zM1265 513q0 134 -88 229t-213 95q-20 0 -39 -3q-23 -78 -78 -136q-87 -95 -211 -101 v-636l211 41v206q51 -19 117 -19q125 0 213 95t88 229zM922 940q0 134 -88.5 229t-213.5 95q-74 0 -141 -36h-186v-840l211 41v206q55 -19 116 -19q125 0 213.5 95t88.5 229zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
|
421 |
-
<glyph unicode="" horiz-adv-x="2038" d="M1222 607q75 3 143.5 -20.5t118 -58.5t101 -94.5t84 -108t75.5 -120.5q33 -56 78.5 -109t75.5 -80.5t99 -88.5q-48 -30 -108.5 -57.5t-138.5 -59t-114 -47.5q-44 37 -74 115t-43.5 164.5t-33 180.5t-42.5 168.5t-72.5 123t-122.5 48.5l-10 -2l-6 -4q4 -5 13 -14 q6 -5 28 -23.5t25.5 -22t19 -18t18 -20.5t11.5 -21t10.5 -27.5t4.5 -31t4 -40.5l1 -33q1 -26 -2.5 -57.5t-7.5 -52t-12.5 -58.5t-11.5 -53q-35 1 -101 -9.5t-98 -10.5q-39 0 -72 10q-2 16 -2 47q0 74 3 96q2 13 31.5 41.5t57 59t26.5 51.5q-24 2 -43 -24 q-36 -53 -111.5 -99.5t-136.5 -46.5q-25 0 -75.5 63t-106.5 139.5t-84 96.5q-6 4 -27 30q-482 -112 -513 -112q-16 0 -28 11t-12 27q0 15 8.5 26.5t22.5 14.5l486 106q-8 14 -8 25t5.5 17.5t16 11.5t20 7t23 4.5t18.5 4.5q4 1 15.5 7.5t17.5 6.5q15 0 28 -16t20 -33 q163 37 172 37q17 0 29.5 -11t12.5 -28q0 -15 -8.5 -26t-23.5 -14l-182 -40l-1 -16q-1 -26 81.5 -117.5t104.5 -91.5q47 0 119 80t72 129q0 36 -23.5 53t-51 18.5t-51 11.5t-23.5 34q0 16 10 34l-68 19q43 44 43 117q0 26 -5 58q82 16 144 16q44 0 71.5 -1.5t48.5 -8.5 t31 -13.5t20.5 -24.5t15.5 -33.5t17 -47.5t24 -60l50 25q-3 -40 -23 -60t-42.5 -21t-40 -6.5t-16.5 -20.5zM1282 842q-5 5 -13.5 15.5t-12 14.5t-10.5 11.5t-10 10.5l-8 8t-8.5 7.5t-8 5t-8.5 4.5q-7 3 -14.5 5t-20.5 2.5t-22 0.5h-32.5h-37.5q-126 0 -217 -43 q16 30 36 46.5t54 29.5t65.5 36t46 36.5t50 55t43.5 50.5q12 -9 28 -31.5t32 -36.5t38 -13l12 1v-76l22 -1q247 95 371 190q28 21 50 39t42.5 37.5t33 31t29.5 34t24 31t24.5 37t23 38t27 47.5t29.5 53l7 9q-2 -53 -43 -139q-79 -165 -205 -264t-306 -142q-14 -3 -42 -7.5 t-50 -9.5t-39 -14q3 -19 24.5 -46t21.5 -34q0 -11 -26 -30zM1061 -79q39 26 131.5 47.5t146.5 21.5q9 0 22.5 -15.5t28 -42.5t26 -50t24 -51t14.5 -33q-121 -45 -244 -45q-61 0 -125 11zM822 568l48 12l109 -177l-73 -48zM1323 51q3 -15 3 -16q0 -7 -17.5 -14.5t-46 -13 t-54 -9.5t-53.5 -7.5t-32 -4.5l-7 43q21 2 60.5 8.5t72 10t60.5 3.5h14zM866 679l-96 -20l-6 17q10 1 32.5 7t34.5 6q19 0 35 -10zM1061 45h31l10 -83l-41 -12v95zM1950 1535v1v-1zM1950 1535l-1 -5l-2 -2l1 3zM1950 1535l1 1z" />
|
422 |
-
<glyph unicode="" d="M1167 -50q-5 19 -24 5q-30 -22 -87 -39t-131 -17q-129 0 -193 49q-5 4 -13 4q-11 0 -26 -12q-7 -6 -7.5 -16t7.5 -20q34 -32 87.5 -46t102.5 -12.5t99 4.5q41 4 84.5 20.5t65 30t28.5 20.5q12 12 7 29zM1128 65q-19 47 -39 61q-23 15 -76 15q-47 0 -71 -10 q-29 -12 -78 -56q-26 -24 -12 -44q9 -8 17.5 -4.5t31.5 23.5q3 2 10.5 8.5t10.5 8.5t10 7t11.5 7t12.5 5t15 4.5t16.5 2.5t20.5 1q27 0 44.5 -7.5t23 -14.5t13.5 -22q10 -17 12.5 -20t12.5 1q23 12 14 34zM1483 346q0 22 -5 44.5t-16.5 45t-34 36.5t-52.5 14 q-33 0 -97 -41.5t-129 -83.5t-101 -42q-27 -1 -63.5 19t-76 49t-83.5 58t-100 49t-111 19q-115 -1 -197 -78.5t-84 -178.5q-2 -112 74 -164q29 -20 62.5 -28.5t103.5 -8.5q57 0 132 32.5t134 71t120 70.5t93 31q26 -1 65 -31.5t71.5 -67t68 -67.5t55.5 -32q35 -3 58.5 14 t55.5 63q28 41 42.5 101t14.5 106zM1536 506q0 -164 -62 -304.5t-166 -236t-242.5 -149.5t-290.5 -54t-293 57.5t-247.5 157t-170.5 241.5t-64 302q0 89 19.5 172.5t49 145.5t70.5 118.5t78.5 94t78.5 69.5t64.5 46.5t42.5 24.5q14 8 51 26.5t54.5 28.5t48 30t60.5 44 q36 28 58 72.5t30 125.5q129 -155 186 -193q44 -29 130 -68t129 -66q21 -13 39 -25t60.5 -46.5t76 -70.5t75 -95t69 -122t47 -148.5t19.5 -177.5z" />
|
423 |
-
<glyph unicode="" d="M1070 463l-160 -160l-151 -152l-30 -30q-65 -64 -151.5 -87t-171.5 -2q-16 -70 -72 -115t-129 -45q-85 0 -145 60.5t-60 145.5q0 72 44.5 128t113.5 72q-22 86 1 173t88 152l12 12l151 -152l-11 -11q-37 -37 -37 -89t37 -90q37 -37 89 -37t89 37l30 30l151 152l161 160z M729 1145l12 -12l-152 -152l-12 12q-37 37 -89 37t-89 -37t-37 -89.5t37 -89.5l29 -29l152 -152l160 -160l-151 -152l-161 160l-151 152l-30 30q-68 67 -90 159.5t5 179.5q-70 15 -115 71t-45 129q0 85 60 145.5t145 60.5q76 0 133.5 -49t69.5 -123q84 20 169.5 -3.5 t149.5 -87.5zM1536 78q0 -85 -60 -145.5t-145 -60.5q-74 0 -131 47t-71 118q-86 -28 -179.5 -6t-161.5 90l-11 12l151 152l12 -12q37 -37 89 -37t89 37t37 89t-37 89l-30 30l-152 152l-160 160l152 152l160 -160l152 -152l29 -30q64 -64 87.5 -150.5t2.5 -171.5 q76 -11 126.5 -68.5t50.5 -134.5zM1534 1202q0 -77 -51 -135t-127 -69q26 -85 3 -176.5t-90 -158.5l-12 -12l-151 152l12 12q37 37 37 89t-37 89t-89 37t-89 -37l-30 -30l-152 -152l-160 -160l-152 152l161 160l152 152l29 30q67 67 159 89.5t178 -3.5q11 75 68.5 126 t135.5 51q85 0 145 -60.5t60 -145.5z" />
|
424 |
-
<glyph unicode="" d="M654 458q-1 -3 -12.5 0.5t-31.5 11.5l-20 9q-44 20 -87 49q-7 5 -41 31.5t-38 28.5q-67 -103 -134 -181q-81 -95 -105 -110q-4 -2 -19.5 -4t-18.5 0q6 4 82 92q21 24 85.5 115t78.5 118q17 30 51 98.5t36 77.5q-8 1 -110 -33q-8 -2 -27.5 -7.5t-34.5 -9.5t-17 -5 q-2 -2 -2 -10.5t-1 -9.5q-5 -10 -31 -15q-23 -7 -47 0q-18 4 -28 21q-4 6 -5 23q6 2 24.5 5t29.5 6q58 16 105 32q100 35 102 35q10 2 43 19.5t44 21.5q9 3 21.5 8t14.5 5.5t6 -0.5q2 -12 -1 -33q0 -2 -12.5 -27t-26.5 -53.5t-17 -33.5q-25 -50 -77 -131l64 -28 q12 -6 74.5 -32t67.5 -28q4 -1 10.5 -25.5t4.5 -30.5zM449 944q3 -15 -4 -28q-12 -23 -50 -38q-30 -12 -60 -12q-26 3 -49 26q-14 15 -18 41l1 3q3 -3 19.5 -5t26.5 0t58 16q36 12 55 14q17 0 21 -17zM1147 815l63 -227l-139 42zM39 15l694 232v1032l-694 -233v-1031z M1280 332l102 -31l-181 657l-100 31l-216 -536l102 -31l45 110l211 -65zM777 1294l573 -184v380zM1088 -29l158 -13l-54 -160l-40 66q-130 -83 -276 -108q-58 -12 -91 -12h-84q-79 0 -199.5 39t-183.5 85q-8 7 -8 16q0 8 5 13.5t13 5.5q4 0 18 -7.5t30.5 -16.5t20.5 -11 q73 -37 159.5 -61.5t157.5 -24.5q95 0 167 14.5t157 50.5q15 7 30.5 15.5t34 19t28.5 16.5zM1536 1050v-1079l-774 246q-14 -6 -375 -127.5t-368 -121.5q-13 0 -18 13q0 1 -1 3v1078q3 9 4 10q5 6 20 11q106 35 149 50v384l558 -198q2 0 160.5 55t316 108.5t161.5 53.5 q20 0 20 -21v-418z" />
|
425 |
-
<glyph unicode="" horiz-adv-x="1792" d="M288 1152q66 0 113 -47t47 -113v-1088q0 -66 -47 -113t-113 -47h-128q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h128zM1664 989q58 -34 93 -93t35 -128v-768q0 -106 -75 -181t-181 -75h-864q-66 0 -113 47t-47 113v1536q0 40 28 68t68 28h672q40 0 88 -20t76 -48 l152 -152q28 -28 48 -76t20 -88v-163zM928 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 512v128q0 14 -9 23 t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128 q14 0 23 9t9 23zM1184 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 256v128q0 14 -9 23t-23 9h-128 q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1536 896v256h-160q-40 0 -68 28t-28 68v160h-640v-512h896z" />
|
426 |
-
<glyph unicode="" d="M1344 1536q26 0 45 -19t19 -45v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280zM512 1248v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 992v-64q0 -14 9 -23t23 -9h64q14 0 23 9 t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 736v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 480v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM384 160v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM384 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 -96v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9 t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM896 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 928v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 160v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9 t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23z" />
|
427 |
-
<glyph unicode="" horiz-adv-x="1280" d="M1188 988l-292 -292v-824q0 -46 -33 -79t-79 -33t-79 33t-33 79v384h-64v-384q0 -46 -33 -79t-79 -33t-79 33t-33 79v824l-292 292q-28 28 -28 68t28 68t68 28t68 -28l228 -228h368l228 228q28 28 68 28t68 -28t28 -68t-28 -68zM864 1152q0 -93 -65.5 -158.5 t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
|
428 |
-
<glyph unicode="" horiz-adv-x="1664" d="M780 1064q0 -60 -19 -113.5t-63 -92.5t-105 -39q-76 0 -138 57.5t-92 135.5t-30 151q0 60 19 113.5t63 92.5t105 39q77 0 138.5 -57.5t91.5 -135t30 -151.5zM438 581q0 -80 -42 -139t-119 -59q-76 0 -141.5 55.5t-100.5 133.5t-35 152q0 80 42 139.5t119 59.5 q76 0 141.5 -55.5t100.5 -134t35 -152.5zM832 608q118 0 255 -97.5t229 -237t92 -254.5q0 -46 -17 -76.5t-48.5 -45t-64.5 -20t-76 -5.5q-68 0 -187.5 45t-182.5 45q-66 0 -192.5 -44.5t-200.5 -44.5q-183 0 -183 146q0 86 56 191.5t139.5 192.5t187.5 146t193 59zM1071 819 q-61 0 -105 39t-63 92.5t-19 113.5q0 74 30 151.5t91.5 135t138.5 57.5q61 0 105 -39t63 -92.5t19 -113.5q0 -73 -30 -151t-92 -135.5t-138 -57.5zM1503 923q77 0 119 -59.5t42 -139.5q0 -74 -35 -152t-100.5 -133.5t-141.5 -55.5q-77 0 -119 59t-42 139q0 74 35 152.5 t100.5 134t141.5 55.5z" />
|
429 |
-
<glyph unicode="" horiz-adv-x="768" d="M704 1008q0 -145 -57 -243.5t-152 -135.5l45 -821q2 -26 -16 -45t-44 -19h-192q-26 0 -44 19t-16 45l45 821q-95 37 -152 135.5t-57 243.5q0 128 42.5 249.5t117.5 200t160 78.5t160 -78.5t117.5 -200t42.5 -249.5z" />
|
430 |
-
<glyph unicode="" horiz-adv-x="1792" d="M896 -93l640 349v636l-640 -233v-752zM832 772l698 254l-698 254l-698 -254zM1664 1024v-768q0 -35 -18 -65t-49 -47l-704 -384q-28 -16 -61 -16t-61 16l-704 384q-31 17 -49 47t-18 65v768q0 40 23 73t61 47l704 256q22 8 44 8t44 -8l704 -256q38 -14 61 -47t23 -73z " />
|
431 |
-
<glyph unicode="" horiz-adv-x="2304" d="M640 -96l384 192v314l-384 -164v-342zM576 358l404 173l-404 173l-404 -173zM1664 -96l384 192v314l-384 -164v-342zM1600 358l404 173l-404 173l-404 -173zM1152 651l384 165v266l-384 -164v-267zM1088 1030l441 189l-441 189l-441 -189zM2176 512v-416q0 -36 -19 -67 t-52 -47l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-5 2 -7 4q-2 -2 -7 -4l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-33 16 -52 47t-19 67v416q0 38 21.5 70t56.5 48l434 186v400q0 38 21.5 70t56.5 48l448 192q23 10 50 10t50 -10l448 -192q35 -16 56.5 -48t21.5 -70 v-400l434 -186q36 -16 57 -48t21 -70z" />
|
432 |
-
<glyph unicode="" horiz-adv-x="2048" d="M1848 1197h-511v-124h511v124zM1596 771q-90 0 -146 -52.5t-62 -142.5h408q-18 195 -200 195zM1612 186q63 0 122 32t76 87h221q-100 -307 -427 -307q-214 0 -340.5 132t-126.5 347q0 208 130.5 345.5t336.5 137.5q138 0 240.5 -68t153 -179t50.5 -248q0 -17 -2 -47h-658 q0 -111 57.5 -171.5t166.5 -60.5zM277 236h296q205 0 205 167q0 180 -199 180h-302v-347zM277 773h281q78 0 123.5 36.5t45.5 113.5q0 144 -190 144h-260v-294zM0 1282h594q87 0 155 -14t126.5 -47.5t90 -96.5t31.5 -154q0 -181 -172 -263q114 -32 172 -115t58 -204 q0 -75 -24.5 -136.5t-66 -103.5t-98.5 -71t-121 -42t-134 -13h-611v1260z" />
|
433 |
-
<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.5h960zM499 1041h-371v-787h382q117 0 197 57.5t80 170.5q0 158 -143 200q107 52 107 164q0 57 -19.5 96.5 t-56.5 60.5t-79 29.5t-97 8.5zM477 723h-176v184h163q119 0 119 -90q0 -94 -106 -94zM486 388h-185v217h189q124 0 124 -113q0 -104 -128 -104zM1136 356q-68 0 -104 38t-36 107h411q1 10 1 30q0 132 -74.5 220.5t-203.5 88.5q-128 0 -210 -86t-82 -216q0 -135 79 -217 t213 -82q205 0 267 191h-138q-11 -34 -47.5 -54t-75.5 -20zM1126 722q113 0 124 -122h-254q4 56 39 89t91 33zM964 988h319v-77h-319v77z" />
|
434 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1582 954q0 -101 -71.5 -172.5t-172.5 -71.5t-172.5 71.5t-71.5 172.5t71.5 172.5t172.5 71.5t172.5 -71.5t71.5 -172.5zM812 212q0 104 -73 177t-177 73q-27 0 -54 -6l104 -42q77 -31 109.5 -106.5t1.5 -151.5q-31 -77 -107 -109t-152 -1q-21 8 -62 24.5t-61 24.5 q32 -60 91 -96.5t130 -36.5q104 0 177 73t73 177zM1642 953q0 126 -89.5 215.5t-215.5 89.5q-127 0 -216.5 -89.5t-89.5 -215.5q0 -127 89.5 -216t216.5 -89q126 0 215.5 89t89.5 216zM1792 953q0 -189 -133.5 -322t-321.5 -133l-437 -319q-12 -129 -109 -218t-229 -89 q-121 0 -214 76t-118 192l-230 92v429l389 -157q79 48 173 48q13 0 35 -2l284 407q2 187 135.5 319t320.5 132q188 0 321.5 -133.5t133.5 -321.5z" />
|
435 |
-
<glyph unicode="" d="M1242 889q0 80 -57 136.5t-137 56.5t-136.5 -57t-56.5 -136q0 -80 56.5 -136.5t136.5 -56.5t137 56.5t57 136.5zM632 301q0 -83 -58 -140.5t-140 -57.5q-56 0 -103 29t-72 77q52 -20 98 -40q60 -24 120 1.5t85 86.5q24 60 -1.5 120t-86.5 84l-82 33q22 5 42 5 q82 0 140 -57.5t58 -140.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v153l172 -69q20 -92 93.5 -152t168.5 -60q104 0 181 70t87 173l345 252q150 0 255.5 105.5t105.5 254.5q0 150 -105.5 255.5t-255.5 105.5 q-148 0 -253 -104.5t-107 -252.5l-225 -322q-9 1 -28 1q-75 0 -137 -37l-297 119v468q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5zM1289 887q0 -100 -71 -170.5t-171 -70.5t-170.5 70.5t-70.5 170.5t70.5 171t170.5 71q101 0 171.5 -70.5t70.5 -171.5z " />
|
436 |
-
<glyph unicode="" horiz-adv-x="1792" d="M836 367l-15 -368l-2 -22l-420 29q-36 3 -67 31.5t-47 65.5q-11 27 -14.5 55t4 65t12 55t21.5 64t19 53q78 -12 509 -28zM449 953l180 -379l-147 92q-63 -72 -111.5 -144.5t-72.5 -125t-39.5 -94.5t-18.5 -63l-4 -21l-190 357q-17 26 -18 56t6 47l8 18q35 63 114 188 l-140 86zM1680 436l-188 -359q-12 -29 -36.5 -46.5t-43.5 -20.5l-18 -4q-71 -7 -219 -12l8 -164l-230 367l211 362l7 -173q170 -16 283 -5t170 33zM895 1360q-47 -63 -265 -435l-317 187l-19 12l225 356q20 31 60 45t80 10q24 -2 48.5 -12t42 -21t41.5 -33t36 -34.5 t36 -39.5t32 -35zM1550 1053l212 -363q18 -37 12.5 -76t-27.5 -74q-13 -20 -33 -37t-38 -28t-48.5 -22t-47 -16t-51.5 -14t-46 -12q-34 72 -265 436l313 195zM1407 1279l142 83l-220 -373l-419 20l151 86q-34 89 -75 166t-75.5 123.5t-64.5 80t-47 46.5l-17 13l405 -1 q31 3 58 -10.5t39 -28.5l11 -15q39 -61 112 -190z" />
|
437 |
-
<glyph unicode="" horiz-adv-x="2048" d="M480 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM516 768h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5zM1888 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM2048 544v-384 q0 -14 -9 -23t-23 -9h-96v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-1024v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5t179 63.5h768q98 0 179 -63.5t104 -157.5 l105 -419h28q93 0 158.5 -65.5t65.5 -158.5z" />
|
438 |
-
<glyph unicode="" horiz-adv-x="2048" d="M1824 640q93 0 158.5 -65.5t65.5 -158.5v-384q0 -14 -9 -23t-23 -9h-96v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-1024v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5 t179 63.5h128v224q0 14 9 23t23 9h448q14 0 23 -9t9 -23v-224h128q98 0 179 -63.5t104 -157.5l105 -419h28zM320 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47zM516 640h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5z M1728 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47z" />
|
439 |
-
<glyph unicode="" d="M1504 64q0 -26 -19 -45t-45 -19h-462q1 -17 6 -87.5t5 -108.5q0 -25 -18 -42.5t-43 -17.5h-320q-25 0 -43 17.5t-18 42.5q0 38 5 108.5t6 87.5h-462q-26 0 -45 19t-19 45t19 45l402 403h-229q-26 0 -45 19t-19 45t19 45l402 403h-197q-26 0 -45 19t-19 45t19 45l384 384 q19 19 45 19t45 -19l384 -384q19 -19 19 -45t-19 -45t-45 -19h-197l402 -403q19 -19 19 -45t-19 -45t-45 -19h-229l402 -403q19 -19 19 -45z" />
|
440 |
-
<glyph unicode="" d="M1127 326q0 32 -30 51q-193 115 -447 115q-133 0 -287 -34q-42 -9 -42 -52q0 -20 13.5 -34.5t35.5 -14.5q5 0 37 8q132 27 243 27q226 0 397 -103q19 -11 33 -11q19 0 33 13.5t14 34.5zM1223 541q0 40 -35 61q-237 141 -548 141q-153 0 -303 -42q-48 -13 -48 -64 q0 -25 17.5 -42.5t42.5 -17.5q7 0 37 8q122 33 251 33q279 0 488 -124q24 -13 38 -13q25 0 42.5 17.5t17.5 42.5zM1331 789q0 47 -40 70q-126 73 -293 110.5t-343 37.5q-204 0 -364 -47q-23 -7 -38.5 -25.5t-15.5 -48.5q0 -31 20.5 -52t51.5 -21q11 0 40 8q133 37 307 37 q159 0 309.5 -34t253.5 -95q21 -12 40 -12q29 0 50.5 20.5t21.5 51.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" />
|
441 |
-
<glyph unicode="" horiz-adv-x="1024" d="M1024 1233l-303 -582l24 -31h279v-415h-507l-44 -30l-142 -273l-30 -30h-301v303l303 583l-24 30h-279v415h507l44 30l142 273l30 30h301v-303z" />
|
442 |
-
<glyph unicode="" horiz-adv-x="2304" d="M784 164l16 241l-16 523q-1 10 -7.5 17t-16.5 7q-9 0 -16 -7t-7 -17l-14 -523l14 -241q1 -10 7.5 -16.5t15.5 -6.5q22 0 24 23zM1080 193l11 211l-12 586q0 16 -13 24q-8 5 -16 5t-16 -5q-13 -8 -13 -24l-1 -6l-10 -579q0 -1 11 -236v-1q0 -10 6 -17q9 -11 23 -11 q11 0 20 9q9 7 9 20zM35 533l20 -128l-20 -126q-2 -9 -9 -9t-9 9l-17 126l17 128q2 9 9 9t9 -9zM121 612l26 -207l-26 -203q-2 -9 -10 -9q-9 0 -9 10l-23 202l23 207q0 9 9 9q8 0 10 -9zM401 159zM213 650l25 -245l-25 -237q0 -11 -11 -11q-10 0 -12 11l-21 237l21 245 q2 12 12 12q11 0 11 -12zM307 657l23 -252l-23 -244q-2 -13 -14 -13q-13 0 -13 13l-21 244l21 252q0 13 13 13q12 0 14 -13zM401 639l21 -234l-21 -246q-2 -16 -16 -16q-6 0 -10.5 4.5t-4.5 11.5l-20 246l20 234q0 6 4.5 10.5t10.5 4.5q14 0 16 -15zM784 164zM495 785 l21 -380l-21 -246q0 -7 -5 -12.5t-12 -5.5q-16 0 -18 18l-18 246l18 380q2 18 18 18q7 0 12 -5.5t5 -12.5zM589 871l19 -468l-19 -244q0 -8 -5.5 -13.5t-13.5 -5.5q-18 0 -20 19l-16 244l16 468q2 19 20 19q8 0 13.5 -5.5t5.5 -13.5zM687 911l18 -506l-18 -242 q-2 -21 -22 -21q-19 0 -21 21l-16 242l16 506q0 9 6.5 15.5t14.5 6.5q9 0 15 -6.5t7 -15.5zM1079 169v0v0zM881 915l15 -510l-15 -239q0 -10 -7.5 -17.5t-17.5 -7.5t-17 7t-8 18l-14 239l14 510q0 11 7.5 18t17.5 7t17.5 -7t7.5 -18zM980 896l14 -492l-14 -236q0 -11 -8 -19 t-19 -8t-19 8t-9 19l-12 236l12 492q1 12 9 20t19 8t18.5 -8t8.5 -20zM1192 404l-14 -231v0q0 -13 -9 -22t-22 -9t-22 9t-10 22l-6 114l-6 117l12 636v3q2 15 12 24q9 7 20 7q8 0 15 -5q14 -8 16 -26zM2304 423q0 -117 -83 -199.5t-200 -82.5h-786q-13 2 -22 11t-9 22v899 q0 23 28 33q85 34 181 34q195 0 338 -131.5t160 -323.5q53 22 110 22q117 0 200 -83t83 -201z" />
|
443 |
-
<glyph unicode="" d="M768 768q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 0q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127 t443 -43zM768 384q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 1536q208 0 385 -34.5t280 -93.5t103 -128v-128q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5 t-103 128v128q0 69 103 128t280 93.5t385 34.5z" />
|
444 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M894 465q33 -26 84 -56q59 7 117 7q147 0 177 -49q16 -22 2 -52q0 -1 -1 -2l-2 -2v-1q-6 -38 -71 -38q-48 0 -115 20t-130 53q-221 -24 -392 -83q-153 -262 -242 -262q-15 0 -28 7l-24 12q-1 1 -6 5q-10 10 -6 36q9 40 56 91.5t132 96.5q14 9 23 -6q2 -2 2 -4q52 85 107 197 q68 136 104 262q-24 82 -30.5 159.5t6.5 127.5q11 40 42 40h21h1q23 0 35 -15q18 -21 9 -68q-2 -6 -4 -8q1 -3 1 -8v-30q-2 -123 -14 -192q55 -164 146 -238zM318 54q52 24 137 158q-51 -40 -87.5 -84t-49.5 -74zM716 974q-15 -42 -2 -132q1 7 7 44q0 3 7 43q1 4 4 8 q-1 1 -1 2t-0.5 1.5t-0.5 1.5q-1 22 -13 36q0 -1 -1 -2v-2zM592 313q135 54 284 81q-2 1 -13 9.5t-16 13.5q-76 67 -127 176q-27 -86 -83 -197q-30 -56 -45 -83zM1238 329q-24 24 -140 24q76 -28 124 -28q14 0 18 1q0 1 -2 3z" />
|
445 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M233 768v-107h70l164 -661h159l128 485q7 20 10 46q2 16 2 24h4l3 -24q1 -3 3.5 -20t5.5 -26l128 -485h159l164 661h70v107h-300v-107h90l-99 -438q-5 -20 -7 -46l-2 -21h-4l-3 21q-1 5 -4 21t-5 25l-144 545h-114l-144 -545q-2 -9 -4.5 -24.5t-3.5 -21.5l-4 -21h-4l-2 21 q-2 26 -7 46l-99 438h90v107h-300z" />
|
446 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M429 106v-106h281v106h-75l103 161q5 7 10 16.5t7.5 13.5t3.5 4h2q1 -4 5 -10q2 -4 4.5 -7.5t6 -8t6.5 -8.5l107 -161h-76v-106h291v106h-68l-192 273l195 282h67v107h-279v-107h74l-103 -159q-4 -7 -10 -16.5t-9 -13.5l-2 -3h-2q-1 4 -5 10q-6 11 -17 23l-106 159h76v107 h-290v-107h68l189 -272l-194 -283h-68z" />
|
447 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M416 106v-106h327v106h-93v167h137q76 0 118 15q67 23 106.5 87t39.5 146q0 81 -37 141t-100 87q-48 19 -130 19h-368v-107h92v-555h-92zM769 386h-119v268h120q52 0 83 -18q56 -33 56 -115q0 -89 -62 -120q-31 -15 -78 -15z" />
|
448 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M1280 320v-320h-1024v192l192 192l128 -128l384 384zM448 512q-80 0 -136 56t-56 136t56 136t136 56t136 -56t56 -136t-56 -136t-136 -56z" />
|
449 |
-
<glyph unicode="" d="M640 1152v128h-128v-128h128zM768 1024v128h-128v-128h128zM640 896v128h-128v-128h128zM768 768v128h-128v-128h128zM1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400 v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-128v-128h-128v128h-512v-1536h1280zM781 593l107 -349q8 -27 8 -52q0 -83 -72.5 -137.5t-183.5 -54.5t-183.5 54.5t-72.5 137.5q0 25 8 52q21 63 120 396v128h128v-128h79 q22 0 39 -13t23 -34zM640 128q53 0 90.5 19t37.5 45t-37.5 45t-90.5 19t-90.5 -19t-37.5 -45t37.5 -45t90.5 -19z" />
|
450 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M620 686q20 -8 20 -30v-544q0 -22 -20 -30q-8 -2 -12 -2q-12 0 -23 9l-166 167h-131q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h131l166 167q16 15 35 7zM1037 -3q31 0 50 24q129 159 129 363t-129 363q-16 21 -43 24t-47 -14q-21 -17 -23.5 -43.5t14.5 -47.5 q100 -123 100 -282t-100 -282q-17 -21 -14.5 -47.5t23.5 -42.5q18 -15 40 -15zM826 145q27 0 47 20q87 93 87 219t-87 219q-18 19 -45 20t-46 -17t-20 -44.5t18 -46.5q52 -57 52 -131t-52 -131q-19 -20 -18 -46.5t20 -44.5q20 -17 44 -17z" />
|
451 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M768 768q52 0 90 -38t38 -90v-384q0 -52 -38 -90t-90 -38h-384q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h384zM1260 766q20 -8 20 -30v-576q0 -22 -20 -30q-8 -2 -12 -2q-14 0 -23 9l-265 266v90l265 266q9 9 23 9q4 0 12 -2z" />
|
452 |
-
<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M480 768q8 11 21 12.5t24 -6.5l51 -38q11 -8 12.5 -21t-6.5 -24l-182 -243l182 -243q8 -11 6.5 -24t-12.5 -21l-51 -38q-11 -8 -24 -6.5t-21 12.5l-226 301q-14 19 0 38zM1282 467q14 -19 0 -38l-226 -301q-8 -11 -21 -12.5t-24 6.5l-51 38q-11 8 -12.5 21t6.5 24l182 243 l-182 243q-8 11 -6.5 24t12.5 21l51 38q11 8 24 6.5t21 -12.5zM662 6q-13 2 -20.5 13t-5.5 24l138 831q2 13 13 20.5t24 5.5l63 -10q13 -2 20.5 -13t5.5 -24l-138 -831q-2 -13 -13 -20.5t-24 -5.5z" />
|
453 |
-
<glyph unicode="" d="M1497 709v-198q-101 -23 -198 -23q-65 -136 -165.5 -271t-181.5 -215.5t-128 -106.5q-80 -45 -162 3q-28 17 -60.5 43.5t-85 83.5t-102.5 128.5t-107.5 184t-105.5 244t-91.5 314.5t-70.5 390h283q26 -218 70 -398.5t104.5 -317t121.5 -235.5t140 -195q169 169 287 406 q-142 72 -223 220t-81 333q0 192 104 314.5t284 122.5q178 0 273 -105.5t95 -297.5q0 -159 -58 -286q-7 -1 -19.5 -3t-46 -2t-63 6t-62 25.5t-50.5 51.5q31 103 31 184q0 87 -29 132t-79 45q-53 0 -85 -49.5t-32 -140.5q0 -186 105 -293.5t267 -107.5q62 0 121 14z" />
|
454 |
-
<glyph unicode="" horiz-adv-x="1792" d="M216 367l603 -402v359l-334 223zM154 511l193 129l-193 129v-258zM973 -35l603 402l-269 180l-334 -223v-359zM896 458l272 182l-272 182l-272 -182zM485 733l334 223v359l-603 -402zM1445 640l193 -129v258zM1307 733l269 180l-603 402v-359zM1792 913v-546 q0 -41 -34 -64l-819 -546q-21 -13 -43 -13t-43 13l-819 546q-34 23 -34 64v546q0 41 34 64l819 546q21 13 43 13t43 -13l819 -546q34 -23 34 -64z" />
|
455 |
-
<glyph unicode="" horiz-adv-x="2048" d="M1800 764q111 -46 179.5 -145.5t68.5 -221.5q0 -164 -118 -280.5t-285 -116.5q-4 0 -11.5 0.5t-10.5 0.5h-1209h-1h-2h-5q-170 10 -288 125.5t-118 280.5q0 110 55 203t147 147q-12 39 -12 82q0 115 82 196t199 81q95 0 172 -58q75 154 222.5 248t326.5 94 q166 0 306 -80.5t221.5 -218.5t81.5 -301q0 -6 -0.5 -18t-0.5 -18zM468 498q0 -122 84 -193t208 -71q137 0 240 99q-16 20 -47.5 56.5t-43.5 50.5q-67 -65 -144 -65q-55 0 -93.5 33.5t-38.5 87.5q0 53 38.5 87t91.5 34q44 0 84.5 -21t73 -55t65 -75t69 -82t77 -75t97 -55 t121.5 -21q121 0 204.5 71.5t83.5 190.5q0 121 -84 192t-207 71q-143 0 -241 -97q14 -16 29.5 -34t34.5 -40t29 -34q66 64 142 64q52 0 92 -33t40 -84q0 -57 -37 -91.5t-94 -34.5q-43 0 -82.5 21t-72 55t-65.5 75t-69.5 82t-77.5 75t-96.5 55t-118.5 21q-122 0 -207 -70.5 t-85 -189.5z" />
|
456 |
-
<glyph unicode="" horiz-adv-x="1792" d="M896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 1408q-190 0 -361 -90l194 -194q82 28 167 28t167 -28l194 194q-171 90 -361 90zM218 279l194 194 q-28 82 -28 167t28 167l-194 194q-90 -171 -90 -361t90 -361zM896 -128q190 0 361 90l-194 194q-82 -28 -167 -28t-167 28l-194 -194q171 -90 361 -90zM896 256q159 0 271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5 t271.5 -112.5zM1380 473l194 -194q90 171 90 361t-90 361l-194 -194q28 -82 28 -167t-28 -167z" />
|
457 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1760 640q0 -176 -68.5 -336t-184 -275.5t-275.5 -184t-336 -68.5t-336 68.5t-275.5 184t-184 275.5t-68.5 336q0 213 97 398.5t265 305.5t374 151v-228q-221 -45 -366.5 -221t-145.5 -406q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5 t136.5 204t51 248.5q0 230 -145.5 406t-366.5 221v228q206 -31 374 -151t265 -305.5t97 -398.5z" />
|
458 |
-
<glyph unicode="" horiz-adv-x="1792" d="M19 662q8 217 116 406t305 318h5q0 -1 -1 -3q-8 -8 -28 -33.5t-52 -76.5t-60 -110.5t-44.5 -135.5t-14 -150.5t39 -157.5t108.5 -154q50 -50 102 -69.5t90.5 -11.5t69.5 23.5t47 32.5l16 16q39 51 53 116.5t6.5 122.5t-21 107t-26.5 80l-14 29q-10 25 -30.5 49.5t-43 41 t-43.5 29.5t-35 19l-13 6l104 115q39 -17 78 -52t59 -61l19 -27q1 48 -18.5 103.5t-40.5 87.5l-20 31l161 183l160 -181q-33 -46 -52.5 -102.5t-22.5 -90.5l-4 -33q22 37 61.5 72.5t67.5 52.5l28 17l103 -115q-44 -14 -85 -50t-60 -65l-19 -29q-31 -56 -48 -133.5t-7 -170 t57 -156.5q33 -45 77.5 -60.5t85 -5.5t76 26.5t57.5 33.5l21 16q60 53 96.5 115t48.5 121.5t10 121.5t-18 118t-37 107.5t-45.5 93t-45 72t-34.5 47.5l-13 17q-14 13 -7 13l10 -3q40 -29 62.5 -46t62 -50t64 -58t58.5 -65t55.5 -77t45.5 -88t38 -103t23.5 -117t10.5 -136 q3 -259 -108 -465t-312 -321t-456 -115q-185 0 -351 74t-283.5 198t-184 293t-60.5 353z" />
|
459 |
-
<glyph unicode="" horiz-adv-x="1792" d="M874 -102v-66q-208 6 -385 109.5t-283 275.5l58 34q29 -49 73 -99l65 57q148 -168 368 -212l-17 -86q65 -12 121 -13zM276 428l-83 -28q22 -60 49 -112l-57 -33q-98 180 -98 385t98 385l57 -33q-30 -56 -49 -112l82 -28q-35 -100 -35 -212q0 -109 36 -212zM1528 251 l58 -34q-106 -172 -283 -275.5t-385 -109.5v66q56 1 121 13l-17 86q220 44 368 212l65 -57q44 50 73 99zM1377 805l-233 -80q14 -42 14 -85t-14 -85l232 -80q-31 -92 -98 -169l-185 162q-57 -67 -147 -85l48 -241q-52 -10 -98 -10t-98 10l48 241q-90 18 -147 85l-185 -162 q-67 77 -98 169l232 80q-14 42 -14 85t14 85l-233 80q33 93 99 169l185 -162q59 68 147 86l-48 240q44 10 98 10t98 -10l-48 -240q88 -18 147 -86l185 162q66 -76 99 -169zM874 1448v-66q-65 -2 -121 -13l17 -86q-220 -42 -368 -211l-65 56q-38 -42 -73 -98l-57 33 q106 172 282 275.5t385 109.5zM1705 640q0 -205 -98 -385l-57 33q27 52 49 112l-83 28q36 103 36 212q0 112 -35 212l82 28q-19 56 -49 112l57 33q98 -180 98 -385zM1585 1063l-57 -33q-35 56 -73 98l-65 -56q-148 169 -368 211l17 86q-56 11 -121 13v66q209 -6 385 -109.5 t282 -275.5zM1748 640q0 173 -67.5 331t-181.5 272t-272 181.5t-331 67.5t-331 -67.5t-272 -181.5t-181.5 -272t-67.5 -331t67.5 -331t181.5 -272t272 -181.5t331 -67.5t331 67.5t272 181.5t181.5 272t67.5 331zM1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71 t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
|
460 |
-
<glyph unicode="" d="M582 228q0 -66 -93 -66q-107 0 -107 63q0 64 98 64q102 0 102 -61zM546 694q0 -85 -74 -85q-77 0 -77 84q0 90 77 90q36 0 55 -25.5t19 -63.5zM712 769v125q-78 -29 -135 -29q-50 29 -110 29q-86 0 -145 -57t-59 -143q0 -50 29.5 -102t73.5 -67v-3q-38 -17 -38 -85 q0 -53 41 -77v-3q-113 -37 -113 -139q0 -45 20 -78.5t54 -51t72 -25.5t81 -8q224 0 224 188q0 67 -48 99t-126 46q-27 5 -51.5 20.5t-24.5 39.5q0 44 49 52q77 15 122 70t45 134q0 24 -10 52q37 9 49 13zM771 350h137q-2 27 -2 82v387q0 46 2 69h-137q3 -23 3 -71v-392 q0 -50 -3 -75zM1280 366v121q-30 -21 -68 -21q-53 0 -53 82v225h52q9 0 26.5 -1t26.5 -1v117h-105q0 82 3 102h-140q4 -24 4 -55v-47h-60v-117q36 3 37 3q3 0 11 -0.5t12 -0.5v-2h-2v-217q0 -37 2.5 -64t11.5 -56.5t24.5 -48.5t43.5 -31t66 -12q64 0 108 24zM924 1072 q0 36 -24 63.5t-60 27.5t-60.5 -27t-24.5 -64q0 -36 25 -62.5t60 -26.5t59.5 27t24.5 62zM1536 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" />
|
461 |
-
<glyph unicode="" horiz-adv-x="1792" d="M595 22q0 100 -165 100q-158 0 -158 -104q0 -101 172 -101q151 0 151 105zM536 777q0 61 -30 102t-89 41q-124 0 -124 -145q0 -135 124 -135q119 0 119 137zM805 1101v-202q-36 -12 -79 -22q16 -43 16 -84q0 -127 -73 -216.5t-197 -112.5q-40 -8 -59.5 -27t-19.5 -58 q0 -31 22.5 -51.5t58 -32t78.5 -22t86 -25.5t78.5 -37.5t58 -64t22.5 -98.5q0 -304 -363 -304q-69 0 -130 12.5t-116 41t-87.5 82t-32.5 127.5q0 165 182 225v4q-67 41 -67 126q0 109 63 137v4q-72 24 -119.5 108.5t-47.5 165.5q0 139 95 231.5t235 92.5q96 0 178 -47 q98 0 218 47zM1123 220h-222q4 45 4 134v609q0 94 -4 128h222q-4 -33 -4 -124v-613q0 -89 4 -134zM1724 442v-196q-71 -39 -174 -39q-62 0 -107 20t-70 50t-39.5 78t-18.5 92t-4 103v351h2v4q-7 0 -19 1t-18 1q-21 0 -59 -6v190h96v76q0 54 -6 89h227q-6 -41 -6 -165h171 v-190q-15 0 -43.5 2t-42.5 2h-85v-365q0 -131 87 -131q61 0 109 33zM1148 1389q0 -58 -39 -101.5t-96 -43.5q-58 0 -98 43.5t-40 101.5q0 59 39.5 103t98.5 44q58 0 96.5 -44.5t38.5 -102.5z" />
|
462 |
-
<glyph unicode="" d="M809 532l266 499h-112l-157 -312q-24 -48 -44 -92l-42 92l-155 312h-120l263 -493v-324h101v318zM1536 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" />
|
463 |
-
<glyph unicode="" horiz-adv-x="1280" d="M842 964q0 -80 -57 -136.5t-136 -56.5q-60 0 -111 35q-62 -67 -115 -146q-247 -371 -202 -859q1 -22 -12.5 -38.5t-34.5 -18.5h-5q-20 0 -35 13.5t-17 33.5q-14 126 -3.5 247.5t29.5 217t54 186t69 155.5t74 125q61 90 132 165q-16 35 -16 77q0 80 56.5 136.5t136.5 56.5 t136.5 -56.5t56.5 -136.5zM1223 953q0 -158 -78 -292t-212.5 -212t-292.5 -78q-64 0 -131 14q-21 5 -32.5 23.5t-6.5 39.5q5 20 23 31.5t39 7.5q51 -13 108 -13q97 0 186 38t153 102t102 153t38 186t-38 186t-102 153t-153 102t-186 38t-186 -38t-153 -102t-102 -153 t-38 -186q0 -114 52 -218q10 -20 3.5 -40t-25.5 -30t-39.5 -3t-30.5 26q-64 123 -64 265q0 119 46.5 227t124.5 186t186 124t226 46q158 0 292.5 -78t212.5 -212.5t78 -292.5z" />
|
464 |
-
<glyph unicode="" horiz-adv-x="1792" d="M270 730q-8 19 -8 52q0 20 11 49t24 45q-1 22 7.5 53t22.5 43q0 139 92.5 288.5t217.5 209.5q139 66 324 66q133 0 266 -55q49 -21 90 -48t71 -56t55 -68t42 -74t32.5 -84.5t25.5 -89.5t22 -98l1 -5q55 -83 55 -150q0 -14 -9 -40t-9 -38q0 -1 1.5 -3.5t3.5 -5t2 -3.5 q77 -114 120.5 -214.5t43.5 -208.5q0 -43 -19.5 -100t-55.5 -57q-9 0 -19.5 7.5t-19 17.5t-19 26t-16 26.5t-13.5 26t-9 17.5q-1 1 -3 1l-5 -4q-59 -154 -132 -223q20 -20 61.5 -38.5t69 -41.5t35.5 -65q-2 -4 -4 -16t-7 -18q-64 -97 -302 -97q-53 0 -110.5 9t-98 20 t-104.5 30q-15 5 -23 7q-14 4 -46 4.5t-40 1.5q-41 -45 -127.5 -65t-168.5 -20q-35 0 -69 1.5t-93 9t-101 20.5t-74.5 40t-32.5 64q0 40 10 59.5t41 48.5q11 2 40.5 13t49.5 12q4 0 14 2q2 2 2 4l-2 3q-48 11 -108 105.5t-73 156.5l-5 3q-4 0 -12 -20q-18 -41 -54.5 -74.5 t-77.5 -37.5h-1q-4 0 -6 4.5t-5 5.5q-23 54 -23 100q0 275 252 466z" />
|
465 |
-
<glyph unicode="" horiz-adv-x="2048" d="M580 1075q0 41 -25 66t-66 25q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 66 24.5t25 65.5zM1323 568q0 28 -25.5 50t-65.5 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q40 0 65.5 22t25.5 51zM1087 1075q0 41 -24.5 66t-65.5 25 q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 65.5 24.5t24.5 65.5zM1722 568q0 28 -26 50t-65 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q39 0 65 22t26 51zM1456 965q-31 4 -70 4q-169 0 -311 -77t-223.5 -208.5t-81.5 -287.5 q0 -78 23 -152q-35 -3 -68 -3q-26 0 -50 1.5t-55 6.5t-44.5 7t-54.5 10.5t-50 10.5l-253 -127l72 218q-290 203 -290 490q0 169 97.5 311t264 223.5t363.5 81.5q176 0 332.5 -66t262 -182.5t136.5 -260.5zM2048 404q0 -117 -68.5 -223.5t-185.5 -193.5l55 -181l-199 109 q-150 -37 -218 -37q-169 0 -311 70.5t-223.5 191.5t-81.5 264t81.5 264t223.5 191.5t311 70.5q161 0 303 -70.5t227.5 -192t85.5 -263.5z" />
|
466 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-453 185l-242 -295q-18 -23 -49 -23q-13 0 -22 4q-19 7 -30.5 23.5t-11.5 36.5v349l864 1059l-1069 -925l-395 162q-37 14 -40 55q-2 40 32 59l1664 960q15 9 32 9q20 0 36 -11z" />
|
467 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-527 215l-298 -327q-18 -21 -47 -21q-14 0 -23 4q-19 7 -30 23.5t-11 36.5v452l-472 193q-37 14 -40 55q-3 39 32 59l1664 960q35 21 68 -2zM1422 26l221 1323l-1434 -827l336 -137 l863 639l-478 -797z" />
|
468 |
-
<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 -298zM896 928v-448q0 -14 -9 -23 t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23z" />
|
469 |
-
<glyph unicode="" d="M768 1280q-130 0 -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.5t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 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" />
|
470 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1682 -128q-44 0 -132.5 3.5t-133.5 3.5q-44 0 -132 -3.5t-132 -3.5q-24 0 -37 20.5t-13 45.5q0 31 17 46t39 17t51 7t45 15q33 21 33 140l-1 391q0 21 -1 31q-13 4 -50 4h-675q-38 0 -51 -4q-1 -10 -1 -31l-1 -371q0 -142 37 -164q16 -10 48 -13t57 -3.5t45 -15 t20 -45.5q0 -26 -12.5 -48t-36.5 -22q-47 0 -139.5 3.5t-138.5 3.5q-43 0 -128 -3.5t-127 -3.5q-23 0 -35.5 21t-12.5 45q0 30 15.5 45t36 17.5t47.5 7.5t42 15q33 23 33 143l-1 57v813q0 3 0.5 26t0 36.5t-1.5 38.5t-3.5 42t-6.5 36.5t-11 31.5t-16 18q-15 10 -45 12t-53 2 t-41 14t-18 45q0 26 12 48t36 22q46 0 138.5 -3.5t138.5 -3.5q42 0 126.5 3.5t126.5 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17 -43.5t-38.5 -14.5t-49.5 -4t-43 -13q-35 -21 -35 -160l1 -320q0 -21 1 -32q13 -3 39 -3h699q25 0 38 3q1 11 1 32l1 320q0 139 -35 160 q-18 11 -58.5 12.5t-66 13t-25.5 49.5q0 26 12.5 48t37.5 22q44 0 132 -3.5t132 -3.5q43 0 129 3.5t129 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17.5 -44t-40 -14.5t-51.5 -3t-44 -12.5q-35 -23 -35 -161l1 -943q0 -119 34 -140q16 -10 46 -13.5t53.5 -4.5t41.5 -15.5t18 -44.5 q0 -26 -12 -48t-36 -22z" />
|
471 |
-
<glyph unicode="" horiz-adv-x="1280" d="M1278 1347v-73q0 -29 -18.5 -61t-42.5 -32q-50 0 -54 -1q-26 -6 -32 -31q-3 -11 -3 -64v-1152q0 -25 -18 -43t-43 -18h-108q-25 0 -43 18t-18 43v1218h-143v-1218q0 -25 -17.5 -43t-43.5 -18h-108q-26 0 -43.5 18t-17.5 43v496q-147 12 -245 59q-126 58 -192 179 q-64 117 -64 259q0 166 88 286q88 118 209 159q111 37 417 37h479q25 0 43 -18t18 -43z" />
|
472 |
-
<glyph unicode="" d="M352 128v-128h-352v128h352zM704 256q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM864 640v-128h-864v128h864zM224 1152v-128h-224v128h224zM1536 128v-128h-736v128h736zM576 1280q26 0 45 -19t19 -45v-256 q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1216 768q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1536 640v-128h-224v128h224zM1536 1152v-128h-864v128h864z" />
|
473 |
-
<glyph unicode="" d="M1216 512q133 0 226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5t-226.5 93.5t-93.5 226.5q0 12 2 34l-360 180q-92 -86 -218 -86q-133 0 -226.5 93.5t-93.5 226.5t93.5 226.5t226.5 93.5q126 0 218 -86l360 180q-2 22 -2 34q0 133 93.5 226.5t226.5 93.5 t226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5q-126 0 -218 86l-360 -180q2 -22 2 -34t-2 -34l360 -180q92 86 218 86z" />
|
474 |
-
<glyph unicode="" d="M1280 341q0 88 -62.5 151t-150.5 63q-84 0 -145 -58l-241 120q2 16 2 23t-2 23l241 120q61 -58 145 -58q88 0 150.5 63t62.5 151t-62.5 150.5t-150.5 62.5t-151 -62.5t-63 -150.5q0 -7 2 -23l-241 -120q-62 57 -145 57q-88 0 -150.5 -62.5t-62.5 -150.5t62.5 -150.5 t150.5 -62.5q83 0 145 57l241 -120q-2 -16 -2 -23q0 -88 63 -150.5t151 -62.5t150.5 62.5t62.5 150.5zM1536 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" />
|
475 |
-
<glyph unicode="" horiz-adv-x="1792" d="M571 947q-10 25 -34 35t-49 0q-108 -44 -191 -127t-127 -191q-10 -25 0 -49t35 -34q13 -5 24 -5q42 0 60 40q34 84 98.5 148.5t148.5 98.5q25 11 35 35t0 49zM1513 1303l46 -46l-244 -243l68 -68q19 -19 19 -45.5t-19 -45.5l-64 -64q89 -161 89 -343q0 -143 -55.5 -273.5 t-150 -225t-225 -150t-273.5 -55.5t-273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5q182 0 343 -89l64 64q19 19 45.5 19t45.5 -19l68 -68zM1521 1359q-10 -10 -22 -10q-13 0 -23 10l-91 90q-9 10 -9 23t9 23q10 9 23 9t23 -9l90 -91 q10 -9 10 -22.5t-10 -22.5zM1751 1129q-11 -9 -23 -9t-23 9l-90 91q-10 9 -10 22.5t10 22.5q9 10 22.5 10t22.5 -10l91 -90q9 -10 9 -23t-9 -23zM1792 1312q0 -14 -9 -23t-23 -9h-96q-14 0 -23 9t-9 23t9 23t23 9h96q14 0 23 -9t9 -23zM1600 1504v-96q0 -14 -9 -23t-23 -9 t-23 9t-9 23v96q0 14 9 23t23 9t23 -9t9 -23zM1751 1449l-91 -90q-10 -10 -22 -10q-13 0 -23 10q-10 9 -10 22.5t10 22.5l90 91q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
|
476 |
-
<glyph unicode="" horiz-adv-x="1792" d="M609 720l287 208l287 -208l-109 -336h-355zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM1515 186q149 203 149 454v3l-102 -89l-240 224l63 323 l134 -12q-150 206 -389 282l53 -124l-287 -159l-287 159l53 124q-239 -76 -389 -282l135 12l62 -323l-240 -224l-102 89v-3q0 -251 149 -454l30 132l326 -40l139 -298l-116 -69q117 -39 240 -39t240 39l-116 69l139 298l326 40z" />
|
477 |
-
<glyph unicode="" horiz-adv-x="1792" d="M448 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM256 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM832 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM66 768q-28 0 -47 19t-19 46v129h514v-129q0 -27 -19 -46t-46 -19h-383zM1216 224v-192q0 -14 -9 -23t-23 -9h-192 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1600 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23 zM1408 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1016v-13h-514v10q0 104 -382 102q-382 -1 -382 -102v-10h-514v13q0 17 8.5 43t34 64t65.5 75.5t110.5 76t160 67.5t224 47.5t293.5 18.5t293 -18.5t224 -47.5 t160.5 -67.5t110.5 -76t65.5 -75.5t34 -64t8.5 -43zM1792 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 962v-129q0 -27 -19 -46t-46 -19h-384q-27 0 -46 19t-19 46v129h514z" />
|
478 |
-
<glyph unicode="" horiz-adv-x="1792" d="M704 1216v-768q0 -26 -19 -45t-45 -19v-576q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v512l249 873q7 23 31 23h424zM1024 1216v-704h-256v704h256zM1792 320v-512q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v576q-26 0 -45 19t-19 45v768h424q24 0 31 -23z M736 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23zM1408 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23z" />
|
479 |
-
<glyph unicode="" horiz-adv-x="1792" d="M1755 1083q37 -37 37 -90t-37 -91l-401 -400l150 -150l-160 -160q-163 -163 -389.5 -186.5t-411.5 100.5l-362 -362h-181v181l362 362q-124 185 -100.5 411.5t186.5 389.5l160 160l150 -150l400 401q38 37 91 37t90 -37t37 -90.5t-37 -90.5l-400 -401l234 -234l401 400 q38 37 91 37t90 -37z" />
|
480 |
-
<glyph unicode="" horiz-adv-x="1792" d="M873 796q0 -83 -63.5 -142.5t-152.5 -59.5t-152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59t152.5 -59t63.5 -143zM1375 796q0 -83 -63 -142.5t-153 -59.5q-89 0 -152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59q90 0 153 -59t63 -143zM1600 616v667q0 87 -32 123.5 t-111 36.5h-1112q-83 0 -112.5 -34t-29.5 -126v-673q43 -23 88.5 -40t81 -28t81 -18.5t71 -11t70 -4t58.5 -0.5t56.5 2t44.5 2q68 1 95 -27q6 -6 10 -9q26 -25 61 -51q7 91 118 87q5 0 36.5 -1.5t43 -2t45.5 -1t53 1t54.5 4.5t61 8.5t62 13.5t67 19.5t67.5 27t72 34.5z M1763 621q-121 -149 -372 -252q84 -285 -23 -465q-66 -113 -183 -148q-104 -32 -182 15q-86 51 -82 164l-1 326v1q-8 2 -24.5 6t-23.5 5l-1 -338q4 -114 -83 -164q-79 -47 -183 -15q-117 36 -182 150q-105 180 -22 463q-251 103 -372 252q-25 37 -4 63t60 -1q3 -2 11 -7 t11 -8v694q0 72 47 123t114 51h1257q67 0 114 -51t47 -123v-694l21 15q39 27 60 1t-4 -63z" />
|
481 |
-
<glyph unicode="" horiz-adv-x="1792" d="M896 1102v-434h-145v434h145zM1294 1102v-434h-145v434h145zM1294 342l253 254v795h-1194v-1049h326v-217l217 217h398zM1692 1536v-1013l-434 -434h-326l-217 -217h-217v217h-398v1158l109 289h1483z" />
|
482 |
-
<glyph unicode="" d="M773 217v-127q-1 -292 -6 -305q-12 -32 -51 -40q-54 -9 -181.5 38t-162.5 89q-13 15 -17 36q-1 12 4 26q4 10 34 47t181 216q1 0 60 70q15 19 39.5 24.5t49.5 -3.5q24 -10 37.5 -29t12.5 -42zM624 468q-3 -55 -52 -70l-120 -39q-275 -88 -292 -88q-35 2 -54 36 q-12 25 -17 75q-8 76 1 166.5t30 124.5t56 32q13 0 202 -77q70 -29 115 -47l84 -34q23 -9 35.5 -30.5t11.5 -48.5zM1450 171q-7 -54 -91.5 -161t-135.5 -127q-37 -14 -63 7q-14 10 -184 287l-47 77q-14 21 -11.5 46t19.5 46q35 43 83 26q1 -1 119 -40q203 -66 242 -79.5 t47 -20.5q28 -22 22 -61zM778 803q5 -102 -54 -122q-58 -17 -114 71l-378 598q-8 35 19 62q41 43 207.5 89.5t224.5 31.5q40 -10 49 -45q3 -18 22 -305.5t24 -379.5zM1440 695q3 -39 -26 -59q-15 -10 -329 -86q-67 -15 -91 -23l1 2q-23 -6 -46 4t-37 32q-30 47 0 87 q1 1 75 102q125 171 150 204t34 39q28 19 65 2q48 -23 123 -133.5t81 -167.5v-3z" />
|
483 |
-
<glyph unicode="" horiz-adv-x="2048" d="M1024 1024h-384v-384h384v384zM1152 384v-128h-640v128h640zM1152 1152v-640h-640v640h640zM1792 384v-128h-512v128h512zM1792 640v-128h-512v128h512zM1792 896v-128h-512v128h512zM1792 1152v-128h-512v128h512zM256 192v960h-128v-960q0 -26 19 -45t45 -19t45 19 t19 45zM1920 192v1088h-1536v-1088q0 -33 -11 -64h1483q26 0 45 19t19 45zM2048 1408v-1216q0 -80 -56 -136t-136 -56h-1664q-80 0 -136 56t-56 136v1088h256v128h1792z" />
|
484 |
-
<glyph unicode="" horiz-adv-x="2048" d="M1024 13q-20 0 -93 73.5t-73 93.5q0 32 62.5 54t103.5 22t103.5 -22t62.5 -54q0 -20 -73 -93.5t-93 -73.5zM1294 284q-2 0 -40 25t-101.5 50t-128.5 25t-128.5 -25t-101 -50t-40.5 -25q-18 0 -93.5 75t-75.5 93q0 13 10 23q78 77 196 121t233 44t233 -44t196 -121 q10 -10 10 -23q0 -18 -75.5 -93t-93.5 -75zM1567 556q-11 0 -23 8q-136 105 -252 154.5t-268 49.5q-85 0 -170.5 -22t-149 -53t-113.5 -62t-79 -53t-31 -22q-17 0 -92 75t-75 93q0 12 10 22q132 132 320 205t380 73t380 -73t320 -205q10 -10 10 -22q0 -18 -75 -93t-92 -75z M1838 827q-11 0 -22 9q-179 157 -371.5 236.5t-420.5 79.5t-420.5 -79.5t-371.5 -236.5q-11 -9 -22 -9q-17 0 -92.5 75t-75.5 93q0 13 10 23q187 186 445 288t527 102t527 -102t445 -288q10 -10 10 -23q0 -18 -75.5 -93t-92.5 -75z" />
|
485 |
-
<glyph unicode="" horiz-adv-x="1792" d="M384 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.5zM768 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.5zM384 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.5zM1152 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.5zM768 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.5 t37.5 90.5zM384 768q0 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 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.5zM768 768q0 53 -37.5 90.5t-90.5 37.5 t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1536 0v384q0 52 -38 90t-90 38t-90 -38t-38 -90v-384q0 -52 38 -90t90 -38t90 38t38 90zM1152 768q0 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.5z M1536 1088v256q0 26 -19 45t-45 19h-1280q-26 0 -45 -19t-19 -45v-256q0 -26 19 -45t45 -19h1280q26 0 45 19t19 45zM1536 768q0 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 1408v-1536q0 -52 -38 -90t-90 -38 h-1408q-52 0 -90 38t-38 90v1536q0 52 38 90t90 38h1408q52 0 90 -38t38 -90z" />
|
486 |
-
<glyph unicode="" d="M1519 890q18 -84 -4 -204q-87 -444 -565 -444h-44q-25 0 -44 -16.5t-24 -42.5l-4 -19l-55 -346l-2 -15q-5 -26 -24.5 -42.5t-44.5 -16.5h-251q-21 0 -33 15t-9 36q9 56 26.5 168t26.5 168t27 167.5t27 167.5q5 37 43 37h131q133 -2 236 21q175 39 287 144q102 95 155 246 q24 70 35 133q1 6 2.5 7.5t3.5 1t6 -3.5q79 -59 98 -162zM1347 1172q0 -107 -46 -236q-80 -233 -302 -315q-113 -40 -252 -42q0 -1 -90 -1l-90 1q-100 0 -118 -96q-2 -8 -85 -530q-1 -10 -12 -10h-295q-22 0 -36.5 16.5t-11.5 38.5l232 1471q5 29 27.5 48t51.5 19h598 q34 0 97.5 -13t111.5 -32q107 -41 163.5 -123t56.5 -196z" />
|
487 |
-
<glyph unicode="" horiz-adv-x="1792" d="M441 864q32 0 52 -26q266 -364 362 -774h-446q-127 441 -367 749q-12 16 -3 33.5t29 17.5h373zM1000 507q-49 -199 -125 -393q-79 310 -256 594q40 221 44 449q211 -340 337 -650zM1099 1216q235 -324 384.5 -698.5t184.5 -773.5h-451q-41 665 -553 1472h435zM1792 640 q0 -424 -101 -812q-67 560 -359 1083q-25 301 -106 584q-4 16 5.5 28.5t25.5 12.5h359q21 0 38.5 -13t22.5 -33q115 -409 115 -850z" />
|
488 |
-
<glyph unicode="" horiz-adv-x="2304" d="M1975 546h-138q14 37 66 179l3 9q4 10 10 26t9 26l12 -55zM531 611l-58 295q-11 54 -75 54h-268l-2 -13q311 -79 403 -336zM710 960l-162 -438l-17 89q-26 70 -85 129.5t-131 88.5l135 -510h175l261 641h-176zM849 318h166l104 642h-166zM1617 944q-69 27 -149 27 q-123 0 -201 -59t-79 -153q-1 -102 145 -174q48 -23 67 -41t19 -39q0 -30 -30 -46t-69 -16q-86 0 -156 33l-22 11l-23 -144q74 -34 185 -34q130 -1 208.5 59t80.5 160q0 106 -140 174q-49 25 -71 42t-22 38q0 22 24.5 38.5t70.5 16.5q70 1 124 -24l15 -8zM2042 960h-128 q-65 0 -87 -54l-246 -588h174l35 96h212q5 -22 20 -96h154zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
|
489 |
-
<glyph unicode="" horiz-adv-x="2304" d="M671 603h-13q-47 0 -47 -32q0 -22 20 -22q17 0 28 15t12 39zM1066 639h62v3q1 4 0.5 6.5t-1 7t-2 8t-4.5 6.5t-7.5 5t-11.5 2q-28 0 -36 -38zM1606 603h-12q-48 0 -48 -32q0 -22 20 -22q17 0 28 15t12 39zM1925 629q0 41 -30 41q-19 0 -31 -20t-12 -51q0 -42 28 -42 q20 0 32.5 20t12.5 52zM480 770h87l-44 -262h-56l32 201l-71 -201h-39l-4 200l-34 -200h-53l44 262h81l2 -163zM733 663q0 -6 -4 -42q-16 -101 -17 -113h-47l1 22q-20 -26 -58 -26q-23 0 -37.5 16t-14.5 42q0 39 26 60.5t73 21.5q14 0 23 -1q0 3 0.5 5.5t1 4.5t0.5 3 q0 20 -36 20q-29 0 -59 -10q0 4 7 48q38
|
1 |
<?xml version="1.0" standalone="no"?>
|
2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg>
|
4 |
+
<metadata>
|
5 |
+
Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016
|
6 |
+
By ,,,
|
7 |
+
Copyright Dave Gandy 2016. All rights reserved.
|
8 |
+
</metadata>
|
9 |
<defs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|