Commit fb4f30ff authored by Shohruh Tojiboev's avatar Shohruh Tojiboev

add publick tug components

parents
Pipeline #82 canceled with stages
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$arComponentDescription = array(
"NAME" => GetMessage("COMP_ALV_SETTINGS_TITLE"),
"DESCRIPTION" => GetMessage("COMP_ALV_SETTINGS_DESCR"),
);
?>
\ No newline at end of file
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
use \Bitrix\Main\Config\Option;
if (isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y')
return;
// var_dump($arParams);
// die;
$arResult = $arParams['CHART_DATA'];
if (!(isset($arParams['TEMPLATE_HIDE']) && $arParams['TEMPLATE_HIDE'] == 'Y'))
$this->IncludeComponentTemplate();
return $arResult;
<?
$MESS["COMP_VI_SETTINGS_TITLE"] = "Composite component for telephony configuration";
$MESS["COMP_VI_SETTINGS_DESCR"] = "Composite component for telephony configuration";
?>
\ No newline at end of file
<?
$MESS["COMP_VI_ACCESS_DENIED"] = "Insufficient access permissions";
?>
\ No newline at end of file
<?
$MESS ['COMP_VI_SETTINGS_TITLE'] = "Комплексный компонент настроек телефонии";
$MESS ['COMP_VI_SETTINGS_DESCR'] = "Комплексный компонент настроек телефонии";
?>
\ No newline at end of file
<?php
$MESS['COMP_VI_ACCESS_DENIED'] = "Недостаточно прав доступа";
$MESS['ALV_QUEUE_COLOR_FREE'] = "Свободен";
$MESS['ALV_QUEUE_COLOR_DND'] = "ДНД";
$MESS['ALV_QUEUE_COLOR_INCALL'] = "Входящий звонок";
$MESS['ALV_QUEUE_COLOR_INTALK'] = "Входящий разговор";
$MESS['ALV_QUEUE_COLOR_OUTCALL'] = "Исходящий звонок";
$MESS['ALV_QUEUE_COLOR_OUTTALK'] = "Исходящий разговор";
$MESS['ALV_QUEUE_COLOR_OFFLINE'] = "Отключен";
$MESS['ALV_SIP_SERVER_STATUS'] = "Статус";
$MESS['ALOVOICE_AMI_HOST'] = "Адрес";
$MESS['ALOVOICE_AMI_PORT'] = "Порт";
$MESS['ALOVOICE_AMI_USER'] = "Пользователь";
$MESS['ALOVOICE_AMI_PASSWORD'] = "Пароль";
компонента tug.charts
/**
* '*' - обязательный параметр
**/
принимает
[
'CHART_DATA' => [
'SECTIONS' => [
[
'TITLE' => 'Статистика комманд', // Заголовок секции
'FIELDS' => [] // масиив с графиками
]
]
]
]
_____________________________________
Элемент 'FIELDS'
$FIELDS = [
[
'type' => '' // * тип
]
]
Тип может быть:
-PIE - круговой график
-XY - график ? ?
-SERIAL - график ? ?
-RADAR - график в виде радара
-FUNNEL - график ? ?
-CUSTOMN - пользовательский график
_____________________________________
Тип PIE
[
'TITLE' => '', // Заголовок графика
'TYPE' => 'PIE', // * тип
'DATA' => [ // * Массив с Элементами
[
'TITLE' => '', // Заголовок
'VALUE' => Number, // * значение
]
],
'ID' => '' // id графика
]
_____________________________________
Тип XY
[
'TITLE' => 'Статистика комманд по популярности', // Заголовок графика
'TYPE' => 'XY', // * тип
'DATA' => [ // * Массив с Элементами
[
'TITLE' => '', // Заголовок
'VALUE_X' => Number, // X координата
'VALUE_Y' => Number // Y координата
],
],
'GRAPHS' => [
// Массив с ??
[
'id' => '', // Id
'title' => '', // Заголовок группы
'type' => '', // возмодные типы ( "column" ) (Задан по умолчанию => '')
'bullet' => 'circle', // (Задан по умолчанию => 'circle')
'valueField' => 'TITLE', // ключ к значению в DATA (Задан по умолчанию => 'TITLE')
'xField' => 'VALUE_X', // ключ к значению в DATA (Задан по умолчанию => 'VALUE_X')
'yField' => 'VALUE_Y', // ключ к значению в DATA (Задан по умолчанию => 'VALUE_Y')
'fillAlphas' => 0.5, // полупрозрачность (Задан по умолчанию => 0.5)
'visibleInLegend' => true // (Задан по умолчанию => true)
]
],
'ID' => 'any_id2' // id графика
],
_____________________________________
Тип SERIAL
[
'TITLE' => '', // Заголовок графика
'TYPE' => 'SERIAL', // * тип
'DATA' => [
[
'TITLE' => '', // Заголовок
'VALUE' => 10, // значение
'VALUE2' => 20
]
],
'GRAPHS' => [
[
'id' => '', // Id
'title' => 'GROUP 1', // Заголовок группы
'type' => '', // возмодные типы ( "column" ) (Задан по умолчанию => '')
'valueField' => 'VALUE', // ключ к значению в DATA (Задан по умолчанию => 'VALUE')
'fillAlphas' => 0.5, // полупрозрачность (Задан по умолчанию => 0.5)
'visibleInLegend' => true // (Задан по умолчанию => true)
]
],
'ID' => 'any_id3' // id графика
],
_____________________________________
Тип RADAR
[
'TITLE' => 'Статистика комманд по популярности RADAR', // Заголовок
'TYPE' => 'RADAR', // * тип
'DATA' => [ // Массив с Элементами
[
'TITLE' => 'Command 1', // Заголовок
'VALUE' => 10, // значение
]
],
'GRAPHS' => [ //
[
'id' => 'cmd', // ID
'title' => '', // Заголовок для группы
'type' => 'column', // возмодные типы ( "column" ) (Задан по умолчанию => '')
'fillAlphas' => 0.5,
'visibleInLegend' => true
],
],
'ID' => 'any_id4' // ID
]
_____________________________________
Тип FUNNEL
[
'TITLE' => 'Статистика комманд по популярности FUNNEL', // Заголовок
'TYPE' => 'FUNNEL', // * Заголовок
'DATA' => [
[
'TITLE' => 'Command 1', // Заголовок
'VALUE' => 10, // Заголовок
]
],
'ID' => 'any_id6' // ID
]
/*******************************
***** ПРИМЕР ****
********************************/
[
'CHART_DATA' => [
'SECTIONS' => [
[
'TITLE' => 'Статистика комманд',
'FIELDS' => [
[
'TITLE' => 'Статистика комманды ### по пользователям',
'TYPE' => 'PIE',
'DATA' => [
[
'TITLE' => 'user 1',
'VALUE' => 60,
],
[
'TITLE' => 'user 2',
'VALUE' => 40,
],
],
'ID' => 'any_id'
],
[
'TITLE' => 'Статистика комманд по популярности',
'TYPE' => 'XY',
'DATA' => [
[
'TITLE' => 'Command 1',
'VALUE_Y' => 10,
'VALUE_X' => 20
],
[
'TITLE' => 'command 2',
'VALUE_Y' => 15,
'VALUE_X' => 15
],
[
'TITLE' => 'command 3',
'VALUE_X' => 30,
'VALUE_Y' => '50'
],
],
'GRAPHS' => [
[
'title' => 'Any title'
]
]
'ID' => 'any_id2'
],
[
'TITLE' => 'Статистика комманд по популярности SERIAL',
'TYPE' => 'SERIAL',
'DATA' => [
[
'TITLE' => 'Command 1',
'VALUE' => 10,
],
[
'TITLE' => 'command 2',
'VALUE' => 15,
],
[
'TITLE' => 'command3',
'VALUE' => 30,
],
],
'GRAPHS' => [
[
'title' => 'Any title'
]
],
'ID' => 'any_id3'
],
[
'TITLE' => 'Статистика комманд по популярности RADAR',
'TYPE' => 'RADAR',
'DATA' => [
[
'TITLE' => 'Command 1',
'VALUE' => 10,
],
[
'TITLE' => 'command 2',
'VALUE' => 15,
],
[
'TITLE' => 'command 3',
'VALUE' => 30,
],
],
'GRAPHS' => [
[
'type' => "column",
'title' => 'GROUP 1',
]
],
'ID' => 'any_id4'
],
[
'TITLE' => 'Статистика комманд по популярности FUNNEL',
'TYPE' => 'FUNNEL',
'DATA' => [
[
'TITLE' => 'Command 1',
'VALUE' => 10,
],
[
'TITLE' => 'command 2',
'VALUE' => 15,
],
[
'TITLE' => 'command3',
'VALUE' => 30,
],
],
'ID' => 'any_id6'
],
]
]
]
];
]
\ No newline at end of file
function createChaer() {
}
createChaer.prototype = {
}
\ No newline at end of file
.bot_statistics__gr {
height: 500px;
}
\ No newline at end of file
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
\Bitrix\Main\UI\Extension::load("ui.fonts.opensans");
\Bitrix\Main\UI\Extension::load("ui.forms");
\Bitrix\Main\UI\Extension::load("ui.buttons");
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/shopbot/lang/ru/form.php");
CJSCore::Init(array('amcharts4', 'amcharts4_theme_animated', 'jquery'));
if (!is_array($arResult["SECTIONS"]) || empty($arResult["SECTIONS"]))
{
return;
}
$isBitrix24Template = (SITE_TEMPLATE_ID == "bitrix24");
$defAlphas = 0.5;
?>
<?if($isBitrix24Template):?>
<?
$bodyClass = $APPLICATION->GetPageProperty("BodyClass");
$APPLICATION->SetPageProperty("BodyClass", ($bodyClass ? $bodyClass." " : "")."pagetitle-toolbar-field-view");
$this->SetViewTarget("inside_pagetitle", 0);
?>
<div class="pagetitle-container pagetitle-flexible-space">
<?if(!empty($arResult["PAGETITLE_BUTTONS"])):?>
<div class="pagetitle-container pagetitle-align-right-container">
<?foreach($arResult["PAGETITLE_BUTTONS"] as $tbButton):?>
<button type="button"
class="ui-btn ui-btn-md ui-btn-themes <?=$tbButton['CLASSES'] ?: 'ui-btn-light-border'?>"
<?if($tbButton['ON_CLICK']):?>
onclick="<?=$tbButton['ON_CLICK']?>"
<?endif?>
></button>
<?endforeach?>
</div>
<?endif?>
</div>
<?
$this->EndViewTarget();
?>
<?endif?>
<div>
<div>
<?foreach($arResult["SECTIONS"] as $section):?>
<div>
<?if (!empty($section["TITLE"])):?>
<div class="ui-form-section-title">
<h2><?=$section["TITLE"]?></h2>
</div>
<?endif?>
<?if(is_array($section["FIELDS"]) && !empty($section["FIELDS"])):?>
<?foreach($section["FIELDS"] as $key => $arField):
$fId;
$fHeight = 500;
if(!empty($arField['ID']))
{
$fId = $arField['ID'];
} else
{
$fId = 'chart__'.$key;
}
if(!empty($arResult['height'])) {
$fHeight = $arResult['height'][$fId];
}
?>
<?switch ($arField['TYPE'])
{
case 'PIE':?>
<div>
<div>
<h4>
<?=$arField['TITLE']?>
</h4>
</div>
<div class="bot_statistics__gr" id="<?=$fId?>" style="height: <?=$fHeight?>px"></div>
<script>
BX.ready(function()
{
var divId = "<?=$fId?>";
// Themes begin
am4core.useTheme(am4themes_animated);
// Themes end
<?if($arField['PIE_3D'] === 'Y'):?>
var pie = am4charts.PieChart3D;
var pieSeries = am4charts.PieSeries3D
<?else:?>
var pie = am4charts.PieChart;
var pieSeries = am4charts.PieSeries;
<?endif?>
var chart = am4core.create(divId, pie);
<?if(!empty($arField['PIE_RADIUS'])):?>
// pie radios
chart.innerRadius = am4core.percent(<?=$arField['PIE_RADIUS']?>);
<?endif?>
// Create chart instance
// Add data
chart.data = <?=CUtil::PhpToJSObject($arField['DATA'])?>
<?if(!empty($arField['PIE_SERIOS'])):?>
// Add and configure Series
var pieSeries = chart.series.push(new pieSeries());
pieSeries.dataFields.value = "<?=$arField['PIE_SERIOS']['VALUE'] ?: 'VALUE'?>";
pieSeries.dataFields.category = "<?=$arField['PIE_SERIOS']['TITLE'] ?: 'TITLE'?>";
pieSeries.slices.template.stroke = am4core.color("#fff");
pieSeries.slices.template.strokeOpacity = 1;
<?endif?>
<?if($arField['LEGEND'] === 'Y'):?>
chart.legend = new am4charts.Legend();
<?endif?>
// This creates initial animation
pieSeries.hiddenState.properties.opacity = 1;
pieSeries.hiddenState.properties.endAngle = -90;
pieSeries.hiddenState.properties.startAngle = -90;
chart.hiddenState.properties.radius = am4core.percent(0);
});
</script>
</div>
<?break;
case 'LINE_':?>
<div>
<div>
<h4>
<?=$arField['TITLE']?>
</h4>
</div>
<div class="bot_statistics__gr" id="<?=$fId?>" style="height: <?=$fHeight?>px"></div>
<script>
BX.ready(function()
{
var divId = "<?=$fId?>";
// var chart = function()
// {
// var graphsDefParams = {
// valueField: "VALUE",
// fillAlphas: <?=$defAlphas?>,
// visibleInLegend: true
// };
// var graphsParams = <?=CUtil::PhpToJSObject($arField['GRAPHS'])?>;
// var graphsData = ectendGraph(graphsParams, graphsDefParams, "<?=$fId?>");
// // AmCharts.makeChart("<?=$fId?>",
// // {
// // type: 'serial',
// // theme: "none",
// // categoryField: "TITLE",
// // titleField: 'TITLE',
// // valueAxes: [
// // {
// // title: "<?=$arField['VALUE_AXES']?>",
// // }
// // ],
// // graphs: graphsData,
// // dataProvider: <?=CUtil::PhpToJSObject($arField['DATA'])?>,
// // legend: {
// // markerType: "circle",
// // position: "bottom",
// // marginBottom: 10,
// // autoMargins: false
// // }
// // }
// // );
// }
// AmCharts.isReady ? chart() : AmCharts.ready(chart);
});
</script>
</div>
<?break;
case 'RADAR_':?>
<div>
<div>
<h4>
<?=$arField['TITLE']?>
</h4>
</div>
<div class="bot_statistics__gr" id="<?=$fId?>" style="height: <?=$fHeight?>px"></div>
<script>
BX.ready(function()
{
var graphsDefParams = {
bullet: 'circle',
valueField: "VALUE",
fillAlphas: <?=$defAlphas?>,
visibleInLegend: true
};
var graphsParams = <?=CUtil::PhpToJSObject($arField['GRAPHS'])?>;
var graphsData = ectendGraph(graphsParams, graphsDefParams, "<?=$fId?>");
var chart = function()
{
AmCharts.makeChart("<?=$fId?>",
{
type: "radar",
categoryField: "TITLE",
graphs: graphsData,
dataProvider: <?=CUtil::PhpToJSObject($arField['DATA'])?>,
legend: {
markerType: "circle",
position: "bottom",
marginBottom: 10,
autoMargins: false
}
}
);
}
AmCharts.isReady ? chart() : AmCharts.ready(chart);
});
</script>
</div>
<?break;
case 'XY':?>
<div>
<div>
<h4>
<?=$arField['TITLE']?>
</h4>
</div>
<div class="bot_statistics__gr" id="<?=$fId?>" style="height: <?=$fHeight?>px"></div>
<script>
BX.ready(function()
{
var divId = "<?=$fId?>";
// Themes begin
am4core.useTheme(am4themes_animated);
// Themes end
var chart = am4core.create(divId, am4charts.XYChart);
chart.padding(40, 40, 40, 40);
<?if(!empty($arField['CATEGORY_AXIS'])):?>
var categoryAxis = chart.yAxes.push(new am4charts.CategoryAxis());
categoryAxis.renderer.grid.template.location = 0;
categoryAxis.dataFields.category = "<?=$arField['CATEGORY_AXIS']['TITLE'] ?: 'TITLE'?>";
categoryAxis.renderer.minGridDistance = 1;
categoryAxis.renderer.inversed = true;
categoryAxis.renderer.grid.template.disabled = true;
<?endif?>
<?if(!empty($arField['VALUE_AXIS'])):?>
var valueAxis = chart.xAxes.push(new am4charts.ValueAxis());
valueAxis.min = 0;
<?endif?>
<?if(!empty($arField['COLUMN_SERIES'])):?>
var series = chart.series.push(new am4charts.ColumnSeries());
series.dataFields.categoryY = "<?=$arField['COLUMN_SERIES']['TITLE'] ?: 'TITLE'?>";
series.dataFields.valueX = "<?=$arField['COLUMN_SERIES']['VALUE_X'] ?: 'VALUE'?>";
series.tooltipText = "{valueX.value}"
series.columns.template.strokeOpacity = 0;
series.columns.template.column.cornerRadiusBottomRight = 5;
series.columns.template.column.cornerRadiusTopRight = 5;
<?endif?>
<?if(!empty($arField['LABEL_BULLET'])):?>
var labelBullet = series.bullets.push(new am4charts.LabelBullet())
labelBullet.label.horizontalCenter = "left";
labelBullet.label.dx = 10;
labelBullet.label.text = "<?=$arField['LABEL_BULLET']['LABEL_TEXT'] ?: '{values.valueX.workingValue}'?>";
labelBullet.locationX = 1;
<?if(!empty($arField['LABEL_BULLET']['FILL_COLOR'])):?>
series.columns.template.adapter.add("fill", function(fill, target){
return chart.colors.getIndex(target.dataItem.index);
});
<?endif?>
<?endif?>
<?if(!empty($arField['COLUMN_SERIES'])):?>
// as by default columns of the same series are of the same color, we add adapter which takes colors from chart.colors color set
categoryAxis.sortBySeries = series;
<?endif?>
<?if($arField['LEGEND'] === 'Y'):?>
chart.legend = new am4charts.Legend();
<?endif?>
chart.data = <?=CUtil::PhpToJSObject($arField['DATA'])?>;
});
</script>
</div>
<?break;
case 'FUNNEL_':?>
<div>
<div>
<h4>
<?=$arField['TITLE']?>
</h4>
</div>
<div class="bot_statistics__gr" id="<?=$fId?>" style="height: <?=$fHeight?>px"></div>
<script>
BX.ready(function()
{
var chart = function()
{
AmCharts.makeChart("<?=$fId?>",
{
type: "funnel",
titleField: "TITLE",
valueField: "VALUE",
dataProvider: <?=CUtil::PhpToJSObject($arField['DATA'])?>,
legend: {
markerType: "circle",
position: "bottom",
marginBottom: 10,
autoMargins: false
}
}
);
}
AmCharts.isReady ? chart() : AmCharts.ready(chart);
});
</script>
</div>
<?break;
case 'CUSTOMN':
echo $arField['DATA'];
break;
}?>
<?endforeach?>
<?endif?>
</div>
<?endforeach?>
</div>
<script>
function ectendGraph(arrData, def, str) {
var result = [];
if(!arrData && !def) {
return undefined;
}
$.each(arrData, function(none, data) {
if(!data.id) {
data.id = str + "__" + none + getRandomInt(100)
}
result.push({
...def,
...data
});
});
return result;
}
function getRandomInt(max) {
if(!max) {
max = 50;
}
return Math.floor(Math.random() * Math.floor(max));
}
</script>
</div>
<?if(!empty( $arResult["SCRIPTS"] )):?>
<script>
<?=$arResult["SCRIPTS"]?>
</script>
<?endif?>
\ No newline at end of file
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$arComponentDescription = array(
"NAME" => GetMessage("COMP_ALV_SETTINGS_TITLE"),
"DESCRIPTION" => GetMessage("COMP_ALV_SETTINGS_DESCR"),
);
?>
\ No newline at end of file
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
use \Bitrix\Main\Config\Option;
if (isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y')
return;
$arResult = $arParams['FORM_DATA'];
if (!(isset($arParams['TEMPLATE_HIDE']) && $arParams['TEMPLATE_HIDE'] == 'Y'))
$this->IncludeComponentTemplate();
return $arResult;
<?
$MESS["COMP_VI_SETTINGS_TITLE"] = "Composite component for telephony configuration";
$MESS["COMP_VI_SETTINGS_DESCR"] = "Composite component for telephony configuration";
?>
\ No newline at end of file
<?
$MESS["COMP_VI_ACCESS_DENIED"] = "Insufficient access permissions";
?>
\ No newline at end of file
<?
$MESS ['COMP_VI_SETTINGS_TITLE'] = "Комплексный компонент настроек телефонии";
$MESS ['COMP_VI_SETTINGS_DESCR'] = "Комплексный компонент настроек телефонии";
?>
\ No newline at end of file
<?php
$MESS['COMP_VI_ACCESS_DENIED'] = "Недостаточно прав доступа";
$MESS['ALV_QUEUE_COLOR_FREE'] = "Свободен";
$MESS['ALV_QUEUE_COLOR_DND'] = "ДНД";
$MESS['ALV_QUEUE_COLOR_INCALL'] = "Входящий звонок";
$MESS['ALV_QUEUE_COLOR_INTALK'] = "Входящий разговор";
$MESS['ALV_QUEUE_COLOR_OUTCALL'] = "Исходящий звонок";
$MESS['ALV_QUEUE_COLOR_OUTTALK'] = "Исходящий разговор";
$MESS['ALV_QUEUE_COLOR_OFFLINE'] = "Отключен";
$MESS['ALV_SIP_SERVER_STATUS'] = "Статус";
$MESS['ALOVOICE_AMI_HOST'] = "Адрес";
$MESS['ALOVOICE_AMI_PORT'] = "Порт";
$MESS['ALOVOICE_AMI_USER'] = "Пользователь";
$MESS['ALOVOICE_AMI_PASSWORD'] = "Пароль";
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
if (!CModule::IncludeModule('advertising'))
{
return;
}
/**
*
* function GetMessage - get msg from lang '.parameters.php'
*/
//$arTemplateParameters = array();
\ No newline at end of file
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] {
position: absolute;
z-index: 1000;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] li.textcomplete-item {
font-size: 14px;
padding: 1px 3px;
border: 0;
}
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] li.textcomplete-item a {
text-decoration: none;
display: block;
height: 100%;
line-height: 1.8em;
padding: 0 1.54em 0 .615em;
color: #4f4f4f;
}
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] li.textcomplete-item:hover,
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] li.textcomplete-item.active {
background-color: #e4e4e4;
}
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] li.textcomplete-item:hover a,
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] li.textcomplete-item.active a {
color: #333;
}
.dropdown-menu.textcomplete-dropdown[data-strategy="emojionearea"] li.textcomplete-item .emojioneemoji {
font-size: inherit;
height: 2ex;
width: 2.1ex;
min-height: 20px;
min-width: 20px;
display: inline-block;
margin: 0 5px .2ex 0;
line-height: normal;
vertical-align: middle;
max-width: 100%;
top: 0;
}
.emojionearea-text [class*=emojione-],
.emojionearea-text .emojioneemoji {
font-size: inherit;
height: 2ex;
width: 2.1ex;
min-height: 20px;
min-width: 20px;
display: inline-block;
margin: -.2ex .15em .2ex;
line-height: normal;
vertical-align: middle;
max-width: 100%;
top: 0;
}
.emojionearea,
.emojionearea * {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.emojionearea.emojionearea-disable {
position: relative;
background-color: #eee;
-moz-user-select: -moz-none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
}
.emojionearea.emojionearea-disable:before {
content: "";
display: block;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
opacity: 0.3;
position: absolute;
background-color: #eee;
}
.emojionearea,
.emojionearea.form-control {
display: block;
position: relative !important;
width: 100%;
height: auto;
padding: 0;
font-size: 14px;
border: 0;
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-transition: border-color 0.15s ease-in-out, -moz-box-shadow 0.15s ease-in-out;
-o-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
-webkit-transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.emojionearea.focused {
border-color: #66AFE9;
outline: 0;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.emojionearea .emojionearea-editor {
display: block;
height: auto;
min-height: 8em;
max-height: 15em;
overflow: auto;
padding: 6px 24px 6px 12px;
line-height: 1.42857143;
font-size: inherit;
color: #555555;
background-color: transparent;
border: 0;
cursor: text;
margin-right: 1px;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.emojionearea .emojionearea-editor:empty:before {
content: attr(placeholder);
display: block;
color: #BBBBBB;
}
.emojionearea .emojionearea-editor:focus {
border: 0;
outline: 0;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.emojionearea .emojionearea-editor [class*=emojione-],
.emojionearea .emojionearea-editor .emojioneemoji {
font-size: inherit;
height: 2ex;
width: 2.1ex;
min-height: 20px;
min-width: 20px;
display: inline-block;
margin: -.2ex .15em .2ex;
line-height: normal;
vertical-align: middle;
max-width: 100%;
top: 0;
}
.emojionearea.emojionearea-inline {
height: 34px;
}
.emojionearea.emojionearea-inline>.emojionearea-editor {
height: 32px;
min-height: 20px;
overflow: hidden;
white-space: nowrap;
position: absolute;
top: 0;
left: 12px;
right: 24px;
padding: 6px 0;
}
.emojionearea.emojionearea-inline>.emojionearea-button {
top: 4px;
}
.emojionearea .emojionearea-button {
z-index: 5;
position: absolute;
right: 3px;
top: 3px;
width: 24px;
height: 24px;
opacity: 0.6;
cursor: pointer;
-moz-transition: opacity 300ms ease-in-out;
-o-transition: opacity 300ms ease-in-out;
-webkit-transition: opacity 300ms ease-in-out;
transition: opacity 300ms ease-in-out;
}
.emojionearea .emojionearea-button:hover {
opacity: 1;
}
.emojionearea .emojionearea-button>div {
display: block;
width: 24px;
height: 24px;
position: absolute;
-moz-transition: all 400ms ease-in-out;
-o-transition: all 400ms ease-in-out;
-webkit-transition: all 400ms ease-in-out;
transition: all 400ms ease-in-out;
}
.emojionearea .emojionearea-button>div.emojionearea-button-open {
background-position: 0 -24px;
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
}
.emojionearea .emojionearea-button>div.emojionearea-button-close {
background-position: 0 0;
-webkit-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
.emojionearea .emojionearea-button.active>div.emojionearea-button-open {
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
.emojionearea .emojionearea-button.active>div.emojionearea-button-close {
-webkit-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
}
.emojionearea .emojionearea-picker {
background: #FFFFFF;
position: absolute;
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.32);
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.32);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.32);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
height: 276px;
width: 316px;
top: -15px;
right: -15px;
z-index: 90;
-moz-transition: all 0.25s ease-in-out;
-o-transition: all 0.25s ease-in-out;
-webkit-transition: all 0.25s ease-in-out;
transition: all 0.25s ease-in-out;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-moz-user-select: -moz-none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
}
.emojionearea .emojionearea-picker.hidden {
display: none;
}
.emojionearea .emojionearea-picker .emojionearea-wrapper {
position: relative;
height: 276px;
width: 316px;
}
.emojionearea .emojionearea-picker .emojionearea-wrapper:after {
content: "";
display: block;
position: absolute;
background-repeat: no-repeat;
z-index: 91;
}
.emojionearea .emojionearea-picker .emojionearea-filters {
width: 100%;
position: absolute;
z-index: 95;
}
.emojionearea .emojionearea-picker .emojionearea-filters {
background: #F5F7F9;
padding: 0 0 0 7px;
height: 40px;
}
.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter {
display: block;
float: left;
height: 40px;
width: 32px;
filter: inherit;
padding: 7px 1px 0;
cursor: pointer;
-webkit-filter: grayscale(1);
filter: grayscale(1);
}
.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter.active {
background: #fff;
}
.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter.active,
.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter:hover {
-webkit-filter: grayscale(0);
filter: grayscale(0);
}
.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>i {
width: 24px;
height: 24px;
top: 0;
}
.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>img {
width: 24px;
height: 24px;
margin: 0 3px;
}
.emojionearea .emojionearea-picker .emojionearea-search-panel {
height: 30px;
position: absolute;
z-index: 95;
top: 40px;
left: 0;
right: 0;
padding: 5px 0 5px 8px;
}
.emojionearea .emojionearea-picker .emojionearea-search-panel .emojionearea-tones {
float: right;
margin-right: 10px;
margin-top: -1px;
}
.emojionearea .emojionearea-picker .emojionearea-tones-panel .emojionearea-tones {
position: absolute;
top: 4px;
left: 171px;
}
.emojionearea .emojionearea-picker .emojionearea-search {
float: left;
padding: 0;
height: 20px;
width: 160px;
}
.emojionearea .emojionearea-picker .emojionearea-search>input {
outline: none;
width: 160px;
min-width: 160px;
height: 20px;
}
.emojionearea .emojionearea-picker .emojionearea-tones {
padding: 0;
width: 120px;
height: 20px;
}
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone {
display: inline-block;
padding: 0;
border: 0;
vertical-align: middle;
outline: none;
background: transparent;
cursor: pointer;
position: relative;
}
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-0,
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-0:after {
background-color: #ffcf3e;
}
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-1,
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-1:after {
background-color: #fae3c5;
}
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-2,
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-2:after {
background-color: #e2cfa5;
}
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-3,
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-3:after {
background-color: #daa478;
}
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-4,
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-4:after {
background-color: #a78058;
}
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-5,
.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-5:after {
background-color: #5e4d43;
}
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone {
width: 20px;
height: 20px;
margin: 0;
background-color: transparent;
}
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone:after,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone:after {
content: "";
position: absolute;
display: block;
top: 4px;
left: 4px;
width: 12px;
height: 12px;
}
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone.active:after,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone.active:after {
top: 0;
left: 0;
width: 20px;
height: 20px;
}
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone {
width: 16px;
height: 16px;
margin: 0px 2px;
}
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone.active:after,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone.active:after {
content: "";
position: absolute;
display: block;
background-color: transparent;
border: 2px solid #fff;
width: 8px;
height: 8px;
top: 2px;
left: 2px;
box-sizing: initial;
}
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone:after,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone:after {
-moz-border-radius: 100%;
-webkit-border-radius: 100%;
border-radius: 100%;
}
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone:after,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone,
.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone:after {
-moz-border-radius: 1px;
-webkit-border-radius: 1px;
border-radius: 1px;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area {
height: 236px;
}
.emojionearea .emojionearea-picker .emojionearea-search-panel+.emojionearea-scroll-area {
height: 206px;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area {
overflow: auto;
overflow-x: hidden;
width: 100%;
position: absolute;
padding: 0 0 5px;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-emojis-list {
z-index: 1;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-title {
display: block;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
font-size: 13px;
font-weight: normal;
color: #b2b2b2;
background: #FFFFFF;
line-height: 20px;
margin: 0;
padding: 7px 0 5px 6px;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-title:after,
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-title:before {
content: " ";
display: block;
clear: both;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block {
padding: 0 0 0 7px;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block>.emojionearea-category {
padding: 0 !important;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block>.emojionearea-category:after,
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block>.emojionearea-category:before {
content: " ";
display: block;
clear: both;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block:after,
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block:before {
content: " ";
display: block;
clear: both;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area [class*=emojione-] {
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
margin: 0;
width: 24px;
height: 24px;
top: 0;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn {
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
width: 24px;
height: 24px;
float: left;
display: block;
margin: 1px;
padding: 3px;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn:hover {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
background-color: #e4e4e4;
cursor: pointer;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn i,
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn img {
float: left;
display: block;
width: 24px;
height: 24px;
}
.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn img.lazy-emoji {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-top .emojionearea-filters {
top: 0;
-moz-border-radius-topleft: 5px;
-webkit-border-top-left-radius: 5px;
border-top-left-radius: 5px;
-moz-border-radius-topright: 5px;
-webkit-border-top-right-radius: 5px;
border-top-right-radius: 5px;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-top.emojionearea-search-position-top .emojionearea-scroll-area {
bottom: 0;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-top.emojionearea-search-position-bottom .emojionearea-scroll-area {
top: 40px;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-top.emojionearea-search-position-bottom .emojionearea-search-panel {
top: initial;
bottom: 0;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom .emojionearea-filters {
bottom: 0;
-moz-border-radius-bottomleft: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom-right-radius: 5px;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-bottom .emojionearea-scroll-area {
top: 0;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-bottom .emojionearea-search-panel {
top: initial;
bottom: 40px;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-top .emojionearea-scroll-area {
top: initial;
bottom: 40px;
}
.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-top .emojionearea-search-panel {
top: 0;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-top {
margin-top: -286px;
right: -14px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-top .emojionearea-wrapper:after {
width: 19px;
height: 10px;
background-position: -2px -49px;
bottom: -10px;
right: 20px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-top.emojionearea-filters-position-bottom .emojionearea-wrapper:after {
background-position: -2px -80px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-left,
.emojionearea .emojionearea-picker.emojionearea-picker-position-right {
margin-right: -326px;
top: -8px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-left .emojionearea-wrapper:after,
.emojionearea .emojionearea-picker.emojionearea-picker-position-right .emojionearea-wrapper:after {
width: 10px;
height: 19px;
background-position: 0px -60px;
top: 13px;
left: -10px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-left.emojionearea-filters-position-bottom .emojionearea-wrapper:after,
.emojionearea .emojionearea-picker.emojionearea-picker-position-right.emojionearea-filters-position-bottom .emojionearea-wrapper:after {
background-position: right -60px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-bottom {
margin-top: 10px;
right: -14px;
top: 47px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-bottom .emojionearea-wrapper:after {
width: 19px;
height: 10px;
background-position: -2px -100px;
top: -10px;
right: 20px;
}
.emojionearea .emojionearea-picker.emojionearea-picker-position-bottom.emojionearea-filters-position-bottom .emojionearea-wrapper:after {
background-position: -2px -90px;
}
.emojionearea .emojionearea-button.active+.emojionearea-picker {
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
}
.emojionearea .emojionearea-button.active+.emojionearea-picker-position-top {
margin-top: -269px;
}
.emojionearea .emojionearea-button.active+.emojionearea-picker-position-left,
.emojionearea .emojionearea-button.active+.emojionearea-picker-position-right {
margin-right: -309px;
}
.emojionearea .emojionearea-button.active+.emojionearea-picker-position-bottom {
margin-top: -7px;
}
.emojionearea.emojionearea-standalone {
display: inline-block;
width: auto;
box-shadow: none;
}
.emojionearea.emojionearea-standalone .emojionearea-editor {
min-height: 33px;
position: relative;
padding: 6px 42px 6px 6px;
}
.emojionearea.emojionearea-standalone .emojionearea-editor::before {
content: "";
position: absolute;
top: 4px;
left: 50%;
bottom: 4px;
border-left: 1px solid #e6e6e6;
}
.emojionearea.emojionearea-standalone .emojionearea-editor.has-placeholder {
background-repeat: no-repeat;
background-position: 20px 4px;
}
.emojionearea.emojionearea-standalone .emojionearea-editor.has-placeholder .emojioneemoji {
opacity: 0.4;
}
.emojionearea.emojionearea-standalone .emojionearea-button {
top: 0;
right: 0;
bottom: 0;
left: 0;
width: auto;
height: auto;
}
.emojionearea.emojionearea-standalone .emojionearea-button>div {
right: 6px;
top: 5px;
}
.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-bottom .emojionearea-wrapper:after,
.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-top .emojionearea-wrapper:after {
right: 23px;
}
.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-left .emojionearea-wrapper:after,
.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-right .emojionearea-wrapper:after {
top: 15px;
}
.emojionearea .emojionearea-button>div,
.emojionearea .emojionearea-picker .emojionearea-wrapper:after {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAABuCAYAAADMB4ipAAAHfElEQVRo3u1XS1NT2Rb+9uOcQF4YlAJzLymFUHaLrdxKULvEUNpdTnRqD532f+AHMLMc94gqR1Zbt8rBnUh3YXipPGKwRDoWgXvrYiFUlEdIkPPYZ/dAkwox5yQCVt/bzRrBPnt9e+211/etFeDQDu3ArL+/X37OeqmRWoH7+vpItfWawStF1tfXR+zW9xW5ne0p8loOcAKuCdwpRft60C8a+X5zTvebCqcAvmidf1GGHtqhHdpf1qqKzsrKipyensbi4iKWl5cBAMFgEG1tbYhGo2hpadlbmxseHpaDg4MAgI6ODng8HgBAPp/H/Pw8AODatWvo7e2tvUHrui7v3r2L+fl5XL58GVeuXIHH49m1N5/Py0ePHmF0dBQdHR24desWVFXdtYdXAn/48CHm5+dx8+ZNRKPRigEUDpuenpb3799H4YaOnWh5eVmOj48jFoshGo0STdPkwMCAXF5elqV7BgYGpKZpMhqNklgshrGxMbx580Y6gicSCTDGEIvFAADpdBqpVArJZLK4J5lMIpVKIZ1OAwBisRgYY0gkEs6Rp1IphMNh+Hw+AgCGYQAANE0r7in8Xfjm8/lIOBzGq1evnMHX19fR1NRU/D8UCoFzjnA4XFwLh8PgnCMUChXXmpqakM1mUfVBS62xsZHk83lZWi1nz579ZA0AhBDO4A0NDchkMsWSJIRAURRiVy26rktVVUkmk0EgEHAGP3XqFKamppDP56Vpmrhz5w5u374t/X4/OP+w3TRNZLNZ6LoO0zSRz+dlf38/Ll686Jzz8+fPQwiBeDwOt9tNrl+/jkwmU6yaQpVkMhncuHEDbrebxONxCCEQiUScIw8Gg+TBgwdyZGQEyWRSdnV1kVQqJYeGhrC6ugrGGEKhEHp7e3Hy5EmSTCblvXv30NPTg2AwSA6M/vF4HCMjI7b0/yzh8vv9AIBsNrt34aokuQsLC7skt729varkHtqftUFf++FHsrq0QN3eBvp68Tfvf9Mv12oFCYU7G//e9nVuO7dpNbe2W4M//yQr0p8yRvyBo1Zr++lwLcCt7afD/sBRizJGavrB1dDYYh47Htrq+Kb7jBNwxzfdZ44dD201NLaYVUkU7ozQpuAJBkARwnRZpunN5zaa5hJjiXLH05GeiMd7JEM5zzHGNQBGZvk/Iv0yYVWMvK0zKk1Dl6ahW5RQobjqdjy+wEZn9PKF0n2d0csXPL7AhuKq26GECtPQLdPQZVtn1LlB69p7yRVVSEiDEGJwRd12e4+8PR3piRQidnuPvOWKuk0IMSSkwRVV6Np7WVVbSqvGsgSnlKkAFNPQXdrOtuKqcxtcUTUAhmUJnVJmlleJo3CVHmAaOlPUOmYJkxFKibQsSRkXhr4juKIKO2BHVSwcoLrqCVdUYho6K3YYRRWmoUtdey/tgKtK7rUffiQAsLq08MnbNLe2WwBgB/zHzueFyD8nwlIfbvdx8eU0WV1aKD1cVAMs9+F2j9gUPEEKemEJIe3AnXy4XfkBoNKSZHNthWfX31EA69VKttyHVyIOY1wRwmS6tqNsrr31vXo5k/bUu4gT2cp9lhbm0rzCJpeUUrE0vS63+c7/6uXMbDUWl/ssLczNFrVFddUT09AZpUy1LKvO0DVfPrfR9HxqfNbuEe185l9MFX3o6tIC5YpKFLWOfdQQ93Zu49j0+FDCDtjOp1yaOQCYhs4Y40wI05XfWj8yPT40Ua2ey33mEmMTtp2IUEq0nW3FKeJPGPjRp1Iz2QUuLUu66txG9NLVSK3gBZ+C1lcE54oqKOOCK6rm8QU2unu+u1ANuNynvFsBAG1ubbdMQ5eGviMAFDuP0w3sfMpvQEtb24fOQncU1bXl8R7JnOu+ZNv97XxKJwY6+PNPsrm13drObVqUMlMIU5OWpVHOc96Go5lTnV2fzC/VfAozD7HTCa6olBBa1Imlhbmq2lLuQ5xaW6nCPfnln0Yt7bDUhzhps8cfKH5//uTXmvS81OeLdqI/ZoROzSZrHqG/OvOPzxuhK5VgJTvV2bW3EdqJRABwrvvS/kfoSkoZvXT1YEbociHr7vnuYEfogpBFL109HKH/h0fomnXg3Lff79r7/MmvVbWG7gX4QObzc99+Tz7mHKah05KcW6ahQ9feS6cbMCdgt7eBWJagjCuUAC5tZzuouuo0Spm0hElc9R4cbf4bVl8v1p6WUmCuqEwIs34ruxaeeTy4uJVd67As08UVlVmWoG5vA7FLG3WMmHEupVTyW+vh2cn4DADMTsaTuc21LiGEhzHOnQ6gNtMrJSBMCKHkNt999WLi0S7hejEZH81n174WpukiIMw0dKq66p3Bw50RwhUVXFGJKUy28Xal48VkfKrSlWenhsc23q2cEB9SR7iiItwZIbbgHn8AlDFCCMW7laXjqZnHjkNpaubJzNuVpWZCKChjxOMPVH/QlaW0f/G3ZLqWWl6ce/bvlddp7yFD/w8Z+njoX1+GoZMjgzMAMDkyeLAMnRh+uKveJ0YGD4ahEyODFRk6OfrL/hj67GnckaHPng7vjaGzyYmaGDr77KktQ38H8tqx8Wja+WIAAAAASUVORK5CYII=') !important;
}
.emojionearea.emojionearea-standalone .emojionearea-editor.has-placeholder {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAC/v79T5hyIAAAAAXRSTlMAQObYZgAAABNJREFUCNdjYGNgQEb/P4AQqiAASiUEG6Vit44AAAAASUVORK5CYII=') !important;
}
/*# sourceMappingURL=emojionearea.css.map */
\ No newline at end of file
/*!
* EmojioneArea v3.4.1
* https://github.com/mervick/emojionearea
* Copyright Andrey Izman and other contributors
* Released under the MIT license
* Date: 2018-04-27T09:03Z
*/
window = ( typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {} );
document = window.document || {};
; ( function ( factory, global ) {
if ( typeof require === "function" && typeof exports === "object" && typeof module === "object" ) {
// CommonJS
factory( require( "jquery" ) );
} else if ( typeof define === "function" && define.amd ) {
// AMD
define( [ "jquery" ], factory );
} else {
// Normal script tag
factory( global.jQuery );
}
}( function ( $ ) {
"use strict";
var unique = 0;
var eventStorage = {};
var possibleEvents = {};
var emojione = window.emojione;
var readyCallbacks = [];
function emojioneReady (fn) {
if (emojione) {
fn();
} else {
readyCallbacks.push(fn);
}
};
var blankImg = 'data:image/gif;base64,R0lGODlhAQABAJH/AP///wAAAMDAwAAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==';
var slice = [].slice;
var css_class = "emojionearea";
var emojioneSupportMode = 0;
var invisibleChar = '&#8203;';
function trigger(self, event, args) {
var result = true, j = 1;
if (event) {
event = event.toLowerCase();
do {
var _event = j==1 ? '@' + event : event;
if (eventStorage[self.id][_event] && eventStorage[self.id][_event].length) {
$.each(eventStorage[self.id][_event], function (i, fn) {
return result = fn.apply(self, args|| []) !== false;
});
}
} while (result && !!j--);
}
return result;
}
function attach(self, element, events, target) {
target = target || function (event, callerEvent) { return $(callerEvent.currentTarget) };
$.each(events, function(event, link) {
event = $.isArray(events) ? link : event;
(possibleEvents[self.id][link] || (possibleEvents[self.id][link] = []))
.push([element, event, target]);
});
}
function getTemplate(template, unicode, shortname) {
var imageType = emojione.imageType, imagePath;
if (imageType=='svg'){
imagePath = emojione.imagePathSVG;
} else {
imagePath = emojione.imagePathPNG;
}
var friendlyName = '';
if (shortname) {
friendlyName = shortname.substr(1, shortname.length - 2).replace(/_/g, ' ').replace(/\w\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
var fname = '';
if (unicode.uc_base && emojioneSupportMode > 4) {
fname = unicode.uc_base;
unicode = unicode.uc_output.toUpperCase();
} else {
fname = unicode;
}
template = template.replace('{name}', shortname || '')
.replace('{friendlyName}', friendlyName)
.replace('{img}', imagePath + (emojioneSupportMode < 2 ? fname.toUpperCase() : fname) + '.' + imageType)
.replace('{uni}', unicode);
if(shortname) {
template = template.replace('{alt}', emojione.shortnameToUnicode(shortname));
} else {
template = template.replace('{alt}', emojione.convert(unicode));
}
return template;
};
function shortnameTo(str, template, clear) {
return str.replace(/:?\+?[\w_\-]+:?/g, function(shortname) {
shortname = ":" + shortname.replace(/:$/,'').replace(/^:/,'') + ":";
var unicode = emojione.emojioneList[shortname];
if (unicode) {
if (emojioneSupportMode > 4) {
return getTemplate(template, unicode, shortname);
} else {
if (emojioneSupportMode > 3) unicode = unicode.unicode;
return getTemplate(template, unicode[unicode.length-1], shortname);
}
}
return clear ? '' : shortname;
});
};
function pasteHtmlAtCaret(html) {
var sel, range;
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0);
range.deleteContents();
var el = document.createElement("div");
el.innerHTML = html;
var frag = document.createDocumentFragment(), node, lastNode;
while ( (node = el.firstChild) ) {
lastNode = frag.appendChild(node);
}
range.insertNode(frag);
if (lastNode) {
range = range.cloneRange();
range.setStartAfter(lastNode);
range.collapse(true);
sel.removeAllRanges();
sel.addRange(range);
}
}
} else if (document.selection && document.selection.type != "Control") {
document.selection.createRange().pasteHTML(html);
}
}
function getEmojioneVersion() {
return window.emojioneVersion || '3.1.2';
};
function isObject(variable) {
return typeof variable === 'object';
};
function detectVersion(emojione) {
var version;
if (emojione.cacheBustParam) {
version = emojione.cacheBustParam;
if (!isObject(emojione['jsEscapeMap'])) return '1.5.2';
if (version === "?v=1.2.4") return '2.0.0';
if (version === "?v=2.0.1") return '2.1.0'; // v2.0.1 || v2.1.0
if (version === "?v=2.1.1") return '2.1.1';
if (version === "?v=2.1.2") return '2.1.2';
if (version === "?v=2.1.3") return '2.1.3';
if (version === "?v=2.1.4") return '2.1.4';
if (version === "?v=2.2.7") return '2.2.7';
return '2.2.7';
} else {
return emojione.emojiVersion;
}
};
function getSupportMode(version) {
switch (version) {
case '1.5.2': return 0;
case '2.0.0': return 1;
case '2.1.0':
case '2.1.1': return 2;
case '2.1.2': return 3;
case '2.1.3':
case '2.1.4':
case '2.2.7': return 4;
case '3.0.1':
case '3.0.2':
case '3.0.3':
case '3.0': return 5;
case '3.1.0':
case '3.1.1':
case '3.1.2':
case '3.1':
default: return 6;
}
};
function getDefaultOptions () {
if ($.fn.emojioneArea && $.fn.emojioneArea.defaults) {
return $.fn.emojioneArea.defaults;
}
var defaultOptions = {
attributes: {
dir : "ltr",
spellcheck : false,
autocomplete : "off",
autocorrect : "off",
autocapitalize : "off",
},
search : true,
placeholder : null,
emojiPlaceholder : ":smiley:",
searchPlaceholder : "SEARCH",
container : null,
hideSource : true,
shortnames : true,
sprite : true,
pickerPosition : "top", // top | bottom | right
filtersPosition : "top", // top | bottom
searchPosition : "top", // top | bottom
hidePickerOnBlur : true,
buttonTitle : "Use the TAB key to insert emoji faster",
tones : true,
tonesStyle : "bullet", // bullet | radio | square | checkbox
inline : null, // null - auto
saveEmojisAs : "unicode", // unicode | shortname | image
shortcuts : true,
autocomplete : true,
autocompleteTones : false,
standalone : false,
useInternalCDN : true, // Use the self loading mechanism
imageType : "png", // Default image type used by internal CDN
recentEmojis : true,
textcomplete: {
maxCount : 15,
placement : null // null - default | top | absleft | absright
}
};
var supportMode = !emojione ? getSupportMode(getEmojioneVersion()) : getSupportMode(detectVersion(emojione));
if (supportMode > 4) {
defaultOptions.filters = {
tones: {
title: "Diversity",
emoji: "open_hands raised_hands palms_up_together clap pray thumbsup thumbsdown punch fist left_facing_fist right_facing_fist " +
"fingers_crossed v metal love_you_gesture ok_hand point_left point_right point_up_2 point_down point_up raised_hand " +
"raised_back_of_hand hand_splayed vulcan wave call_me muscle middle_finger writing_hand selfie nail_care ear " +
"nose baby boy girl man woman blond-haired_woman blond-haired_man older_man older_woman " +
"man_with_chinese_cap woman_wearing_turban man_wearing_turban woman_police_officer " +
"man_police_officer woman_construction_worker man_construction_worker " +
"woman_guard man_guard woman_detective man_detective woman_health_worker man_health_worker " +
"woman_farmer man_farmer woman_cook man_cook woman_student man_student woman_singer man_singer woman_teacher " +
"man_teacher woman_factory_worker man_factory_worker woman_technologist man_technologist woman_office_worker " +
"man_office_worker woman_mechanic man_mechanic woman_scientist man_scientist woman_artist man_artist " +
"woman_firefighter man_firefighter woman_pilot man_pilot woman_astronaut man_astronaut woman_judge " +
"man_judge mrs_claus santa princess prince bride_with_veil man_in_tuxedo angel pregnant_woman " +
"breast_feeding woman_bowing man_bowing man_tipping_hand woman_tipping_hand " +
"man_gesturing_no woman_gesturing_no man_gesturing_ok woman_gesturing_ok " +
"man_raising_hand woman_raising_hand woman_facepalming man_facepalming " +
"woman_shrugging man_shrugging man_pouting woman_pouting " +
"man_frowning woman_frowning man_getting_haircut woman_getting_haircut " +
"man_getting_face_massage woman_getting_face_massage man_in_business_suit_levitating dancer man_dancing " +
"woman_walking man_walking woman_running man_running adult child older_adult " +
"bearded_person woman_with_headscarf woman_mage man_mage " +
"woman_fairy man_fairy woman_vampire man_vampire mermaid merman woman_elf man_elf " +
"snowboarder woman_lifting_weights man_lifting_weights woman_cartwheeling " +
"man_cartwheeling woman_bouncing_ball man_bouncing_ball " +
"woman_playing_handball man_playing_handball woman_golfing man_golfing " +
"woman_surfing man_surfing woman_swimming man_swimming woman_playing_water_polo " +
"man_playing_water_polo woman_rowing_boat man_rowing_boat " +
"horse_racing woman_biking man_biking woman_mountain_biking " +
"man_mountain_biking woman_juggling man_juggling " +
"woman_in_steamy_room man_in_steamy_room woman_climbing " +
"man_climbing woman_in_lotus_position man_in_lotus_position bath person_in_bed"
},
recent: {
icon: "clock3",
title: "Recent",
emoji: ""
},
smileys_people: {
icon: "yum",
title: "Smileys & People",
emoji: "grinning smiley smile grin laughing sweat_smile joy rofl relaxed blush innocent slight_smile upside_down " +
"wink relieved crazy_face star_struck heart_eyes kissing_heart kissing kissing_smiling_eyes kissing_closed_eyes yum " +
"stuck_out_tongue_winking_eye stuck_out_tongue_closed_eyes stuck_out_tongue money_mouth hugging nerd sunglasses " +
"cowboy smirk unamused disappointed pensive worried face_with_raised_eyebrow face_with_monocle confused slight_frown " +
"frowning2 persevere confounded tired_face weary triumph angry rage face_with_symbols_over_mouth " +
"no_mouth neutral_face expressionless hushed frowning anguished open_mouth astonished dizzy_face exploding_head flushed scream " +
"fearful cold_sweat cry disappointed_relieved drooling_face sob sweat sleepy sleeping rolling_eyes thinking " +
"shushing_face face_with_hand_over_mouth lying_face grimacing zipper_mouth face_vomiting nauseated_face sneezing_face mask thermometer_face " +
"head_bandage smiling_imp imp japanese_ogre japanese_goblin poop ghost skull skull_crossbones alien space_invader " +
"robot jack_o_lantern clown smiley_cat smile_cat joy_cat heart_eyes_cat smirk_cat kissing_cat scream_cat crying_cat_face " +
"pouting_cat open_hands raised_hands palms_up_together clap pray handshake thumbsup thumbsdown punch fist left_facing_fist " +
"right_facing_fist fingers_crossed v metal love_you_gesture ok_hand point_left point_right point_up_2 point_down point_up " +
"raised_hand raised_back_of_hand hand_splayed vulcan wave call_me muscle middle_finger writing_hand selfie " +
"nail_care ring lipstick kiss lips tongue ear nose footprints eye eyes speaking_head bust_in_silhouette " +
"busts_in_silhouette baby boy girl man woman blond-haired_woman blond_haired_man older_man older_woman " +
"man_with_chinese_cap woman_wearing_turban man_wearing_turban woman_police_officer police_officer " +
"woman_construction_worker construction_worker woman_guard guard woman_detective detective woman_health_worker " +
"man_health_worker woman_farmer man_farmer woman_cook man_cook woman_student man_student woman_singer man_singer " +
"woman_teacher man_teacher woman_factory_worker man_factory_worker woman_technologist man_technologist " +
"woman_office_worker man_office_worker woman_mechanic man_mechanic woman_scientist man_scientist woman_artist " +
"man_artist woman_firefighter man_firefighter woman_pilot man_pilot woman_astronaut man_astronaut woman_judge " +
"man_judge mrs_claus santa princess prince bride_with_veil man_in_tuxedo angel pregnant_woman breast_feeding woman_bowing " +
"man_bowing woman_tipping_hand man_tipping_hand woman_gesturing_no man_gesturing_no woman_gesturing_ok " +
"man_gesturing_ok woman_raising_hand man_raising_hand woman_facepalming man_facepalming woman_shrugging " +
"man_shrugging woman_pouting man_pouting woman_frowning man_frowning woman_getting_haircut man_getting_haircut " +
"woman_getting_face_massage man_getting_face_massage man_in_business_suit_levitating dancer man_dancing women_with_bunny_ears_partying " +
"men_with_bunny_ears_partying woman_walking man_walking woman_running man_running couple two_women_holding_hands " +
"two_men_holding_hands couple_with_heart couple_ww couple_mm couplekiss kiss_ww kiss_mm family family_mwg family_mwgb " +
"family_mwbb family_mwgg family_wwb family_wwg family_wwgb family_wwbb family_wwgg family_mmb family_mmg family_mmgb " +
"family_mmbb family_mmgg family_woman_boy family_woman_girl family_woman_girl_boy family_woman_boy_boy " +
"family_woman_girl_girl family_man_boy family_man_girl family_man_girl_boy family_man_boy_boy family_man_girl_girl " +
"bearded_person woman_with_headscarf woman_mage man_mage woman_fairy man_fairy woman_vampire man_vampire " +
"mermaid merman woman_elf man_elf woman_genie man_genie woman_zombie man_zombie " +
"womans_clothes shirt jeans necktie dress bikini kimono high_heel sandal boot mans_shoe athletic_shoe womans_hat " +
"tophat mortar_board crown helmet_with_cross school_satchel pouch purse handbag briefcase eyeglasses dark_sunglasses " +
"closed_umbrella umbrella2 brain billed_cap scarf gloves coat socks "
},
animals_nature: {
icon: "hamster",
title: "Animals & Nature",
emoji: "dog cat mouse hamster rabbit fox bear panda_face koala tiger lion_face cow pig pig_nose frog monkey_face see_no_evil " +
"hear_no_evil speak_no_evil monkey chicken penguin bird baby_chick hatching_chick hatched_chick duck eagle owl bat wolf boar " +
"horse unicorn bee bug butterfly snail shell beetle ant spider spider_web turtle snake lizard scorpion crab squid octopus shrimp " +
"tropical_fish fish blowfish dolphin shark whale whale2 crocodile leopard tiger2 water_buffalo ox cow2 deer dromedary_camel camel " +
"elephant rhino gorilla racehorse pig2 goat ram sheep dog2 poodle cat2 rooster turkey dove rabbit2 mouse2 rat chipmunk dragon " +
"giraffe zebra hedgehog sauropod t_rex cricket dragon_face feet cactus christmas_tree evergreen_tree deciduous_tree palm_tree seedling herb shamrock four_leaf_clover " +
"bamboo tanabata_tree leaves fallen_leaf maple_leaf mushroom ear_of_rice bouquet tulip rose wilted_rose sunflower blossom " +
"cherry_blossom hibiscus earth_americas earth_africa earth_asia full_moon waning_gibbous_moon last_quarter_moon " +
"waning_crescent_moon new_moon waxing_crescent_moon first_quarter_moon waxing_gibbous_moon new_moon_with_face " +
"full_moon_with_face sun_with_face first_quarter_moon_with_face last_quarter_moon_with_face crescent_moon dizzy star star2 " +
"sparkles zap fire boom comet sunny white_sun_small_cloud partly_sunny white_sun_cloud white_sun_rain_cloud rainbow cloud " +
"cloud_rain thunder_cloud_rain cloud_lightning cloud_snow snowman2 snowman snowflake wind_blowing_face dash cloud_tornado " +
"fog ocean droplet sweat_drops umbrella "
},
food_drink: {
icon: "pizza",
title: "Food & Drink",
emoji: "green_apple apple pear tangerine lemon banana watermelon grapes strawberry melon cherries peach pineapple kiwi " +
"avocado tomato eggplant cucumber carrot corn hot_pepper potato sweet_potato chestnut peanuts honey_pot croissant " +
"bread french_bread cheese egg cooking bacon pancakes fried_shrimp poultry_leg meat_on_bone pizza hotdog hamburger " +
"fries stuffed_flatbread taco burrito salad shallow_pan_of_food spaghetti ramen stew fish_cake sushi bento curry " +
"rice_ball rice rice_cracker oden dango shaved_ice ice_cream icecream cake birthday custard lollipop candy " +
"chocolate_bar popcorn doughnut cookie milk baby_bottle coffee tea sake beer beers champagne_glass wine_glass " +
"tumbler_glass cocktail tropical_drink champagne spoon fork_and_knife fork_knife_plate dumpling fortune_cookie " +
"takeout_box chopsticks bowl_with_spoon cup_with_straw coconut broccoli pie pretzel cut_of_meat sandwich canned_food"
},
activity: {
icon: "basketball",
title: "Activity",
emoji: "soccer basketball football baseball tennis volleyball rugby_football 8ball ping_pong badminton goal hockey field_hockey " +
"cricket_game golf bow_and_arrow fishing_pole_and_fish boxing_glove martial_arts_uniform ice_skate ski skier snowboarder " +
"woman_lifting_weights man_lifting_weights person_fencing women_wrestling men_wrestling woman_cartwheeling " +
"man_cartwheeling woman_bouncing_ball man_bouncing_ball woman_playing_handball man_playing_handball woman_golfing " +
"man_golfing woman_surfing man_surfing woman_swimming man_swimming woman_playing_water_polo " +
"man_playing_water_polo woman_rowing_boat man_rowing_boat horse_racing woman_biking man_biking woman_mountain_biking man_mountain_biking " +
"woman_in_steamy_room man_in_steamy_room woman_climbing man_climbing woman_in_lotus_position man_in_lotus_position " +
"running_shirt_with_sash medal military_medal first_place second_place " +
"third_place trophy rosette reminder_ribbon ticket tickets circus_tent woman_juggling man_juggling performing_arts art " +
"clapper microphone headphones musical_score musical_keyboard drum saxophone trumpet guitar violin game_die dart bowling " +
"video_game slot_machine sled curling_stone "
},
travel_places: {
icon: "rocket",
title: "Travel & Places",
emoji: "red_car taxi blue_car bus trolleybus race_car police_car ambulance fire_engine minibus truck articulated_lorry tractor " +
"scooter bike motor_scooter motorcycle rotating_light oncoming_police_car oncoming_bus oncoming_automobile oncoming_taxi " +
"aerial_tramway mountain_cableway suspension_railway railway_car train mountain_railway monorail bullettrain_side " +
"bullettrain_front light_rail steam_locomotive train2 metro tram station helicopter airplane_small airplane " +
"airplane_departure airplane_arriving rocket satellite_orbital seat canoe sailboat motorboat speedboat cruise_ship " +
"ferry ship anchor construction fuelpump busstop vertical_traffic_light traffic_light map moyai statue_of_liberty " +
"fountain tokyo_tower european_castle japanese_castle stadium ferris_wheel roller_coaster carousel_horse beach_umbrella " +
"beach island mountain mountain_snow mount_fuji volcano desert camping tent railway_track motorway construction_site " +
"factory house house_with_garden homes house_abandoned office department_store post_office european_post_office hospital " +
"bank hotel convenience_store school love_hotel wedding classical_building church mosque synagogue kaaba shinto_shrine " +
"japan rice_scene park sunrise sunrise_over_mountains stars sparkler fireworks city_sunset city_dusk cityscape " +
"night_with_stars milky_way bridge_at_night foggy flying_saucer"
},
objects: {
icon: "bulb",
title: "Objects",
emoji: "watch iphone calling computer keyboard desktop printer mouse_three_button trackball joystick compression minidisc " +
"floppy_disk cd dvd vhs camera camera_with_flash video_camera movie_camera projector film_frames telephone_receiver " +
"telephone pager fax tv radio microphone2 level_slider control_knobs stopwatch timer alarm_clock clock hourglass " +
"hourglass_flowing_sand satellite battery electric_plug bulb flashlight candle wastebasket oil money_with_wings " +
"dollar yen euro pound moneybag credit_card gem scales wrench hammer hammer_pick tools pick nut_and_bolt gear " +
"chains gun bomb knife dagger crossed_swords shield smoking coffin urn amphora crystal_ball prayer_beads barber " +
"alembic telescope microscope hole pill syringe thermometer toilet potable_water shower bathtub bath bellhop key " +
"key2 door couch bed sleeping_accommodation frame_photo shopping_bags shopping_cart gift balloon flags ribbon " +
"confetti_ball tada dolls izakaya_lantern wind_chime envelope envelope_with_arrow incoming_envelope e-mail " +
"love_letter inbox_tray outbox_tray package label mailbox_closed mailbox mailbox_with_mail mailbox_with_no_mail " +
"postbox postal_horn scroll page_with_curl page_facing_up bookmark_tabs bar_chart chart_with_upwards_trend " +
"chart_with_downwards_trend notepad_spiral calendar_spiral calendar date card_index card_box ballot_box " +
"file_cabinet clipboard file_folder open_file_folder dividers newspaper2 newspaper notebook " +
"notebook_with_decorative_cover ledger closed_book green_book blue_book orange_book books book bookmark link " +
"paperclip paperclips triangular_ruler straight_ruler pushpin round_pushpin scissors pen_ballpoint pen_fountain " +
"black_nib paintbrush crayon pencil pencil2 mag mag_right lock_with_ink_pen closed_lock_with_key lock unlock"
},
symbols: {
icon: "heartpulse",
title: "Symbols",
emoji: "heart orange_heart yellow_heart green_heart blue_heart purple_heart black_heart broken_heart heart_exclamation two_hearts " +
"revolving_hearts heartbeat heartpulse sparkling_heart cupid gift_heart heart_decoration peace cross star_and_crescent " +
"om_symbol wheel_of_dharma star_of_david six_pointed_star menorah yin_yang orthodox_cross place_of_worship ophiuchus " +
"aries taurus gemini cancer leo virgo libra scorpius sagittarius capricorn aquarius pisces id atom accept radioactive " +
"biohazard mobile_phone_off vibration_mode u6709 u7121 u7533 u55b6 u6708 eight_pointed_black_star vs white_flower " +
"ideograph_advantage secret congratulations u5408 u6e80 u5272 u7981 a b ab cl o2 sos x o octagonal_sign no_entry " +
"name_badge no_entry_sign 100 anger hotsprings no_pedestrians do_not_litter no_bicycles non-potable_water underage " +
"no_mobile_phones no_smoking exclamation grey_exclamation question grey_question bangbang interrobang low_brightness " +
"high_brightness part_alternation_mark warning children_crossing trident fleur-de-lis beginner recycle " +
"white_check_mark u6307 chart sparkle eight_spoked_asterisk negative_squared_cross_mark globe_with_meridians " +
"diamond_shape_with_a_dot_inside m cyclone zzz atm wc wheelchair parking u7a7a sa passport_control customs " +
"baggage_claim left_luggage mens womens baby_symbol restroom put_litter_in_its_place cinema signal_strength koko " +
"symbols information_source abc abcd capital_abcd ng ok up cool new free zero one two three four five six seven " +
"eight nine keycap_ten 1234 hash asterisk arrow_forward pause_button play_pause stop_button record_button eject " +
"track_next track_previous fast_forward rewind arrow_double_up arrow_double_down arrow_backward arrow_up_small " +
"arrow_down_small arrow_right arrow_left arrow_up arrow_down arrow_upper_right arrow_lower_right arrow_lower_left " +
"arrow_upper_left arrow_up_down left_right_arrow arrow_right_hook leftwards_arrow_with_hook arrow_heading_up " +
"arrow_heading_down twisted_rightwards_arrows repeat repeat_one arrows_counterclockwise arrows_clockwise " +
"musical_note notes heavy_plus_sign heavy_minus_sign heavy_division_sign heavy_multiplication_x heavy_dollar_sign " +
"currency_exchange tm copyright registered wavy_dash curly_loop loop end back on top soon heavy_check_mark " +
"ballot_box_with_check radio_button white_circle black_circle red_circle blue_circle small_red_triangle " +
"small_red_triangle_down small_orange_diamond small_blue_diamond large_orange_diamond large_blue_diamond " +
"white_square_button black_square_button black_small_square white_small_square black_medium_small_square " +
"white_medium_small_square black_medium_square white_medium_square black_large_square white_large_square speaker " +
"mute sound loud_sound bell no_bell mega loudspeaker speech_left eye_in_speech_bubble speech_balloon thought_balloon " +
"anger_right spades clubs hearts diamonds black_joker flower_playing_cards mahjong clock1 clock2 clock3 clock4 clock5 " +
"clock6 clock7 clock8 clock9 clock10 clock11 clock12 clock130 clock230 clock330 clock430 clock530 clock630 " +
"clock730 clock830 clock930 clock1030 clock1130 clock1230"
},
flags: {
icon: "flag_gb",
title: "Flags",
emoji: "flag_white flag_black checkered_flag triangular_flag_on_post rainbow_flag flag_af flag_ax flag_al flag_dz flag_as " +
"flag_ad flag_ao flag_ai flag_aq flag_ag flag_ar flag_am flag_aw flag_au flag_at flag_az flag_bs flag_bh flag_bd flag_bb " +
"flag_by flag_be flag_bz flag_bj flag_bm flag_bt flag_bo flag_ba flag_bw flag_br flag_io flag_vg flag_bn flag_bg flag_bf " +
"flag_bi flag_kh flag_cm flag_ca flag_ic flag_cv flag_bq flag_ky flag_cf flag_td flag_cl flag_cn flag_cx flag_cc flag_co " +
"flag_km flag_cg flag_cd flag_ck flag_cr flag_ci flag_hr flag_cu flag_cw flag_cy flag_cz flag_dk flag_dj flag_dm flag_do " +
"flag_ec flag_eg flag_sv flag_gq flag_er flag_ee flag_et flag_eu flag_fk flag_fo flag_fj flag_fi flag_fr flag_gf flag_pf " +
"flag_tf flag_ga flag_gm flag_ge flag_de flag_gh flag_gi flag_gr flag_gl flag_gd flag_gp flag_gu flag_gt flag_gg flag_gn " +
"flag_gw flag_gy flag_ht flag_hn flag_hk flag_hu flag_is flag_in flag_id flag_ir flag_iq flag_ie flag_im flag_il flag_it " +
"flag_jm flag_jp crossed_flags flag_je flag_jo flag_kz flag_ke flag_ki flag_xk flag_kw flag_kg flag_la flag_lv flag_lb " +
"flag_ls flag_lr flag_ly flag_li flag_lt flag_lu flag_mo flag_mk flag_mg flag_mw flag_my flag_mv flag_ml flag_mt flag_mh " +
"flag_mq flag_mr flag_mu flag_yt flag_mx flag_fm flag_md flag_mc flag_mn flag_me flag_ms flag_ma flag_mz flag_mm flag_na " +
"flag_nr flag_np flag_nl flag_nc flag_nz flag_ni flag_ne flag_ng flag_nu flag_nf flag_kp flag_mp flag_no flag_om flag_pk " +
"flag_pw flag_ps flag_pa flag_pg flag_py flag_pe flag_ph flag_pn flag_pl flag_pt flag_pr flag_qa flag_re flag_ro flag_ru " +
"flag_rw flag_ws flag_sm flag_st flag_sa flag_sn flag_rs flag_sc flag_sl flag_sg flag_sx flag_sk flag_si flag_gs flag_sb " +
"flag_so flag_za flag_kr flag_ss flag_es flag_lk flag_bl flag_sh flag_kn flag_lc flag_pm flag_vc flag_sd flag_sr flag_sz " +
"flag_se flag_ch flag_sy flag_tw flag_tj flag_tz flag_th flag_tl flag_tg flag_tk flag_to flag_tt flag_tn flag_tr flag_tm " +
"flag_tc flag_tv flag_vi flag_ug flag_ua flag_ae flag_gb flag_us flag_uy flag_uz flag_vu flag_va flag_ve flag_vn flag_wf " +
"flag_eh flag_ye flag_zm flag_zw flag_ac flag_ta flag_bv flag_hm flag_sj flag_um flag_ea flag_cp flag_dg flag_mf " +
"united_nations england scotland wales"
}
};
} else {
defaultOptions.filters = {
tones: {
title: "Diversity",
emoji: "santa runner surfer swimmer lifter ear nose point_up_2 point_down point_left point_right punch " +
"wave ok_hand thumbsup thumbsdown clap open_hands boy girl man woman cop bride_with_veil person_with_blond_hair " +
"man_with_gua_pi_mao man_with_turban older_man grandma baby construction_worker princess angel " +
"information_desk_person guardsman dancer nail_care massage haircut muscle spy hand_splayed middle_finger " +
"vulcan no_good ok_woman bow raising_hand raised_hands person_frowning person_with_pouting_face pray rowboat " +
"bicyclist mountain_bicyclist walking bath metal point_up basketball_player fist raised_hand v writing_hand"
},
recent: {
icon: "clock3",
title: "Recent",
emoji: ""
},
smileys_people: {
icon: "yum",
title: "Smileys & People",
emoji: "grinning grimacing grin joy smiley smile sweat_smile laughing innocent wink blush slight_smile " +
"upside_down relaxed yum relieved heart_eyes kissing_heart kissing kissing_smiling_eyes " +
"kissing_closed_eyes stuck_out_tongue_winking_eye stuck_out_tongue_closed_eyes stuck_out_tongue " +
"money_mouth nerd sunglasses hugging smirk no_mouth neutral_face expressionless unamused rolling_eyes " +
"thinking flushed disappointed worried angry rage pensive confused slight_frown frowning2 persevere " +
"confounded tired_face weary triumph open_mouth scream fearful cold_sweat hushed frowning anguished " +
"cry disappointed_relieved sleepy sweat sob dizzy_face astonished zipper_mouth mask thermometer_face " +
"head_bandage sleeping zzz poop smiling_imp imp japanese_ogre japanese_goblin skull ghost alien robot " +
"smiley_cat smile_cat joy_cat heart_eyes_cat smirk_cat kissing_cat scream_cat crying_cat_face " +
"pouting_cat raised_hands clap wave thumbsup thumbsdown punch fist v ok_hand raised_hand open_hands " +
"muscle pray point_up point_up_2 point_down point_left point_right middle_finger hand_splayed metal " +
"vulcan writing_hand nail_care lips tongue ear nose eye eyes bust_in_silhouette busts_in_silhouette " +
"speaking_head baby boy girl man woman person_with_blond_hair older_man older_woman man_with_gua_pi_mao " +
"man_with_turban cop construction_worker guardsman spy santa angel princess bride_with_veil walking " +
"runner dancer dancers couple two_men_holding_hands two_women_holding_hands bow information_desk_person " +
"no_good ok_woman raising_hand person_with_pouting_face person_frowning haircut massage couple_with_heart " +
"couple_ww couple_mm couplekiss kiss_ww kiss_mm family family_mwg family_mwgb family_mwbb family_mwgg " +
"family_wwb family_wwg family_wwgb family_wwbb family_wwgg family_mmb family_mmg family_mmgb family_mmbb " +
"family_mmgg womans_clothes shirt jeans necktie dress bikini kimono lipstick kiss footprints high_heel " +
"sandal boot mans_shoe athletic_shoe womans_hat tophat helmet_with_cross mortar_board crown school_satchel " +
"pouch purse handbag briefcase eyeglasses dark_sunglasses ring closed_umbrella"
},
animals_nature: {
icon: "hamster",
title: "Animals & Nature",
emoji: "dog cat mouse hamster rabbit bear panda_face koala tiger lion_face cow pig pig_nose frog " +
"octopus monkey_face see_no_evil hear_no_evil speak_no_evil monkey chicken penguin bird baby_chick " +
"hatching_chick hatched_chick wolf boar horse unicorn bee bug snail beetle ant spider scorpion crab " +
"snake turtle tropical_fish fish blowfish dolphin whale whale2 crocodile leopard tiger2 water_buffalo " +
"ox cow2 dromedary_camel camel elephant goat ram sheep racehorse pig2 rat mouse2 rooster turkey dove " +
"dog2 poodle cat2 rabbit2 chipmunk feet dragon dragon_face cactus christmas_tree evergreen_tree " +
"deciduous_tree palm_tree seedling herb shamrock four_leaf_clover bamboo tanabata_tree leaves " +
"fallen_leaf maple_leaf ear_of_rice hibiscus sunflower rose tulip blossom cherry_blossom bouquet " +
"mushroom chestnut jack_o_lantern shell spider_web earth_americas earth_africa earth_asia full_moon " +
"waning_gibbous_moon last_quarter_moon waning_crescent_moon new_moon waxing_crescent_moon " +
"first_quarter_moon waxing_gibbous_moon new_moon_with_face full_moon_with_face first_quarter_moon_with_face " +
"last_quarter_moon_with_face sun_with_face crescent_moon star star2 dizzy sparkles comet sunny " +
"white_sun_small_cloud partly_sunny white_sun_cloud white_sun_rain_cloud cloud cloud_rain " +
"thunder_cloud_rain cloud_lightning zap fire boom snowflake cloud_snow snowman2 snowman wind_blowing_face " +
"dash cloud_tornado fog umbrella2 umbrella droplet sweat_drops ocean"
},
food_drink: {
icon: "pizza",
title: "Food & Drink",
emoji: "green_apple apple pear tangerine lemon banana watermelon grapes strawberry melon cherries peach " +
"pineapple tomato eggplant hot_pepper corn sweet_potato honey_pot bread cheese poultry_leg meat_on_bone " +
"fried_shrimp egg hamburger fries hotdog pizza spaghetti taco burrito ramen stew fish_cake sushi bento " +
"curry rice_ball rice rice_cracker oden dango shaved_ice ice_cream icecream cake birthday custard candy " +
"lollipop chocolate_bar popcorn doughnut cookie beer beers wine_glass cocktail tropical_drink champagne " +
"sake tea coffee baby_bottle fork_and_knife fork_knife_plate"
},
activity: {
icon: "basketball",
title: "Activity",
emoji: "soccer basketball football baseball tennis volleyball rugby_football 8ball golf golfer ping_pong " +
"badminton hockey field_hockey cricket ski skier snowboarder ice_skate bow_and_arrow fishing_pole_and_fish " +
"rowboat swimmer surfer bath basketball_player lifter bicyclist mountain_bicyclist horse_racing levitate " +
"trophy running_shirt_with_sash medal military_medal reminder_ribbon rosette ticket tickets performing_arts " +
"art circus_tent microphone headphones musical_score musical_keyboard saxophone trumpet guitar violin " +
"clapper video_game space_invader dart game_die slot_machine bowling"
},
travel_places: {
icon: "rocket",
title: "Travel & Places",
emoji: "red_car taxi blue_car bus trolleybus race_car police_car ambulance fire_engine minibus truck " +
"articulated_lorry tractor motorcycle bike rotating_light oncoming_police_car oncoming_bus " +
"oncoming_automobile oncoming_taxi aerial_tramway mountain_cableway suspension_railway railway_car " +
"train monorail bullettrain_side bullettrain_front light_rail mountain_railway steam_locomotive train2 " +
"metro tram station helicopter airplane_small airplane airplane_departure airplane_arriving sailboat " +
"motorboat speedboat ferry cruise_ship rocket satellite_orbital seat anchor construction fuelpump busstop " +
"vertical_traffic_light traffic_light checkered_flag ship ferris_wheel roller_coaster carousel_horse " +
"construction_site foggy tokyo_tower factory fountain rice_scene mountain mountain_snow mount_fuji volcano " +
"japan camping tent park motorway railway_track sunrise sunrise_over_mountains desert beach island " +
"city_sunset city_dusk cityscape night_with_stars bridge_at_night milky_way stars sparkler fireworks " +
"rainbow homes european_castle japanese_castle stadium statue_of_liberty house house_with_garden " +
"house_abandoned office department_store post_office european_post_office hospital bank hotel " +
"convenience_store school love_hotel wedding classical_building church mosque synagogue kaaba shinto_shrine"
},
objects: {
icon: "bulb",
title: "Objects",
emoji: "watch iphone calling computer keyboard desktop printer mouse_three_button trackball joystick " +
"compression minidisc floppy_disk cd dvd vhs camera camera_with_flash video_camera movie_camera projector " +
"film_frames telephone_receiver telephone pager fax tv radio microphone2 level_slider control_knobs " +
"stopwatch timer alarm_clock clock hourglass_flowing_sand hourglass satellite battery electric_plug bulb " +
"flashlight candle wastebasket oil money_with_wings dollar yen euro pound moneybag credit_card gem scales " +
"wrench hammer hammer_pick tools pick nut_and_bolt gear chains gun bomb knife dagger crossed_swords shield " +
"smoking skull_crossbones coffin urn amphora crystal_ball prayer_beads barber alembic telescope microscope " +
"hole pill syringe thermometer label bookmark toilet shower bathtub key key2 couch sleeping_accommodation " +
"bed door bellhop frame_photo map beach_umbrella moyai shopping_bags balloon flags ribbon gift confetti_ball " +
"tada dolls wind_chime crossed_flags izakaya_lantern envelope envelope_with_arrow incoming_envelope e-mail " +
"love_letter postbox mailbox_closed mailbox mailbox_with_mail mailbox_with_no_mail package postal_horn " +
"inbox_tray outbox_tray scroll page_with_curl bookmark_tabs bar_chart chart_with_upwards_trend " +
"chart_with_downwards_trend page_facing_up date calendar calendar_spiral card_index card_box ballot_box " +
"file_cabinet clipboard notepad_spiral file_folder open_file_folder dividers newspaper2 newspaper notebook " +
"closed_book green_book blue_book orange_book notebook_with_decorative_cover ledger books book link " +
"paperclip paperclips scissors triangular_ruler straight_ruler pushpin round_pushpin triangular_flag_on_post " +
"flag_white flag_black closed_lock_with_key lock unlock lock_with_ink_pen pen_ballpoint pen_fountain " +
"black_nib pencil pencil2 crayon paintbrush mag mag_right"
},
symbols: {
icon: "heartpulse",
title: "Symbols",
emoji: "heart yellow_heart green_heart blue_heart purple_heart broken_heart heart_exclamation two_hearts " +
"revolving_hearts heartbeat heartpulse sparkling_heart cupid gift_heart heart_decoration peace cross " +
"star_and_crescent om_symbol wheel_of_dharma star_of_david six_pointed_star menorah yin_yang orthodox_cross " +
"place_of_worship ophiuchus aries taurus gemini cancer leo virgo libra scorpius sagittarius capricorn " +
"aquarius pisces id atom u7a7a u5272 radioactive biohazard mobile_phone_off vibration_mode u6709 u7121 " +
"u7533 u55b6 u6708 eight_pointed_black_star vs accept white_flower ideograph_advantage secret congratulations " +
"u5408 u6e80 u7981 a b ab cl o2 sos no_entry name_badge no_entry_sign x o anger hotsprings no_pedestrians " +
"do_not_litter no_bicycles non-potable_water underage no_mobile_phones exclamation grey_exclamation question " +
"grey_question bangbang interrobang 100 low_brightness high_brightness trident fleur-de-lis part_alternation_mark " +
"warning children_crossing beginner recycle u6307 chart sparkle eight_spoked_asterisk negative_squared_cross_mark " +
"white_check_mark diamond_shape_with_a_dot_inside cyclone loop globe_with_meridians m atm sa passport_control " +
"customs baggage_claim left_luggage wheelchair no_smoking wc parking potable_water mens womens baby_symbol " +
"restroom put_litter_in_its_place cinema signal_strength koko ng ok up cool new free zero one two three four " +
"five six seven eight nine ten 1234 arrow_forward pause_button play_pause stop_button record_button track_next " +
"track_previous fast_forward rewind twisted_rightwards_arrows repeat repeat_one arrow_backward arrow_up_small " +
"arrow_down_small arrow_double_up arrow_double_down arrow_right arrow_left arrow_up arrow_down arrow_upper_right " +
"arrow_lower_right arrow_lower_left arrow_upper_left arrow_up_down left_right_arrow arrows_counterclockwise " +
"arrow_right_hook leftwards_arrow_with_hook arrow_heading_up arrow_heading_down hash asterisk information_source " +
"abc abcd capital_abcd symbols musical_note notes wavy_dash curly_loop heavy_check_mark arrows_clockwise " +
"heavy_plus_sign heavy_minus_sign heavy_division_sign heavy_multiplication_x heavy_dollar_sign currency_exchange " +
"copyright registered tm end back on top soon ballot_box_with_check radio_button white_circle black_circle " +
"red_circle large_blue_circle small_orange_diamond small_blue_diamond large_orange_diamond large_blue_diamond " +
"small_red_triangle black_small_square white_small_square black_large_square white_large_square small_red_triangle_down " +
"black_medium_square white_medium_square black_medium_small_square white_medium_small_square black_square_button " +
"white_square_button speaker sound loud_sound mute mega loudspeaker bell no_bell black_joker mahjong spades " +
"clubs hearts diamonds flower_playing_cards thought_balloon anger_right speech_balloon clock1 clock2 clock3 " +
"clock4 clock5 clock6 clock7 clock8 clock9 clock10 clock11 clock12 clock130 clock230 clock330 clock430 " +
"clock530 clock630 clock730 clock830 clock930 clock1030 clock1130 clock1230 eye_in_speech_bubble"
},
flags: {
icon: "flag_gb",
title: "Flags",
emoji: "ac af al dz ad ao ai ag ar am aw au at az bs bh bd bb by be bz bj bm bt bo ba bw br bn bg bf bi " +
"cv kh cm ca ky cf td flag_cl cn co km cg flag_cd cr hr cu cy cz dk dj dm do ec eg sv gq er ee et fk fo " +
"fj fi fr pf ga gm ge de gh gi gr gl gd gu gt gn gw gy ht hn hk hu is in flag_id ir iq ie il it ci jm jp " +
"je jo kz ke ki xk kw kg la lv lb ls lr ly li lt lu mo mk mg mw my mv ml mt mh mr mu mx fm md mc mn me " +
"ms ma mz mm na nr np nl nc nz ni ne flag_ng nu kp no om pk pw ps pa pg py pe ph pl pt pr qa ro ru rw " +
"sh kn lc vc ws sm st flag_sa sn rs sc sl sg sk si sb so za kr es lk sd sr sz se ch sy tw tj tz th tl " +
"tg to tt tn tr flag_tm flag_tm ug ua ae gb us vi uy uz vu va ve vn wf eh ye zm zw re ax ta io bq cx " +
"cc gg im yt nf pn bl pm gs tk bv hm sj um ic ea cp dg as aq vg ck cw eu gf tf gp mq mp sx ss tc "
}
};
};
return defaultOptions;
};
function getOptions(options) {
var default_options = getDefaultOptions();
if (options && options['filters']) {
var filters = default_options.filters;
$.each(options['filters'], function(filter, data) {
if (!isObject(data) || $.isEmptyObject(data)) {
delete filters[filter];
return;
}
$.each(data, function(key, val) {
filters[filter][key] = val;
});
});
options['filters'] = filters;
}
return $.extend({}, default_options, options);
};
var saveSelection, restoreSelection;
if (window.getSelection && document.createRange) {
saveSelection = function(el) {
var sel = window.getSelection && window.getSelection();
if (sel && sel.rangeCount > 0) {
return sel.getRangeAt(0);
}
};
restoreSelection = function(el, sel) {
var range = document.createRange();
range.setStart(sel.startContainer, sel.startOffset);
range.setEnd(sel.endContainer, sel.endOffset)
sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
}
} else if (document.selection && document.body.createTextRange) {
saveSelection = function(el) {
return document.selection.createRange();
};
restoreSelection = function(el, sel) {
var textRange = document.body.createTextRange();
textRange.moveToElementText(el);
textRange.setStart(sel.startContanier, sel.startOffset);
textRange.setEnd(sel.endContainer, sel.endOffset);
textRange.select();
};
}
var uniRegexp;
function unicodeTo(str, template) {
return str.replace(uniRegexp, function(unicodeChar) {
var map = emojione[(emojioneSupportMode === 0 ? 'jsecapeMap' : 'jsEscapeMap')];
if (typeof unicodeChar !== 'undefined' && unicodeChar in map) {
return getTemplate(template, map[unicodeChar], emojione.toShort(unicodeChar));
}
return unicodeChar;
});
}
function htmlFromText(str, self) {
str = str
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#x27;')
.replace(/`/g, '&#x60;')
.replace(/(?:\r\n|\r|\n)/g, '\n')
.replace(/(\n+)/g, '<div>$1</div>')
.replace(/\n/g, '<br/>')
.replace(/<br\/><\/div>/g, '</div>');
if (self.shortnames) {
str = emojione.shortnameToUnicode(str);
}
return unicodeTo(str, self.emojiTemplate)
.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;')
.replace(/ /g, '&nbsp;&nbsp;');
}
function textFromHtml(str, self) {
str = str
.replace(/&#10;/g, '\n')
.replace(/&#09;/g, '\t')
.replace(/<img[^>]*alt="([^"]+)"[^>]*>/ig, '$1')
.replace(/\n|\r/g, '')
.replace(/<br[^>]*>/ig, '\n')
.replace(/(?:<(?:div|p|ol|ul|li|pre|code|object)[^>]*>)+/ig, '<div>')
.replace(/(?:<\/(?:div|p|ol|ul|li|pre|code|object)>)+/ig, '</div>')
.replace(/\n<div><\/div>/ig, '\n')
.replace(/<div><\/div>\n/ig, '\n')
.replace(/(?:<div>)+<\/div>/ig, '\n')
.replace(/([^\n])<\/div><div>/ig, '$1\n')
.replace(/(?:<\/div>)+/ig, '</div>')
.replace(/([^\n])<\/div>([^\n])/ig, '$1\n$2')
.replace(/<\/div>/ig, '')
.replace(/([^\n])<div>/ig, '$1\n')
.replace(/\n<div>/ig, '\n')
.replace(/<div>\n/ig, '\n\n')
.replace(/<(?:[^>]+)?>/g, '')
.replace(new RegExp(invisibleChar, 'g'), '')
.replace(/&nbsp;/g, ' ')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#x27;/g, "'")
.replace(/&#x60;/g, '`')
.replace(/&#60;/g, '<')
.replace(/&#62;/g, '>')
.replace(/&amp;/g, '&');
switch (self.saveEmojisAs) {
case 'image':
str = unicodeTo(str, self.emojiTemplate);
break;
case 'shortname':
str = emojione.toShort(str);
}
return str;
}
function calcButtonPosition() {
var self = this,
offset = self.editor[0].offsetWidth - self.editor[0].clientWidth,
current = parseInt(self.button.css('marginRight'));
if (current !== offset) {
self.button.css({marginRight: offset});
if (self.floatingPicker) {
self.picker.css({right: parseInt(self.picker.css('right')) - current + offset});
}
}
}
function lazyLoading() {
var self = this;
if (!self.sprite && self.lasyEmoji[0] && self.lasyEmoji.eq(0).is(".lazy-emoji")) {
var pickerTop = self.picker.offset().top,
pickerBottom = pickerTop + self.picker.height() + 20;
self.lasyEmoji.each(function() {
var e = $(this), top = e.offset().top;
if (top > pickerTop && top < pickerBottom) {
e.attr("src", e.data("src")).removeClass("lazy-emoji");
}
if (top > pickerBottom) {
return false;
}
});
self.lasyEmoji = self.lasyEmoji.filter(".lazy-emoji");
}
};
function selector (prefix, skip_dot) {
return (skip_dot ? '' : '.') + css_class + (prefix ? ("-" + prefix) : "");
}
function div(prefix) {
var parent = $('<div/>', isObject(prefix) ? prefix : {"class" : selector(prefix, true)});
$.each(slice.call(arguments).slice(1), function(i, child) {
if ($.isFunction(child)) {
child = child.call(parent);
}
if (child) {
$(child).appendTo(parent);
}
});
return parent;
}
function getRecent () {
return localStorage.getItem("recent_emojis") || "";
}
function updateRecent(self, show) {
var emojis = getRecent();
if (!self.recent || self.recent !== emojis || show) {
if (emojis.length) {
var skinnable = self.scrollArea.is(".skinnable"),
scrollTop, height;
if (!skinnable) {
scrollTop = self.scrollArea.scrollTop();
if (show) {
self.recentCategory.show();
}
height = self.recentCategory.is(":visible") ? self.recentCategory.height() : 0;
}
var items = shortnameTo(emojis, self.emojiBtnTemplate, true).split('|').join('');
self.recentCategory.children(".emojibtn").remove();
$(items).insertAfter(self.recentCategory.children(".emojionearea-category-title"));
self.recentCategory.children(".emojibtn").on("click", function() {
self.trigger("emojibtn.click", $(this));
});
self.recentFilter.show();
if (!skinnable) {
self.recentCategory.show();
var height2 = self.recentCategory.height();
if (height !== height2) {
self.scrollArea.scrollTop(scrollTop + height2 - height);
}
}
} else {
if (self.recentFilter.hasClass("active")) {
self.recentFilter.removeClass("active").next().addClass("active");
}
self.recentCategory.hide();
self.recentFilter.hide();
}
self.recent = emojis;
}
};
function setRecent(self, emoji) {
var recent = getRecent();
var emojis = recent.split("|");
var index = emojis.indexOf(emoji);
if (index !== -1) {
emojis.splice(index, 1);
}
emojis.unshift(emoji);
if (emojis.length > 9) {
emojis.pop();
}
localStorage.setItem("recent_emojis", emojis.join("|"));
updateRecent(self);
};
// see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js
function supportsLocalStorage () {
var test = 'test';
try {
localStorage.setItem(test, test);
localStorage.removeItem(test);
return true;
} catch(e) {
return false;
}
}
function init(self, source, options) {
//calcElapsedTime('init', function() {
self.options = options = getOptions(options);
self.sprite = options.sprite && emojioneSupportMode < 3;
self.inline = options.inline === null ? source.is("INPUT") : options.inline;
self.shortnames = options.shortnames;
self.saveEmojisAs = options.saveEmojisAs;
self.standalone = options.standalone;
self.emojiTemplate = '<img alt="{alt}" class="emojione' + (self.sprite ? '-{uni}" src="' + blankImg + '"/>' : 'emoji" src="{img}"/>');
self.emojiTemplateAlt = self.sprite ? '<i class="emojione-{uni}"/>' : '<img class="emojioneemoji" src="{img}"/>';
self.emojiBtnTemplate = '<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}">' + self.emojiTemplateAlt + '</i>';
self.recentEmojis = options.recentEmojis && supportsLocalStorage();
var pickerPosition = options.pickerPosition;
self.floatingPicker = pickerPosition === 'top' || pickerPosition === 'bottom';
self.source = source;
if (source.is(":disabled") || source.is(".disabled")) {
self.disable();
}
var sourceValFunc = source.is("TEXTAREA") || source.is("INPUT") ? "val" : "text",
editor, button, picker, filters, filtersBtns, searchPanel, emojisList, categories, categoryBlocks, scrollArea,
tones = div('tones',
options.tones ?
function() {
this.addClass(selector('tones-' + options.tonesStyle, true));
for (var i = 0; i <= 5; i++) {
this.append($("<i/>", {
"class": "btn-tone btn-tone-" + i + (!i ? " active" : ""),
"data-skin": i,
role: "button"
}));
}
} : null
),
app = div({
"class" : css_class + ((self.standalone) ? " " + css_class + "-standalone " : " ") + (source.attr("class") || ""),
role: "application"
},
editor = self.editor = div("editor").attr({
contenteditable: (self.standalone) ? false : true,
placeholder: options.placeholder || source.data("placeholder") || source.attr("placeholder") || "",
tabindex: 0
}),
button = self.button = div('button',
div('button-open'),
div('button-close')
).attr('title', options.buttonTitle),
picker = self.picker = div('picker',
div('wrapper',
filters = div('filters'),
(options.search ?
searchPanel = div('search-panel',
div('search',
options.search ?
function() {
self.search = $("<input/>", {
"placeholder": options.searchPlaceholder || "",
"type": "text",
"class": "search"
});
this.append(self.search);
} : null
),
tones
) : null
),
scrollArea = div('scroll-area',
options.tones && !options.search ? div('tones-panel',
tones
) : null,
emojisList = div('emojis-list')
)
)
).addClass(selector('picker-position-' + options.pickerPosition, true))
.addClass(selector('filters-position-' + options.filtersPosition, true))
.addClass(selector('search-position-' + options.searchPosition, true))
.addClass('hidden')
);
if (options.search) {
searchPanel.addClass(selector('with-search', true));
}
self.searchSel = null;
editor.data(source.data());
$.each(options.attributes, function(attr, value) {
editor.attr(attr, value);
});
var mainBlock = div('category-block').attr({"data-tone": 0}).prependTo(emojisList);
$.each(options.filters, function(filter, params) {
var skin = 0;
if (filter === 'recent' && !self.recentEmojis) {
return;
}
if (filter !== 'tones') {
$("<i/>", {
"class": selector("filter", true) + " " + selector("filter-" + filter, true),
"data-filter": filter,
title: params.title
})
.wrapInner(shortnameTo(params.icon, self.emojiTemplateAlt))
.appendTo(filters);
} else if (options.tones) {
skin = 5;
} else {
return;
}
do {
var category,
items = params.emoji.replace(/[\s,;]+/g, '|');
if (skin === 0) {
category = div('category').attr({
name: filter,
"data-tone": skin
}).appendTo(mainBlock);
} else {
category = div('category-block').attr({
name: filter,
"data-tone": skin
}).appendTo(emojisList);
}
if (skin > 0) {
category.hide();
items = items.split('|').join('_tone' + skin + '|') + '_tone' + skin;
}
if (filter === 'recent') {
items = getRecent();
}
items = shortnameTo(items,
self.sprite ?
'<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><i class="emojione-{uni}"></i></i>' :
'<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><img class="emojioneemoji lazy-emoji" data-src="{img}"/></i>',
true).split('|').join('');
category.html(items);
$('<div class="emojionearea-category-title"/>').text(params.title).prependTo(category);
} while (--skin > 0);
});
options.filters = null;
if (!self.sprite) {
self.lasyEmoji = emojisList.find(".lazy-emoji");
}
filtersBtns = filters.find(selector("filter"));
filtersBtns.eq(0).addClass("active");
categoryBlocks = emojisList.find(selector("category-block"))
categories = emojisList.find(selector("category"))
self.recentFilter = filtersBtns.filter('[data-filter="recent"]');
self.recentCategory = categories.filter("[name=recent]");
self.scrollArea = scrollArea;
if (options.container) {
$(options.container).wrapInner(app);
} else {
app.insertAfter(source);
}
if (options.hideSource) {
source.hide();
}
self.setText(source[sourceValFunc]());
source[sourceValFunc](self.getText());
calcButtonPosition.apply(self);
// if in standalone mode and no value is set, initialise with a placeholder
if (self.standalone && !self.getText().length) {
var placeholder = $(source).data("emoji-placeholder") || options.emojiPlaceholder;
self.setText(placeholder);
editor.addClass("has-placeholder");
}
// attach() must be called before any .on() methods !!!
// 1) attach() stores events into possibleEvents{},
// 2) .on() calls bindEvent() and stores handlers into eventStorage{},
// 3) bindEvent() finds events in possibleEvents{} and bind founded via jQuery.on()
// 4) attached events via jQuery.on() calls trigger()
// 5) trigger() calls handlers stored into eventStorage{}
attach(self, emojisList.find(".emojibtn"), {click: "emojibtn.click"});
attach(self, window, {resize: "!resize"});
attach(self, tones.children(), {click: "tone.click"});
attach(self, [picker, button], {mousedown: "!mousedown"}, editor);
attach(self, button, {click: "button.click"});
attach(self, editor, {paste :"!paste"}, editor);
attach(self, editor, ["focus", "blur"], function() { return self.stayFocused ? false : editor; } );
attach(self, picker, {mousedown: "picker.mousedown", mouseup: "picker.mouseup", click: "picker.click",
keyup: "picker.keyup", keydown: "picker.keydown", keypress: "picker.keypress"});
attach(self, editor, ["mousedown", "mouseup", "click", "keyup", "keydown", "keypress"]);
attach(self, picker.find(".emojionearea-filter"), {click: "filter.click"});
attach(self, source, {change: "source.change"});
if (options.search) {
attach(self, self.search, {keyup: "search.keypress", focus: "search.focus", blur: "search.blur"});
}
var noListenScroll = false;
scrollArea.on('scroll', function () {
if (!noListenScroll) {
lazyLoading.call(self);
if (scrollArea.is(":not(.skinnable)")) {
var item = categories.eq(0), scrollTop = scrollArea.offset().top;
categories.each(function (i, e) {
if ($(e).offset().top - scrollTop >= 10) {
return false;
}
item = $(e);
});
var filter = filtersBtns.filter('[data-filter="' + item.attr("name") + '"]');
if (filter[0] && !filter.is(".active")) {
filtersBtns.removeClass("active");
filter.addClass("active");
}
}
}
});
self.on("@filter.click", function(filter) {
var isActive = filter.is(".active");
if (scrollArea.is(".skinnable")) {
if (isActive) return;
tones.children().eq(0).click();
}
noListenScroll = true;
if (!isActive) {
filtersBtns.filter(".active").removeClass("active");
filter.addClass("active");
}
var headerOffset = categories.filter('[name="' + filter.data('filter') + '"]').offset().top,
scroll = scrollArea.scrollTop(),
offsetTop = scrollArea.offset().top;
scrollArea.stop().animate({
scrollTop: headerOffset + scroll - offsetTop - 2
}, 200, 'swing', function () {
lazyLoading.call(self);
noListenScroll = false;
});
})
.on("@picker.show", function() {
if (self.recentEmojis) {
updateRecent(self);
}
lazyLoading.call(self);
})
.on("@tone.click", function(tone) {
tones.children().removeClass("active");
var skin = tone.addClass("active").data("skin");
if (skin) {
scrollArea.addClass("skinnable");
categoryBlocks.hide().filter("[data-tone=" + skin + "]").show();
filtersBtns.removeClass("active");//.not('[data-filter="recent"]').eq(0).addClass("active");
} else {
scrollArea.removeClass("skinnable");
categoryBlocks.hide().filter("[data-tone=0]").show();
filtersBtns.eq(0).click();
}
lazyLoading.call(self);
if (options.search) {
self.trigger('search.keypress');
}
})
.on("@button.click", function(button) {
if (button.is(".active")) {
self.hidePicker();
} else {
self.showPicker();
self.searchSel = null;
}
})
.on("@!paste", function(editor, event) {
var pasteText = function(text) {
var caretID = "caret-" + (new Date()).getTime();
var html = htmlFromText(text, self);
pasteHtmlAtCaret(html);
pasteHtmlAtCaret('<i id="' + caretID +'"></i>');
editor.scrollTop(editorScrollTop);
var caret = $("#" + caretID),
top = caret.offset().top - editor.offset().top,
height = editor.height();
if (editorScrollTop + top >= height || editorScrollTop > top) {
editor.scrollTop(editorScrollTop + top - 2 * height/3);
}
caret.remove();
self.stayFocused = false;
calcButtonPosition.apply(self);
trigger(self, 'paste', [editor, text, html]);
};
if (event.originalEvent.clipboardData) {
var text = event.originalEvent.clipboardData.getData('text/plain');
pasteText(text);
if (event.preventDefault){
event.preventDefault();
} else {
event.stop();
}
event.returnValue = false;
event.stopPropagation();
return false;
}
self.stayFocused = true;
// insert invisible character for fix caret position
pasteHtmlAtCaret('<span>' + invisibleChar + '</span>');
var sel = saveSelection(editor[0]),
editorScrollTop = editor.scrollTop(),
clipboard = $("<div/>", {contenteditable: true})
.css({position: "fixed", left: "-999px", width: "1px", height: "1px", top: "20px", overflow: "hidden"})
.appendTo($("BODY"))
.focus();
window.setTimeout(function() {
editor.focus();
restoreSelection(editor[0], sel);
var text = textFromHtml(clipboard.html().replace(/\r\n|\n|\r/g, '<br>'), self);
clipboard.remove();
pasteText(text);
}, 200);
})
.on("@emojibtn.click", function(emojibtn) {
editor.removeClass("has-placeholder");
if (self.searchSel !== null) {
editor.focus();
restoreSelection(editor[0], self.searchSel);
self.searchSel = null;
}
if (self.standalone) {
editor.html(shortnameTo(emojibtn.data("name"), self.emojiTemplate));
self.trigger("blur");
} else {
saveSelection(editor[0]);
pasteHtmlAtCaret(shortnameTo(emojibtn.data("name"), self.emojiTemplate));
}
if (self.recentEmojis) {
setRecent(self, emojibtn.data("name"));
}
// self.search.val('').trigger("change");
self.trigger('search.keypress');
})
.on("@!resize @keyup @emojibtn.click", calcButtonPosition)
.on("@!mousedown", function(editor, event) {
if ($(event.target).hasClass('search')) {
// Allow search clicks
self.stayFocused = true;
if (self.searchSel === null) {
self.searchSel = saveSelection(editor[0]);
}
} else {
if (!app.is(".focused")) {
editor.trigger("focus");
}
event.preventDefault();
}
return false;
})
.on("@change", function() {
var html = self.editor.html().replace(/<\/?(?:div|span|p)[^>]*>/ig, '');
// clear input: chrome adds <br> when contenteditable is empty
if (!html.length || /^<br[^>]*>$/i.test(html)) {
self.editor.html(self.content = '');
}
source[sourceValFunc](self.getText());
})
.on("@source.change", function() {
self.setText(source[sourceValFunc]());
trigger('change');
})
.on("@focus", function() {
app.addClass("focused");
})
.on("@blur", function() {
app.removeClass("focused");
if (options.hidePickerOnBlur) {
self.hidePicker();
}
var content = self.editor.html();
if (self.content !== content) {
self.content = content;
trigger(self, 'change', [self.editor]);
source.trigger("blur").trigger("change");
} else {
source.trigger("blur");
}
if (options.search) {
self.search.val('');
self.trigger('search.keypress', true);
}
});
if (options.search) {
self.on("@search.focus", function() {
self.stayFocused = true;
self.search.addClass("focused");
})
.on("@search.keypress", function(hide) {
var filterBtns = picker.find(".emojionearea-filter");
var activeTone = (options.tones ? tones.find("i.active").data("skin") : 0);
var term = self.search.val().replace( / /g, "_" ).replace(/"/g, "\\\"");
if (term && term.length) {
if (self.recentFilter.hasClass("active")) {
self.recentFilter.removeClass("active").next().addClass("active");
}
self.recentCategory.hide();
self.recentFilter.hide();
categoryBlocks.each(function() {
var matchEmojis = function(category, activeTone) {
var $matched = category.find('.emojibtn[data-name*="' + term + '"]');
if ($matched.length === 0) {
if (category.data('tone') === activeTone) {
category.hide();
}
filterBtns.filter('[data-filter="' + category.attr('name') + '"]').hide();
} else {
var $notMatched = category.find('.emojibtn:not([data-name*="' + term + '"])');
$notMatched.hide();
$matched.show();
if (category.data('tone') === activeTone) {
category.show();
}
filterBtns.filter('[data-filter="' + category.attr('name') + '"]').show();
}
}
var $block = $(this);
if ($block.data('tone') === 0) {
categories.filter(':not([name="recent"])').each(function() {
matchEmojis($(this), 0);
})
} else {
matchEmojis($block, activeTone);
}
});
if (!noListenScroll) {
scrollArea.trigger('scroll');
} else {
lazyLoading.call(self);
}
} else {
updateRecent(self, true);
categoryBlocks.filter('[data-tone="' + tones.find("i.active").data("skin") + '"]:not([name="recent"])').show();
$('.emojibtn', categoryBlocks).show();
filterBtns.show();
lazyLoading.call(self);
}
})
.on("@search.blur", function() {
self.stayFocused = false;
self.search.removeClass("focused");
self.trigger("blur");
});
}
if (options.shortcuts) {
self.on("@keydown", function(_, e) {
if (!e.ctrlKey) {
if (e.which == 9) {
e.preventDefault();
button.click();
}
else if (e.which == 27) {
e.preventDefault();
if (button.is(".active")) {
self.hidePicker();
}
}
}
});
}
if (isObject(options.events) && !$.isEmptyObject(options.events)) {
$.each(options.events, function(event, handler) {
self.on(event.replace(/_/g, '.'), handler);
});
}
if (options.autocomplete) {
var autocomplete = function() {
var textcompleteOptions = {
maxCount: options.textcomplete.maxCount,
placement: options.textcomplete.placement
};
if (options.shortcuts) {
textcompleteOptions.onKeydown = function (e, commands) {
if (!e.ctrlKey && e.which == 13) {
return commands.KEY_ENTER;
}
};
}
var map = $.map(emojione.emojioneList, function (_, emoji) {
return !options.autocompleteTones ? /_tone[12345]/.test(emoji) ? null : emoji : emoji;
});
map.sort();
editor.textcomplete([
{
id: css_class,
match: /\B(:[\-+\w]*)$/,
search: function (term, callback) {
callback($.map(map, function (emoji) {
return emoji.indexOf(term) === 0 ? emoji : null;
}));
},
template: function (value) {
return shortnameTo(value, self.emojiTemplate) + " " + value.replace(/:/g, '');
},
replace: function (value) {
return shortnameTo(value, self.emojiTemplate);
},
cache: true,
index: 1
}
], textcompleteOptions);
if (options.textcomplete.placement) {
// Enable correct positioning for textcomplete
if ($(editor.data('textComplete').option.appendTo).css("position") == "static") {
$(editor.data('textComplete').option.appendTo).css("position", "relative");
}
}
};
var initAutocomplete = function() {
if (self.disabled) {
var enable = function () {
self.off('enabled', enable);
autocomplete();
};
self.on('enabled', enable);
} else {
autocomplete();
}
}
if ($.fn.textcomplete) {
initAutocomplete();
} else {
$.ajax({
url: "https://cdn.rawgit.com/yuku-t/jquery-textcomplete/v1.3.4/dist/jquery.textcomplete.js",
dataType: "script",
cache: true,
success: initAutocomplete
});
}
}
if (self.inline) {
app.addClass(selector('inline', true));
self.on("@keydown", function(_, e) {
if (e.which == 13) {
e.preventDefault();
}
});
}
if (/firefox/i.test(navigator.userAgent)) {
// disabling resize images on Firefox
document.execCommand("enableObjectResizing", false, false);
}
self.isReady = true;
self.trigger("onLoad", editor);
self.trigger("ready", editor);
//}, self.id === 1); // calcElapsedTime()
};
var cdn = {
defaultBase: "https://cdnjs.cloudflare.com/ajax/libs/emojione/",
defaultBase3: "https://cdn.jsdelivr.net/",
base: null,
isLoading: false
};
function loadEmojione(options) {
var emojioneVersion = getEmojioneVersion()
options = getOptions(options);
if (!cdn.isLoading) {
if (!emojione || getSupportMode(detectVersion(emojione)) < 2) {
cdn.isLoading = true;
var emojioneJsCdnUrlBase;
if (getSupportMode(emojioneVersion) > 5) {
emojioneJsCdnUrlBase = cdn.defaultBase3 + "npm/emojione@" + emojioneVersion;
} else if (getSupportMode(emojioneVersion) > 4) {
emojioneJsCdnUrlBase = cdn.defaultBase3 + "emojione/" + emojioneVersion;
} else {
emojioneJsCdnUrlBase = cdn.defaultBase + "/" + emojioneVersion;
}
$.ajax({
url: emojioneJsCdnUrlBase + "/lib/js/emojione.min.js",
dataType: "script",
cache: true,
success: function () {
emojione = window.emojione;
emojioneVersion = detectVersion(emojione);
emojioneSupportMode = getSupportMode(emojioneVersion);
var sprite;
if (emojioneSupportMode > 4) {
cdn.base = cdn.defaultBase3 + "emojione/assets/" + emojioneVersion;
sprite = cdn.base + "/sprites/emojione-sprite-" + emojione.emojiSize + ".css";
} else {
cdn.base = cdn.defaultBase + emojioneVersion + "/assets";
sprite = cdn.base + "/sprites/emojione.sprites.css";
}
if (options.sprite) {
if (document.createStyleSheet) {
document.createStyleSheet(sprite);
} else {
$('<link/>', {rel: 'stylesheet', href: sprite}).appendTo('head');
}
}
while (readyCallbacks.length) {
readyCallbacks.shift().call();
}
cdn.isLoading = false;
}
});
} else {
emojioneVersion = detectVersion(emojione);
emojioneSupportMode = getSupportMode(emojioneVersion);
if (emojioneSupportMode > 4) {
cdn.base = cdn.defaultBase3 + "emojione/assets/" + emojioneVersion;
} else {
cdn.base = cdn.defaultBase + emojioneVersion + "/assets";
}
}
}
emojioneReady(function() {
var emojiSize = "";
if (options.useInternalCDN) {
if (emojioneSupportMode > 4) emojiSize = emojione.emojiSize + "/";
emojione.imagePathPNG = cdn.base + "/png/" + emojiSize;
emojione.imagePathSVG = cdn.base + "/svg/" + emojiSize;
emojione.imagePathSVGSprites = cdn.base + "/sprites/emojione.sprites.svg";
emojione.imageType = options.imageType;
}
if (getSupportMode(emojioneVersion) > 4) {
uniRegexp = emojione.regUnicode;
emojione.imageType = options.imageType || "png";
} else {
uniRegexp = new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|(" + emojione.unicodeRegexp + ")", "gi");
}
});
};
var EmojioneArea = function(element, options) {
var self = this;
loadEmojione(options);
eventStorage[self.id = ++unique] = {};
possibleEvents[self.id] = {};
emojioneReady(function() {
init(self, element, options);
});
};
function bindEvent(self, event) {
event = event.replace(/^@/, '');
var id = self.id;
if (possibleEvents[id][event]) {
$.each(possibleEvents[id][event], function(i, ev) {
// ev[0] = element
// ev[1] = event
// ev[2] = target
$.each($.isArray(ev[0]) ? ev[0] : [ev[0]], function(i, el) {
$(el).on(ev[1], function() {
var args = slice.call(arguments),
target = $.isFunction(ev[2]) ? ev[2].apply(self, [event].concat(args)) : ev[2];
if (target) {
trigger(self, event, [target].concat(args));
}
});
});
});
possibleEvents[id][event] = null;
}
}
EmojioneArea.prototype.on = function(events, handler) {
if (events && $.isFunction(handler)) {
var self = this;
$.each(events.toLowerCase().split(' '), function(i, event) {
bindEvent(self, event);
(eventStorage[self.id][event] || (eventStorage[self.id][event] = [])).push(handler);
});
}
return this;
};
EmojioneArea.prototype.off = function(events, handler) {
if (events) {
var id = this.id;
$.each(events.toLowerCase().replace(/_/g, '.').split(' '), function(i, event) {
if (eventStorage[id][event] && !/^@/.test(event)) {
if (handler) {
$.each(eventStorage[id][event], function(j, fn) {
if (fn === handler) {
eventStorage[id][event].splice(j, 1);
}
});
} else {
eventStorage[id][event] = [];
}
}
});
}
return this;
};
EmojioneArea.prototype.trigger = function() {
var args = slice.call(arguments),
call_args = [this].concat(args.slice(0,1));
call_args.push(args.slice(1));
return trigger.apply(this, call_args);
};
EmojioneArea.prototype.setFocus = function () {
var self = this;
emojioneReady(function () {
self.editor.focus();
});
return self;
};
EmojioneArea.prototype.setText = function (str) {
var self = this;
emojioneReady(function () {
self.editor.html(htmlFromText(str, self));
self.content = self.editor.html();
trigger(self, 'change', [self.editor]);
calcButtonPosition.apply(self);
});
return self;
}
EmojioneArea.prototype.getText = function() {
return textFromHtml(this.editor.html(), this);
}
EmojioneArea.prototype.showPicker = function () {
var self = this;
if (self._sh_timer) {
window.clearTimeout(self._sh_timer);
}
self.picker.removeClass("hidden");
self._sh_timer = window.setTimeout(function() {
self.button.addClass("active");
}, 50);
trigger(self, "picker.show", [self.picker]);
return self;
}
EmojioneArea.prototype.hidePicker = function () {
var self = this;
if (self._sh_timer) {
window.clearTimeout(self._sh_timer);
}
self.button.removeClass("active");
self._sh_timer = window.setTimeout(function() {
self.picker.addClass("hidden");
}, 500);
trigger(self, "picker.hide", [self.picker]);
return self;
}
EmojioneArea.prototype.enable = function () {
var self = this;
var next = function () {
self.disabled = false;
self.editor.prop('contenteditable', true);
self.button.show();
var editor = self[(self.standalone) ? "button" : "editor"];
editor.parent().removeClass('emojionearea-disable');
trigger(self, 'enabled', [editor]);
};
self.isReady ? next() : self.on("ready", next);
return self;
}
EmojioneArea.prototype.disable = function () {
var self = this;
self.disabled = true;
var next = function () {
self.editor.prop('contenteditable', false);
self.hidePicker();
self.button.hide();
var editor = self[(self.standalone) ? "button" : "editor"];
editor.parent().addClass('emojionearea-disable');
trigger(self, 'disabled', [editor]);
};
self.isReady ? next() : self.on("ready", next);
return self;
}
$.fn.emojioneArea = function(options) {
return this.each(function() {
if (!!this.emojioneArea) return this.emojioneArea;
$.data(this, 'emojioneArea', this.emojioneArea = new EmojioneArea($(this), options));
return this.emojioneArea;
});
};
$.fn.emojioneArea.defaults = getDefaultOptions();
$.fn.emojioneAreaText = function(options) {
options = getOptions(options);
var self = this, pseudoSelf = {
shortnames: (options && typeof options.shortnames !== 'undefined' ? options.shortnames : true),
emojiTemplate: '<img alt="{alt}" class="emojione' + (options && options.sprite && emojioneSupportMode < 3 ? '-{uni}" src="' + blankImg : 'emoji" src="{img}') + '"/>'
};
loadEmojione(options);
emojioneReady(function() {
self.each(function() {
var $this = $(this);
if (!$this.hasClass('emojionearea-text')) {
$this.addClass('emojionearea-text').html(htmlFromText(($this.is('TEXTAREA') || $this.is('INPUT') ? $this.val() : $this.text()), pseudoSelf));
}
return $this;
});
});
return this;
};
}, window ) );
\ No newline at end of file
Компанента tug:tug.settings
* обязательные параметры
[
'FORM_DATA' => [
'FORM_ID' => 'ID формы *'
'SECTIONS' => [
[
'ID' => 'Id секции'
'TITLE' => 'Заголовок секции'
'FIELDS' => [
// 'подробнее в 1,1'
[
// пример
'type' => 'text',
'id' => 'text_inp_id'
'value' => '',
'title' => 'Введите текст'
]
]
]
],
'TEXTAREAS' => [
'TITLE' => STRING, // Заголовок
'FIELDS' => [ // массивом с данными
[
'ID' => STRING, // * ID
'TITLE' => STRING, // Заголовок
'BG_COLOR' => STRING, // Цвет Hex
'VALUE' => STRING, // Значение поля
'PLACEHOLDER' => STRING, // Подсказка поля
'TEXT' => STRING, // Тект под полем
]
]
],
'BUTTONS' => [
'standard_buttons' => [
'save' => 'Сохранить' // кнопка сохранить
'cancel' => 'Закрыть', // кнопка закрыть
'reset' => 'Сбросить', // кнопка сбросить форму
],
'custom_html' => '' // любой html код
],
'LOG_RESULT' => 'N' // вывести $arResult в консоль браузера ('Y/N')
]
]
____________________________________________________________
1,1 ---- 'FIELDS' => Поля формы
FIELDS = [
'type' => 'тип поля *' // подробнее в 1,2
]
____________________________________________________________
1,2 - 'type' --- тип поля
типы поля 'type'
'userbox' - выбор из списка пользователей
'text' - текстовое поле
'password' - поля для ввода паполя
'timeinterval' - поле дял ввода промежутка времени
'time' - поля для ввода времени
'list' - поле списка вариантов
'colorpicker' - поле для выбора цвета
'text_audiofile' - поле для загрузки аудио
'custom' - пользовательское поле
____________________________________________________________
1,2,1
Поля формы
[
'id' => 'id input-а *',
'type' => 'тип поля *',
'title' => 'Заголовок'
] - это параметры присутсвуют во всех типах
____________________________________________________________
параметры для userbox
[
]
____________________________________________________________
параметры для text и password
[
'value' => 'значение по умолчанию',
]
____________________________________________________________
параметры для timeinterval
[
'value' => 'значение по умолчанию (резделеить через "-")'
]
____________________________________________________________
параметры для time
[
'value' => 'значение по умолчанию может быть массивом(при multiple="Y")',
'multiple' => " (Y/N)",
'add_btn' => "кнопка добавить еще поле (Y/N)"
]
____________________________________________________________
параметры для number
[
'value' => 'значение по умолчанию'
]
____________________________________________________________
параметры для number
[
'value' => 'значение по умолчанию'
]
____________________________________________________________
параметры для list
[
'value' => 'значение по умолчанию',
'items' => 'список элементов *'
]
____________________________________________________________
параметры для colorpicker
[
'value' => 'значение по умолчанию (hex цвет)',
]
____________________________________________________________
параметры для text_audiofile
[
'label' => '',
'text' => [
'id' => '*'
'title' => '',
'value' => ''
], // *
'audiofile' => [
'id' => '*',
'value' => 'Путь к файлу',
'title' => ''
]
]
____________________________________________________________
параметры для custom
[
'value' => 'любой html код'
]
____________________________________________________________
/*! jquery-textcomplete - v1.8.5 - 2019-02-17 */
!function(a){if("function"==typeof define&&define.amd)define(["jquery"],a);else if("object"==typeof module&&module.exports){var b=require("jquery");module.exports=a(b)}else a(jQuery)}(function(a){if("undefined"==typeof a)throw new Error("jQuery.textcomplete requires jQuery");return+function(a){"use strict";var b=function(a){console.warn&&console.warn(a)},c=1;a.fn.textcomplete=function(d,e){var f=Array.prototype.slice.call(arguments);return this.each(function(){var g=this,h=a(this),i=h.data("textComplete");if(i||(e||(e={}),e._oid=c++,i=new a.fn.textcomplete.Completer(this,e),h.data("textComplete",i)),"string"==typeof d){if(!i)return;f.shift(),i[d].apply(i,f),"destroy"===d&&h.removeData("textComplete")}else a.each(d,function(c){a.each(["header","footer","placement","maxCount"],function(a){c[a]&&(i.option[a]=c[a],b(a+"as a strategy param is deprecated. Use option."),delete c[a])})}),i.register(a.fn.textcomplete.Strategy.parse(d,{el:g,$el:h}))})}}(a),+function(a){"use strict";function b(c,d){if(this.$el=a(c),this.id="textcomplete"+e++,this.strategies=[],this.views=[],this.option=a.extend({},b.defaults,d),!(this.$el.is("input[type=text]")||this.$el.is("input[type=search]")||this.$el.is("textarea")||c.isContentEditable||"true"==c.contentEditable))throw new Error("textcomplete must be called on a Textarea or a ContentEditable.");if(c===c.ownerDocument.activeElement)this.initialize();else{var g=this;this.$el.one("focus."+this.id,function(){g.initialize()}),this.option.adapter&&"CKEditor"!=this.option.adapter||"undefined"==typeof CKEDITOR||!this.$el.is("textarea")||CKEDITOR.on("instanceReady",function(b){-1==a.inArray(b.editor.id,f)&&(f.push(b.editor.id),b.editor.on("focus",function(c){g.$el=a(b.editor.editable().$),g.option.adapter||(g.option.adapter=a.fn.textcomplete.CKEditor),g.option.ckeditor_instance=b.editor,g.initialize()}))})}}var c=function(a){var b,c;return function(){var d=Array.prototype.slice.call(arguments);if(b)return void(c=d);b=!0;var e=this;d.unshift(function f(){if(c){var d=c;c=void 0,d.unshift(f),a.apply(e,d)}else b=!1}),a.apply(this,d)}},d=function(a){return"[object String]"===Object.prototype.toString.call(a)},e=0,f=[];b.defaults={appendTo:"body",className:"",dropdownClassName:"dropdown-menu textcomplete-dropdown",maxCount:10,zIndex:"100",rightEdgeOffset:30},a.extend(b.prototype,{id:null,option:null,strategies:null,adapter:null,dropdown:null,$el:null,$iframe:null,initialize:function(){var b=this.$el.get(0);if(this.$el.prop("ownerDocument")!==document&&window.frames.length)for(var c=0;c<window.frames.length;c++)if(this.$el.prop("ownerDocument")===window.frames[c].document){this.$iframe=a(window.frames[c].frameElement);break}this.dropdown=new a.fn.textcomplete.Dropdown(b,this,this.option);var d,e;this.option.adapter?d=this.option.adapter:(e=this.$el.is("textarea")||this.$el.is("input[type=text]")||this.$el.is("input[type=search]")?"number"==typeof b.selectionEnd?"Textarea":"IETextarea":"ContentEditable",d=a.fn.textcomplete[e]),this.adapter=new d(b,this,this.option)},destroy:function(){this.$el.off("."+this.id),this.adapter&&this.adapter.destroy(),this.dropdown&&this.dropdown.destroy(),this.$el=this.adapter=this.dropdown=null},deactivate:function(){this.dropdown&&this.dropdown.deactivate()},trigger:function(a,b){this.dropdown||this.initialize(),null!=a||(a=this.adapter.getTextFromHeadToCaret());var c=this._extractSearchQuery(a);if(c.length){var d=c[1];if(b&&this._term===d&&""!==d)return;this._term=d,this._search.apply(this,c)}else this._term=null,this.dropdown.deactivate()},fire:function(a){var b=Array.prototype.slice.call(arguments,1);return this.$el.trigger(a,b),this},register:function(a){Array.prototype.push.apply(this.strategies,a)},select:function(a,b,c){this._term=null,this.adapter.select(a,b,c),this.fire("change").fire("textComplete:select",a,b),this.adapter.focus()},_clearAtNext:!0,_term:null,_extractSearchQuery:function(b){for(var c=0;c<this.strategies.length;c++){var e=this.strategies[c],f=e.context(b);if(f||""===f){var g=a.isFunction(e.match)?e.match(b):e.match;d(f)&&(b=f);var h=b.match(g);if(h)return[e,h[e.index],h]}}return[]},_search:c(function(a,b,c,d){var e=this;b.search(c,function(d,f){e.dropdown.shown||e.dropdown.activate(),e._clearAtNext&&(e.dropdown.clear(),e._clearAtNext=!1),e.dropdown.setPosition(e.adapter.getCaretPosition()),e.dropdown.render(e._zip(d,b,c)),f||(a(),e._clearAtNext=!0)},d)}),_zip:function(b,c,d){return a.map(b,function(a){return{value:a,strategy:c,term:d}})}}),a.fn.textcomplete.Completer=b}(a),+function(a){"use strict";function b(c,d,f){this.$el=b.createElement(f),this.completer=d,this.id=d.id+"dropdown",this._data=[],this.$inputEl=a(c),this.option=f,f.listPosition&&(this.setPosition=f.listPosition),f.height&&this.$el.height(f.height);var g=this;a.each(["maxCount","placement","footer","header","noResultsMessage","className"],function(a,b){null!=f[b]&&(g[b]=f[b])}),this._bindEvents(c),e[this.id]=this}var c=a(window),d=function(a,b){var c,d,e=b.strategy.idProperty;for(c=0;c<a.length;c++)if(d=a[c],d.strategy===b.strategy)if(e){if(d.value[e]===b.value[e])return!0}else if(d.value===b.value)return!0;return!1},e={};a(document).on("click",function(b){var c=b.originalEvent&&b.originalEvent.keepTextCompleteDropdown;a.each(e,function(a,b){a!==c&&b.deactivate()})});var f={SKIP_DEFAULT:0,KEY_UP:1,KEY_DOWN:2,KEY_ENTER:3,KEY_PAGEUP:4,KEY_PAGEDOWN:5,KEY_ESCAPE:6};a.extend(b,{createElement:function(b){var c=b.appendTo;c instanceof a||(c=a(c));var d=a("<ul></ul>").addClass(b.dropdownClassName).attr("id","textcomplete-dropdown-"+b._oid).css({display:"none",left:0,position:"absolute",zIndex:b.zIndex}).appendTo(c);return d}}),a.extend(b.prototype,{$el:null,$inputEl:null,completer:null,footer:null,header:null,id:null,maxCount:null,placement:"",shown:!1,data:[],className:"",destroy:function(){this.deactivate(),this.$el.off("."+this.id),this.$inputEl.off("."+this.id),this.clear(),this.$el.remove(),this.$el=this.$inputEl=this.completer=null,delete e[this.id]},render:function(b){var c=this._buildContents(b),d=a.map(b,function(a){return a.value});if(b.length){var e=b[0].strategy;e.id?this.$el.attr("data-strategy",e.id):this.$el.removeAttr("data-strategy"),this._renderHeader(d),this._renderFooter(d),c&&(this._renderContents(c),this._fitToBottom(),this._fitToRight(),this._activateIndexedItem()),this._setScroll()}else this.noResultsMessage?this._renderNoResultsMessage(d):this.shown&&this.deactivate()},setPosition:function(b){var d="absolute";return this.$inputEl.add(this.$inputEl.parents()).each(function(){return"absolute"===a(this).css("position")?!1:"fixed"===a(this).css("position")?(b.top-=c.scrollTop(),b.left-=c.scrollLeft(),d="fixed",!1):void 0}),this.$el.css(this._applyPlacement(b)),this.$el.css({position:d}),this},clear:function(){this.$el.html(""),this.data=[],this._index=0,this._$header=this._$footer=this._$noResultsMessage=null},activate:function(){return this.shown||(this.clear(),this.$el.show(),this.className&&this.$el.addClass(this.className),this.completer.fire("textComplete:show"),this.shown=!0),this},deactivate:function(){return this.shown&&(this.$el.hide(),this.className&&this.$el.removeClass(this.className),this.completer.fire("textComplete:hide"),this.shown=!1),this},isUp:function(a){return 38===a.keyCode||a.ctrlKey&&80===a.keyCode},isDown:function(a){return 40===a.keyCode||a.ctrlKey&&78===a.keyCode},isEnter:function(a){var b=a.ctrlKey||a.altKey||a.metaKey||a.shiftKey;return!b&&(13===a.keyCode||9===a.keyCode||this.option.completeOnSpace===!0&&32===a.keyCode)},isPageup:function(a){return 33===a.keyCode},isPagedown:function(a){return 34===a.keyCode},isEscape:function(a){return 27===a.keyCode},_data:null,_index:null,_$header:null,_$noResultsMessage:null,_$footer:null,_bindEvents:function(){this.$el.on("mousedown."+this.id,".textcomplete-item",a.proxy(this._onClick,this)),this.$el.on("touchstart."+this.id,".textcomplete-item",a.proxy(this._onClick,this)),this.$el.on("mouseover."+this.id,".textcomplete-item",a.proxy(this._onMouseover,this)),this.$inputEl.on("keydown."+this.id,a.proxy(this._onKeydown,this))},_onClick:function(b){var c=a(b.target);b.preventDefault(),b.originalEvent.keepTextCompleteDropdown=this.id,c.hasClass("textcomplete-item")||(c=c.closest(".textcomplete-item"));var d=this.data[parseInt(c.data("index"),10)];this.completer.select(d.value,d.strategy,b);var e=this;setTimeout(function(){e.deactivate(),"touchstart"===b.type&&e.$inputEl.focus()},0)},_onMouseover:function(b){var c=a(b.target);b.preventDefault(),c.hasClass("textcomplete-item")||(c=c.closest(".textcomplete-item")),this._index=parseInt(c.data("index"),10),this._activateIndexedItem()},_onKeydown:function(b){if(this.shown){var c;switch(a.isFunction(this.option.onKeydown)&&(c=this.option.onKeydown(b,f)),null==c&&(c=this._defaultKeydown(b)),c){case f.KEY_UP:b.preventDefault(),this._up();break;case f.KEY_DOWN:b.preventDefault(),this._down();break;case f.KEY_ENTER:b.preventDefault(),this._enter(b);break;case f.KEY_PAGEUP:b.preventDefault(),this._pageup();break;case f.KEY_PAGEDOWN:b.preventDefault(),this._pagedown();break;case f.KEY_ESCAPE:b.preventDefault(),this.deactivate()}}},_defaultKeydown:function(a){return this.isUp(a)?f.KEY_UP:this.isDown(a)?f.KEY_DOWN:this.isEnter(a)?f.KEY_ENTER:this.isPageup(a)?f.KEY_PAGEUP:this.isPagedown(a)?f.KEY_PAGEDOWN:this.isEscape(a)?f.KEY_ESCAPE:void 0},_up:function(){0===this._index?this._index=this.data.length-1:this._index-=1,this._activateIndexedItem(),this._setScroll()},_down:function(){this._index===this.data.length-1?this._index=0:this._index+=1,this._activateIndexedItem(),this._setScroll()},_enter:function(a){var b=this.data[parseInt(this._getActiveElement().data("index"),10)];this.completer.select(b.value,b.strategy,a),this.deactivate()},_pageup:function(){var b=0,c=this._getActiveElement().position().top-this.$el.innerHeight();this.$el.children().each(function(d){return a(this).position().top+a(this).outerHeight()>c?(b=d,!1):void 0}),this._index=b,this._activateIndexedItem(),this._setScroll()},_pagedown:function(){var b=this.data.length-1,c=this._getActiveElement().position().top+this.$el.innerHeight();this.$el.children().each(function(d){return a(this).position().top>c?(b=d,!1):void 0}),this._index=b,this._activateIndexedItem(),this._setScroll()},_activateIndexedItem:function(){this.$el.find(".textcomplete-item.active").removeClass("active"),this._getActiveElement().addClass("active")},_getActiveElement:function(){return this.$el.children(".textcomplete-item:nth("+this._index+")")},_setScroll:function(){var a=this._getActiveElement(),b=a.position().top,c=a.outerHeight(),d=this.$el.innerHeight(),e=this.$el.scrollTop();0===this._index||this._index==this.data.length-1||0>b?this.$el.scrollTop(b+e):b+c>d&&this.$el.scrollTop(b+c+e-d)},_buildContents:function(a){var b,c,e,f="";for(c=0;c<a.length&&this.data.length!==this.maxCount;c++)b=a[c],d(this.data,b)||(e=this.data.length,this.data.push(b),f+='<li class="textcomplete-item" data-index="'+e+'"><a>',f+=b.strategy.template(b.value,b.term),f+="</a></li>");return f},_renderHeader:function(b){if(this.header){this._$header||(this._$header=a('<li class="textcomplete-header"></li>').prependTo(this.$el));var c=a.isFunction(this.header)?this.header(b):this.header;this._$header.html(c)}},_renderFooter:function(b){if(this.footer){this._$footer||(this._$footer=a('<li class="textcomplete-footer"></li>').appendTo(this.$el));var c=a.isFunction(this.footer)?this.footer(b):this.footer;this._$footer.html(c)}},_renderNoResultsMessage:function(b){if(this.noResultsMessage){this._$noResultsMessage||(this._$noResultsMessage=a('<li class="textcomplete-no-results-message"></li>').appendTo(this.$el));var c=a.isFunction(this.noResultsMessage)?this.noResultsMessage(b):this.noResultsMessage;this._$noResultsMessage.html(c)}},_renderContents:function(a){this._$footer?this._$footer.before(a):this.$el.append(a)},_fitToBottom:function(){var a=c.scrollTop()+c.height(),b=this.$el.height();this.$el.position().top+b>a&&(this.completer.$iframe||this.$el.offset({top:a-b}))},_fitToRight:function(){for(var a,b=this.option.rightEdgeOffset,d=this.$el.offset().left,e=this.$el.width(),f=c.width()-b;d+e>f&&(this.$el.offset({left:d-b}),a=this.$el.offset().left,!(a>=d));)d=a},_applyPlacement:function(a){return-1!==this.placement.indexOf("top")?a={top:"auto",bottom:this.$el.parent().height()-a.top+a.lineHeight,left:a.left}:(a.bottom="auto",delete a.lineHeight),-1!==this.placement.indexOf("absleft")?a.left=0:-1!==this.placement.indexOf("absright")&&(a.right=0,a.left="auto"),a}}),a.fn.textcomplete.Dropdown=b,a.extend(a.fn.textcomplete,f)}(a),+function(a){"use strict";function b(b){a.extend(this,b),this.cache&&(this.search=c(this.search))}var c=function(a){var b={};return function(c,d){b[c]?d(b[c]):a.call(this,c,function(a){b[c]=(b[c]||[]).concat(a),d.apply(null,arguments)})}};b.parse=function(c,d){return a.map(c,function(a){var c=new b(a);return c.el=d.el,c.$el=d.$el,c})},a.extend(b.prototype,{match:null,replace:null,search:null,id:null,cache:!1,context:function(){return!0},index:2,template:function(a){return a},idProperty:null}),a.fn.textcomplete.Strategy=b}(a),+function(a){"use strict";function b(){}var c=Date.now||function(){return(new Date).getTime()},d=function(a,b){var d,e,f,g,h,i=function(){var j=c()-g;b>j?d=setTimeout(i,b-j):(d=null,h=a.apply(f,e),f=e=null)};return function(){return f=this,e=arguments,g=c(),d||(d=setTimeout(i,b)),h}};a.extend(b.prototype,{id:null,completer:null,el:null,$el:null,option:null,initialize:function(b,c,e){this.el=b,this.$el=a(b),this.id=c.id+this.constructor.name,this.completer=c,this.option=e,this.option.debounce&&(this._onKeyup=d(this._onKeyup,this.option.debounce)),this._bindEvents()},destroy:function(){this.$el.off("."+this.id),this.$el=this.el=this.completer=null},select:function(){throw new Error("Not implemented")},getCaretPosition:function(){var b=this._getCaretRelativePosition(),c=this.$el.offset(),d=this.option.appendTo;if(d){d instanceof a||(d=a(d));var e=d.offsetParent().offset();c.top-=e.top,c.left-=e.left}return b.top+=c.top,b.left+=c.left,b},focus:function(){this.$el.focus()},_bindEvents:function(){this.$el.on("keyup."+this.id,a.proxy(this._onKeyup,this))},_onKeyup:function(a){this._skipSearch(a)||this.completer.trigger(this.getTextFromHeadToCaret(),!0)},_skipSearch:function(a){switch(a.keyCode){case 9:case 13:case 16:case 17:case 18:case 33:case 34:case 40:case 38:case 27:return!0}if(a.ctrlKey)switch(a.keyCode){case 78:case 80:return!0}}}),a.fn.textcomplete.Adapter=b}(a),+function(a){"use strict";function b(a,b,c){this.initialize(a,b,c)}a.extend(b.prototype,a.fn.textcomplete.Adapter.prototype,{select:function(b,c,d){var e,f=this.getTextFromHeadToCaret(),g=this.el.value.substring(this.el.selectionEnd),h=c.replace(b,d);"undefined"!=typeof h&&(a.isArray(h)&&(g=h[1]+g,h=h[0]),e=a.isFunction(c.match)?c.match(f):c.match,f=f.replace(e,h),this.$el.val(f+g),this.el.selectionStart=this.el.selectionEnd=f.length)},getTextFromHeadToCaret:function(){return this.el.value.substring(0,this.el.selectionEnd)},_getCaretRelativePosition:function(){var b=a.fn.textcomplete.getCaretCoordinates(this.el,this.el.selectionStart);return{top:b.top+this._calculateLineHeight()-this.$el.scrollTop(),left:b.left-this.$el.scrollLeft(),lineHeight:this._calculateLineHeight()}},_calculateLineHeight:function(){var a=parseInt(this.$el.css("line-height"),10);if(isNaN(a)){var b=this.el.parentNode,c=document.createElement(this.el.nodeName),d=this.el.style;c.setAttribute("style","margin:0px;padding:0px;font-family:"+d.fontFamily+";font-size:"+d.fontSize),c.innerHTML="test",b.appendChild(c),a=c.clientHeight,b.removeChild(c)}return a}}),a.fn.textcomplete.Textarea=b}(a),+function(a){"use strict";function b(b,d,e){this.initialize(b,d,e),a("<span>"+c+"</span>").css({position:"absolute",top:-9999,left:-9999}).insertBefore(b)}var c="";a.extend(b.prototype,a.fn.textcomplete.Textarea.prototype,{select:function(b,c,d){var e,f=this.getTextFromHeadToCaret(),g=this.el.value.substring(f.length),h=c.replace(b,d);if("undefined"!=typeof h){a.isArray(h)&&(g=h[1]+g,h=h[0]),e=a.isFunction(c.match)?c.match(f):c.match,f=f.replace(e,h),this.$el.val(f+g),this.el.focus();var i=this.el.createTextRange();i.collapse(!0),i.moveEnd("character",f.length),i.moveStart("character",f.length),i.select()}},getTextFromHeadToCaret:function(){this.el.focus();var a=document.selection.createRange();a.moveStart("character",-this.el.value.length);var b=a.text.split(c);return 1===b.length?b[0]:b[1]}}),a.fn.textcomplete.IETextarea=b}(a),+function(a){"use strict";function b(a,b,c){this.initialize(a,b,c)}a.extend(b.prototype,a.fn.textcomplete.Adapter.prototype,{select:function(b,c,d){var e=this.getTextFromHeadToCaret(),f=this.el.ownerDocument.getSelection(),g=f.getRangeAt(0),h=g.cloneRange();h.selectNodeContents(g.startContainer);var i,j=h.toString(),k=j.substring(g.startOffset),l=c.replace(b,d);if("undefined"!=typeof l){a.isArray(l)&&(k=l[1]+k,l=l[0]),i=a.isFunction(c.match)?c.match(e):c.match,e=e.replace(i,l).replace(/ $/,"&nbsp"),g.selectNodeContents(g.startContainer),g.deleteContents();var m=this.el.ownerDocument.createElement("div");m.innerHTML=e;var n=this.el.ownerDocument.createElement("div");n.innerHTML=k;for(var o,p,q=this.el.ownerDocument.createDocumentFragment();o=m.firstChild;)p=q.appendChild(o);for(;o=n.firstChild;)q.appendChild(o);g.insertNode(q),g.setStartAfter(p),g.collapse(!0),f.removeAllRanges(),f.addRange(g)}},_getCaretRelativePosition:function(){var b=this.el.ownerDocument.getSelection().getRangeAt(0).cloneRange(),c=b.endContainer.parentNode,d=this.el.ownerDocument.createElement("span");b.insertNode(d),b.selectNodeContents(d),b.deleteContents(),setTimeout(function(){c.normalize()},0);var e=a(d),f=e.offset();if(f.left-=this.$el.offset().left,f.top+=e.height()-this.$el.offset().top,f.lineHeight=e.height(),this.completer.$iframe){var g=this.completer.$iframe.offset();f.top+=g.top,f.left+=g.left,f.top-=a(this.completer.$iframe[0].contentWindow.document).scrollTop()}return e.remove(),f},getTextFromHeadToCaret:function(){var a=this.el.ownerDocument.getSelection().getRangeAt(0),b=a.cloneRange();return b.selectNodeContents(a.startContainer),b.toString().substring(0,a.startOffset)}}),a.fn.textcomplete.ContentEditable=b}(a),+function(a){"use strict";function b(a,b,c){this.initialize(a,b,c)}a.extend(b.prototype,a.fn.textcomplete.ContentEditable.prototype,{_bindEvents:function(){var b=this;this.option.ckeditor_instance.on("key",function(a){var c=a.data;return b._onKeyup(c),b.completer.dropdown.shown&&b._skipSearch(c)?!1:void 0},null,null,1),this.$el.on("keyup."+this.id,a.proxy(this._onKeyup,this))}}),a.fn.textcomplete.CKEditor=b}(a),function(a){function b(a,b,f){if(!d)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var g=f&&f.debug||!1;if(g){var h=document.querySelector("#input-textarea-caret-position-mirror-div");h&&h.parentNode.removeChild(h)}var i=document.createElement("div");i.id="input-textarea-caret-position-mirror-div",document.body.appendChild(i);var j=i.style,k=window.getComputedStyle?getComputedStyle(a):a.currentStyle;j.whiteSpace="pre-wrap","INPUT"!==a.nodeName&&(j.wordWrap="break-word"),j.position="absolute",g||(j.visibility="hidden"),c.forEach(function(a){j[a]=k[a]}),e?a.scrollHeight>parseInt(k.height)&&(j.overflowY="scroll"):j.overflow="hidden",i.textContent=a.value.substring(0,b),"INPUT"===a.nodeName&&(i.textContent=i.textContent.replace(/\s/g," "));var l=document.createElement("span");l.textContent=a.value.substring(b)||".",i.appendChild(l);var m={top:l.offsetTop+parseInt(k.borderTopWidth),left:l.offsetLeft+parseInt(k.borderLeftWidth)};return g?l.style.backgroundColor="#aaa":document.body.removeChild(i),m}var c=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],d="undefined"!=typeof window,e=d&&null!=window.mozInnerScreenX;a.fn.textcomplete.getCaretCoordinates=b}(a),a});
//# sourceMappingURL=dist/jquery.textcomplete.min.map
\ No newline at end of file
<?
$MESS['TUG_SETTINGS_ADD_TIME_MSG'] = 'Add...';
\ No newline at end of file
<?
$MESS['TUG_SETTINGS_'] = 'aaaa';
\ No newline at end of file
<?
$MESS['TUG_SETTINGS_ADD_TIME_MSG'] = 'Еще...';
\ No newline at end of file
<?
$MESS['TUG_SETTINGS_'] = 'aaaa';
\ No newline at end of file
<?
$MESS['MULTY__ADD_FIELD'] = 'Добавить поле';
\ No newline at end of file
"use strict";
var ajaxFunctions = {
}
$().ready(function () {
var dataTogles = $("[data-toggle]");
var $form = $("#" + formId);
dataTogles.on("click", function () {
var $el = $(this);
var target = $el.data("target");
var $target = $(target);
$target.slideToggle(() => {
$target.css({
overflow: "visible"
})
});
});
$form.on("submit", function(e) {
e.preventDefault();
// clear empty multy fields
$form.find("input[data-field-multy], select[data-field-multy], textarea[data-field-multy]").each(function() {
var $el = $(this);
var val = $el.val();
if(val) {
return;
}
$el.remove();
})
this.submit();
});
})
function getCurrentCursorPositionSetVal() {
var sel, range, func;
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
func = (html) => {
range = sel.getRangeAt(0);
range.deleteContents();
var el = document.createElement("div");
var frag = document.createDocumentFragment(), node, lastNode;
el.innerHTML = html;
while ( (node = el.firstChild) ) {
lastNode = frag.appendChild(node);
}
range.insertNode(frag);
if (lastNode) {
range = range.cloneRange();
range.setStartAfter(lastNode);
range.collapse(true);
sel.removeAllRanges();
sel.addRange(range);
}
}
}
} else if (document.selection && document.selection.type != "Control") {
func = (html) => document.selection.createRange().pasteHTML(html);
}
return func;
}
function MultyTextInput(selectors) {
this.selectors = selectors;
this.$get = {
fieldContainer: () => $(selectors.fieldContainer),
addFiled: () => $(selectors.addFiled),
cards: (s="") => $(selectors.fieldContainer + ' ' + selectors.card + s),
removeBtn: (s="") => $(selectors.fieldContainer + ' ' + selectors.removeBtn + s),
}
this.copyContainer = null;
};
MultyTextInput.prototype = {
init() {
var self = this;
var $addFiled = this.$get.addFiled();
var $removeBtn = this.$get.removeBtn();
var clone = this.getCopyContainer(this.$get.cards(":last"));
// this.$cloneNode = clone;
$addFiled.on("click", function() {
var cloneNode = clone.clone();
self.addEvents(cloneNode);
self.addFiled(cloneNode);
self.controller();
});
$removeBtn.on("click", function() {
self.removeFiled(this);
self.controller();
});
},
getCopyContainer(el) {
var copy = $(el)
.clone()
.attr({
id: ""
});
copy.find("input").val("");
return copy;
},
addEvents(node) {
var self = this;
var $node = $(node);
$node.find(this.selectors.removeBtn).on("click", function() {
self.removeFiled(this);
self.controller();
})
},
controller() {
var $cards = this.$get.cards();
if($cards.length > 1) {
this.$get.removeBtn().show();
return;
}
this.$get.removeBtn().hide();
},
addFiled(cloneNode) {
var $cont = this.$get.fieldContainer();
$cont.append(cloneNode)
},
removeFiled(el) {
var $el = $(el);
$el.parent().remove();
}
};
// function ajaxForm(form, options) {
// $(form).on("submit", function(e) {
// var ajaxParams = {
// url: $(form).attr("action"),
// method : $(form).attr("method"),
// data: $(form).serialize(),
// success: function(data) {
// options.function($(form, data))
// },
// error: function(er) {
// options.error($(form, er))
// }
// }
// // e.preventDefault();
// // $.ajax(ajaxParams);
// })
// // this.form = $(form);
// // this.success = options.success
// // this.error = options.error
// // this.init()
// }
// function defaultSuccess(form, data) {
// }
// function defaultError(form, data) {
// }
// ajaxForm.prototype = {
// init() {
// this.form.on("submit", function() {
// })
// },
// _send() {
// var params = {
// url: this.form.attr("action"),
// method: this.form.attr("method"),
// data: this.form.serialize(),
// success: this.options.function,
// error: this.options.error
// };
// $.ajax(params);
// }
// }
\ No newline at end of file
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--theme-color-danger: #ff5752;
--theme-color-warn: #d5a933;
--theme-color-success: #7bd500;
--theme-color-primary: #4F9CED;
--theme-color-gray: #696969;
}
.ui-ctl-label-text {
padding-left: 20px;
}
/**
* Table
**/
table.sms-sender-grid-table,
table.sms-sender-grid-table td,
table.sms-sender-grid-table th {
border: 1px solid #ddd;
text-align: left;
}
table.sms-sender-grid-table {
border-collapse: collapse;
width: 100%;
}
table.sms-sender-grid-table th,
table.sms-sender-grid-table td {
padding: 15px;
}
table.sms-sender-grid-table,
table.sms-sender-grid-table td,
table.sms-sender-grid-table th {
border: 1px solid #ddd;
text-align: left;
}
table.sms-sender-grid-table {
border-collapse: collapse;
width: 100%;
}
table.sms-sender-grid-table th,
table.sms-sender-grid-table td {
padding: 15px;
}
.fixwidth .form-table-label-td {
width: 400px;
}
/**
* END Table
**/
/**
* color picker
**/
.color-picker label {
width: 150px;
display: inline-block;
text-align: right;
}
.color-picker {
margin: 5px;
padding: 3px;
}
.td_multy {
vertical-align: baseline;
}
.field__container {
margin: 0 !important;
margin-bottom: 0.5em !important;
}
/**
* END color picker
**/
/**
* ui
**/
.ui-form-block {
margin: 10px 0;
width: 87%;
}
.ui-form-block label {
min-width: 250px;
}
.ui-ctl-number {
width: 80px !important;
}
.ui-ctl-timeinterval,
.ui-ctl-timeinput {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.ui-ctl-timeinterval input,
.ui-ctl-timeinput input {
width: 100px !important;
}
.ui-ctl-element {
z-index: auto !important;
overflow: visible !important;
}
.ui-time {
flex-basis: 0;
-ms-flex-positive: 1;
flex-grow: 1;
max-width: 100%;
width: 100px;
margin-right: 10px;
margin-bottom: 5px;
}
.ui-circle {
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
}
/** ui circle color **/
.ui-circle-success {
background-color: var(--theme-color-success);
}
.ui-circle-danger {
background-color: var(--theme-color-danger);
}
/** ui text color **/
.ui-text-danger {
color: var(--theme-color-danger);
}
.ui-text-success {
color: var(--theme-color-success);
}
.ui-text-warn {
color: var(--theme-color-warn);
}
.ui-text-primary {
color: var(--theme-color-primary);
}
/**
* END ui
**/
/**
* other
**/
.workarea-content-paddings {
min-height: 100%;
}
.alv_plus_icon:before {
background-image: url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%3E%0A%20%20%3Cpath%20fill%3D%22%23FFF%22%20fill-rule%3D%22evenodd%22%20d%3D%22M5%2C3%20L8%2C3%20L8%2C5%20L5%2C5%20L5%2C8%20L3%2C8%20L3%2C5%20L0%2C5%20L1.2246468e-16%2C3%20L3%2C3%20L3%2C0%20L5%2C0%20L5%2C3%20Z%22/%3E%0A%3C/svg%3E%0A);
opacity: .8;
display: block;
content: "";
width: 8px;
height: 8px;
position: absolute;
left: 8px;
top: 8px;
transition: opacity .3s;
}
.alv_plus_icon {
position: absolute;
cursor: pointer;
width: 18px;
height: 18px;
padding: 1px 2px 5px 5px;
font-weight: bold;
font-size: 1.5em;
background-color: #0069c4;
bottom: -10px;
right: 10px;
top: auto;
left: auto;
border-radius: 50%;
}
.form-talbe {
width: 100%;
}
.fieldset {
margin: 15px 0;
position: relative;
min-inline-size: auto;
}
.textareas_container {
padding-top: 1em;
padding-bottom: 1em;
display: grid;
grid-gap: 0.5em;
}
.box {
border-width: 2px;
border-style: solid;
}
.box__btn {
display: block;
width: 100%;
border: none;
cursor: pointer;
text-align: left;
}
.box__btn_icon {
border: none;
}
.box__content {
padding: .5em;
background-color: #eef2f4;
}
.box__btn:focus {
outline: 1px solid #222;
}
.box__content__text__placeholder {
color: #9e9e9e;
padding-top: 5px;
}
.emojionearea .emojionearea-editor {
height: auto !important;
max-height: none !important;
}
textarea {
width: 100%;
padding: 0.5em;
resize: none;
}
.w-full {
width: 100%;
}
regval {
color: var(--theme-color-gray);
display: inline !important;
text-decoration: underline;
cursor: pointer;
}
/* textarea:focus {
outline-color: #00ffff;
} */
\ No newline at end of file
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)
{
die();
}
use Bitrix\Main\Page\Asset;
\Bitrix\Main\UI\Extension::load("ui.fonts.opensans");
\Bitrix\Main\UI\Extension::load("ui.forms");
\Bitrix\Main\UI\Extension::load("ui.buttons");
CJSCore::Init(array("jquery"));
$componentPath = 'tug/tug.settings/templates/.default';
Asset::getInstance()->addJs('/bitrix/components/'.$componentPath.'/jquery.textcomplete.min.js');
Asset::getInstance()->addJs('/bitrix/components/'.$componentPath.'/EmojioneArea.js');
Asset::getInstance()->addCss('/bitrix/components/'.$componentPath.'/EmojioneArea.css');
if (!is_array($arResult["SECTIONS"]) || empty($arResult["SECTIONS"]))
{
return;
}
$defBgColor = "#4F9CED";
$arMoreFileds = [];
$isBitrix24Template = (SITE_TEMPLATE_ID == "bitrix24");
?>
<?if($isBitrix24Template):?>
<?
$bodyClass = $APPLICATION->GetPageProperty("BodyClass");
$APPLICATION->SetPageProperty("BodyClass", ($bodyClass ? $bodyClass." " : "")."pagetitle-toolbar-field-view");
$this->SetViewTarget("inside_pagetitle", 0);
?>
<div class="pagetitle-container pagetitle-flexible-space">
<?if(!empty($arResult["PAGETITLE_BUTTONS"])):?>
<div class="pagetitle-container pagetitle-align-right-container">
<?foreach($arResult["PAGETITLE_BUTTONS"] as $tbButton):?>
<button type="button"
class="ui-btn ui-btn-md ui-btn-themes <?=$tbButton['CLASSES'] ?: 'ui-btn-light-border'?>"
<?if($tbButton['ON_CLICK']):?>
onclick="<?=$tbButton['ON_CLICK']?>"
<?endif?>
></button>
<?endforeach?>
</div>
<?endif?>
</div>
<?
$this->EndViewTarget();
?>
<?endif?>
<form method="POST" class="fixwidth" name="form_<?=$arResult["FORM_ID"]?>" action="<?=POST_FORM_ACTION_URI?>" id="form_<?=$arResult["FORM_ID"]?>" enctype="multipart/form-data">
<?=bitrix_sessid_post();?>
<input type="hidden" name="Update" value="Y">
<input type="hidden" name="Formid" value="<?=$arResult["FORM_ID"]?>">
<?foreach ($arResult["SECTIONS"] as $section):?>
<div class="ui-form-section"
<?if(!empty($section['ID'])):?>
id="<?=$section['ID']?>"
<?endif?>
>
<?if (!empty($section["TITLE"])):?>
<div class="ui-form-section-title">
<h2>
<?=$section["TITLE"]?>
</h2>
</div>
<?endif?>
<?if (is_array($section["FIELDS"]) && !empty($section["FIELDS"])):?>
<table class="form-talbe">
<tbody>
<?foreach ($section["FIELDS"] as $arKey => $field):
$fId = $field['id'];
$fName = $fId;
$isMulty = false;
if($field['multy'] === 'Y') {
$isMulty = true;
$fName .= '[]';
}
if($field["type"]=="textarea_morefile"){
$arMoreFileds[$field["id"]] = $field;
continue;
}
switch ($field["type"])
{
case "userbox":?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline">
<?$APPLICATION->IncludeComponent('bitrix:main.user.selector', '',
[
'ID' => $fId,
"API_VERSION" => 3,
//"LIST" => ['U1', 'SG2', 'DR3'],
"LIST" => json_decode($field["value"]), //['SG2', 'DR3'],
"INPUT_NAME" => $fId."[]", //"fields[crm_queue][]",
"USE_SYMBOLIC_ID" => true,
"BUTTON_SELECT_CAPTION" => $field["title"],
"SELECTOR_OPTIONS" => [
"enableDepartments" => "Y",
"departmentSelectDisable" => "N",
"context" => "MAIL_CLIENT_CONFIG_QUEUE",
"contextCode" => (!empty($field["itype"])) ? $field["itype"] : "U",
"enableAll" => "N",
"userSearchArea" => "I"
]
]);?>
</div>
</td>
</tr>
<?break;
case "text":
case "password":?>
<tr>
<td class="form-table-label-td <?=$isMulty ? 'td_multy' : ''?>">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<?if($isMulty):?>
<div id="<?=$fId?>__container">
<?foreach($field['value'] as $value):?>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline w-full field__container">
<button type="button" class="ui-ctl-after ui-ctl-icon-clear field_remove"></button>
<input
name="<?=$fName?>"
type="<?=$field["type"]?>"
class="ui-ctl-element w-full"
value="<?=$value ?: ''?>"
placeholder="<?=$field['placeholder']?>"
<?if($field['disabled'] == 'Y'):?>
disabled="disabled"
<?endif?>
data-field-multy
>
</div>
<?endforeach?>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline w-full field__container">
<button type="button" class="ui-ctl-after ui-ctl-icon-clear field_remove"></button>
<input
name="<?=$fName?>"
type="<?=$field["type"]?>"
class="ui-ctl-element w-full"
value=""
placeholder="<?=$field['placeholder']?>"
<?if($field['disabled'] == 'Y'):?>
disabled="disabled"
<?endif?>
data-field-multy
>
</div>
</div>
<button type="button" class="ui-btn ui-btn-light"
id="<?=$fId?>__add_filed">
<?=getMessage('MULTY__ADD_FIELD')?>
</button>
<?else:?>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline w-full field__container">
<input
id="<?=$fId?>"
name="<?=$fName?>"
type="<?=$field["type"]?>"
class="ui-ctl-element w-full"
value="<?=isset($field["value"]) ? htmlspecialcharsbx($field["value"]) : ""?>"
placeholder="<?=$field['placeholder']?>"
<?if($field['disabled'] == 'Y'):?>
disabled="disabled"
<?endif?>
>
</div>
<?endif?>
<?if($field['text']):?>
<p id="" class="box__content__text__placeholder">
<?=$field['text']?>
</p>
<?endif?>
<script>
(function(){
$(document).ready(function () {
<?if($field['emojy'] === 'Y'):?>
var range = 0;
var $textarea = $("#<?=$fId?>");
$textarea.emojioneArea({
placeholder: "<?=$field['placeholder']?>",
search: false,
filtersPosition: "bottom",
pickerPosition: "bottom",
})
<?endif?>
<?if($isMulty):?>
var selectors = {
fieldContainer: "#<?=$fId?>__container",
addFiled: "#<?=$fId?>__add_filed",
card: ".field__container",
removeBtn: ".field_remove",
};
var multy = new MultyTextInput(selectors);
multy.init();
<?endif?>
});
})()
</script>
</td>
</tr>
<?break;
case "timeinterval":
$arTimeIntervals = explode("-", $field["value"]);?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline ui-ctl-timeinterval">
<input id="<?=$fId?>"
name="<?=$fId?>"
type="hidden"
value="<?=isset($field["value"]) ? $field["value"] : ""?>"
>
<input
id="<?=$fId?>_from"
type="time"
class="ui-ctl-element"
value="<?=isset($arTimeIntervals[0]) ? $arTimeIntervals[0] : ""?>"
onchange="timeintervalChanged('<?=$fId?>')"
>
<span>-</span>
<input
id="<?=$fId?>_to"
type="time"
class="ui-ctl-element"
value="<?=isset($arTimeIntervals[1]) ? $arTimeIntervals[1] : ""?>"
onchange="timeintervalChanged('<?=$fId?>')"
>
</div>
</td>
<script>
// function timeintervalChanged(inp){
// if(typeof inp === 'undefined')
// {
// return;
// }
// var tFrom = BX(inp+'_from').value;
// var tTo = BX(inp+'_to').value;
// BX(inp).value = tFrom + '-' + tTo;
// console.log("ValTEST:",BX(inp).value);
// }
(function() {
var inp = {
from: "<?=$fId?>_from",
to: "<?=$fId?>_to"
};
var $inp = {
from: $("#" + inp.from),
to: $("#" + inp.to)
}
$inp.from.on("change", timeintervalChanged);
$inp.to.on("change", timeintervalChanged);
function timeintervalChanged(inp){
if(typeof inp === 'undefined')
{
return;
}
var values = {
from: $inp.from.value(),
to: $inp.to.value()
}
this.value = values.from + '-' + values.to;
}
})()
</script>
</tr>
<?break;
case "time":?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<div class="ui-time-container" id="<?=$fId?>_box">
<input id="<?=$fId?>" type="hidden" value="<?=isset($field["value"]) ? $field["value"] : ""?>"/>
<?if(!empty($field["multiple"]) && $field["multiple"] == "Y"):?>
<?if(!empty($field["value"])):?>
<?if(is_array($field["value"])):?>
<?foreach($field["value"] as $tmval):?>
<input
type="time"
name="<?=$fId?>[]"
class="ui-ctl-element ui-time"
value="<?=(!empty($tmval)) ? $tmval : ""?>"
>
<?endforeach?>
<?endif?>
<?else:?>
<input
type="time"
name="<?=$fId?>[]"
class="ui-ctl-element ui-time"
value="<?=(!empty($tmval)) ? $tmval : ""?>"
>
<?endif?>
<?else:?>
<input
id="<?=$fId?>"
type="time"
class="ui-ctl-element ui-time"
value="<?=(!empty($field["value"])) ? $field["value"] : ""?>"
>
<?endif?>
</div>
<?if($field['add_btn'] === 'Y'):?>
<button type="button"
class="ui-btn"
id="ui_add_time_btn__<?=$rKey?>">
<?=GetMessage('TUG_SETTINGS_ADD_TIME_MSG')?>
</button>
<?endif?>
</td>
<?if($field['add_btn'] === 'Y'):?>
<script>
//onchange="timeinputChanged('<?=$fId?>')"
(function(inpid)
{
var btn = "ui_add_time_btn__<?=$rKey?>";
var $el = $("#" + btn);
$el.on("click", timeinputaddmore);
function timeinputaddmore()
{
var inp = BX.create('input', {
attrs: {
className: 'ui-ctl-element ui-time',
type: 'time',
name: inpid+'[]',
}
});
var targ = BX(inpid + "_box");
BX.append(inp, targ);
}
})("<?=$fId?>")
</script>
<?endif?>
</tr>
<?break;
case "number":?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline">
<input type="number"
id="<?=$fId?>"
name="<?=$fId?>"
class="ui-ctl-element ui-ctl-number"
value="<?=isset($field["value"]) ? htmlspecialcharsbx($field["value"]) : ""?>"
>
</div>
</td>
</tr>
<?break;
case "number_diapazon":?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline">
<input type="number"
id="<?=$fId?>_from"
name="<?=$fId?>[]"
class="ui-ctl-element ui-ctl-number"
value="<?=isset($field["value"][0]) ? $field["value"][0] : ""?>"
>
</div>
<div class="ui-ctl ui-ctl-inline">-</div>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline">
<input type="number"
id="<?=$fId?>_to"
name="<?=$fId?>[]"
class="ui-ctl-element ui-ctl-number"
value="<?=isset($field["value"][1]) ? $field["value"][1] : ""?>"
>
</div>
</td>
</tr>
<?break;
case "list":
$defAnsTxt = (!empty($field["items"])) ? "Не выбрано" : "Нет";?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<div id="list-<?=$fId?>" class="ui-ctl ui-ctl-after-icon ui-ctl-dropdown ui-ctl-inline">
<div class="ui-ctl-after ui-ctl-icon-angle"></div>
<div class="ui-ctl-element js-list-title">
<?=!empty($field["value"]) ? htmlspecialcharsbx($field["items"][$field["value"]]) : $defAnsTxt?>
</div>
<input
id="<?=$fId?>"
name="<?=$fId?>"
type="hidden"
value="<?=isset($field["value"]) ? htmlspecialcharsbx($field["value"]) : ""?>"
/>
</div>
</td>
<script>
BX.ready(function () {
var fieldId = "<?=CUtil::JSEscape($fId)?>";
console.log("BEFORE List Items BIND");
BX.bind(BX("list-" + fieldId), "click", function () {
console.log("List Items BIND");
var listItems = [];
var fields = <?=CUtil::PhpToJSObject($field["items"])?>;
console.log("Items: ",fields);
for (var value in fields)
{
if (!fields.hasOwnProperty(value))
continue;
listItems.push({
text: fields[value],
className: "menu-popup-no-icon",
onclick: BX.proxy(function () {
BX(fieldId).value = this.value;
var title = BX.findChild(BX("list-" + fieldId), {className: "js-list-title"}, true, false);
if (BX.type.isDomNode(title))
{
title.innerHTML = this.title;
}
var currentContext = BX.proxy_context;
currentContext.popupWindow.close();
console.log("Curr VaL:",this.value);
<?
if(!empty($field["changereload"])){
if($field["changereload"]=="Y"){
echo 'location.reload();';
}
}
?>
<?
if(!empty($field["changesubmit"])){
if($field["changesubmit"]=="Y"){
echo "BX('form_".$arResult['FORM_ID']."').submit()";
}
}
?>
}, {title: fields[value], value: value})
});
}
BX.PopupMenu.show("form-popup-" + fieldId, this, listItems,
{
offsetTop: 0,
offsetLeft: 0,
width: 320,
angle: false
});
});
});
</script>
</tr>
<?break;
case "colorpicker":?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<input class="ui-btn" type="text"
name="<?=$fId?>"
id="<?=$fId?>"
value="<?echo $field["value"];?>"
style="border:none; <? if(!empty($field['value'])){ echo 'background-color:'.$field['value'].';';}?>"
>
</td>
<script>
(function() {
var box_<?=$fId?> = BX("<?=$fId?>");
BX.bind(box_<?=$fId?>, 'focus', function () {
var picker_<?=$fId?> = new BX.ColorPicker({
bindElement: box_<?=$fId?>,
defaultColor: "#000000",
onColorSelected: function(color, picker) {
box_<?=$fId?>.style.backgroundColor = color;
box_<?=$fId?>.value = color;
}
});
picker_<?=$fId?>.open();
});
})()
</script>
</tr>
<?break;
case "text_audiofile":?>
<tr>
<td colspan="2">
<fieldset class="fieldset">
<legend>
<?=$field["label"]?>
</legend>
<div class="ui-form-block">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$field["text"]['id']?>" class="ui-ctl-label-text">
<?=$field["text"]["title"]?>
</label>
</div>
<div class="ui-ctl ui-ctl-textbox ui-ctl-inline ui-ctl-w25">
<input id="<?=$field["text"]['id']?>"
name="<?=$field["text"]['id']?>"
type="text"
class="ui-ctl-element"
value="<?=isset($field["text"]["value"]) ? htmlspecialcharsbx($field["text"]["value"]) : ""?>"
>
</div>
</div>
<div class="ui-form-block">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$field["audiofile"]['id']?>" class="ui-ctl-label-text">
<?=$field["audiofile"]["title"]?>
</label>
</div>
<div class="ui-ctl ui-ctl-inline">
<?if(!empty($field["audiofile"]["value"]))
{
$crmInstalled = CModule::IncludeModule('crm');
$addrBegin = CAlovoiceMain::getUrlHost();
$flPath = CFile::GetPath($field["audiofile"]["value"]);
$filePath = $addrBegin.$flPath;
}
?>
<div>
<?$APPLICATION->IncludeComponent(
"bitrix:player",
"audio",
array(
"PLAYER_ID" => "player_".$field["audiofile"]['id'],
"PLAYER_TYPE" => "videojs",
"ADVANCED_MODE_SETTINGS" => "Y",
"ALLOW_SWF" => "N",
"AUTOSTART" => "N",
"HEIGHT" => "30",
"MUTE" => "N",
"PATH" => $filePath,
"TYPE" => "audio/mp3",
"PLAYLIST_SIZE" => "180",
"PRELOAD" => "N",
"PREVIEW" => "",
"REPEAT" => "none",
"SHOW_CONTROLS" => "Y",
"SKIN" => $crmInstalled ? "timeline_player.css" : "",
"SKIN_PATH" => $crmInstalled ? "/bitrix/js/crm/" : "",
"USE_PLAYLIST" => "N",
"VOLUME" => "100",
"WIDTH" => "600",
"COMPONENT_TEMPLATE" => "audio",
"SIZE_TYPE" => "absolute",
"START_TIME" => "0",
"PLAYBACK_RATE" => "1"
),
$this->component,
array("HIDE_ICONS" => true)
);?>
</div>
<div>
<?$APPLICATION->IncludeComponent('bitrix:main.file.input', '.default',
array(
'INPUT_CAPTION' => "Выбрать аудиозапись",
'INPUT_NAME' => $field["audiofile"]['id'],
'INPUT_VALUE' => (!empty($field["audiofile"]["value"])) ? [$field["audiofile"]["value"]] : [],
'MODULE_ID' => 'alovoice',
'FORCE_MD5' => true,
'CONTROL_ID' => $field["audiofile"]['id'],
'MULTIPLE' => 'N',
'ALLOW_UPLOAD' => 'F',
'ALLOW_UPLOAD_EXT' => 'mp3'
),
$this->component,
array("HIDE_ICONS" => false)
);?>
</div>
</div>
</div>
</fieldset>
</td>
</tr>
<?break;
case "custom":?>
<tr>
<td class="form-table-label-td ">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$fId?>" class="ui-ctl-label-text">
<?=$field["title"]?>
</label>
</div>
</td>
<td>
<?echo $field["value"];?>
</td>
</tr>
<?break;
case "textarea":?>
<?
$arBgColor = '';
$arShow = 'none';
$arId = $fId;
$boxbg_color = '';
if($field['show_bg'] !== 'N') {
$arBgColor = (!empty($field['bg_color'])) ? $field['bg_color'] : $defBgColor;
}
if($field['show'] === 'Y') {
$arShow = 'block';
}
if($field['boxbg_color']) {
$boxbg_color = $field['boxbg_color'];
}
?>
<tr>
<td colspan="2">
<div class="textareas_container">
<div class="box" style="border-color: <?=$arBgColor?>;">
<div class="ui-btn-split ui-btn-primary box__btn" data-toggle="collapse" data-target="#<?=$arId?>__tab" id="<?=$arId?>__btn">
<button type="button" class="ui-btn-main box__btn" style="background-color: <?=$arBgColor?>;">
<?=$field['title']?>
</button>
<button type="button" class="ui-btn-menu box__btn_icon" style="background-color: <?=$arBgColor?>;"></button>
</div>
<div class="box__content" id="<?=$arId?>__tab" style="display: <?=$arShow?>; background-color: <?=$boxbg_color?>">
<? if(!empty($field["morefile_id"]) && !empty($arMoreFileds[$field["morefile_id"]])){
$mField = $arMoreFileds[$field["morefile_id"]];
?>
<div class="box_content">
<div class="ui-form-block">
<div class="ui-ctl ui-ctl-inline">
<label for="<?=$mField['id']?>" class="ui-ctl-label-text">
<?=$mField["title"]?>
</label>
</div>
<div class="ui-ctl ui-ctl-inline" id="<?=$arId?>__files">
<?//=$field['morefile_id']?>
<?$APPLICATION->IncludeComponent('bitrix:main.file.input', '.default',
array(
'INPUT_CAPTION' => "Выбрать картинку или видео",
'INPUT_NAME' => $mField['id'],
'INPUT_VALUE' => (!empty($mField["value"])) ? [$mField["value"]] : [],
'MODULE_ID' => 'shopbot',
'FORCE_MD5' => true,
'CONTROL_ID' => $mField['id'],
'MULTIPLE' => 'N',
'ALLOW_UPLOAD' => 'F',
'ALLOW_UPLOAD_EXT' => 'mp4,png'
),
$this->component,
array("HIDE_ICONS" => false)
);
?>
<script>
BX.ready(function() {
var $target = $("#<?=$arId?>__files [data-bx-role='file-delete']");
$target.on("click", function() {
$("[name='<?=$mField['id']?>']").attr({
value: ""
})
})
})
</script>
</div>
</div>
</div>
<? } ?>
<textarea name="<?=$arId?>" id="<?=$arId?>__textarea" cols="30" rows="10"><?=$field['value']?></textarea>
<?if($field['text']):?>
<p id="<?=$arId?>__textarea_ppp" class="box__content__text__placeholder">
<?
$field['text'] = str_replace("{{", '<regval>{{', $field['text']);
$field['text'] = str_replace("}}", '}}</regval>', $field['text']);
echo $field['text'];
?>
</p>
<?endif?>
</div>
<script>
(function(){
var range = 0;
var target;
var $textarea = $("#<?=$arId?>__textarea");
var $btn = $("#<?=$arId?>__btn");
$(document).ready(function () {
$btn.on("click", function() {
$textarea.emojioneArea({
placeholder: "<?=$field['placeholder']?>",
search: false,
filtersPosition: "bottom",
pickerPosition: "bottom",
events: {
keyup: (n) => {
target = n;
range = getCurrentCursorPositionSetVal();
},
click: (n) => {
target = n;
range = getCurrentCursorPositionSetVal();
}
}
})
})
$("#<?=$arId?>__textarea_ppp regval").on("mousedown", function() {
var reg = $(this).text();
var textareaVal = $textarea.val();
if(range) {
target.trigger("focus");
event.preventDefault();
range(reg);
} else {
$textarea.val(textareaVal + reg).trigger("change");
}
})
});
})()
</script>
</div>
</div>
</td>
</tr>
<?break;
}
endforeach?>
</tbody>
</table>
<?endif?>
</div>
<?endforeach?>
<?if(!empty($arResult['TEXTAREAS'])):?>
<div class="textareas_container">
<div>
<h3>
<?=$arResult['TEXTAREAS']['TITLE']?>
</h3>
</div>
<?foreach($arResult['TEXTAREAS']['FIELDS'] as $key => $arItem):?>
<?
$arBgColor = '';
$arShow = 'none';
$arId = $arItem['ID'];
if($arItem['SHOW_BG'] !== 'N') {
$arBgColor = (!empty($arItem['BG_COLOR'])) ? $arItem['BG_COLOR'] : $defBgColor;
}
if($arItem['SHOW'] === 'Y') {
$arShow = 'block';
}
?>
<div class="box" style="border-color: <?=$arBgColor?>;">
<div class="ui-btn-split ui-btn-primary box__btn" data-toggle="collapse" data-target="#<?=$arId?>__tab">
<button type="button" class="ui-btn-main box__btn" style="background-color: <?=$arBgColor?>;">
<?=$arItem['TITLE']?>
</button>
<button type="button" class="ui-btn-menu box__btn_icon" style="background-color: <?=$arBgColor?>;"></button>
</div>
<div class="box__content" id="<?=$arId?>__tab" style="display: <?=$arShow?>">
<textarea name="<?=$arId?>" id="<?=$arId?>__textarea" cols="30" rows="10"><?=$arItem['VALUE']?></textarea>
<?if($arItem['PLACEHOLDER']):?>
<p id="<?=$arId?>__textarea_ppp" class="box__content__text__placeholder">
<?
$arItem['TEXT'] = str_replace("{{", '<regval>{{', $arItem['TEXT']);
$arItem['TEXT'] = str_replace("}}", '}}</regval>', $arItem['TEXT']);
echo $arItem['TEXT'];
?>
</p>
<?endif?>
</div>
<script>
(function(){
var range = 0;
var target;
var $textarea = $("#<?=$arId?>__textarea");
$textarea.emojioneArea({
placeholder: "<?=$arItem['PLACEHOLDER']?>",
search: false,
filtersPosition: "bottom",
events: {
keyup: (n) => {
target = n;
range = getCurrentCursorPositionSetVal();
},
click: (n) => {
target = n;
range = getCurrentCursorPositionSetVal();
}
}
})
$("#<?=$arId?>__textarea_ppp regval").on("mousedown", function() {
var reg = $(this).text();
var textareaVal = $textarea.val();
if(range) {
target.trigger("focus");
event.preventDefault();
range(reg);
} else {
$textarea.val(textareaVal + reg).trigger("change");
}
})
})()
</script>
</div>
<?endforeach?>
</div>
<?endif?>
<?
$arButtons = (!empty($arResult["BUTTONS"])) ? $arResult["BUTTONS"] : false;
if(empty($arButtons) && !empty($arParams["BUTTONS"]))
{
$arButtons = $arParams["BUTTONS"];
}
if(!empty($arButtons)):?>
<div>
<?if(!empty($arButtons["standard_buttons"])):?>
<!-- BUTTONS -->
<?if(in_array("save", $arButtons["standard_buttons"])):?>
<input
type="submit"
name="save"
class="ui-btn ui-btn-success"
value="<?=(!empty($arButtons["save_text"])) ? $arButtons["save_text"] : GetMessage("UI_FORM_BUTTON_SAVE")?>"
onclick="BX.addClass(this, 'ui-btn-wait')"
>
<?endif?>
<?if(in_array("cancel", $arButtons["standard_buttons"])):?>
<input
type="button"
value="<?=(!empty($arButtons["cancel_text"])) ? $arButtons["cancel_text"] : GetMessage("UI_FORM_BUTTON_CANCEL")?>"
name="cancel"
class="ui-btn ui-btn-warning"
onclick="window.location='<?=htmlspecialcharsbx(CUtil::addslashes($arButtons['back_url']))?>'"
>
<?endif?>
<?if(in_array("reset", $arButtons["standard_buttons"])):?>
<input
type="reset"
value="<?=(!empty($arButtons["reset_text"])) ? $arButtons["reset_text"] : GetMessage("UI_FORM_BUTTON_CANCEL")?>"
name="reset"
class="ui-btn ui-btn-warning"
onclick="window.location='<?=htmlspecialcharsbx(CUtil::addslashes($arButtons['back_url']))?>'"
>
<?endif?>
<!-- END BUTTONS -->
<?endif?>
<?if(!empty($arButtons["custom_html"])):?>
<!-- HTML -->
<?=$arButtons["custom_html"]?>
<!-- END HTML -->
<?endif?>
</div>
<?endif?>
</form>
<?if(!empty($arResult["SCRIPTS"])):?>
<script>
<?=$arResult["SCRIPTS"]?>
</script>
<?endif?>
<script>
var formId = "form_<?=$arResult["FORM_ID"]?>";
</script>
<?if($arResult["LOG_RESULT"] === "Y"):?>
<script>
var log_data = <?=CUtil::PhpToJSObject($field["items"])?>;
console.log("log_data --->");
console.log(log_data);
</script>
<?endif?>
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$arComponentDescription = array(
"NAME" => "AloVoice Peers", //GetMessage("COMP_ALV_SETTINGS_TITLE"),
"DESCRIPTION" => "AloVoice Peers", //GetMessage("COMP_ALV_SETTINGS_DESCR"),
);
?>
\ No newline at end of file
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
if (isset($_REQUEST['AJAX_CALL']) && $_REQUEST['AJAX_CALL'] == 'Y')
return;
$arResult = $arParams['TABLE_DATA'];
if (!empty($arResult)){
$this->IncludeComponentTemplate();
} else { echo "Table not found";}
\ No newline at end of file
<?
$MESS["COMP_VI_SETTINGS_TITLE"] = "Composite component for telephony configuration";
$MESS["COMP_VI_SETTINGS_DESCR"] = "Composite component for telephony configuration";
?>
\ No newline at end of file
<?
$MESS["COMP_VI_ACCESS_DENIED"] = "Insufficient access permissions";
?>
\ No newline at end of file
<?
$MESS ['COMP_VI_SETTINGS_TITLE'] = "Комплексный компонент настроек телефонии";
$MESS ['COMP_VI_SETTINGS_DESCR'] = "Комплексный компонент настроек телефонии";
?>
\ No newline at end of file
<?php
$MESS['COMP_VI_ACCESS_DENIED'] = "Недостаточно прав доступа";
Компонента tug.tables
/***
* '*' - Обязательный параметры
***/
[
'DATA_TABLE' => [
'TABLE_ID' => STRING, // * ID Табдицы
'FILTER_FIELDS' => [
'BEGIN_TIME' => [
'id' => STRING, // * ID
'name' => STRING, // * имя
'type' => STRING, // * тип
'default' => bool, // * по умолчанию (true/false)
]
] // ??
'FILTER_PRESETS' => false, // ??
'BUTTONS' => [ // кнопка сверху возле аоиска
[
'href' => STRING, // * ссылка
'icon' => STRING, // класс иконки (bitrix ui)
'title' => STRING, // * значение
'click' => STRING, // событие
'style' => STRING // класс иконки (по умолчанию -> 'ui-btn-light-border')
]
],
'NAV_OBJECT' => (object)[
'id' => STRING, // *??
'pageSizes' => [], // *??
'pageSize' => int, // *??
'recordCount' => null, // *??
'currentPage' => null, // *??
'allowAll' => bool, // *??
'allRecords' => bool, // *??
],
'DIGITBLOCKS' => [
[
'COLOR' => STRING, // цвет заднего фонаы (hex)
'TITLE' => '', // ?
'DIGIT' => '', // ?
]
],
'TABLE_HEADER_BOX' => NULL, // ?
'NAV_OBJECT' => (object)[ // ?
'id' => '', // *??
'pageSizes' => [], // *??
'pageSize' => 20, // *??
'recordCount' => NULL, // *??
'currentPage' => NULL, // *??
'allowAll' => true, // *??
'allRecords' => false // *??
],
'COLUMNS' => [ // * Щапка Табдицы *
[
'id' => STRING, // * ключ к значению в DATAS
'name' => STRING, // * значние
'default' => bool // тип (для чекбоксов)
]
],
'DATAS' => [ // массив с данными
[
'' => STRING // пара КЛЮЧ значение (ключ из 'COLUMNS')
]
],
'ROWS_COUNT' => int, // *? общее количество элементов
'CHECKBOX' => NULL, // ?
'ACTION_PANEL_ITEMS' => NULL, // ?
'ENABLE_COLLAPSIBLE_ROWS' => NULL, // ?
'TOTAL_ROWS_COUNT_HTML' => NULL, // ?
'SCRIPTS' => STRING, // js код (без тега)
]
]
\ No newline at end of file
/**
* author : İlker YILMAZ
* url : https://github.com/kuantal/Multiple-circular-player
* inspired by https://github.com/frumbert/circular-player
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.lunar = factory();
}
})(this, function () {
'use strict';
var lunar = {};
lunar.hasClass = function (elem, name) {
return new RegExp('(\\s|^)' + name + '(\\s|$)').test(elem.attr('class'));
};
lunar.addClass = function (elem, name) {
!lunar.hasClass(elem, name) && elem.attr('class', (!!elem.getAttribute('class') ? elem.getAttribute('class') + ' ' : '') + name);
};
lunar.removeClass = function (elem, name) {
var remove = elem.attr('class').replace(new RegExp('(\\s|^)' + name + '(\\s|$)', 'g'), '$2');
lunar.hasClass(elem, name) && elem.attr('class', remove);
};
lunar.toggleClass = function (elem, name) {
lunar[lunar.hasClass(elem, name) ? 'removeClass' : 'addClass'](elem, name);
};
lunar.className = function (elem, name) {
elem.attr('class', name);
console.log('className', elem);
};
return lunar;
});
(function ($) {
var _ = {
cursorPoint: function (evt, el) {
_.settings.pt.x = evt.clientX;
_.settings.pt.y = evt.clientY;
var playObject = el.find('svg').attr('id');
playObject = document.getElementById(playObject);
return _.settings.pt.matrixTransform(playObject.getScreenCTM().inverse());
},
angle: function (ex, ey) {
var dy = ey - 50; // 100;
var dx = ex - 50; // 100;
var theta = Math.atan2(dy, dx); // range (-PI, PI]
theta *= 180 / Math.PI; // rads to degs, range (-180, 180]
theta = theta + 90; // in our case we are animating from the top, so we offset by the rotation value;
if (theta < 0) theta = 360 + theta; // range [0, 360)
return theta;
},
setGraphValue: function (obj, val, el) {
var audioObj = el.find(_.settings.audioObj),
pc = _.settings.pc,
dash = pc - parseFloat(((val / audioObj[0].duration) * pc), 10);
$(obj).css('strokeDashoffset', dash);
if (val === 0) {
$(obj).addClass(obj, 'done');
if (obj === $(_.settings.progress)) $(obj).attr('class', 'ended');
}
},
reportPosition: function (el, audioId) {
var progress = el.find(_.settings.progress),
audio = el.find(_.settings.audioObj);
_.setGraphValue(progress, audioId.currentTime, el);
},
stopAllSounds: function () {
document.addEventListener('play', function (e) {
var audios = document.getElementsByTagName('audio');
for (var i = 0, len = audios.length; i < len; i++) {
if (audios[i] != e.target) {
audios[i].pause();
}
if (audios[i] != e.target) $(audios[i]).parent('div').find('.playing').attr('class', 'paused');
}
}, true);
},
settings: {},
/**
* Main Function for plugin
* @param options
*/
init: function (options) {
/**
* Default Options
*/
var template = ['<svg viewBox="0 0 100 100" id="playable" version="1.1" xmlns="http://www.w3.org/2000/svg" width="34" height="34" data-play="playable" class="not-started playable">',
'<g class="shape">',
'<circle class="progress-track" cx="50" cy="50" r="47.45" stroke="#becce1" stroke-opacity="0.25" stroke-linecap="round" fill="none" stroke-width="5"/>',
'<circle class="precache-bar" cx="50" cy="50" r="47.45" stroke="#302F32" stroke-opacity="0.25" stroke-linecap="round" fill="none" stroke-width="5" transform="rotate(-90 50 50)"/>',
'<circle class="progress-bar" cx="50" cy="50" r="47.45" stroke="#009EF8" stroke-opacity="1" stroke-linecap="round" fill="none" stroke-width="5" transform="rotate(-90 50 50)"/>',
'</g>',
'<circle class="controls" cx="50" cy="50" r="45" stroke="none" fill="#000000" opacity="0.0" pointer-events="all"/>',
'<g class="control pause">',
'<line x1="40" y1="35" x2="40" y2="65" stroke="#000000" fill="none" stroke-width="8" stroke-linecap="round"/>',
'<line x1="60" y1="35" x2="60" y2="65" stroke="#000000" fill="none" stroke-width="8" stroke-linecap="round"/>',
'</g>',
'<g class="control play">',
'<polygon points="45,35 65,50 45,65" fill="#009EF8" stroke-width="0"></polygon>',
'</g>',
'<g class="control stop">',
'<rect x="35" y="35" width="30" height="30" stroke="#000000" fill="none" stroke-width="1"/>',
'</g>',
'</svg>'];
template = template.join(' ');
$.each(this, function (a, b) {
var audio = $(this).find('audio');
audio.attr('id', 'audio' + a);
template = template.replace('width="34"','width="'+ audio.data('size') +'"');
template = template.replace('height="34"','height="'+ audio.data('size') +'"');
template = template.replace('id="playable"', 'id="playable' + a + '"');
$(this).append(template);
});
var svgId = $(this).find('svg').attr('id');
svgId = document.getElementById(svgId);
_.defaults = {
this : this,
thisSelector: this.selector.toString(),
playObj : 'playable',
progress : '.progress-bar',
precache : '.precache-bar',
audioObj : 'audio',
controlsObj : '.controls',
pt : svgId.createSVGPoint(),
pc : 298.1371428256714 // 2 pi r
};
lunar = {};
_.settings = $.extend({}, _.defaults, options);
$(_.settings.controlsObj).on('click', function (e) {
var el = $(e.currentTarget).closest($(_.settings.thisSelector));
var obj = {
el : el,
activeAudio: el.find(_.settings.audioObj),
playObj : el.find('[data-play]'),
precache : el.find(_.settings.precache)
};
obj.class = obj.playObj.attr('class');
switch (obj.class.replace('playable', '').trim()) {
case 'not-started':
_.stopAllSounds();
obj.activeAudio[0].play();
var audioId = document.getElementById(obj.activeAudio.attr('id'));
audioId.addEventListener('timeupdate', function (e) {
_.reportPosition(el, audioId)
});
obj.playObj.attr('class', 'playing');
break;
case 'playing':
obj.playObj.attr('class', 'playable paused');
obj.activeAudio[0].pause();
$(audioId).off('timeupdate');
break;
case 'paused':
obj.playObj.attr('class', 'playable playing');
obj.activeAudio[0].play();
break;
case 'ended':
obj.playObj.attr('class', 'not-started playable');
obj.activeAudio.off('timeupdate', _.reportPosition);
break;
}
});
$(_.defaults.audioObj).on('progress', function (e) {
if (this.buffered.length > 0) {
var end = this.buffered.end(this.buffered.length - 1);
var cache = $(e.currentTarget).parent().find(_.settings.precache),
el = $(this).closest($(_.settings.thisSelector));
_.setGraphValue(cache, end, el);
}
});
}
};
// Add Plugin to Jquery
$.fn.mediaPlayer = function (methodOrOptions) {
if (_[methodOrOptions]) {
return _[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof methodOrOptions === 'object' || !methodOrOptions) {
// Default to "init"
return _.init.apply(this, arguments);
} else {
$.error('Method ' + methodOrOptions + ' does not exist on jQuery.mediaPlayer');
}
};
})(jQuery);
\ No newline at end of file
*,
*:after,
*:before {
box-sizing : border-box;
-webkit-box-sizing : border-box;
-moz-box-sizing : border-box;
-webkit-font-smoothing : antialiased;
-moz-font-smoothing : antialiased;
-o-font-smoothing : antialiased;
font-smoothing : antialiased;
text-rendering : optimizeLegibility;
}
.mediPlayer .control {
opacity : 0; /* transition: opacity .2s linear; */
pointer-events : none;
cursor : pointer;
}
.mediPlayer .not-started .play, .mediPlayer .paused .play {
opacity : 1;
}
.mediPlayer .playing .pause {
opacity : 1;
}
.mediPlayer .playing .play {
opacity : 0;
}
.mediPlayer .ended .stop {
opacity : 1;
pointer-events : none;
}
.mediPlayer .precache-bar .done {
opacity : 0;
}
.mediPlayer .not-started .progress-bar, .mediPlayer .ended .progress-bar {
display : none;
}
.mediPlayer .ended .progress-track {
stroke-opacity : 1;
}
.mediPlayer .progress-bar,
.mediPlayer .precache-bar {
transition : stroke-dashoffset 500ms;
stroke-dasharray : 298.1371428256714;
stroke-dashoffset : 298.1371428256714;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
use Bitrix\Main\Grid\Panel\Snippet\Button;
use Bitrix\Main\Grid\Panel\Snippet\Checkbox;
use Bitrix\Main\Grid\Panel\Snippet\Onchange;
use Bitrix\Main\Grid\Panel\Actions;
use Bitrix\Main\Grid\Panel\DefaultValue;
if(strlen($_POST['Update'])>0 && check_bitrix_sessid())
{
LocalRedirect($APPLICATION->GetCurPage());
}
CJSCore::Init([
//'jquery3'
'player',
'ui.buttons',
'sidepanel'
]);
//\Bitrix\Main\Page\Asset::getInstance()->addCss(__DIR__."/crprogres-bar.css");
\Bitrix\Main\Page\Asset::getInstance()->addJs(__DIR__."/crplayer.js");
//\Bitrix\Main\Page\Asset::getInstance()->addCss(__DIR__."/style.min.css");
//\Bitrix\Main\Page\Asset::getInstance()->addCss('/bitrix/css/main/grid/webform-button.css');
$APPLICATION->SetAdditionalCSS(__DIR__."/crprogres-bar.css", true);
$APPLICATION->SetAdditionalCSS(__DIR__."/style.min.css", true);
$APPLICATION->SetAdditionalCSS('/bitrix/css/main/grid/webform-button.css', true);
if(!empty($arResult["TABLE_ID"])){
$filterIdTables = $arResult["TABLE_ID"];
} else {
$filterIdTables = 'alovoice_tablelist_'.$arParams['TABLE_NAME'];
}
$isBitrix24Template = (SITE_TEMPLATE_ID == "bitrix24");
?>
<?if($isBitrix24Template):?>
<?
$bodyClass = $APPLICATION->GetPageProperty("BodyClass");
$APPLICATION->SetPageProperty("BodyClass", ($bodyClass ? $bodyClass." " : "")."pagetitle-toolbar-field-view");
$this->SetViewTarget("inside_pagetitle", 0);
?>
<!-- start pagetitle-container -->
<div class="pagetitle-container pagetitle-flexible-space">
<?endif?>
<?if(!empty($arResult["FILTER_FIELDS"]))
{
$APPLICATION->IncludeComponent(
"bitrix:main.ui.filter",
"",
array(
"GRID_ID" => $filterIdTables,
"FILTER_ID" => $filterIdTables,
"FILTER" => $arResult["FILTER_FIELDS"],
"FILTER_PRESETS" => $arResult["FILTER_PRESETS"],
"ENABLE_LIVE_SEARCH" => false,
"ENABLE_LABEL" => true
),
$component,
array()
);
}?>
<?if(!empty($arResult["BUTTONS"] )):?>
<div class="pagetitle-container pagetitle-align-right-container">
<?foreach($arResult["BUTTONS"] as $tbButton):
if(!empty($tbButton['href'])):?>
<a href="<?=$tbButton['href']?>" class="ui-btn ui-btn-md ui-btn-themes <?=(!empty($tbButton["style"])) ? $tbButton["style"] : "ui-btn-light-border"?>
<?=(!empty($tbButton["icon"])) ? $tbButton["icon"] : ""?>">
<?=$tbButton["title"]?>
</a>
<?else:?>
<button id="alv-stats-export"
class="ui-btn ui-btn-md ui-btn-themes
<?=(!empty($tbButton["style"])) ? $tbButton["style"] : "ui-btn-light-border"?>
<?=($tbButton['disable'] ? 'ui-btn-disabled' : "")?>
<?=(!empty($tbButton["icon"])) ? $tbButton["icon"] : ""?>"
<?=(!empty($tbButton["click"])) ? ' onClick="'.$tbButton["click"].'" ' : ""?>
>
<?=$tbButton["title"]?>
</button>
<?endif?>
<?endforeach?>
</div>
<?endif?>
<?if($isBitrix24Template):?>
</div>
<!-- end pagetitle-container -->
<?
$this->EndViewTarget();
?>
<?endif?>
<?
$grid_options = new Bitrix\Main\Grid\Options('peers_list');
$sort = $grid_options->GetSorting(['sort' => ['ID' => 'DESC'], 'vars' => ['by' => 'by', 'order' => 'order']]);
$nav_params = $grid_options->GetNavParams();
if(!empty($arResult["NAV_OBJECT"]))
{
$nav = $arResult["NAV_OBJECT"];
} elseif($arResult["NAV_OBJECT"] == false)
{
$nav = false;
} else
{
$nav = new Bitrix\Main\UI\PageNavigation('peers_list');
$nav->allowAllRecords(true)
->setPageSize($nav_params['nPageSize'])
->initFromUri();
}
?>
<?if(!empty($arResult["DIGITBLOCKS"])):?>
<div class="stat_widgets">
<?foreach($arResult["DIGITBLOCKS"] as $dblock):?>
<div class="stat_block" style="<?=(!empty($dblock["COLOR"])) ? 'background-color:'.$dblock["COLOR"].';' : 'background-color:#ccc;'?>">
<div class="stat_block_title">
<?=$dblock["TITLE"]?>
</div>
<div class="stat_block_body">
<span class="stat_block_bigicon ui-icon ui-icon-service-call">
<i></i>
</span>
<div class="stat_block_bigdigit">
<?=$dblock["DIGIT"]?>
</div>
</div>
</div>
<?endforeach?>
</div>
<?endif?>
<?if(!empty($arResult["TABLE_HEADER_BOX"])) {?>
<?=$arResult["TABLE_HEADER_BOX"];?>
<?}?>
<div id="tel-stat-grid-container">
<?
$request = \Bitrix\Main\Application::getInstance()->getContext()->getRequest();
$isGridAjaxRequest = (
$request->isAjaxRequest()
&& \Bitrix\Main\Grid\Context::isInternalRequest()
&& $_REQUEST['grid_id'] === $uitable_id
);
if ($isGridAjaxRequest)
{
$APPLICATION->RestartBuffer();
}
if($_REQUEST["action"] == "getChildRows")
{
//\CAlovoiceMain::aLog("------ AloVoice AUTOCALLS TABLE TEMP REQUEST : ----------".json_encode($arResult),true,'autocalls.log');
}
if(!empty($arResult["NAV_OBJECT"]))
{
$pageSizes = [
['NAME' => "10", 'VALUE' => '10'],
['NAME' => "15", 'VALUE' => '15'],
['NAME' => "25", 'VALUE' => '25'],
['NAME' => '50', 'VALUE' => '50'],
// ['NAME' => '100', 'VALUE' => '100'],
// ['NAME' => '200', 'VALUE' => '200'],
// ['NAME' => '300', 'VALUE' => '300'],
// ['NAME' => '500', 'VALUE' => '500'],
];
} else
{
$pageSizes = false;
}
$ui_grid_params = [
'GRID_ID' => $filterIdTables,
'COLUMNS' => $arResult["COLUMNS"],
'ROWS' => $arResult["DATAS"],
'TOTAL_ROWS_COUNT' => $arResult['ROWS_COUNT'],
'ACTION_ALL_ROWS' => true,
'SHOW_ROW_CHECKBOXES' => (!empty($arResult["CHECKBOX"])) ? $arResult["CHECKBOX"] : true,
'NAV_OBJECT' => $nav,
'AJAX_MODE' => 'Y',
'AJAX_ID' => \CAjax::getComponentID('bitrix:main.ui.grid', '.default', ''),
'PAGE_SIZES' => $pageSizes,
'AJAX_OPTION_JUMP' => 'Y',
'SHOW_CHECK_ALL_CHECKBOXES' => (!empty($arResult["CHECKBOX"])) ? $arResult["CHECKBOX"] : true,
'SHOW_ROW_ACTIONS_MENU' => true,
'SHOW_GRID_SETTINGS_MENU' => true,
'SHOW_NAVIGATION_PANEL' => (!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_PAGINATION' => (!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_SELECTED_COUNTER' => false, (!empty($arResult["DATAS"])), // (!empty($arResult["CHECKBOX"])),
'SHOW_TOTAL_COUNTER' => true, //(!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_PAGESIZE' => (!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_ACTION_PANEL' => (!empty($arResult["ACTION_PANEL_ITEMS"] )),
'ACTION_PANEL' => [
'GROUPS' => [
'TYPE' => [
'ITEMS' => $arResult["ACTION_PANEL_ITEMS"]
]
],
],
'ENABLE_COLLAPSIBLE_ROWS' => ($arResult["ENABLE_COLLAPSIBLE_ROWS"]) ? $arResult["ENABLE_COLLAPSIBLE_ROWS"] : false,
'ALLOW_COLUMNS_SORT' => true,
'ALLOW_COLUMNS_RESIZE' => true,
'ALLOW_HORIZONTAL_SCROLL' => true,
'ALLOW_SORT' => true,
'ALLOW_PIN_HEADER' => true,
'AJAX_OPTION_HISTORY' => 'N',
];
if(!empty($arResult["TOTAL_ROWS_COUNT_HTML"]))
{
$ui_grid_params["TOTAL_ROWS_COUNT_HTML"] = $arResult["TOTAL_ROWS_COUNT_HTML"];
}
$APPLICATION->IncludeComponent('bitrix:main.ui.grid', '', $ui_grid_params);
if ($isGridAjaxRequest)
{
die();
}
?>
<div>
<div id="alv_records_player"></div>
<script>
<?if(!empty( $arResult["BUTTONS"] )):
foreach($arResult["BUTTONS"] as $tbButton):?>
BX.append(
BX.create('div', {
attrs: {
className: 'ui-toolbar-btn-box'
},
html: '<a class="ui-btn <?=(!empty($tbButton["active"])) ? "ui-btn-success" : "ui-btn-primary"?> <?=(!empty($tbButton["icon"])) ? $tbButton["icon"] : "ui-btn-icon-add"?>" onClick="<?=$tbButton["click"]?>"><?=$tbButton["title"]?></a>'}
),
BX('uiToolbarContainer')
);
<?endforeach?>
<?endif?>
</script>
<?if(!empty( $arResult["SCRIPTS"] )):?>
<script><?=$arResult["SCRIPTS"]?></script>
<?endif?>
<script>
var playRecordFile = false;
var playContainer = BX("workarea-content");
var player = new BX.Fileman.Player('vi_records_player', {
'width': 10,
'height': 10,
'onInit': function (player) {
player.vjsPlayer.on('pause', function () {
var buttons = BX.findChildrenByClassName(playContainer, 'alv_player_pause');
for (var i in buttons) {
BX.removeClass(buttons[i], 'alv_player_pause');
}
}.bind(this));
}
});
console.log("CONT:", playContainer);
player.isAudio = true;
var playerNode = player.createElement();
playerNode.style.display = 'none';
BX.insertAfter(playerNode, playContainer);
player.init();
BX.bindDelegate(playContainer, 'click', {
className: 'alv_player_play'
}, function (event) {
var buttons = BX.findChildrenByClassName(playContainer, 'alv_player_pause');
for (var i in buttons) {
BX.removeClass(buttons[i], 'alv_player_pause');
}
var target = event.srcElement || event.target;
var source = target.getAttribute('data-bx-record');
if (source) {
source = {
src: source,
type: 'audio/mp3'
};
var currentSource = player.getSource();
if (currentSource && currentSource.indexOf(source.src) !== -1 && player.isPlaying()) {
player.pause();
} else {
player.setSource(source);
player.play();
BX.addClass(target, 'alv_player_pause');
}
event.preventDefault();
return false;
}
}.bind(this));
//alv_player_play
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.lunar = factory();
}
})(this, function () {
'use strict';
var lunar = {};
lunar.hasClass = function (elem, name) {
return new RegExp('(\\s|^)' + name + '(\\s|$)').test(elem.attr('class'));
};
lunar.addClass = function (elem, name) {
!lunar.hasClass(elem, name) && elem.attr('class', (!!elem.getAttribute('class') ? elem.getAttribute('class') + ' ' : '') + name);
};
lunar.removeClass = function (elem, name) {
var remove = elem.attr('class').replace(new RegExp('(\\s|^)' + name + '(\\s|$)', 'g'), '$2');
lunar.hasClass(elem, name) && elem.attr('class', remove);
};
lunar.toggleClass = function (elem, name) {
lunar[lunar.hasClass(elem, name) ? 'removeClass' : 'addClass'](elem, name);
};
lunar.className = function (elem, name) {
elem.attr('class', name);
console.log('className', elem);
};
return lunar;
});
function showTablePopupWin(wintitle, wincontent) {
console.log("Check Table Popup WIN", wintitle, wincontent);
var alvTablePopupWin = new BX.PopupWindow("form_table_alv_popup_win", null, {
content: wincontent,
closeIcon: {
right: "20px",
top: "10px"
},
titleBar: wintitle,
zIndex: 0,
offsetLeft: 0,
offsetTop: 0,
draggable: {
restrict: false
},
buttons: [
new BX.PopupWindowButton({
text: "Закрыть",
className: "webform-button-link-cancel",
events: {
click: function () {
this.popupWindow.close(); // закрытие окна
}
}
})
],
events: {}
});
alvTablePopupWin.show();
}
var checkBxs = document.querySelectorAll(".checkboxswitch");
console.log("Checkboxes:", checkBxs);
for (var c = 0; c < checkBxs.length; c++) {
checkBxs[c].addEventListener('change', function (event) {
//event.preventDefault();
//event.stopImmediatePropagation();
var userNum = this.getAttribute('data-num');
var userId = this.getAttribute('data-uid');
var userValue = this.value;
var swtype = (this.checked) ? 'on' : 'off';
console.log("Num:", userNum);
console.log("UID:", userId);
console.log("ON/OFF", swtype);
if (typeof alvApparatToUser !== 'undefined') {
alvApparatToUser(swtype, userId, userNum);
} else {
console.log("function 'alvApparatToUser' is not found!");
}
})
}
</script>
\ No newline at end of file
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
use Bitrix\Main\Grid\Panel\Snippet\Button;
use Bitrix\Main\Grid\Panel\Snippet\Checkbox;
use Bitrix\Main\Grid\Panel\Snippet\Onchange;
use Bitrix\Main\Grid\Panel\Actions;
use Bitrix\Main\Grid\Panel\DefaultValue;
if(!empty($arResult["TABLE_TITLE"])){
$APPLICATION->SetTitle($arResult["TABLE_TITLE"]);
}
if(strlen($_POST['Update'])>0 && check_bitrix_sessid())
{
LocalRedirect($APPLICATION->GetCurPage());
}
CJSCore::Init([
//'jquery3'
'player',
'ui.buttons',
'sidepanel'
]);
//\Bitrix\Main\Page\Asset::getInstance()->addCss(__DIR__."/crprogres-bar.css");
\Bitrix\Main\Page\Asset::getInstance()->addJs(__DIR__."/crplayer.js");
//\Bitrix\Main\Page\Asset::getInstance()->addCss(__DIR__."/style.min.css");
//\Bitrix\Main\Page\Asset::getInstance()->addCss('/bitrix/css/main/grid/webform-button.css');
$APPLICATION->SetAdditionalCSS(__DIR__."/crprogres-bar.css", true);
$APPLICATION->SetAdditionalCSS(__DIR__."/style.min.css", true);
$APPLICATION->SetAdditionalCSS('/bitrix/css/main/grid/webform-button.css', true);
if(!empty($arResult["TABLE_ID"])){
$filterIdTables = $arResult["TABLE_ID"];
} else {
$filterIdTables = $arParams['TABLE_NAME'];
}
$isBitrix24Template = (SITE_TEMPLATE_ID == "bitrix24");?>
<?if($isBitrix24Template):?>
<?
$bodyClass = $APPLICATION->GetPageProperty("BodyClass");
$APPLICATION->SetPageProperty("BodyClass", ($bodyClass ? $bodyClass." " : "")."pagetitle-toolbar-field-view");
$this->SetViewTarget("inside_pagetitle", 0);
?>
<div class="pagetitle-container pagetitle-flexible-space">
<?endif?>
<?if(!empty($arResult["FILTER_FIELDS"]))
{
$APPLICATION->IncludeComponent(
"bitrix:main.ui.filter",
"",
array(
"GRID_ID" => $filterIdTables,
"FILTER_ID" => $filterIdTables,
"FILTER" => $arResult["FILTER_FIELDS"],
"FILTER_PRESETS" => $arResult["FILTER_PRESETS"],
"ENABLE_LIVE_SEARCH" => false,
"ENABLE_LABEL" => true
),
$component,
array()
);
}?>
<!--div class="pagetitle-container pagetitle-align-right-container">
<button id="vi-stat-export" class="ui-btn ui-btn-md ui-btn-themes ui-btn-light-border <?=($arResult['ENABLE_EXPORT'] ? '' : 'ui-btn-disabled')?>">Экспорт</button>
</div-->
<?
if(!empty( $arResult["BUTTONS"] )) {
?>
<div class="pagetitle-container pagetitle-align-right-container">
<?foreach($arResult["BUTTONS"] as $tbButton):
if(!empty($tbButton['href'])):?>
<a href="<?=$tbButton['href']?>" class="ui-btn ui-btn-md ui-btn-themes <?=(!empty($tbButton["style"])) ? $tbButton["style"] : "ui-btn-light-border"?> <?=(!empty($tbButton["icon"])) ? $tbButton["icon"] : ""?>"><?=$tbButton["title"]?></a>
<?else:?>
<button id="alv-stats-export" class="ui-btn ui-btn-md ui-btn-themes <?=(!empty($tbButton["style"])) ? $tbButton["style"] : "ui-btn-light-border"?> <?=($tbButton['disable'] ? 'ui-btn-disabled' : "")?> <?=(!empty($tbButton["icon"])) ? $tbButton["icon"] : ""?>"<?=(!empty($tbButton["click"])) ? ' onClick="'.$tbButton["click"].'" ' : ""?>><?=$tbButton["title"]?></button>
<?elseif?>
<?endforeach?>
</div>
<?
}
if($isBitrix24Template)
{
?></div><?
$this->EndViewTarget();
}
$grid_options = new Bitrix\Main\Grid\Options('peers_list');
$sort = $grid_options->GetSorting(['sort' => ['ID' => 'DESC'], 'vars' => ['by' => 'by', 'order' => 'order']]);
$nav_params = $grid_options->GetNavParams();
if(!empty($arResult["NAV_OBJECT"])){
$nav = $arResult["NAV_OBJECT"];
} elseif($arResult["NAV_OBJECT"]==false) {
$nav = false;
} else {
$nav = new Bitrix\Main\UI\PageNavigation('peers_list');
$nav->allowAllRecords(true)
->setPageSize($nav_params['nPageSize'])
->initFromUri();
}
if(!empty($arResult["DIGITBLOCKS"])){
?>
<div class="stat_widgets">
<? foreach($arResult["DIGITBLOCKS"] as $dblock) { ?>
<div class="stat_block" style="<?=(!empty($dblock["COLOR"])) ? 'background-color:'.$dblock["COLOR"].';' : 'background-color:#ccc;'?>">
<div class="stat_block_title"><?=$dblock["TITLE"]?></div>
<div class="stat_block_body">
<span class="stat_block_bigicon ui-icon ui-icon-service-call"><i></i></span>
<div class="stat_block_bigdigit"><?=$dblock["DIGIT"]?></div>
</div>
</div>
<? } ?>
</div>
<? } ?>
<? if(!empty($arResult["TABLE_HEADER_BOX"])){ echo $arResult["TABLE_HEADER_BOX"]; } ?>
<div id="tel-stat-grid-container"><?
$request = \Bitrix\Main\Application::getInstance()->getContext()->getRequest();
$isGridAjaxRequest = (
$request->isAjaxRequest()
&& \Bitrix\Main\Grid\Context::isInternalRequest()
&& $_REQUEST['grid_id'] === $uitable_id
);
if ($isGridAjaxRequest){
$APPLICATION->RestartBuffer();
}
if($_REQUEST["action"] == "getChildRows"){
//\CAlovoiceMain::aLog("------ AloVoice AUTOCALLS TABLE TEMP REQUEST : ----------".json_encode($arResult),true,'autocalls.log');
}
if(!empty($arResult["NAV_OBJECT"])){
$pageSizes = [
['NAME' => "10", 'VALUE' => '10'],
['NAME' => "15", 'VALUE' => '15'],
['NAME' => "25", 'VALUE' => '25'],
['NAME' => '50', 'VALUE' => '50'],
// ['NAME' => '100', 'VALUE' => '100'],
// ['NAME' => '200', 'VALUE' => '200'],
// ['NAME' => '300', 'VALUE' => '300'],
// ['NAME' => '500', 'VALUE' => '500'],
];
} else {
$pageSizes = false;
}
$ui_grid_params = [
'GRID_ID' => $filterIdTables,
'COLUMNS' => $arResult["COLUMNS"],
'ROWS' => $arResult["DATAS"],
'TOTAL_ROWS_COUNT' => $arResult['ROWS_COUNT'],
'ACTION_ALL_ROWS' => true,
'SHOW_ROW_CHECKBOXES' => (!empty($arResult["CHECKBOX"])) ? $arResult["CHECKBOX"] : true,
'NAV_OBJECT' => $nav,
'AJAX_MODE' => 'Y',
'AJAX_ID' => \CAjax::getComponentID('bitrix:main.ui.grid', '.default', ''),
'PAGE_SIZES' => $pageSizes,
'AJAX_OPTION_JUMP' => 'Y',
'SHOW_CHECK_ALL_CHECKBOXES' => (!empty($arResult["CHECKBOX"])) ? $arResult["CHECKBOX"] : true,
'SHOW_ROW_ACTIONS_MENU' => true,
'SHOW_GRID_SETTINGS_MENU' => true,
'SHOW_NAVIGATION_PANEL' => (!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_PAGINATION' => (!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_SELECTED_COUNTER' => false, (!empty($arResult["DATAS"])), // (!empty($arResult["CHECKBOX"])),
'SHOW_TOTAL_COUNTER' => true, //(!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_PAGESIZE' => (!empty($arResult["DATAS"])), // (count($arResult["DATAS"])>24),
'SHOW_ACTION_PANEL' => (!empty($arResult["ACTION_PANEL_ITEMS"] )),
'ACTION_PANEL' => [
'GROUPS' => [
'TYPE' => [
'ITEMS' => $arResult["ACTION_PANEL_ITEMS"]
]
],
],
'ENABLE_COLLAPSIBLE_ROWS' => ($arResult["ENABLE_COLLAPSIBLE_ROWS"]) ? $arResult["ENABLE_COLLAPSIBLE_ROWS"] : false,
'ALLOW_COLUMNS_SORT' => true,
'ALLOW_COLUMNS_RESIZE' => true,
'ALLOW_HORIZONTAL_SCROLL' => true,
'ALLOW_SORT' => true,
'ALLOW_PIN_HEADER' => true,
'AJAX_OPTION_HISTORY' => 'N',
];
//}
if(!empty($arResult["TOTAL_ROWS_COUNT_HTML"])){
$ui_grid_params["TOTAL_ROWS_COUNT_HTML"] = $arResult["TOTAL_ROWS_COUNT_HTML"];
}
$APPLICATION->IncludeComponent('bitrix:main.ui.grid', '', $ui_grid_params);
if ($isGridAjaxRequest){
die();
}
//echo '<PRE>'; var_dump($ui_grid_params); echo '</PRE>';
?>
</div>
<div id="alv_records_player"></div>
<script>
<?
if(!empty( $arResult["BUTTONS"] )) { foreach($arResult["BUTTONS"] as $tbButton){?>
BX.append(
BX.create('div', {attrs: {className: 'ui-toolbar-btn-box'},html:'<a class="ui-btn <?=(!empty($tbButton["active"])) ? "ui-btn-success" : "ui-btn-primary"?> <?=(!empty($tbButton["icon"])) ? $tbButton["icon"] : "ui-btn-icon-add"?>" onClick="<?=$tbButton["click"]?>"><?=$tbButton["title"]?></a>'}),
BX('uiToolbarContainer')
);
<? } } ?>
</script>
<? if(!empty( $arResult["SCRIPTS"] )) { ?>
<script><?=$arResult["SCRIPTS"]?></script>
<? } ?>
<script>
var playRecordFile = false;
var playContainer = BX("workarea-content");
var player = new BX.Fileman.Player('vi_records_player', {
'width': 10,
'height': 10,
'onInit': function(player)
{
player.vjsPlayer.on('pause', function()
{
var buttons = BX.findChildrenByClassName(playContainer, 'alv_player_pause');
for(var i in buttons)
{
BX.removeClass(buttons[i], 'alv_player_pause');
}
}.bind(this));
}
});
console.log("CONT:",playContainer);
player.isAudio = true;
var playerNode = player.createElement();
playerNode.style.display = 'none';
BX.insertAfter(playerNode, playContainer);
player.init();
BX.bindDelegate(playContainer, 'click', {className: 'alv_player_play'}, function(event)
{
var buttons = BX.findChildrenByClassName(playContainer, 'alv_player_pause');
for(var i in buttons)
{
BX.removeClass(buttons[i], 'alv_player_pause');
}
var target = event.srcElement || event.target;
var source = target.getAttribute('data-bx-record');
if(source)
{
source = {src: source, type: 'audio/mp3'};
var currentSource = player.getSource();
if(currentSource && currentSource.indexOf(source.src) !== -1 && player.isPlaying())
{
player.pause();
}
else
{
player.setSource(source);
player.play();
BX.addClass(target, 'alv_player_pause');
}
event.preventDefault();
return false;
}
}.bind(this));
//alv_player_play
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.lunar = factory();
}
})(this, function () {
'use strict';
var lunar = {};
lunar.hasClass = function (elem, name) {
return new RegExp('(\\s|^)' + name + '(\\s|$)').test(elem.attr('class'));
};
lunar.addClass = function (elem, name) {
!lunar.hasClass(elem, name) && elem.attr('class', (!!elem.getAttribute('class') ? elem.getAttribute('class') + ' ' : '') + name);
};
lunar.removeClass = function (elem, name) {
var remove = elem.attr('class').replace(new RegExp('(\\s|^)' + name + '(\\s|$)', 'g'), '$2');
lunar.hasClass(elem, name) && elem.attr('class', remove);
};
lunar.toggleClass = function (elem, name) {
lunar[lunar.hasClass(elem, name) ? 'removeClass' : 'addClass'](elem, name);
};
lunar.className = function (elem, name) {
elem.attr('class', name);
console.log('className', elem);
};
return lunar;
});
function showTablePopupWin(wintitle, wincontent){
console.log("Check Table Popup WIN",wintitle,wincontent);
var alvTablePopupWin = new BX.PopupWindow("form_table_alv_popup_win", null, {
content: wincontent,
closeIcon: {right: "20px", top: "10px"},
titleBar: wintitle,
zIndex: 0,
offsetLeft: 0,
offsetTop: 0,
draggable: {restrict: false},
buttons: [
new BX.PopupWindowButton({
text: "Закрыть",
className: "webform-button-link-cancel",
events: {click: function(){
this.popupWindow.close(); // закрытие окна
}}
})
],
events: {}
});
alvTablePopupWin.show();
}
var checkBxs = document.querySelectorAll(".checkboxswitch");
console.log("Checkboxes:",checkBxs);
for (var c = 0; c < checkBxs.length; c++) {
checkBxs[c].addEventListener('change', function (event) {
//event.preventDefault();
//event.stopImmediatePropagation();
var userNum = this.getAttribute('data-num');
var userId = this.getAttribute('data-uid');
var userValue = this.value;
var swtype = (this.checked) ? 'on' : 'off';
console.log("Num:",userNum);
console.log("UID:",userId);
console.log("ON/OFF",swtype);
if(typeof alvApparatToUser !== 'undefined'){
alvApparatToUser(swtype,userId,userNum);
} else {
console.log("function 'alvApparatToUser' is not found!");
}
})
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment