repo_id
stringlengths
6
101
file_path
stringlengths
2
269
content
stringlengths
367
5.14M
size
int64
367
5.14M
filename
stringlengths
1
248
ext
stringlengths
0
87
lang
stringclasses
88 values
program_lang
stringclasses
232 values
doc_type
stringclasses
5 values
quality_signal
stringlengths
2
1.9k
effective
stringclasses
2 values
hit_map
stringlengths
2
1.4k
1c-syntax/ssl_3_1
src/cf/CommonForms/РедактированиеДополнительныхСведений/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) УстановитьУсловноеОформление(); Если Не ПравоДоступа("Изменение", Метаданные.РегистрыСведений.ДополнительныеСведения) Тогда Элементы.ФормаЗаписать.Видимость = Ложь; Элементы.ФормаЗаписатьИЗакрыть.Видимость = Ложь; КонецЕсли; Если Не ПравоДоступа("Изменение", Метаданные.Справочники.НаборыДополнительныхРеквизитовИСведений) Тогда Элементы.ИзменитьСоставДополнительныхСведений.Видимость = Ложь; КонецЕсли; СсылкаНаОбъект = Параметры.Ссылка; НаборыСвойств = УправлениеСвойствамиСлужебный.ПолучитьНаборыСвойствОбъекта(Параметры.Ссылка); Для каждого СтрокаТаблицы Из НаборыСвойств Цикл ДоступныеНаборыСвойств.Добавить(СтрокаТаблицы.Набор); КонецЦикла; ЗаполнитьТаблицуЗначенийСвойств(Истина); КонецПроцедуры &НаКлиенте Процедура ПередЗакрытием(Отказ, ЗавершениеРаботы, ТекстПредупреждения, СтандартнаяОбработка) Оповещение = Новый ОписаниеОповещения("ЗаписатьИЗакрытьЗавершение", ЭтотОбъект); ОбщегоНазначенияКлиент.ПоказатьПодтверждениеЗакрытияФормы(Оповещение, Отказ, ЗавершениеРаботы); КонецПроцедуры &НаКлиенте Процедура ОбработкаОповещения(ИмяСобытия, Параметр, Источник) Если ИмяСобытия = "Запись_НаборыДополнительныхРеквизитовИСведений" Тогда Если ДоступныеНаборыСвойств.НайтиПоЗначению(Источник) <> Неопределено Тогда ЗаполнитьТаблицуЗначенийСвойств(Ложь); КонецЕсли; КонецЕсли; КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовТаблицыФормыТаблицаЗначенийСвойств &НаКлиенте Процедура ТаблицаЗначенийСвойствПриИзменении(Элемент) Модифицированность = Истина; КонецПроцедуры &НаКлиенте Процедура ТаблицаЗначенийСвойствПередНачаломДобавления(Элемент, Отказ, Копирование, Родитель, Группа) Отказ = Истина; КонецПроцедуры &НаКлиенте Процедура ТаблицаЗначенийСвойствПередУдалением(Элемент, Отказ) Если Элемент.ТекущиеДанные.НомерКартинки = -1 Тогда Отказ = Истина; Элемент.ТекущиеДанные.Значение = Элемент.ТекущиеДанные.ТипЗначения.ПривестиЗначение(Неопределено); Модифицированность = Истина; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ТаблицаЗначенийСвойствПриНачалеРедактирования(Элемент, НоваяСтрока, Копирование) Элемент.ПодчиненныеЭлементы.ТаблицаЗначенийСвойствЗначение.ОграничениеТипа = Элемент.ТекущиеДанные.ТипЗначения; КонецПроцедуры &НаКлиенте Процедура ТаблицаЗначенийСвойствПередНачаломИзменения(Элемент, Отказ) Если Элементы.ТаблицаЗначенийСвойств.ТекущиеДанные = Неопределено Тогда Возврат; КонецЕсли; Строка = Элементы.ТаблицаЗначенийСвойств.ТекущиеДанные; ПараметрыВыбораМассив = Новый Массив; Если Строка.ТипЗначения.СодержитТип(Тип("СправочникСсылка.ЗначенияСвойствОбъектов")) Или Строка.ТипЗначения.СодержитТип(Тип("СправочникСсылка.ЗначенияСвойствОбъектовИерархия")) Тогда ПараметрыВыбораМассив.Добавить(Новый ПараметрВыбора("Отбор.Владелец", ?(ЗначениеЗаполнено(Строка.ВладелецДополнительныхЗначений), Строка.ВладелецДополнительныхЗначений, Строка.Свойство))); КонецЕсли; Если Строка.ТипЗначения.СодержитТип(Тип("СправочникСсылка.ЗначенияСвойствОбъектов")) Тогда Элементы.ТаблицаЗначенийСвойствЗначение.ВыборГруппИЭлементов = ГруппыИЭлементы.Элементы; Иначе Элементы.ТаблицаЗначенийСвойствЗначение.ВыборГруппИЭлементов = ГруппыИЭлементы.ГруппыИЭлементы; КонецЕсли; Элементы.ТаблицаЗначенийСвойствЗначение.ПараметрыВыбора = Новый ФиксированныйМассив(ПараметрыВыбораМассив); КонецПроцедуры &НаКлиенте Процедура ТаблицаЗначенийСвойствВыбор(Элемент, ВыбраннаяСтрока, Поле, СтандартнаяОбработка) Если Поле.Имя <> Элементы.ТаблицаЗначенийСвойствКолонкаВопрос.Имя Тогда Возврат; КонецЕсли; СтандартнаяОбработка = Ложь; Строка = ТаблицаЗначенийСвойств.НайтиПоИдентификатору(ВыбраннаяСтрока); Если Не ЗначениеЗаполнено(Строка.Подсказка) Тогда Возврат; КонецЕсли; ТекстЗаголовка = НСтр("ru = 'Подсказка сведения ""%1""'"); ТекстЗаголовка = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(ТекстЗаголовка, Строка.Наименование); ПараметрыВопросаПользователю = СтандартныеПодсистемыКлиент.ПараметрыВопросаПользователю(); ПараметрыВопросаПользователю.Заголовок = ТекстЗаголовка; ПараметрыВопросаПользователю.ПредлагатьБольшеНеЗадаватьЭтотВопрос = Ложь; ПараметрыВопросаПользователю.Картинка = БиблиотекаКартинок.ДиалогИнформация; Кнопки = Новый СписокЗначений; Кнопки.Добавить("ОК", НСтр("ru = 'ОК'")); СтандартныеПодсистемыКлиент.ПоказатьВопросПользователю(Неопределено, Строка.Подсказка, Кнопки, ПараметрыВопросаПользователю); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура Записать(Команда) ЗаписатьЗначенияСвойств(); КонецПроцедуры &НаКлиенте Процедура ЗаписатьИЗакрыть(Команда) ЗаписатьИЗакрытьЗавершение(); КонецПроцедуры &НаКлиенте Процедура ИзменитьСоставДополнительныхСведений(Команда) Если ДоступныеНаборыСвойств.Количество() = 0 ИЛИ НЕ ЗначениеЗаполнено(ДоступныеНаборыСвойств[0].Значение) Тогда ПоказатьПредупреждение(, НСтр("ru = 'Не удалось получить наборы дополнительных сведений объекта. | |Возможно у объекта не заполнены необходимые реквизиты.'")); Иначе ПараметрыФормы = Новый Структура; ПараметрыФормы.Вставить("ВидСвойств", ПредопределенноеЗначение("Перечисление.ВидыСвойств.ДополнительныеСведения")); ОткрытьФорму("Справочник.НаборыДополнительныхРеквизитовИСведений.ФормаСписка", ПараметрыФормы); ПараметрыПерехода = Новый Структура; ПараметрыПерехода.Вставить("Набор", ДоступныеНаборыСвойств[0].Значение); ПараметрыПерехода.Вставить("Свойство", Неопределено); ПараметрыПерехода.Вставить("ЭтоДополнительноеСведение", Истина); ПараметрыПерехода.Вставить("ВидСвойства", ПредопределенноеЗначение("Перечисление.ВидыСвойств.ДополнительныеСведения")); Если Элементы.ТаблицаЗначенийСвойств.ТекущиеДанные <> Неопределено Тогда ПараметрыПерехода.Вставить("Набор", Элементы.ТаблицаЗначенийСвойств.ТекущиеДанные.Набор); ПараметрыПерехода.Вставить("Свойство", Элементы.ТаблицаЗначенийСвойств.ТекущиеДанные.Свойство); КонецЕсли; Оповестить("Переход_НаборыДополнительныхРеквизитовИСведений", ПараметрыПерехода); КонецЕсли; КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаКлиенте Процедура ЗаписатьИЗакрытьЗавершение(Результат = Неопределено, ДополнительныеПараметры = Неопределено) Экспорт ЗаписатьЗначенияСвойств(); Модифицированность = Ложь; Закрыть(); КонецПроцедуры &НаСервере Процедура ЗаполнитьТаблицуЗначенийСвойств(ИзОбработчикаПриСоздании) Если ИзОбработчикаПриСоздании Тогда ЗначенияСвойств = ПрочитатьЗначенияСвойствИзРегистраСведений(Параметры.Ссылка); Иначе ЗначенияСвойств = ТекущиеЗначенияСвойств(); ТаблицаЗначенийСвойств.Очистить(); КонецЕсли; ПроверяемаяТаблица = "РегистрСведений.ДополнительныеСведения"; ЗначениеДоступа = Тип("ПланВидовХарактеристикСсылка.ДополнительныеРеквизитыИСведения"); Таблица = УправлениеСвойствамиСлужебный.ЗначенияСвойств( ЗначенияСвойств, ДоступныеНаборыСвойств, Перечисления.ВидыСвойств.ДополнительныеСведения); ПроверятьПрава = Не Пользователи.ЭтоПолноправныйПользователь() И ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.УправлениеДоступом"); Если ПроверятьПрава Тогда МодульУправлениеДоступом = ОбщегоНазначения.ОбщийМодуль("УправлениеДоступом"); МодульУправлениеДоступомСлужебный = ОбщегоНазначения.ОбщийМодуль("УправлениеДоступомСлужебный"); УниверсальноеОграничение = МодульУправлениеДоступомСлужебный.ОграничиватьДоступНаУровнеЗаписейУниверсально(); Если Не УниверсальноеОграничение Тогда ПроверяемыеСвойства = Таблица.ВыгрузитьКолонку("Свойство"); РазрешенныеСвойства = МодульУправлениеДоступомСлужебный.РазрешенныеЗначенияДляДинамическогоСписка( ПроверяемаяТаблица, ЗначениеДоступа, ПроверяемыеСвойства, , Истина); КонецЕсли; КонецЕсли; Для Каждого СтрокаТаблицы Из Таблица Цикл Если ПроверятьПрава Тогда ПраваДоступаСвойства = ПраваДоступаСвойства(СтрокаТаблицы.Свойство, УниверсальноеОграничение, РазрешенныеСвойства, МодульУправлениеДоступом); Если Не ПраваДоступаСвойства.ДоступноДляЧтения Тогда Продолжить; КонецЕсли; КонецЕсли; НоваяСтрока = ТаблицаЗначенийСвойств.Добавить(); ЗаполнитьЗначенияСвойств(НоваяСтрока, СтрокаТаблицы); Если ЗначениеЗаполнено(НоваяСтрока.Подсказка) Тогда НоваяСтрока.КолонкаВопрос = "?"; КонецЕсли; НоваяСтрока.НомерКартинки = ?(СтрокаТаблицы.Удалено, 0, -1); НоваяСтрока.ДоступноДляИзменения = ?(ПроверятьПрава, ПраваДоступаСвойства.ДоступноДляИзменения, Истина); Если СтрокаТаблицы.Значение = Неопределено И ОбщегоНазначения.ОписаниеТипаСостоитИзТипа(СтрокаТаблицы.ТипЗначения, Тип("Булево")) Тогда НоваяСтрока.Значение = Ложь; КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Функция ПраваДоступаСвойства(Свойство, УниверсальноеОграничение, РазрешенныеСвойства, МодульУправлениеДоступом) Результат = Новый Структура("ДоступноДляЧтения,ДоступноДляИзменения", Ложь, Ложь); Если УниверсальноеОграничение Тогда НаборЗаписей = ТестовыйНаборЗаписей(Свойство); Результат.ДоступноДляЧтения = МодульУправлениеДоступом.ЧтениеРазрешено(НаборЗаписей); Результат.ДоступноДляИзменения = МодульУправлениеДоступом.ИзменениеРазрешено(НаборЗаписей); Возврат Результат; КонецЕсли; Если РазрешенныеСвойства <> Неопределено И РазрешенныеСвойства.Найти(Свойство) = Неопределено Тогда Возврат Результат; КонецЕсли; Результат.ДоступноДляЧтения = Истина; НачатьТранзакцию(); // АПК:326 Фиксация транзакции не требуется, т.к. это проверка прав на запись. Попытка НаборЗаписей = ТестовыйНаборЗаписей(Свойство); НаборЗаписей.ОбменДанными.Загрузка = Истина; НаборЗаписей.Записать(Истина); Результат.ДоступноДляИзменения = Истина; ОтменитьТранзакцию(); Исключение ОтменитьТранзакцию(); КонецПопытки; Возврат Результат; КонецФункции &НаСервере Функция ТестовыйНаборЗаписей(Свойство) НаборЗаписей = РегистрыСведений.ДополнительныеСведения.СоздатьНаборЗаписей(); НаборЗаписей.Отбор.Объект.Установить(Параметры.Ссылка); НаборЗаписей.Отбор.Свойство.Установить(Свойство); Запись = НаборЗаписей.Добавить(); Запись.Свойство = Свойство; Запись.Объект = Параметры.Ссылка; Возврат НаборЗаписей; КонецФункции &НаКлиенте Процедура ЗаписатьЗначенияСвойств() ЗначенияСвойств = Новый Массив; Для Каждого СтрокаТаблицы Из ТаблицаЗначенийСвойств Цикл Значение = Новый Структура("Свойство, Значение", СтрокаТаблицы.Свойство, СтрокаТаблицы.Значение); ЗначенияСвойств.Добавить(Значение); КонецЦикла; Если ЗначенияСвойств.Количество() > 0 Тогда ЗаписатьНаборСвойствВРегистр(СсылкаНаОбъект, ЗначенияСвойств); КонецЕсли; Модифицированность = Ложь; КонецПроцедуры &НаСервереБезКонтекста Процедура ЗаписатьНаборСвойствВРегистр(Знач Ссылка, Знач ЗначенияСвойств) УстановитьПривилегированныйРежим(Истина); НачатьТранзакцию(); Попытка Блокировка = Новый БлокировкаДанных; ЭлементБлокировки = Блокировка.Добавить("РегистрСведений.ДополнительныеСведения"); ЭлементБлокировки.УстановитьЗначение("Объект", Ссылка); Блокировка.Заблокировать(); Набор = РегистрыСведений.ДополнительныеСведения.СоздатьНаборЗаписей(); Набор.Отбор.Объект.Установить(Ссылка); Набор.Прочитать(); ТекущиеЗначения = Набор.Выгрузить(); Для Каждого СтрокаТаблицы Из ЗначенияСвойств Цикл Запись = ТекущиеЗначения.Найти(СтрокаТаблицы.Свойство, "Свойство"); Если Запись = Неопределено Тогда Запись = ТекущиеЗначения.Добавить(); Запись.Свойство = СтрокаТаблицы.Свойство; Запись.Значение = СтрокаТаблицы.Значение; Запись.Объект = Ссылка; КонецЕсли; Запись.Значение = СтрокаТаблицы.Значение; Если Не ЗначениеЗаполнено(Запись.Значение) Или Запись.Значение = Ложь Тогда ТекущиеЗначения.Удалить(Запись); КонецЕсли; КонецЦикла; Набор.Загрузить(ТекущиеЗначения); Набор.Записать(); ЗафиксироватьТранзакцию(); Исключение ОтменитьТранзакцию(); КонецПопытки; КонецПроцедуры &НаСервереБезКонтекста Функция ПрочитатьЗначенияСвойствИзРегистраСведений(Ссылка) Запрос = Новый Запрос; Запрос.Текст = "ВЫБРАТЬ РАЗРЕШЕННЫЕ | ДополнительныеСведения.Свойство, | ДополнительныеСведения.Значение |ИЗ | РегистрСведений.ДополнительныеСведения КАК ДополнительныеСведения |ГДЕ | ДополнительныеСведения.Объект = &Объект"; Запрос.УстановитьПараметр("Объект", Ссылка); Возврат Запрос.Выполнить().Выгрузить(); КонецФункции &НаСервере Функция ТекущиеЗначенияСвойств() ЗначенияСвойств = Новый ТаблицаЗначений; ЗначенияСвойств.Колонки.Добавить("Свойство"); ЗначенияСвойств.Колонки.Добавить("Значение"); Для каждого СтрокаТаблицы Из ТаблицаЗначенийСвойств Цикл Если ЗначениеЗаполнено(СтрокаТаблицы.Значение) И (СтрокаТаблицы.Значение <> Ложь) Тогда НоваяСтрока = ЗначенияСвойств.Добавить(); НоваяСтрока.Свойство = СтрокаТаблицы.Свойство; НоваяСтрока.Значение = СтрокаТаблицы.Значение; КонецЕсли; КонецЦикла; Возврат ЗначенияСвойств; КонецФункции &НаСервере Процедура УстановитьУсловноеОформление() УсловноеОформление.Элементы.Очистить(); // Элемент = УсловноеОформление.Элементы.Добавить(); ПолеЭлемента = Элемент.Поля.Элементы.Добавить(); ПолеЭлемента.Поле = Новый ПолеКомпоновкиДанных(Элементы.ТаблицаЗначенийСвойствЗначение.Имя); // Формат даты - время. ОтборЭлемента = Элемент.Отбор.Элементы.Добавить(Тип("ЭлементОтбораКомпоновкиДанных")); ОтборЭлемента.ЛевоеЗначение = Новый ПолеКомпоновкиДанных("ТаблицаЗначенийСвойств.ТипЗначения"); ОтборЭлемента.ВидСравнения = ВидСравненияКомпоновкиДанных.Равно; ОтборЭлемента.ПравоеЗначение = Новый ОписаниеТипов("Дата",,, Новый КвалификаторыДаты(ЧастиДаты.Время)); Элемент.Оформление.УстановитьЗначениеПараметра("Формат", "ДЛФ=T"); // Элемент = УсловноеОформление.Элементы.Добавить(); ПолеЭлемента = Элемент.Поля.Элементы.Добавить(); ПолеЭлемента.Поле = Новый ПолеКомпоновкиДанных(Элементы.ТаблицаЗначенийСвойствЗначение.Имя); // Формат даты - дата. ОтборЭлемента = Элемент.Отбор.Элементы.Добавить(Тип("ЭлементОтбораКомпоновкиДанных")); ОтборЭлемента.ЛевоеЗначение = Новый ПолеКомпоновкиДанных("ТаблицаЗначенийСвойств.ТипЗначения"); ОтборЭлемента.ВидСравнения = ВидСравненияКомпоновкиДанных.Равно; ОтборЭлемента.ПравоеЗначение = Новый ОписаниеТипов("Дата",,, Новый КвалификаторыДаты(ЧастиДаты.Дата)); Элемент.Оформление.УстановитьЗначениеПараметра("Формат", "ДЛФ=D"); // Элемент = УсловноеОформление.Элементы.Добавить(); ПолеЭлемента = Элемент.Поля.Элементы.Добавить(); ПолеЭлемента.Поле = Новый ПолеКомпоновкиДанных(Элементы.ТаблицаЗначенийСвойствЗначение.Имя); // Доступность поля, если нет прав на изменение. ОтборЭлемента = Элемент.Отбор.Элементы.Добавить(Тип("ЭлементОтбораКомпоновкиДанных")); ОтборЭлемента.ЛевоеЗначение = Новый ПолеКомпоновкиДанных("ТаблицаЗначенийСвойств.ДоступноДляИзменения"); ОтборЭлемента.ВидСравнения = ВидСравненияКомпоновкиДанных.Равно; ОтборЭлемента.ПравоеЗначение = Ложь; Элемент.Оформление.УстановитьЗначениеПараметра("ТолькоПросмотр", Истина); Элемент.Оформление.УстановитьЗначениеПараметра("ЦветТекста", ЦветаСтиля.ТекстЗапрещеннойЯчейкиЦвет); КонецПроцедуры #КонецОбласти
15,605
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 1113, "qsc_code_num_chars": 15605.0, "qsc_code_mean_word_length": 11.37825696, "qsc_code_frac_words_unique": 0.29020665, "qsc_code_frac_chars_top_2grams": 0.01847757, "qsc_code_frac_chars_top_3grams": 0.02274163, "qsc_code_frac_chars_top_4grams": 0.0098705, "qsc_code_frac_chars_dupe_5grams": 0.15255843, "qsc_code_frac_chars_dupe_6grams": 0.13463361, "qsc_code_frac_chars_dupe_7grams": 0.10975995, "qsc_code_frac_chars_dupe_8grams": 0.09807328, "qsc_code_frac_chars_dupe_9grams": 0.09807328, "qsc_code_frac_chars_dupe_10grams": 0.09807328, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00156394, "qsc_code_frac_chars_whitespace": 0.09855815, "qsc_code_size_file_byte": 15605.0, "qsc_code_num_lines": 456.0, "qsc_code_num_chars_line_max": 149.0, "qsc_code_num_chars_line_mean": 34.22149123, "qsc_code_frac_chars_alphabet": 0.89862799, "qsc_code_frac_chars_comments": 0.99327139, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java
package com.ruoyi.framework.manager; import com.ruoyi.framework.shiro.web.session.SpringSessionValidationScheduler; import net.sf.ehcache.CacheManager; import org.apache.shiro.cache.ehcache.EhCacheManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PreDestroy; /** * 确保应用退出时能关闭后台线程 * * @author cj */ @Component public class ShutdownManager { private static final Logger logger = LoggerFactory.getLogger("sys-user"); @Autowired(required = false) private SpringSessionValidationScheduler springSessionValidationScheduler; @Autowired(required = false) private EhCacheManager ehCacheManager; @PreDestroy public void destroy() { shutdownSpringSessionValidationScheduler(); shutdownAsyncManager(); shutdownEhCacheManager(); } /** * 停止Seesion会话检查 */ private void shutdownSpringSessionValidationScheduler() { if (springSessionValidationScheduler != null && springSessionValidationScheduler.isEnabled()) { try { logger.info("====关闭会话验证任务===="); springSessionValidationScheduler.disableSessionValidation(); } catch (Exception e) { logger.error(e.getMessage(), e); } } } /** * 停止异步执行任务 */ private void shutdownAsyncManager() { try { logger.info("====关闭后台任务任务线程池===="); AsyncManager.me().shutdown(); } catch (Exception e) { logger.error(e.getMessage(), e); } } private void shutdownEhCacheManager() { try { logger.info("====关闭缓存===="); if (ehCacheManager != null) { CacheManager cacheManager = ehCacheManager.getCacheManager(); cacheManager.shutdown(); } } catch (Exception e) { logger.error(e.getMessage(), e); } } }
2,160
ShutdownManager
java
en
java
code
{"qsc_code_num_words": 150, "qsc_code_num_chars": 2160.0, "qsc_code_mean_word_length": 8.6, "qsc_code_frac_words_unique": 0.46, "qsc_code_frac_chars_top_2grams": 0.03488372, "qsc_code_frac_chars_top_3grams": 0.03023256, "qsc_code_frac_chars_top_4grams": 0.04883721, "qsc_code_frac_chars_dupe_5grams": 0.10077519, "qsc_code_frac_chars_dupe_6grams": 0.10077519, "qsc_code_frac_chars_dupe_7grams": 0.10077519, "qsc_code_frac_chars_dupe_8grams": 0.10077519, "qsc_code_frac_chars_dupe_9grams": 0.07131783, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00131666, "qsc_code_frac_chars_whitespace": 0.29675926, "qsc_code_size_file_byte": 2160.0, "qsc_code_num_lines": 87.0, "qsc_code_num_chars_line_max": 102.0, "qsc_code_num_chars_line_mean": 24.82758621, "qsc_code_frac_chars_alphabet": 0.84792627, "qsc_code_frac_chars_comments": 0.04675926, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.16176471, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.026712, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.05882353, "qsc_codejava_score_lines_no_logic": 0.22058824, "qsc_codejava_frac_words_no_modifier": 0.8, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java
package com.ruoyi.framework.manager; import java.util.TimerTask; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import com.ruoyi.common.utils.Threads; import com.ruoyi.common.utils.spring.SpringUtils; /** * 异步任务管理器 * * @author liuhulu */ public class AsyncManager { /** * 操作延迟10毫秒 */ private final int OPERATE_DELAY_TIME = 10; /** * 异步操作任务调度线程池 */ private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); /** * 单例模式 */ private AsyncManager(){} private static AsyncManager me = new AsyncManager(); public static AsyncManager me() { return me; } /** * 执行任务 * * @param task 任务 */ public void execute(TimerTask task) { executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); } /** * 停止任务线程池 */ public void shutdown() { Threads.shutdownAndAwaitTermination(executor); } }
1,029
AsyncManager
java
en
java
code
{"qsc_code_num_words": 92, "qsc_code_num_chars": 1029.0, "qsc_code_mean_word_length": 7.07608696, "qsc_code_frac_words_unique": 0.54347826, "qsc_code_frac_chars_top_2grams": 0.03686636, "qsc_code_frac_chars_top_3grams": 0.06451613, "qsc_code_frac_chars_top_4grams": 0.07373272, "qsc_code_frac_chars_dupe_5grams": 0.07680492, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00522193, "qsc_code_frac_chars_whitespace": 0.25558795, "qsc_code_size_file_byte": 1029.0, "qsc_code_num_lines": 55.0, "qsc_code_num_chars_line_max": 97.0, "qsc_code_num_chars_line_mean": 18.70909091, "qsc_code_frac_chars_alphabet": 0.84464752, "qsc_code_frac_chars_comments": 0.19436346, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.02895054, "qsc_code_frac_chars_long_word_length": 0.02895054, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.12, "qsc_codejava_score_lines_no_logic": 0.4, "qsc_codejava_frac_words_no_modifier": 0.75, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ПустойРабочийСтол/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <AutoTitle>false</AutoTitle> <Customizable>false</Customizable> <CommandBarLocation>None</CommandBarLocation> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <Autofill>false</Autofill> </AutoCommandBar> <Events> <Event name="OnOpen">ПриОткрытии</Event> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <UsualGroup name="ТестовыйРежим" id="1"> <Visible>false</Visible> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Тестовый режим</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ТестовыйРежимРасширеннаяПодсказка" id="2"/> <ChildItems> <PictureDecoration name="Картинка" id="3"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Картинка</v8:content> </v8:item> </Title> <Picture> <xr:Ref>StdPicture.DialogStop</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="КартинкаКонтекстноеМеню" id="4"/> <ExtendedTooltip name="КартинкаРасширеннаяПодсказка" id="5"/> </PictureDecoration> <LabelDecoration name="Надпись" id="6"> <Width>60</Width> <ContextMenu name="НадписьКонтекстноеМеню" id="7"/> <ExtendedTooltip name="НадписьРасширеннаяПодсказка" id="8"/> </LabelDecoration> </ChildItems> </UsualGroup> </ChildItems> <Attributes/> </Form>
2,494
Form
xml
ru
xml
data
{"qsc_code_num_words": 340, "qsc_code_num_chars": 2494.0, "qsc_code_mean_word_length": 5.08529412, "qsc_code_frac_words_unique": 0.33235294, "qsc_code_frac_chars_top_2grams": 0.05205321, "qsc_code_frac_chars_top_3grams": 0.06940428, "qsc_code_frac_chars_top_4grams": 0.08675535, "qsc_code_frac_chars_dupe_5grams": 0.29323308, "qsc_code_frac_chars_dupe_6grams": 0.27009832, "qsc_code_frac_chars_dupe_7grams": 0.24117987, "qsc_code_frac_chars_dupe_8grams": 0.2145749, "qsc_code_frac_chars_dupe_9grams": 0.11856564, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.04523063, "qsc_code_frac_chars_whitespace": 0.10465116, "qsc_code_size_file_byte": 2494.0, "qsc_code_num_lines": 51.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 48.90196078, "qsc_code_frac_chars_alphabet": 0.72861621, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.23529412, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.36126704, "qsc_code_frac_chars_long_word_length": 0.05332799, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
package com.ruoyi.common.core.domain; import java.util.HashMap; import com.ruoyi.common.utils.StringUtils; /** * 操作消息提醒 * * @author ruoyi */ public class AjaxResult extends HashMap<String, Object> { private static final long serialVersionUID = 1L; /** 状态码 */ public static final String CODE_TAG = "code"; /** 返回内容 */ public static final String MSG_TAG = "msg"; /** 数据对象 */ public static final String DATA_TAG = "data"; /** * 状态类型 */ public enum Type { /** 成功 */ SUCCESS(0), /** 警告 */ WARN(301), /** 错误 */ ERROR(500); private final int value; Type(int value) { this.value = value; } public int value() { return this.value; } } /** * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 */ public AjaxResult() { } /** * 初始化一个新创建的 AjaxResult 对象 * * @param type 状态类型 * @param msg 返回内容 */ public AjaxResult(Type type, String msg) { super.put(CODE_TAG, type.value); super.put(MSG_TAG, msg); } /** * 初始化一个新创建的 AjaxResult 对象 * * @param type 状态类型 * @param msg 返回内容 * @param data 数据对象 */ public AjaxResult(Type type, String msg, Object data) { super.put(CODE_TAG, type.value); super.put(MSG_TAG, msg); if (StringUtils.isNotNull(data)) { super.put(DATA_TAG, data); } } /** * 返回成功消息 * * @return 成功消息 */ public static AjaxResult success() { return AjaxResult.success("操作成功"); } /** * 返回成功数据 * * @return 成功消息 */ public static AjaxResult success(Object data) { return AjaxResult.success("操作成功", data); } /** * 返回成功消息 * * @param msg 返回内容 * @return 成功消息 */ public static AjaxResult success(String msg) { return AjaxResult.success(msg, null); } /** * 返回成功消息 * * @param msg 返回内容 * @param data 数据对象 * @return 成功消息 */ public static AjaxResult success(String msg, Object data) { return new AjaxResult(Type.SUCCESS, msg, data); } /** * 返回警告消息 * * @param msg 返回内容 * @return 警告消息 */ public static AjaxResult warn(String msg) { return AjaxResult.warn(msg, null); } /** * 返回警告消息 * * @param msg 返回内容 * @param data 数据对象 * @return 警告消息 */ public static AjaxResult warn(String msg, Object data) { return new AjaxResult(Type.WARN, msg, data); } /** * 返回错误消息 * * @return */ public static AjaxResult error() { return AjaxResult.error("操作失败"); } /** * 返回错误消息 * * @param msg 返回内容 * @return 警告消息 */ public static AjaxResult error(String msg) { return AjaxResult.error(msg, null); } /** * 返回错误消息 * * @param msg 返回内容 * @param data 数据对象 * @return 警告消息 */ public static AjaxResult error(String msg, Object data) { return new AjaxResult(Type.ERROR, msg, data); } }
3,245
AjaxResult
java
zh
java
code
{"qsc_code_num_words": 378, "qsc_code_num_chars": 3245.0, "qsc_code_mean_word_length": 4.35714286, "qsc_code_frac_words_unique": 0.18518519, "qsc_code_frac_chars_top_2grams": 0.08743169, "qsc_code_frac_chars_top_3grams": 0.12021858, "qsc_code_frac_chars_top_4grams": 0.0582878, "qsc_code_frac_chars_dupe_5grams": 0.56466302, "qsc_code_frac_chars_dupe_6grams": 0.53187614, "qsc_code_frac_chars_dupe_7grams": 0.47905282, "qsc_code_frac_chars_dupe_8grams": 0.40862174, "qsc_code_frac_chars_dupe_9grams": 0.34061931, "qsc_code_frac_chars_dupe_10grams": 0.25318761, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00394477, "qsc_code_frac_chars_whitespace": 0.37503852, "qsc_code_size_file_byte": 3245.0, "qsc_code_num_lines": 182.0, "qsc_code_num_chars_line_max": 62.0, "qsc_code_num_chars_line_mean": 17.82967033, "qsc_code_frac_chars_alphabet": 0.8081854, "qsc_code_frac_chars_comments": 0.33066256, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.05128205, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.01058932, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.12820513, "qsc_codejava_score_lines_no_logic": 0.17948718, "qsc_codejava_frac_words_no_modifier": 0.90909091, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
package com.ruoyi.common.core.domain; import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonFormat; /** * Entity基类 * * @author ruoyi */ public class BaseEntity implements Serializable { private static final long serialVersionUID = 1L; /** 搜索值 */ private String searchValue; /** 创建者 */ private String createBy; /** 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 更新者 */ private String updateBy; /** 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** 备注 */ private String remark; /** 请求参数 */ private Map<String, Object> params; public String getSearchValue() { return searchValue; } public void setSearchValue(String searchValue) { this.searchValue = searchValue; } public String getCreateBy() { return createBy; } public void setCreateBy(String createBy) { this.createBy = createBy; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getUpdateBy() { return updateBy; } public void setUpdateBy(String updateBy) { this.updateBy = updateBy; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public Map<String, Object> getParams() { if (params == null) { params = new HashMap<>(); } return params; } public void setParams(Map<String, Object> params) { this.params = params; } }
2,021
BaseEntity
java
zh
java
code
{"qsc_code_num_words": 195, "qsc_code_num_chars": 2021.0, "qsc_code_mean_word_length": 6.14358974, "qsc_code_frac_words_unique": 0.38974359, "qsc_code_frac_chars_top_2grams": 0.05843072, "qsc_code_frac_chars_top_3grams": 0.03505843, "qsc_code_frac_chars_top_4grams": 0.03839733, "qsc_code_frac_chars_dupe_5grams": 0.07345576, "qsc_code_frac_chars_dupe_6grams": 0.07345576, "qsc_code_frac_chars_dupe_7grams": 0.07345576, "qsc_code_frac_chars_dupe_8grams": 0.07345576, "qsc_code_frac_chars_dupe_9grams": 0.07345576, "qsc_code_frac_chars_dupe_10grams": 0.07345576, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00071429, "qsc_code_frac_chars_whitespace": 0.30727363, "qsc_code_size_file_byte": 2021.0, "qsc_code_num_lines": 114.0, "qsc_code_num_chars_line_max": 54.0, "qsc_code_num_chars_line_mean": 17.72807018, "qsc_code_frac_chars_alphabet": 0.855, "qsc_code_frac_chars_comments": 0.05541811, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.02531646, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.01990571, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.16455696, "qsc_codejava_score_lines_no_logic": 0.40506329, "qsc_codejava_frac_words_no_modifier": 0.92857143, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ФормаПоиска/Ext/Help/ru.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta content="text/html;charset=utf-8" http-equiv="content-type"></meta><link rel="stylesheet" type="text/css" href="v8help://service_book/service_style"></link><meta name="GENERATOR" content="MSHTML 11.00.9600.18739"></meta></head><body> <p>Предназначена для полнотекстового поиска.</p> <p>Можно выполнять поиск прямо с <strong>Начальной страницы</strong>.</p> <h3>Полнотекстовый поиск</h3> <ul><li>Для поиска данных в приложении наберите слово или словосочетание, нажмите <strong>Найти</strong>. </li> <li>Поисковая фраза сохраняется и при последующих поисках приложение выводит список ранее введенных поисковых фраз. </li> <li>Поиск может осуществляться по одному и нескольким словам. В строке ввода допускается использование поисковых операторов типа <strong>И</strong>, <strong>ИЛИ</strong>, <strong>НЕ</strong> и т.д. Можно использовать и <a href="v8help://1cv8/QueryLanguageFullTextSearchInData">другие поисковые операторы</a>, а также проводить поиск по части слова. </li> <li>В окне результатов поиска выводятся объекты, в которых содержится поисковая фраза или слово и краткое описание объекта. Поисковая фраза или слово подсвечивается. Из окна результатов поиска, выбрав объект, можно открыть его. </li> <li>С помощью кнопок <img src="StdPicture.MoveLeft"></img> и <img src="StdPicture.MoveRight"></img> можно перелистывать страницы результатов поиска.</li></ul><h3>Ограничение области поиска</h3> <ul><li>Если найдено большое количество информации, для увеличения точности результатов можно ограничить <a href="DataProcessor.ПолнотекстовыйПоискВДанных.Form.ВыборОбластиПоиска/Help">Область поиска</a>. </li> <li>Например, можно искать данные, которые относятся только к ключевым операциям замера производительности. </li> <li>Область поиска настраивается по ссылке, расположенной под строкой поиска. По умолчанию ссылка принимает значение <strong>Везде</strong>. </li> <li>Нажмите на ссылку, для того чтобы изменить настройки.</li></ul><h3>Ошибки поиска и методы исправления</h3> <ul><li> <div>Если данные не найдены, приложение выдает сообщение об ошибке. Пути исправления ошибки:</div> <ul><li> <div>Проверьте поисковое выражение. Доработайте его при необходимости, исправьте ошибки по рекомендациям приложения.</div> </li> <li> <div>Возможно, выбрана не та <strong>Область поиска</strong>. Попробуйте ее убрать или изменить с помощью соответствующей ссылки.</div> </li> <li> <div>Возможно, <a href="DataProcessor.ПолнотекстовыйПоискВДанных.Form.УправлениеПолнотекстовымПоискомИИзвлечениемТекстов/Help">индекс полнотекстового поиска</a> давно не обновлялся. Проконтролируйте его состояние, при необходимости нажмите <strong>Обновить индекс</strong>.</div></li></ul></li> <li> <div>После исправления ошибки повторите поиск еще раз.</div></li></ul><h3>См. также:</h3> <ul><li><a href="v8help://frame/form_common">Работа с формами</a>.</li></ul></body></html>
2,953
ru
html
ru
html
code
{"qsc_code_num_words": 404, "qsc_code_num_chars": 2953.0, "qsc_code_mean_word_length": 5.67079208, "qsc_code_frac_words_unique": 0.52722772, "qsc_code_frac_chars_top_2grams": 0.01745962, "qsc_code_frac_chars_top_3grams": 0.01047577, "qsc_code_frac_chars_top_4grams": 0.01920559, "qsc_code_frac_chars_dupe_5grams": 0.05761676, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01119821, "qsc_code_frac_chars_whitespace": 0.092787, "qsc_code_size_file_byte": 2953.0, "qsc_code_num_lines": 33.0, "qsc_code_num_chars_line_max": 350.0, "qsc_code_num_chars_line_mean": 89.48484848, "qsc_code_frac_chars_alphabet": 0.84359836, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.42424242, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.14866238, "qsc_code_frac_chars_long_word_length": 0.10193024, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.61869285, "qsc_codehtml_num_chars_text": 1827.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/Ztree.java
package com.ruoyi.common.core.domain; import java.io.Serializable; /** * Ztree树结构实体类 * * @author ruoyi */ public class Ztree implements Serializable { private static final long serialVersionUID = 1L; /** 节点ID */ private Long id; /** 节点父ID */ private Long pId; /** 节点名称 */ private String name; /** 节点标题 */ private String title; /** 是否勾选 */ private boolean checked = false; /** 是否展开 */ private boolean open = false; /** 是否能勾选 */ private boolean nocheck = false; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getpId() { return pId; } public void setpId(Long pId) { this.pId = pId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; } public boolean isOpen() { return open; } public void setOpen(boolean open) { this.open = open; } public boolean isNocheck() { return nocheck; } public void setNocheck(boolean nocheck) { this.nocheck = nocheck; } }
1,521
Ztree
java
en
java
code
{"qsc_code_num_words": 146, "qsc_code_num_chars": 1521.0, "qsc_code_mean_word_length": 5.59589041, "qsc_code_frac_words_unique": 0.38356164, "qsc_code_frac_chars_top_2grams": 0.08567931, "qsc_code_frac_chars_top_3grams": 0.0, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00103413, "qsc_code_frac_chars_whitespace": 0.36423406, "qsc_code_size_file_byte": 1521.0, "qsc_code_num_lines": 104.0, "qsc_code_num_chars_line_max": 53.0, "qsc_code_num_chars_line_mean": 14.625, "qsc_code_frac_chars_alphabet": 0.84384695, "qsc_code_frac_chars_comments": 0.08021039, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.20289855, "qsc_codejava_score_lines_no_logic": 0.39130435, "qsc_codejava_frac_words_no_modifier": 0.93333333, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 1, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ФормаПоиска/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОписаниеПеременных &НаКлиенте Перем НаправлениеПоискаЗначение; #КонецОбласти #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Если Пользователи.ЭтоСеансВнешнегоПользователя() Тогда Возврат; КонецЕсли; СостояниеПоиска = ПолнотекстовыйПоискСервер.СостояниеПолнотекстовогоПоиска(); ЗагрузитьНастройкиИИсториюПоиска(); Если Не ПустаяСтрока(Параметры.ПереданнаяСтрокаПоиска) Тогда СтрокаПоиска = Параметры.ПереданнаяСтрокаПоиска; ПриВыполненииПоискаНаСервере(СтрокаПоиска); Иначе ОбновитьФорму(Новый Массив); КонецЕсли; ОбновитьПредставлениеОбластиПоиска(); КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовШапкиФормы &НаКлиенте Процедура ПриОткрытии(Отказ) Если ПользователиКлиент.ЭтоСеансВнешнегоПользователя() Тогда Отказ = Истина; ВызватьИсключение(НСтр("ru = 'Недостаточно прав для выполнения поиска.'"), КатегорияОшибки.НарушениеПравДоступа); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура СтрокаПоискаОбработкаВыбора(Элемент, ВыбранноеЗначение, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; #Если ВебКлиент Тогда Если Элементы.СтрокаПоиска.СписокВыбора.Количество() = 1 Тогда ВыбранноеЗначение = Элемент.ТекстРедактирования; КонецЕсли; #КонецЕсли СтрокаПоиска = ВыбранноеЗначение; ПриВыполненииПоиска("ПерваяЧасть"); КонецПроцедуры &НаКлиенте Процедура ОбластиПоискаПредставлениеНажатие(Элемент, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; ПараметрыОткрытия = Новый Структура; ПараметрыОткрытия.Вставить("ОбластиПоиска", ОбластиПоиска); ПараметрыОткрытия.Вставить("ИскатьВРазделах", ИскатьВРазделах); Оповещение = Новый ОписаниеОповещения("ПослеПолученияНастроекОбластиПоиска", ЭтотОбъект); ОткрытьФорму("Обработка.ПолнотекстовыйПоискВДанных.Форма.ВыборОбластиПоиска", ПараметрыОткрытия,,,,, Оповещение); КонецПроцедуры &НаКлиенте Процедура HTMLТекстПриНажатии(Элемент, ДанныеСобытия, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; СсылкаHTML = ДанныеСобытия.Anchor; Если СсылкаHTML = Неопределено Тогда Возврат; КонецЕсли; Оповещение = Новый ОписаниеОповещения("ПослеОткрытияНавигационнойСсылки", ЭтотОбъект); ФайловаяСистемаКлиент.ОткрытьНавигационнуюСсылку(СсылкаHTML.href, Оповещение); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура ВыполнитьПоиск(Команда) ПриВыполненииПоиска("ПерваяЧасть"); КонецПроцедуры &НаКлиенте Процедура Предыдущие(Команда) ПриВыполненииПоиска("ПредыдущаяЧасть"); КонецПроцедуры &НаКлиенте Процедура Следующие(Команда) ПриВыполненииПоиска("СледующаяЧасть"); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции #Область СлужебныеОбработчикиСобытий &НаКлиенте Процедура ПослеПолученияНастроекОбластиПоиска(Результат, ДополнительныеПараметры) Экспорт Если ТипЗнч(Результат) = Тип("Структура") Тогда ПриУстановкеОбластиПоиска(Результат); КонецЕсли; КонецПроцедуры &НаСервере Процедура ПриУстановкеОбластиПоиска(НастройкиОбластиПоиска) СохранитьНастройкиПоиска(НастройкиОбластиПоиска.ИскатьВРазделах, НастройкиОбластиПоиска.ОбластиПоиска); ОбластиПоиска = НастройкиОбластиПоиска.ОбластиПоиска; ИскатьВРазделах = НастройкиОбластиПоиска.ИскатьВРазделах; ОбновитьПредставлениеОбластиПоиска(); КонецПроцедуры &НаКлиенте Процедура ПриВыполненииПоиска(Знач НаправлениеПоиска) Если ПустаяСтрока(СтрокаПоиска) Тогда ПоказатьПредупреждение(, НСтр("ru = 'Введите, что нужно найти.'")); Возврат; КонецЕсли; Если ОбщегоНазначенияСлужебныйКлиент.ЭтоНавигационнаяСсылка(СтрокаПоиска) Тогда ФайловаяСистемаКлиент.ОткрытьНавигационнуюСсылку(СтрокаПоиска); СтрокаПоиска = ""; Возврат; КонецЕсли; НаправлениеПоискаЗначение = НаправлениеПоиска; ПодключитьОбработчикОжидания("ПриВыполненииПоискаЗавершение", 0.1, Истина); КонецПроцедуры &НаКлиенте Процедура ПриВыполненииПоискаЗавершение() ПриВыполненииПоискаНаСервере(СтрокаПоиска, НаправлениеПоискаЗначение); КонецПроцедуры &НаСервере Процедура ПриВыполненииПоискаНаСервере(Знач СтрокаПоиска, Знач НаправлениеПоиска = "ПерваяЧасть") СохранитьСтрокуПоискаВИстории(СтрокаПоиска); ПараметрыПоиска = ПолнотекстовыйПоискСервер.ПараметрыПоиска(); ПараметрыПоиска.ТекущаяПозиция = ТекущаяПозиция; ПараметрыПоиска.ИскатьВРазделах = ИскатьВРазделах; ПараметрыПоиска.ОбластиПоиска = ОбластиПоиска; ПараметрыПоиска.СтрокаПоиска = СтрокаПоиска; ПараметрыПоиска.НаправлениеПоиска = НаправлениеПоиска; РезультатПоиска = ПолнотекстовыйПоискСервер.ВыполнитьПолнотекстовыйПоиск(ПараметрыПоиска); ТекущаяПозиция = РезультатПоиска.ТекущаяПозиция; Количество = РезультатПоиска.Количество; ПолноеКоличество = РезультатПоиска.ПолноеКоличество; КодОшибки = РезультатПоиска.КодОшибки; ОписаниеОшибки = РезультатПоиска.ОписаниеОшибки; СостояниеПоиска = ПолнотекстовыйПоискСервер.СостояниеПолнотекстовогоПоиска(); ОбновитьФорму(РезультатПоиска.РезультатыПоиска); КонецПроцедуры &НаКлиенте Процедура ПослеОткрытияНавигационнойСсылки(ПриложениеЗапущено, Контекст) Экспорт Если Не ПриложениеЗапущено Тогда ПоказатьПредупреждение(, НСтр("ru = 'Открытие объектов данного типа не предусмотрено'")); КонецЕсли; КонецПроцедуры #КонецОбласти #Область Представления &НаСервере Процедура ОбновитьФорму(РезультатыПоиска) Если Количество = 0 Тогда Элементы.Следующие.Доступность = Ложь; Элементы.Предыдущие.Доступность = Ложь; Иначе Элементы.Следующие.Доступность = (ПолноеКоличество - ТекущаяПозиция) > Количество; Элементы.Предыдущие.Доступность = (ТекущаяПозиция > 0); КонецЕсли; Если Количество <> 0 Тогда ИнформацияОНайденномПредставление = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Показаны %1 - %2 из %3'"), Формат(ТекущаяПозиция + 1, "ЧН=0; ЧГ="), Формат(ТекущаяПозиция + Количество, "ЧН=0; ЧГ="), Формат(ПолноеКоличество, "ЧН=0; ЧГ=")); Иначе ИнформацияОНайденномПредставление = ""; КонецЕсли; Если ПустаяСтрока(КодОшибки) Тогда РезультатыПоискаПредставление = НоваяHTMLСтраницаРезультата(РезультатыПоиска); Иначе РезультатыПоискаПредставление = НоваяHTMLСтраницаОшибки(); КонецЕсли; Если СостояниеПоиска = "ПоискРазрешен" Тогда СостояниеПоискаПредставление = ""; ИначеЕсли СостояниеПоиска = "ВыполняетсяОбновлениеИндекса" Или СостояниеПоиска = "ВыполняетсяСлияниеИндекса" Или СостояниеПоиска = "ТребуетсяОбновлениеИндекса" Тогда СостояниеПоискаПредставление = НСтр("ru = 'Результаты поиска могут быть неточными, повторите поиск позднее.'"); ИначеЕсли СостояниеПоиска = "ОшибкаНастройкиПоиска" Тогда // Для не администратора СостояниеПоискаПредставление = НСтр("ru = 'Полнотекстовый поиск не настроен, обратитесь к администратору.'"); ИначеЕсли СостояниеПоиска = "ПоискЗапрещен" Тогда СостояниеПоискаПредставление = НСтр("ru = 'Полнотекстовый поиск отключен.'"); КонецЕсли; Элементы.СостояниеПоиска.Видимость = (СостояниеПоиска <> "ПоискРазрешен"); КонецПроцедуры &НаСервере Процедура ОбновитьПредставлениеОбластиПоиска() УказаныОбластиПоиска = ОбластиПоиска.Количество() > 0; Если Не ИскатьВРазделах Или Не УказаныОбластиПоиска Тогда ОбластиПоискаПредставление = НСтр("ru = 'Везде'"); Возврат; КонецЕсли; Если ОбластиПоиска.Количество() < 5 Тогда ОбластиПоискаПредставление = ""; Для каждого Область Из ОбластиПоиска Цикл ОбъектМетаданных = ОбщегоНазначения.ОбъектМетаданныхПоИдентификатору(Область.Значение); ОбластиПоискаПредставление = ОбластиПоискаПредставление + ОбщегоНазначения.ПредставлениеСписка(ОбъектМетаданных) + ", "; КонецЦикла; ОбластиПоискаПредставление = Лев(ОбластиПоискаПредставление, СтрДлина(ОбластиПоискаПредставление) - 2); Иначе ОбластиПоискаПредставление = НСтр("ru = 'В выбранных разделах'"); КонецЕсли; КонецПроцедуры // Параметры: // РезультатыПоиска - Массив из Структура: // * Ссылка - Строка // * ОписаниеHTML - Строка // * Представление - Строка // // Возвращаемое значение: // Строка // &НаСервере Функция НоваяHTMLСтраницаРезультата(РезультатыПоиска) ШаблонСтраницы = "<html> |<head> | <meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8""> | <style type=""text/css""> | html { | overflow: auto; | } | body { | margin: 10px; | font-family: Arial, sans-serif; | font-size: 10pt; | overflow: auto; | position: absolute; | top: 0; | left: 0; | bottom: 0; | right: 0; | } | div.main { | overflow: auto; | height: 100%; | } | div.presentation { | font-size: 11pt; | } | div.textPortion { | padding-bottom: 16px; | } | span.bold { | font-weight: bold; | } | ol li { | color: #B3B3B3; | } | ol li div { | color: #333333; | } | a { | text-decoration: none; | color: #0066CC; | } | a:hover { | text-decoration: underline; | } | .gray { | color: #B3B3B3; | } | </style> |</head> |<body> | <div class=""main""> | <ol start=""%ТекущаяПозиция%""> |%Строки% | </ol> | </div> |</body> |</html>"; ШаблонСтроки = " <li> | <div class=""presentation""><a href=""%Ссылка%"">%Представление%</a></div> | %ОписаниеHTML% | </li>"; ШаблонНеактивнойСтроки = " <li> | <div class=""presentation""><a href=""#"" class=""gray"">%Представление%</a></div> | %ОписаниеHTML% | </li>"; Строки = ""; Для каждого СтрокаРезультатаПоиска Из РезультатыПоиска Цикл Ссылка = СтрокаРезультатаПоиска.Ссылка; Представление = СтрокаРезультатаПоиска.Представление; ОписаниеHTML = СтрокаРезультатаПоиска.ОписаниеHTML; Если Ссылка = "#" Тогда Строка = ШаблонНеактивнойСтроки; Иначе Строка = СтрЗаменить(ШаблонСтроки, "%Ссылка%", Ссылка); КонецЕсли; Строка = СтрЗаменить(Строка, "%Представление%", Представление); Строка = СтрЗаменить(Строка, "%ОписаниеHTML%", ОписаниеHTML); Строки = Строки + Строка; КонецЦикла; HTMLСтраница = СтрЗаменить(ШаблонСтраницы, "%Строки%", Строки); HTMLСтраница = СтрЗаменить(HTMLСтраница , "%ТекущаяПозиция%", ТекущаяПозиция + 1); Возврат HTMLСтраница; КонецФункции &НаСервере Функция НоваяHTMLСтраницаОшибки() ШаблонСтраницы = "<html> |<head> | <meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8""> | <style type=""text/css""> | html { | overflow:auto; | } | body { | margin: 10px; | font-family: Arial, sans-serif; | font-size: 10pt; | overflow: auto; | position: absolute; | top: 0; | left: 0; | bottom: 0; | right: 0; | } | div.main { | overflow: auto; | height: 100%; | } | div.error { | font-size: 12pt; | } | div.presentation { | font-size: 11pt; | } | h3 { | color: #009646 | } | li { | padding-bottom: 16px; | } | a { | text-decoration: none; | color: #0066CC; | } | a:hover { | text-decoration: underline; | } | </style> |</head> |<body> | <div class=""main""> | <div class=""error"">%1</div> | <p>%2</p> | </div> |</body> |</html>"; РекомендацииHTML = НСтр("ru = '<h3>Рекомендации:</h3> |<ul> | %1 | %2 | <li> | <b>Воспользуйтесь поиском по началу слова.</b><br> | Используйте звездочку (*) в качестве окончания.<br> | Например, поиск стро* найдет все документы, которые содержат слова, начинающиеся на стро - | Журнал ""Строительство и ремонт"", ""ООО СтройКомплект"" и.т.д. | </li> | <li> | <b>Воспользуйтесь нечетким поиском.</b><br> | Используйте решетку (#).<br> | Например, Ромашка#2 найдет все документы, содержащие такие слова, которые отличаются от слова | Ромашка на одну или две буквы. | </li> |</ul> |<div class ""presentation""><a href=""%3"">Полное описание формата поисковых выражений</a></div>'"); УказаныОбластиПоиска = ОбластиПоиска.Количество() > 0; РекомендацияОбластиПоискаHTML = ""; РекомендацияТекстЗапросаHTML = ""; Если КодОшибки = "НичегоНеНайдено" Тогда Если ИскатьВРазделах И УказаныОбластиПоиска Тогда РекомендацияОбластиПоискаHTML = НСтр("ru = '<li><b>Уточните область поиска.</b><br> |Попробуйте выбрать больше областей поиска или все разделы.</li>'"); КонецЕсли; РекомендацияТекстЗапросаHTML = НСтр("ru = '<li><b>Упростите запрос, исключив из него какое-либо слово.</b></li>'"); ИначеЕсли КодОшибки = "СлишкомМногоРезультатов" Тогда Если Не ИскатьВРазделах Или Не УказаныОбластиПоиска Тогда РекомендацияОбластиПоискаHTML = НСтр("ru = '<li><b>Уточните область поиска.</b><br> |Попробуйте выбрать область поиска, задав точный раздел или список.</li>'"); КонецЕсли; КонецЕсли; РекомендацииHTML = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(РекомендацииHTML, РекомендацияОбластиПоискаHTML, РекомендацияТекстЗапросаHTML, "v8help://1cv8/QueryLanguageFullTextSearchInData"); Возврат СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(ШаблонСтраницы, ОписаниеОшибки, РекомендацииHTML); КонецФункции #КонецОбласти #Область ИсторияНастройкиПоиска &НаСервере Процедура ЗагрузитьНастройкиИИсториюПоиска() ИсторияПоиска = ОбщегоНазначения.ХранилищеОбщихНастроекЗагрузить("ПолнотекстовыйПоискСтрокиПолнотекстовогоПоиска", "", Новый Массив); Элементы.СтрокаПоиска.СписокВыбора.ЗагрузитьЗначения(ИсторияПоиска); СохраненныеНастройкиПоиска = ОбщегоНазначения.ХранилищеОбщихНастроекЗагрузить("НастройкиПолнотекстовогоПоиска", "", НастройкиПоиска()); ИскатьВРазделах = СохраненныеНастройкиПоиска.ИскатьВРазделах; ОбластиПоиска = СохраненныеНастройкиПоиска.ОбластиПоиска; КонецПроцедуры &НаСервере Процедура СохранитьСтрокуПоискаВИстории(СтрокаПоиска) ИсторияПоиска = ОбщегоНазначения.ХранилищеОбщихНастроекЗагрузить("ПолнотекстовыйПоискСтрокиПолнотекстовогоПоиска", "", Новый Массив); СохраненнаяСтрока = ИсторияПоиска.Найти(СтрокаПоиска); Если СохраненнаяСтрока <> Неопределено Тогда ИсторияПоиска.Удалить(СохраненнаяСтрока); КонецЕсли; ИсторияПоиска.Вставить(0, СтрокаПоиска); КоличествоСтрок = ИсторияПоиска.Количество(); Если КоличествоСтрок > 20 Тогда ИсторияПоиска.Удалить(КоличествоСтрок - 1); КонецЕсли; ОбщегоНазначения.ХранилищеОбщихНастроекСохранить("ПолнотекстовыйПоискСтрокиПолнотекстовогоПоиска", "", ИсторияПоиска); Элементы.СтрокаПоиска.СписокВыбора.ЗагрузитьЗначения(ИсторияПоиска); КонецПроцедуры &НаСервереБезКонтекста Процедура СохранитьНастройкиПоиска(ИскатьВРазделах, ОбластиПоиска) Настройки = НастройкиПоиска(); Настройки.ИскатьВРазделах = ИскатьВРазделах; Настройки.ОбластиПоиска = ОбластиПоиска; ОбщегоНазначения.ХранилищеОбщихНастроекСохранить("НастройкиПолнотекстовогоПоиска", "", Настройки); КонецПроцедуры &НаСервереБезКонтекста Функция НастройкиПоиска() Настройки = Новый Структура; Настройки.Вставить("ИскатьВРазделах", Ложь); Настройки.Вставить("ОбластиПоиска", Новый СписокЗначений); Возврат Настройки; КонецФункции #КонецОбласти #КонецОбласти
15,759
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 1176, "qsc_code_num_chars": 15759.0, "qsc_code_mean_word_length": 9.75255102, "qsc_code_frac_words_unique": 0.32057823, "qsc_code_frac_chars_top_2grams": 0.00680094, "qsc_code_frac_chars_top_3grams": 0.02232104, "qsc_code_frac_chars_top_4grams": 0.00549307, "qsc_code_frac_chars_dupe_5grams": 0.14848723, "qsc_code_frac_chars_dupe_6grams": 0.10558898, "qsc_code_frac_chars_dupe_7grams": 0.07611823, "qsc_code_frac_chars_dupe_8grams": 0.06940448, "qsc_code_frac_chars_dupe_9grams": 0.06940448, "qsc_code_frac_chars_dupe_10grams": 0.06940448, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00792632, "qsc_code_frac_chars_whitespace": 0.15940098, "qsc_code_size_file_byte": 15759.0, "qsc_code_num_lines": 562.0, "qsc_code_num_chars_line_max": 137.0, "qsc_code_num_chars_line_mean": 28.04092527, "qsc_code_frac_chars_alphabet": 0.85777912, "qsc_code_frac_chars_comments": 0.99333714, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
package com.ruoyi.common.utils.spring; import org.springframework.aop.framework.AopContext; import org.springframework.beans.BeansException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.stereotype.Component; /** * spring工具类 方便在非spring管理环境中获取bean * * @author ruoyi */ @Component public final class SpringUtils implements BeanFactoryPostProcessor { /** Spring应用上下文环境 */ private static ConfigurableListableBeanFactory beanFactory; @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringUtils.beanFactory = beanFactory; } /** * 获取对象 * * @param name * @return Object 一个以所给名字注册的bean的实例 * @throws org.springframework.beans.BeansException * */ @SuppressWarnings("unchecked") public static <T> T getBean(String name) throws BeansException { return (T) beanFactory.getBean(name); } /** * 获取类型为requiredType的对象 * * @param clz * @return * @throws org.springframework.beans.BeansException * */ public static <T> T getBean(Class<T> clz) throws BeansException { T result = (T) beanFactory.getBean(clz); return result; } /** * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true * * @param name * @return boolean */ public static boolean containsBean(String name) { return beanFactory.containsBean(name); } /** * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) * * @param name * @return boolean * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException * */ public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { return beanFactory.isSingleton(name); } /** * @param name * @return Class 注册对象的类型 * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException * */ public static Class<?> getType(String name) throws NoSuchBeanDefinitionException { return beanFactory.getType(name); } /** * 如果给定的bean名字在bean定义中有别名,则返回这些别名 * * @param name * @return * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException * */ public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { return beanFactory.getAliases(name); } /** * 获取aop代理对象 * * @param invoker * @return */ @SuppressWarnings("unchecked") public static <T> T getAopProxy(T invoker) { return (T) AopContext.currentProxy(); } }
2,922
SpringUtils
java
en
java
code
{"qsc_code_num_words": 228, "qsc_code_num_chars": 2922.0, "qsc_code_mean_word_length": 8.69736842, "qsc_code_frac_words_unique": 0.29824561, "qsc_code_frac_chars_top_2grams": 0.09984871, "qsc_code_frac_chars_top_3grams": 0.10438729, "qsc_code_frac_chars_top_4grams": 0.09077156, "qsc_code_frac_chars_dupe_5grams": 0.38830055, "qsc_code_frac_chars_dupe_6grams": 0.29198185, "qsc_code_frac_chars_dupe_7grams": 0.11649017, "qsc_code_frac_chars_dupe_8grams": 0.11649017, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0, "qsc_code_frac_chars_whitespace": 0.23169062, "qsc_code_size_file_byte": 2922.0, "qsc_code_num_lines": 114.0, "qsc_code_num_chars_line_max": 112.0, "qsc_code_num_chars_line_mean": 25.63157895, "qsc_code_frac_chars_alphabet": 0.88329621, "qsc_code_frac_chars_comments": 0.38877481, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.04166667, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.01007839, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.125, "qsc_codejava_score_lines_no_logic": 0.3125, "qsc_codejava_frac_words_no_modifier": 0.85714286, "qsc_codejava_frac_words_legal_var_name": 0.5, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ЭлектроннаяПодпись/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <SaveWindowSettings>false</SaveWindowSettings> <Customizable>false</Customizable> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <ChildItems> <Button name="ФормаЗакрыть" id="1"> <Type>CommandBarButton</Type> <Representation>Text</Representation> <DefaultButton>true</DefaultButton> <CommandName>Form.StandardCommand.Close</CommandName> <ExtendedTooltip name="ФормаЗакрытьРасширеннаяПодсказка" id="21"/> </Button> <Button name="ФормаСохранитьВФайл" id="10"> <Type>CommandBarButton</Type> <CommandName>Form.Command.СохранитьВФайл</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Сохранить в файл...</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаСохранитьВФайлРасширеннаяПодсказка" id="22"/> </Button> <Button name="ФормаОткрытьСертификат" id="16"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ОткрытьСертификат</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Открыть сертификат...</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаОткрытьСертификатРасширеннаяПодсказка" id="23"/> </Button> <Button name="ФормаПродлитьДействиеПодписи" id="55"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ПродлитьДействиеПодписи</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Продлить действие...</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаПродлитьДействиеПодписиРасширеннаяПодсказка" id="56"/> </Button> <Button name="ФормаОткрытьСертификатДляПроверкиПодписи" id="64"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ОткрытьСертификатДляПроверкиПодписи</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Открыть сертификаты подписи...</v8:content> </v8:item> </Title> <LocationInCommandBar>InAdditionalSubmenu</LocationInCommandBar> <ExtendedTooltip name="ФормаОткрытьСертификатДляПроверкиПодписиРасширеннаяПодсказка" id="65"/> </Button> </ChildItems> </AutoCommandBar> <Events> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <LabelDecoration name="ДекорацияСтатус" id="59"> <AutoMaxWidth>false</AutoMaxWidth> <MaxWidth>80</MaxWidth> <HorizontalStretch>true</HorizontalStretch> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат проверки подписи</v8:content> </v8:item> </Title> <BackColor>style:ToolTipBackColor</BackColor> <ContextMenu name="ДекорацияСтатусКонтекстноеМеню" id="60"/> <ExtendedTooltip name="ДекорацияСтатусРасширеннаяПодсказка" id="61"/> </LabelDecoration> <InputField name="ОбоснованиеРучнойПроверкиДополнительныхАтрибутов" id="87"> <DataPath>ОбоснованиеРучнойПроверкиДополнительныхАтрибутов</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обоснование достоверности подписи</v8:content> </v8:item> </Title> <TitleLocation>Top</TitleLocation> <AutoMaxWidth>false</AutoMaxWidth> <AutoMaxHeight>false</AutoMaxHeight> <MaxHeight>4</MaxHeight> <MultiLine>true</MultiLine> <TextEdit>false</TextEdit> <ContextMenu name="ОбоснованиеРучнойПроверкиДополнительныхАтрибутовКонтекстноеМеню" id="88"/> <ExtendedTooltip name="ОбоснованиеРучнойПроверкиДополнительныхАтрибутовРасширеннаяПодсказка" id="89"/> </InputField> <InputField name="ОписаниеОшибки" id="35"> <DataPath>ОписаниеОшибки</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Описание ошибки</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <AutoMaxWidth>false</AutoMaxWidth> <AutoMaxHeight>false</AutoMaxHeight> <MaxHeight>4</MaxHeight> <MultiLine>true</MultiLine> <TextEdit>false</TextEdit> <BackColor>style:ЦветФонаВнимание</BackColor> <ContextMenu name="ОписаниеОшибкиКонтекстноеМеню" id="36"/> <ExtendedTooltip name="ОписаниеОшибкиРасширеннаяПодсказка" id="37"/> </InputField> <UsualGroup name="ГруппаМЧД" id="69"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Машиночитаемая доверенность</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Usual</Behavior> <Collapsed>true</Collapsed> <Representation>NormalSeparation</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаМЧДРасширеннаяПодсказка" id="70"/> <ChildItems> <LabelDecoration name="МашиночитаемаяДоверенностьДекорация" id="66"> <AutoMaxWidth>false</AutoMaxWidth> <HorizontalStretch>true</HorizontalStretch> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Машиночитаемая доверенность</v8:content> </v8:item> </Title> <ContextMenu name="МашиночитаемаяДоверенностьДекорацияКонтекстноеМеню" id="67"/> <ExtendedTooltip name="МашиночитаемаяДоверенностьДекорацияРасширеннаяПодсказка" id="68"/> </LabelDecoration> <UsualGroup name="ГруппаПротоколПроверки" id="73"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Протокол проверки МЧД</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Collapsible</Behavior> <Collapsed>true</Collapsed> <ControlRepresentation>Picture</ControlRepresentation> <ExtendedTooltip name="ГруппаПротоколПроверкиРасширеннаяПодсказка" id="74"/> </UsualGroup> </ChildItems> </UsualGroup> <InputField name="КомуВыданСертификат" id="2"> <DataPath>КомуВыданСертификат</DataPath> <ReadOnly>true</ReadOnly> <SkipOnInput>true</SkipOnInput> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Автор подписи</v8:content> </v8:item> </Title> <ContextMenu name="КомуВыданСертификатКонтекстноеМеню" id="3"/> <ExtendedTooltip name="КомуВыданСертификатРасширеннаяПодсказка" id="24"/> </InputField> <InputField name="ТипПодписи" id="52"> <DataPath>ТипПодписи</DataPath> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Тип подписи</v8:content> </v8:item> </Title> <ContextMenu name="ТипПодписиКонтекстноеМеню" id="53"/> <ExtendedTooltip name="ТипПодписиРасширеннаяПодсказка" id="54"/> </InputField> <InputField name="УстановившийПодпись" id="12"> <DataPath>УстановившийПодпись</DataPath> <ReadOnly>true</ReadOnly> <SkipOnInput>true</SkipOnInput> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Установивший подпись</v8:content> </v8:item> </Title> <Width>35</Width> <HorizontalStretch>false</HorizontalStretch> <ContextMenu name="УстановившийПодписьКонтекстноеМеню" id="13"/> <ExtendedTooltip name="УстановившийПодписьРасширеннаяПодсказка" id="26"/> </InputField> <InputField name="ДатаПодписи" id="17"> <DataPath>ДатаПодписи</DataPath> <ReadOnly>true</ReadOnly> <SkipOnInput>true</SkipOnInput> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дата подписи</v8:content> </v8:item> </Title> <ContextMenu name="ДатаПодписиКонтекстноеМеню" id="18"/> <ExtendedTooltip name="ДатаПодписиРасширеннаяПодсказка" id="27"/> </InputField> <InputField name="Комментарий" id="14"> <DataPath>Комментарий</DataPath> <ReadOnly>true</ReadOnly> <SkipOnInput>true</SkipOnInput> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Комментарий</v8:content> </v8:item> </Title> <AutoMaxWidth>false</AutoMaxWidth> <MultiLine>true</MultiLine> <TextEdit>false</TextEdit> <ContextMenu name="КомментарийКонтекстноеМеню" id="15"/> <ExtendedTooltip name="КомментарийРасширеннаяПодсказка" id="28"/> </InputField> <InputField name="СрокДействияПоследнейМеткиВремени" id="49"> <DataPath>СрокДействияПоследнейМеткиВремени</DataPath> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Срок действия последней метки времени</v8:content> </v8:item> </Title> <TitleHeight>2</TitleHeight> <ContextMenu name="СрокДействияПоследнейМеткиВремениКонтекстноеМеню" id="50"/> <ExtendedTooltip name="СрокДействияПоследнейМеткиВремениРасширеннаяПодсказка" id="51"/> </InputField> <UsualGroup name="ТехническаяИнформация" id="41"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Техническая информация</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Collapsible</Behavior> <Collapsed>true</Collapsed> <ControlRepresentation>Picture</ControlRepresentation> <Representation>None</Representation> <ExtendedTooltip name="ТехническаяИнформацияРасширеннаяПодсказка" id="42"/> <ChildItems> <InputField name="АлгоритмПодписиПредупреждение" id="75"> <DataPath>АлгоритмПодписи</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм подписи</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм, которым с помощью закрытой части ключа подписана криптостойкая хеш-сумма данных, вычисленная с помощью алгоритма хеширования.</v8:content> </v8:item> </ToolTip> <ToolTipRepresentation>Button</ToolTipRepresentation> <AutoMaxWidth>false</AutoMaxWidth> <AutoMaxHeight>false</AutoMaxHeight> <MaxHeight>2</MaxHeight> <MultiLine>true</MultiLine> <TextEdit>false</TextEdit> <BackColor>style:ЦветФонаВнимание</BackColor> <ContextMenu name="АлгоритмПодписиПредупреждениеКонтекстноеМеню" id="76"/> <ExtendedTooltip name="АлгоритмПодписиПредупреждениеРасширеннаяПодсказка" id="77"/> </InputField> <InputField name="АлгоритмПодписи" id="43"> <DataPath>АлгоритмПодписи</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм подписи</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм, которым с помощью закрытой части ключа подписана криптостойкая хеш-сумма данных, вычисленная с помощью алгоритма хеширования.</v8:content> </v8:item> </ToolTip> <ToolTipRepresentation>Button</ToolTipRepresentation> <AutoMaxWidth>false</AutoMaxWidth> <TextEdit>false</TextEdit> <ContextMenu name="АлгоритмПодписиКонтекстноеМеню" id="44"/> <ExtendedTooltip name="АлгоритмПодписиРасширеннаяПодсказка" id="45"/> </InputField> <InputField name="АлгоритмХеширования" id="46"> <DataPath>АлгоритмХеширования</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм хеширования</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм, которым вычислена криптостойкая хеш-сумма данных и затем подписана закрытой частью ключа с помощью алгоритма подписи.</v8:content> </v8:item> </ToolTip> <ToolTipRepresentation>Button</ToolTipRepresentation> <AutoMaxWidth>false</AutoMaxWidth> <TextEdit>false</TextEdit> <ContextMenu name="АлгоритмХешированияКонтекстноеМеню" id="47"/> <ExtendedTooltip name="АлгоритмХешированияРасширеннаяПодсказка" id="48"/> </InputField> <UsualGroup name="ГруппаОшибкаМатематическойПроверки" id="90"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Ошибка математической проверки</v8:content> </v8:item> </Title> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаОшибкаМатематическойПроверкиРасширеннаяПодсказка" id="91"/> <ChildItems> <InputField name="ОшибкаМатематическойПроверкиПодписи" id="78"> <DataPath>ОшибкаМатематическойПроверкиПодписи</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проверка соответствия подписи документу</v8:content> </v8:item> </Title> <TitleLocation>Top</TitleLocation> <AutoMaxWidth>false</AutoMaxWidth> <AutoMaxHeight>false</AutoMaxHeight> <MaxHeight>2</MaxHeight> <MultiLine>true</MultiLine> <TextEdit>false</TextEdit> <ContextMenu name="ОшибкаМатематическойПроверкиПодписиКонтекстноеМеню" id="79"/> <ExtendedTooltip name="ОшибкаМатематическойПроверкиПодписиРасширеннаяПодсказка" id="80"/> </InputField> <Button name="ОткрытьОписаниеОшибки" id="97"> <Type>Hyperlink</Type> <CommandName>Form.Command.ОткрытьОписаниеОшибкиМатематическойПроверки</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Подробнее</v8:content> </v8:item> </Title> <ExtendedTooltip name="ОткрытьОписаниеОшибкиРасширеннаяПодсказка" id="98"/> </Button> </ChildItems> </UsualGroup> <UsualGroup name="ГруппаОшибкаПроверкиДополнительныхАтрибутов" id="92"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Ошибка проверки дополнительных атрибутов</v8:content> </v8:item> </Title> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаОшибкаПроверкиДополнительныхАтрибутовРасширеннаяПодсказка" id="93"/> <ChildItems> <InputField name="ОшибкаПроверкиДополнительныхАтрибутов" id="81"> <DataPath>ОшибкаПроверкиДополнительныхАтрибутов</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проверка сертификата подписи</v8:content> </v8:item> </Title> <TitleLocation>Top</TitleLocation> <AutoMaxWidth>false</AutoMaxWidth> <AutoMaxHeight>false</AutoMaxHeight> <MaxHeight>2</MaxHeight> <MultiLine>true</MultiLine> <TextEdit>false</TextEdit> <ContextMenu name="ОшибкаПроверкиДополнительныхАтрибутовКонтекстноеМеню" id="82"/> <ExtendedTooltip name="ОшибкаПроверкиДополнительныхАтрибутовРасширеннаяПодсказка" id="83"/> </InputField> <Button name="ОткрытьОписаниеОшибкиДополнительныхАтрибутов" id="99"> <Type>Hyperlink</Type> <CommandName>Form.Command.ОткрытьОписаниеОшибкиДополнительныхАтрибутов</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Подробнее</v8:content> </v8:item> </Title> <ExtendedTooltip name="ОткрытьОписаниеОшибкиДополнительныхАтрибутовРасширеннаяПодсказка" id="100"/> </Button> </ChildItems> </UsualGroup> </ChildItems> </UsualGroup> </ChildItems> <Attributes> <Attribute name="КомуВыданСертификат" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Автор подписи</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="Отпечаток" id="5"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="АдресСертификата" id="6"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="УстановившийПодпись" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Установивший подпись</v8:content> </v8:item> </Title> <Type/> </Attribute> <Attribute name="Комментарий" id="3"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Комментарий</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="АдресПодписи" id="4"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ДатаПодписи" id="7"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дата подписи</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>DateTime</v8:DateFractions> </v8:DateQualifiers> </Type> </Attribute> <Attribute name="ДатаПроверкиПодписи" id="9"> <Type> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>DateTime</v8:DateFractions> </v8:DateQualifiers> </Type> </Attribute> <Attribute name="ПодписьВерна" id="10"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="Статус" id="11"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ОписаниеОшибки" id="12"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Описание ошибки</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="АлгоритмПодписи" id="8"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм подписи</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="АлгоритмХеширования" id="13"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Алгоритм хеширования</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ТипПодписи" id="14"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Тип подписи</v8:content> </v8:item> </Title> <Type> <v8:Type>cfg:EnumRef.ТипыПодписиКриптографии</v8:Type> </Type> </Attribute> <Attribute name="СрокДействияПоследнейМеткиВремени" id="15"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Срок действия последней метки времени</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>DateTime</v8:DateFractions> </v8:DateQualifiers> </Type> </Attribute> <Attribute name="ПодписанныйОбъект" id="16"> <Type> <v8:TypeSet>cfg:AnyIBRef</v8:TypeSet> </Type> </Attribute> <Attribute name="ПорядковыйНомер" id="17"> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>10</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Attribute> <Attribute name="ТребуетсяПроверка" id="18"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="СертификатыДляПроверкиПодписи" id="20"> <Type> <v8:Type>v8:ValueTable</v8:Type> </Type> <Columns> <Column name="ДанныеСертификата" id="21"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="КомуВыдан" id="22"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ЭтоСертификатПодписи" id="23"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Column> </Columns> </Attribute> <Attribute name="СвойстваПрочитаны" id="24"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="ОшибкаЧтенияПодписи" id="25"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="РезультатПроверкиПодписиПоМЧД" id="27"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ПодписьМатематическиВерна" id="28"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="ОшибкаМатематическойПроверкиПодписи" id="29"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Ошибка при проверке соответствия подписи документу</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ОшибкаПроверкиДополнительныхАтрибутов" id="30"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Ошибка при проверке сертификата подписи</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ДополнительныеАтрибутыПровереныВручную" id="31"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="АвторРучнойПроверкиДополнительныхАтрибутов" id="32"> <Type> <v8:Type>cfg:CatalogRef.Пользователи</v8:Type> </Type> </Attribute> <Attribute name="ОбоснованиеРучнойПроверкиДополнительныхАтрибутов" id="33"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обоснование ручной проверки дополнительных атрибутов</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="РезультатПроверки" id="34"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="РезультатПроверкиКраткий" id="35"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> </Attributes> <Commands> <Command name="СохранитьВФайл" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Сохранить в файл...</v8:content> </v8:item> </Title> <Action>СохранитьВФайл</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="ОткрытьСертификат" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Открыть сертификат...</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Открыть сертификат</v8:content> </v8:item> </ToolTip> <Action>ОткрытьСертификат</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="ПродлитьДействиеПодписи" id="3"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Продлить действие...</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Продлить действие подписи (усовершенствовать или добавить архивную метку)</v8:content> </v8:item> </ToolTip> <Action>ПродлитьДействиеПодписи</Action> </Command> <Command name="ОткрытьСертификатДляПроверкиПодписи" id="4"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Открыть сертификаты подписи...</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Сертификаты для проверки подписи: сертификат подписанта, сертификаты меток времени.</v8:content> </v8:item> </ToolTip> <Action>ОткрытьСертификатДляПроверкиПодписи</Action> </Command> <Command name="ОткрытьОписаниеОшибкиМатематическойПроверки" id="5"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Подробнее</v8:content> </v8:item> </Title> <Action>ОткрытьОписаниеОшибкиМатематическойПроверки</Action> </Command> <Command name="ОткрытьОписаниеОшибкиДополнительныхАтрибутов" id="6"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Подробнее</v8:content> </v8:item> </Title> <Action>ОткрытьОписаниеОшибкиДополнительныхАтрибутов</Action> </Command> </Commands> <Parameters> <Parameter name="СвойстваПодписи"> <Type/> </Parameter> </Parameters> </Form>
26,334
Form
xml
ru
xml
data
{"qsc_code_num_words": 2700, "qsc_code_num_chars": 26334.0, "qsc_code_mean_word_length": 6.53740741, "qsc_code_frac_words_unique": 0.14851852, "qsc_code_frac_chars_top_2grams": 0.03399241, "qsc_code_frac_chars_top_3grams": 0.02266161, "qsc_code_frac_chars_top_4grams": 0.03399241, "qsc_code_frac_chars_dupe_5grams": 0.57651125, "qsc_code_frac_chars_dupe_6grams": 0.57333862, "qsc_code_frac_chars_dupe_7grams": 0.54529488, "qsc_code_frac_chars_dupe_8grams": 0.53090476, "qsc_code_frac_chars_dupe_9grams": 0.50733669, "qsc_code_frac_chars_dupe_10grams": 0.4961192, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03659928, "qsc_code_frac_chars_whitespace": 0.16788183, "qsc_code_size_file_byte": 26334.0, "qsc_code_num_lines": 805.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 32.71304348, "qsc_code_frac_chars_alphabet": 0.76885867, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.76397516, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.16123642, "qsc_code_frac_chars_long_word_length": 0.10469355, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
package com.ruoyi.common.utils.bean; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Bean 工具类 * * @author ruoyi */ public class BeanUtils extends org.springframework.beans.BeanUtils { /** Bean方法名中属性名开始的下标 */ private static final int BEAN_METHOD_PROP_INDEX = 3; /** * 匹配getter方法的正则表达式 */ private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); /** * 匹配setter方法的正则表达式 */ private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); /** * Bean属性复制工具方法。 * * @param dest 目标对象 * @param src 源对象 */ public static void copyBeanProp(Object dest, Object src) { try { copyProperties(src, dest); } catch (Exception e) { e.printStackTrace(); } } /** * 获取对象的setter方法。 * * @param obj 对象 * @return 对象的setter方法列表 */ public static List<Method> getSetterMethods(Object obj) { // setter方法列表 List<Method> setterMethods = new ArrayList<Method>(); // 获取所有方法 Method[] methods = obj.getClass().getMethods(); // 查找setter方法 for (Method method : methods) { Matcher m = SET_PATTERN.matcher(method.getName()); if (m.matches() && (method.getParameterTypes().length == 1)) { setterMethods.add(method); } } // 返回setter方法列表 return setterMethods; } /** * 获取对象的getter方法。 * * @param obj 对象 * @return 对象的getter方法列表 */ public static List<Method> getGetterMethods(Object obj) { // getter方法列表 List<Method> getterMethods = new ArrayList<Method>(); // 获取所有方法 Method[] methods = obj.getClass().getMethods(); // 查找getter方法 for (Method method : methods) { Matcher m = GET_PATTERN.matcher(method.getName()); if (m.matches() && (method.getParameterTypes().length == 0)) { getterMethods.add(method); } } // 返回getter方法列表 return getterMethods; } /** * 检查Bean方法名中的属性名是否相等。<br> * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 * * @param m1 方法名1 * @param m2 方法名2 * @return 属性名一样返回true,否则返回false */ public static boolean isMethodPropEquals(String m1, String m2) { return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); } }
2,667
BeanUtils
java
zh
java
code
{"qsc_code_num_words": 324, "qsc_code_num_chars": 2667.0, "qsc_code_mean_word_length": 4.65432099, "qsc_code_frac_words_unique": 0.34876543, "qsc_code_frac_chars_top_2grams": 0.03183024, "qsc_code_frac_chars_top_3grams": 0.03713528, "qsc_code_frac_chars_top_4grams": 0.03779841, "qsc_code_frac_chars_dupe_5grams": 0.35278515, "qsc_code_frac_chars_dupe_6grams": 0.31564987, "qsc_code_frac_chars_dupe_7grams": 0.28116711, "qsc_code_frac_chars_dupe_8grams": 0.16710875, "qsc_code_frac_chars_dupe_9grams": 0.16710875, "qsc_code_frac_chars_dupe_10grams": 0.16710875, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00597501, "qsc_code_frac_chars_whitespace": 0.30971129, "qsc_code_size_file_byte": 2667.0, "qsc_code_num_lines": 110.0, "qsc_code_num_chars_line_max": 98.0, "qsc_code_num_chars_line_mean": 24.24545455, "qsc_code_frac_chars_alphabet": 0.81314503, "qsc_code_frac_chars_comments": 0.25159355, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.07272727, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.02705411, "qsc_code_frac_chars_long_word_length": 0.02705411, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.03636364, "qsc_codejava_score_lines_no_logic": 0.18181818, "qsc_codejava_frac_words_no_modifier": 0.66666667, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java
package com.ruoyi.framework.config; import java.security.SecureRandom; import java.util.Random; import com.google.code.kaptcha.text.impl.DefaultTextCreator; /** * 验证码文本生成器 * * @author ruoyi */ public class KaptchaTextCreator extends DefaultTextCreator { private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(","); @Override public String getText() { Integer result = 0; Random random = new SecureRandom(); int x = random.nextInt(10); int y = random.nextInt(10); StringBuilder suChinese = new StringBuilder(); int randomoperands = (int) Math.round(Math.random() * 2); if (randomoperands == 0) { result = x * y; suChinese.append(CNUMBERS[x]); suChinese.append("*"); suChinese.append(CNUMBERS[y]); } else if (randomoperands == 1) { if (!(x == 0) && y % x == 0) { result = y / x; suChinese.append(CNUMBERS[y]); suChinese.append("/"); suChinese.append(CNUMBERS[x]); } else { result = x + y; suChinese.append(CNUMBERS[x]); suChinese.append("+"); suChinese.append(CNUMBERS[y]); } } else if (randomoperands == 2) { if (x >= y) { result = x - y; suChinese.append(CNUMBERS[x]); suChinese.append("-"); suChinese.append(CNUMBERS[y]); } else { result = y - x; suChinese.append(CNUMBERS[y]); suChinese.append("-"); suChinese.append(CNUMBERS[x]); } } else { result = x + y; suChinese.append(CNUMBERS[x]); suChinese.append("+"); suChinese.append(CNUMBERS[y]); } suChinese.append("=?@" + result); return suChinese.toString(); } }
2,115
KaptchaTextCreator
java
en
java
code
{"qsc_code_num_words": 186, "qsc_code_num_chars": 2115.0, "qsc_code_mean_word_length": 5.32258065, "qsc_code_frac_words_unique": 0.3172043, "qsc_code_frac_chars_top_2grams": 0.28787879, "qsc_code_frac_chars_top_3grams": 0.27878788, "qsc_code_frac_chars_top_4grams": 0.14545455, "qsc_code_frac_chars_dupe_5grams": 0.4979798, "qsc_code_frac_chars_dupe_6grams": 0.4979798, "qsc_code_frac_chars_dupe_7grams": 0.48282828, "qsc_code_frac_chars_dupe_8grams": 0.48282828, "qsc_code_frac_chars_dupe_9grams": 0.48282828, "qsc_code_frac_chars_dupe_10grams": 0.48282828, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01816746, "qsc_code_frac_chars_whitespace": 0.40141844, "qsc_code_size_file_byte": 2115.0, "qsc_code_num_lines": 76.0, "qsc_code_num_chars_line_max": 82.0, "qsc_code_num_chars_line_mean": 27.82894737, "qsc_code_frac_chars_alphabet": 0.76382306, "qsc_code_frac_chars_comments": 0.01891253, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.30882353, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01470588, "qsc_code_frac_chars_string_length": 0.01542169, "qsc_code_frac_chars_long_word_length": 0.01060241, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.01470588, "qsc_codejava_score_lines_no_logic": 0.07352941, "qsc_codejava_frac_words_no_modifier": 0.5, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 1, "qsc_code_frac_chars_top_3grams": 1, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/НастройкаДоступаКСервисуMorpher/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) УстановитьПривилегированныйРежим(Истина); ВладелецТокена = ОбщегоНазначения.ИдентификаторОбъектаМетаданных("РегистрСведений.СклоненияПредставленийОбъектов"); Токен = ОбщегоНазначения.ПрочитатьДанныеИзБезопасногоХранилища(ВладелецТокена, "ТокенДоступаКСервисуMorpher", Истина); УстановитьПривилегированныйРежим(Ложь); ВидДоступаКСервисуMorher = 0; Если ЗначениеЗаполнено(Токен) Тогда ВидДоступаКСервисуMorher = 1; Токен = УникальныйИдентификатор; КонецЕсли; УстановитьДоступностьЭлементов(); КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовШапкиФормы &НаКлиенте Процедура ВидДоступаКСервисуMorherПриИзменении(Элемент) УстановитьДоступностьЭлементов(); Если ВидДоступаКСервисуMorher = 0 Тогда Токен = Неопределено; ТокенИзменен = Истина; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ТокенПриИзменении(Элемент) ТокенИзменен = Истина; КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура ОК(Команда) Отказ = Ложь; ПроверитьТокен(Отказ); Если Отказ Тогда Возврат; КонецЕсли; СохранитьИзмененияНаСервере(); Закрыть(); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервере Процедура СохранитьИзмененияНаСервере() Если Не ТокенИзменен Тогда Возврат; КонецЕсли; УстановитьПривилегированныйРежим(Истина); ВладелецТокена = ОбщегоНазначения.ИдентификаторОбъектаМетаданных("РегистрСведений.СклоненияПредставленийОбъектов"); ОбщегоНазначения.ЗаписатьДанныеВБезопасноеХранилище(ВладелецТокена, Токен, "ТокенДоступаКСервисуMorpher"); УстановитьПривилегированныйРежим(Ложь); Если ЗначениеЗаполнено(Токен) Тогда Токен = УникальныйИдентификатор; КонецЕсли; ТокенИзменен = Ложь; КонецПроцедуры &НаСервере Процедура УстановитьДоступностьЭлементов() ОбщегоНазначенияКлиентСервер.УстановитьСвойствоЭлементаФормы( Элементы, "Токен", "Доступность", ВидДоступаКСервисуMorher = 1); ОбщегоНазначенияКлиентСервер.УстановитьСвойствоЭлементаФормы( Элементы, "Токен", "АвтоОтметкаНезаполненного", ВидДоступаКСервисуMorher = 1); ОбщегоНазначенияКлиентСервер.УстановитьСвойствоЭлементаФормы( Элементы, "Токен", "ОтметкаНезаполненного", Не ЗначениеЗаполнено(Токен)); КонецПроцедуры &НаКлиенте Процедура ПроверитьТокен(Отказ) Если ВидДоступаКСервисуMorher = 1 И Не ЗначениеЗаполнено(Токен) Тогда ТекстСообщения = НСтр("ru = 'Токен доступа не заполнен.'"); ОбщегоНазначенияКлиент.СообщитьПользователю(ТекстСообщения, , , "Токен", Отказ); КонецЕсли; КонецПроцедуры #КонецОбласти
3,156
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 210, "qsc_code_num_chars": 3156.0, "qsc_code_mean_word_length": 11.45238095, "qsc_code_frac_words_unique": 0.44761905, "qsc_code_frac_chars_top_2grams": 0.03659044, "qsc_code_frac_chars_top_3grams": 0.03367983, "qsc_code_frac_chars_top_4grams": 0.08981289, "qsc_code_frac_chars_dupe_5grams": 0.1995842, "qsc_code_frac_chars_dupe_6grams": 0.1995842, "qsc_code_frac_chars_dupe_7grams": 0.11891892, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00602623, "qsc_code_frac_chars_whitespace": 0.10614702, "qsc_code_size_file_byte": 3156.0, "qsc_code_num_lines": 128.0, "qsc_code_num_chars_line_max": 120.0, "qsc_code_num_chars_line_mean": 24.65625, "qsc_code_frac_chars_alphabet": 0.84615385, "qsc_code_frac_chars_comments": 0.96673004, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java
package com.ruoyi.framework.config; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import javax.sql.DataSource; import org.apache.ibatis.io.VFS; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.boot.autoconfigure.SpringBootVFS; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.ResourcePatternResolver; import org.springframework.core.type.classreading.CachingMetadataReaderFactory; import org.springframework.core.type.classreading.MetadataReader; import org.springframework.core.type.classreading.MetadataReaderFactory; import org.springframework.util.ClassUtils; /** * Mybatis支持*匹配扫描包 * * @author ruoyi */ @Configuration public class MyBatisConfig { @Autowired private Environment env; static final String DEFAULT_RESOURCE_PATTERN = "**/*.class"; public static String setTypeAliasesPackage(String typeAliasesPackage) { ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver(); MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver); List<String> allResult = new ArrayList<String>(); try { for (String aliasesPackage : typeAliasesPackage.split(",")) { List<String> result = new ArrayList<String>(); aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN; Resource[] resources = resolver.getResources(aliasesPackage); if (resources != null && resources.length > 0) { MetadataReader metadataReader = null; for (Resource resource : resources) { if (resource.isReadable()) { metadataReader = metadataReaderFactory.getMetadataReader(resource); try { result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } } } } if (result.size() > 0) { HashSet<String> hashResult = new HashSet<String>(result); allResult.addAll(hashResult); } } if (allResult.size() > 0) { typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0])); } else { throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包"); } } catch (IOException e) { e.printStackTrace(); } return typeAliasesPackage; } @Bean public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage"); String mapperLocations = env.getProperty("mybatis.mapperLocations"); String configLocation = env.getProperty("mybatis.configLocation"); typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage); VFS.addImplClass(SpringBootVFS.class); final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); sessionFactory.setDataSource(dataSource); sessionFactory.setTypeAliasesPackage(typeAliasesPackage); sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations)); sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation)); return sessionFactory.getObject(); } }
4,585
MyBatisConfig
java
en
java
code
{"qsc_code_num_words": 335, "qsc_code_num_chars": 4585.0, "qsc_code_mean_word_length": 8.82686567, "qsc_code_frac_words_unique": 0.35820896, "qsc_code_frac_chars_top_2grams": 0.048698, "qsc_code_frac_chars_top_3grams": 0.09739601, "qsc_code_frac_chars_top_4grams": 0.07575245, "qsc_code_frac_chars_dupe_5grams": 0.11768684, "qsc_code_frac_chars_dupe_6grams": 0.0696652, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00119225, "qsc_code_frac_chars_whitespace": 0.26826609, "qsc_code_size_file_byte": 4585.0, "qsc_code_num_lines": 108.0, "qsc_code_num_chars_line_max": 135.0, "qsc_code_num_chars_line_mean": 42.4537037, "qsc_code_frac_chars_alphabet": 0.88017884, "qsc_code_frac_chars_comments": 0.01025082, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.04123711, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.03194536, "qsc_code_frac_chars_long_word_length": 0.02181097, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.02061856, "qsc_codejava_score_lines_no_logic": 0.26804124, "qsc_codejava_frac_words_no_modifier": 0.66666667, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ВыборРолиИсполнителя/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <Customizable>false</Customizable> <CommandBarLocation>Bottom</CommandBarLocation> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <HorizontalAlign>Right</HorizontalAlign> <Autofill>false</Autofill> <ChildItems> <Button name="OK" id="1"> <Type>CommandBarButton</Type> <DefaultButton>true</DefaultButton> <SkipOnInput>false</SkipOnInput> <CommandName>Form.Command.OK</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>OK</v8:content> </v8:item> </Title> <ExtendedTooltip name="OKРасширеннаяПодсказка" id="19"/> </Button> <Button name="Отмена" id="2"> <Type>CommandBarButton</Type> <SkipOnInput>false</SkipOnInput> <CommandName>Form.StandardCommand.Cancel</CommandName> <ExtendedTooltip name="ОтменаРасширеннаяПодсказка" id="20"/> </Button> </ChildItems> </AutoCommandBar> <Events> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> <Event name="FillCheckProcessingAtServer">ОбработкаПроверкиЗаполненияНаСервере</Event> </Events> <ChildItems> <InputField name="Роль" id="3"> <DataPath>Роль</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Роль исполнителя</v8:content> </v8:item> </Title> <ToolTipRepresentation>Button</ToolTipRepresentation> <Wrap>false</Wrap> <DropListButton>false</DropListButton> <ChoiceButton>true</ChoiceButton> <ChoiceButtonRepresentation>ShowInInputField</ChoiceButtonRepresentation> <OpenButton>false</OpenButton> <AutoMarkIncomplete>true</AutoMarkIncomplete> <ContextMenu name="РольКонтекстноеМеню" id="4"/> <ExtendedTooltip name="РольРасширеннаяПодсказка" id="21"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>В ряде случаев, роли исполнителя бывает недостаточно, чтобы точно определить круг исполнителей задач. Для этого можно указать уточняющие основной и дополнительный объекты адресации.</v8:content> </v8:item> </Title> </ExtendedTooltip> <Events> <Event name="OnChange">ИсполнительПриИзменении</Event> </Events> </InputField> <UsualGroup name="ГруппаУточнение" id="25"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Уточнение</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаУточнениеРасширеннаяПодсказка" id="26"/> <ChildItems> <LabelDecoration name="Отступ" id="29"> <ContextMenu name="ОтступКонтекстноеМеню" id="30"/> <ExtendedTooltip name="ОтступРасширеннаяПодсказка" id="31"/> </LabelDecoration> <UsualGroup name="ГруппаОтступ" id="27"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отступ</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаОтступРасширеннаяПодсказка" id="28"/> <ChildItems> <InputField name="ОсновнойОбъектАдресации" id="13"> <DataPath>ОсновнойОбъектАдресации</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Основной объект адресации</v8:content> </v8:item> </Title> <ToolTipRepresentation>Button</ToolTipRepresentation> <Wrap>false</Wrap> <ContextMenu name="ОсновнойОбъектАдресацииКонтекстноеМеню" id="14"/> <ExtendedTooltip name="ОсновнойОбъектАдресацииРасширеннаяПодсказка" id="22"/> </InputField> <InputField name="ДополнительныйОбъектАдресации" id="15"> <DataPath>ДополнительныйОбъектАдресации</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Доп. объект адресации</v8:content> </v8:item> </Title> <Wrap>false</Wrap> <ContextMenu name="ДополнительныйОбъектАдресацииКонтекстноеМеню" id="16"/> <ExtendedTooltip name="ДополнительныйОбъектАдресацииРасширеннаяПодсказка" id="23"/> </InputField> </ChildItems> </UsualGroup> </ChildItems> </UsualGroup> </ChildItems> <Attributes> <Attribute name="ДополнительныйОбъектАдресации" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Доп. объект адресации</v8:content> </v8:item> </Title> <Type> <v8:TypeSet>cfg:Characteristic.ОбъектыАдресацииЗадач</v8:TypeSet> </Type> </Attribute> <Attribute name="ИспользуетсяБезОбъектовАдресации" id="2"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="ИспользуетсяСОбъектамиАдресации" id="3"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="ОсновнойОбъектАдресации" id="4"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Основной объект адресации</v8:content> </v8:item> </Title> <Type> <v8:TypeSet>cfg:Characteristic.ОбъектыАдресацииЗадач</v8:TypeSet> </Type> </Attribute> <Attribute name="Роль" id="6"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Роль исполнителя</v8:content> </v8:item> </Title> <Type> <v8:Type>cfg:CatalogRef.РолиИсполнителей</v8:Type> </Type> <FillCheck>ShowError</FillCheck> </Attribute> <Attribute name="ТипыДополнительногоОбъектаАдресации" id="7"> <Type> <v8:Type>v8:TypeDescription</v8:Type> </Type> </Attribute> <Attribute name="ТипыОсновногоОбъектаАдресации" id="8"> <Type> <v8:Type>v8:TypeDescription</v8:Type> </Type> </Attribute> </Attributes> <Commands> <Command name="OK" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>OK</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>OK</v8:content> </v8:item> </ToolTip> <Action>OKВыполнить</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> </Commands> <Parameters> <Parameter name="РольИсполнителя"> <Type> <v8:Type>cfg:CatalogRef.РолиИсполнителей</v8:Type> </Type> </Parameter> <Parameter name="ОсновнойОбъектАдресации"> <Type/> </Parameter> <Parameter name="ДополнительныйОбъектАдресации"> <Type/> </Parameter> <Parameter name="ВыборОбъектаАдресации"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Parameter> </Parameters> </Form>
7,440
Form
xml
ru
xml
data
{"qsc_code_num_words": 821, "qsc_code_num_chars": 7440.0, "qsc_code_mean_word_length": 6.11693057, "qsc_code_frac_words_unique": 0.24847747, "qsc_code_frac_chars_top_2grams": 0.02867384, "qsc_code_frac_chars_top_3grams": 0.02389486, "qsc_code_frac_chars_top_4grams": 0.02986858, "qsc_code_frac_chars_dupe_5grams": 0.43289526, "qsc_code_frac_chars_dupe_6grams": 0.39964158, "qsc_code_frac_chars_dupe_7grams": 0.37534847, "qsc_code_frac_chars_dupe_8grams": 0.36618877, "qsc_code_frac_chars_dupe_9grams": 0.32735962, "qsc_code_frac_chars_dupe_10grams": 0.25448029, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03411074, "qsc_code_frac_chars_whitespace": 0.15282258, "qsc_code_size_file_byte": 7440.0, "qsc_code_num_lines": 215.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 34.60465116, "qsc_code_frac_chars_alphabet": 0.76249405, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.65116279, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.20887097, "qsc_code_frac_chars_long_word_length": 0.09287634, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java
package com.ruoyi.framework.config; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.LinkedHashMap; import java.util.Map; import javax.servlet.Filter; import org.apache.commons.io.IOUtils; import org.apache.shiro.cache.ehcache.EhCacheManager; import org.apache.shiro.codec.Base64; import org.apache.shiro.config.ConfigurationException; import org.apache.shiro.io.ResourceUtils; import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.web.mgt.CookieRememberMeManager; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.servlet.SimpleCookie; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.framework.shiro.realm.UserRealm; import com.ruoyi.framework.shiro.session.OnlineSessionDAO; import com.ruoyi.framework.shiro.session.OnlineSessionFactory; import com.ruoyi.framework.shiro.web.filter.LogoutFilter; import com.ruoyi.framework.shiro.web.filter.captcha.CaptchaValidateFilter; import com.ruoyi.framework.shiro.web.filter.kickout.KickoutSessionFilter; import com.ruoyi.framework.shiro.web.filter.online.OnlineSessionFilter; import com.ruoyi.framework.shiro.web.filter.sync.SyncOnlineSessionFilter; import com.ruoyi.framework.shiro.web.session.OnlineWebSessionManager; import com.ruoyi.framework.shiro.web.session.SpringSessionValidationScheduler; import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; /** * 权限配置加载 * * @author ruoyi */ @Configuration public class ShiroConfig { public static final String PREMISSION_STRING = "perms[\"{0}\"]"; // Session超时时间,单位为毫秒(默认30分钟) @Value("${shiro.session.expireTime}") private int expireTime; // 相隔多久检查一次session的有效性,单位毫秒,默认就是10分钟 @Value("${shiro.session.validationInterval}") private int validationInterval; // 同一个用户最大会话数 @Value("${shiro.session.maxSession}") private int maxSession; // 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户 @Value("${shiro.session.kickoutAfter}") private boolean kickoutAfter; // 验证码开关 @Value("${shiro.user.captchaEnabled}") private boolean captchaEnabled; // 验证码类型 @Value("${shiro.user.captchaType}") private String captchaType; // 设置Cookie的域名 @Value("${shiro.cookie.domain}") private String domain; // 设置cookie的有效访问路径 @Value("${shiro.cookie.path}") private String path; // 设置HttpOnly属性 @Value("${shiro.cookie.httpOnly}") private boolean httpOnly; // 设置Cookie的过期时间,秒为单位 @Value("${shiro.cookie.maxAge}") private int maxAge; // 登录地址 @Value("${shiro.user.loginUrl}") private String loginUrl; // 权限认证失败地址 @Value("${shiro.user.unauthorizedUrl}") private String unauthorizedUrl; /** * 缓存管理器 使用Ehcache实现 */ @Bean public EhCacheManager getEhCacheManager() { net.sf.ehcache.CacheManager cacheManager = net.sf.ehcache.CacheManager.getCacheManager("ruoyi"); EhCacheManager em = new EhCacheManager(); if (StringUtils.isNull(cacheManager)) { em.setCacheManager(new net.sf.ehcache.CacheManager(getCacheManagerConfigFileInputStream())); return em; } else { em.setCacheManager(cacheManager); return em; } } /** * 返回配置文件流 避免ehcache配置文件一直被占用,无法完全销毁项目重新部署 */ protected InputStream getCacheManagerConfigFileInputStream() { String configFile = "classpath:ehcache/ehcache-shiro.xml"; InputStream inputStream = null; try { inputStream = ResourceUtils.getInputStreamForPath(configFile); byte[] b = IOUtils.toByteArray(inputStream); InputStream in = new ByteArrayInputStream(b); return in; } catch (IOException e) { throw new ConfigurationException( "Unable to obtain input stream for cacheManagerConfigFile [" + configFile + "]", e); } finally { IOUtils.closeQuietly(inputStream); } } /** * 自定义Realm */ @Bean public UserRealm userRealm(EhCacheManager cacheManager) { UserRealm userRealm = new UserRealm(); userRealm.setCacheManager(cacheManager); return userRealm; } /** * 自定义sessionDAO会话 */ @Bean public OnlineSessionDAO sessionDAO() { OnlineSessionDAO sessionDAO = new OnlineSessionDAO(); return sessionDAO; } /** * 自定义sessionFactory会话 */ @Bean public OnlineSessionFactory sessionFactory() { OnlineSessionFactory sessionFactory = new OnlineSessionFactory(); return sessionFactory; } /** * 会话管理器 */ @Bean public OnlineWebSessionManager sessionManager() { OnlineWebSessionManager manager = new OnlineWebSessionManager(); // 加入缓存管理器 manager.setCacheManager(getEhCacheManager()); // 删除过期的session manager.setDeleteInvalidSessions(true); // 设置全局session超时时间 manager.setGlobalSessionTimeout(expireTime * 60 * 1000); // 去掉 JSESSIONID manager.setSessionIdUrlRewritingEnabled(false); // 定义要使用的无效的Session定时调度器 manager.setSessionValidationScheduler(SpringUtils.getBean(SpringSessionValidationScheduler.class)); // 是否定时检查session manager.setSessionValidationSchedulerEnabled(true); // 自定义SessionDao manager.setSessionDAO(sessionDAO()); // 自定义sessionFactory manager.setSessionFactory(sessionFactory()); return manager; } /** * 安全管理器 */ @Bean public SecurityManager securityManager(UserRealm userRealm) { DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); // 设置realm. securityManager.setRealm(userRealm); // 记住我 securityManager.setRememberMeManager(rememberMeManager()); // 注入缓存管理器; securityManager.setCacheManager(getEhCacheManager()); // session管理器 securityManager.setSessionManager(sessionManager()); return securityManager; } /** * 退出过滤器 */ public LogoutFilter logoutFilter() { LogoutFilter logoutFilter = new LogoutFilter(); logoutFilter.setCacheManager(getEhCacheManager()); logoutFilter.setLoginUrl(loginUrl); return logoutFilter; } /** * Shiro过滤器配置 */ @Bean public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) { ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); // Shiro的核心安全接口,这个属性是必须的 shiroFilterFactoryBean.setSecurityManager(securityManager); // 身份认证失败,则跳转到登录页面的配置 shiroFilterFactoryBean.setLoginUrl(loginUrl); // 权限认证失败,则跳转到指定页面 shiroFilterFactoryBean.setUnauthorizedUrl(unauthorizedUrl); // Shiro连接约束配置,即过滤链的定义 LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>(); // 对静态资源设置匿名访问 filterChainDefinitionMap.put("/favicon.ico**", "anon"); filterChainDefinitionMap.put("/ruoyi.png**", "anon"); filterChainDefinitionMap.put("/css/**", "anon"); filterChainDefinitionMap.put("/docs/**", "anon"); filterChainDefinitionMap.put("/fonts/**", "anon"); filterChainDefinitionMap.put("/img/**", "anon"); filterChainDefinitionMap.put("/ajax/**", "anon"); filterChainDefinitionMap.put("/js/**", "anon"); filterChainDefinitionMap.put("/ruoyi/**", "anon"); filterChainDefinitionMap.put("/captcha/captchaImage**", "anon"); // 退出 logout地址,shiro去清除session filterChainDefinitionMap.put("/logout", "logout"); // 不需要拦截的访问 filterChainDefinitionMap.put("/login", "anon,captchaValidate"); // 注册相关 filterChainDefinitionMap.put("/register", "anon,captchaValidate"); // 系统权限列表 // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll()); Map<String, Filter> filters = new LinkedHashMap<String, Filter>(); filters.put("onlineSession", onlineSessionFilter()); filters.put("syncOnlineSession", syncOnlineSessionFilter()); filters.put("captchaValidate", captchaValidateFilter()); filters.put("kickout", kickoutSessionFilter()); // 注销成功,则跳转到指定页面 filters.put("logout", logoutFilter()); shiroFilterFactoryBean.setFilters(filters); // 所有请求需要认证 filterChainDefinitionMap.put("/**", "user,kickout,onlineSession,syncOnlineSession"); shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); return shiroFilterFactoryBean; } /** * 自定义在线用户处理过滤器 */ @Bean public OnlineSessionFilter onlineSessionFilter() { OnlineSessionFilter onlineSessionFilter = new OnlineSessionFilter(); onlineSessionFilter.setLoginUrl(loginUrl); return onlineSessionFilter; } /** * 自定义在线用户同步过滤器 */ @Bean public SyncOnlineSessionFilter syncOnlineSessionFilter() { SyncOnlineSessionFilter syncOnlineSessionFilter = new SyncOnlineSessionFilter(); return syncOnlineSessionFilter; } /** * 自定义验证码过滤器 */ @Bean public CaptchaValidateFilter captchaValidateFilter() { CaptchaValidateFilter captchaValidateFilter = new CaptchaValidateFilter(); captchaValidateFilter.setCaptchaEnabled(captchaEnabled); captchaValidateFilter.setCaptchaType(captchaType); return captchaValidateFilter; } /** * cookie 属性设置 */ public SimpleCookie rememberMeCookie() { SimpleCookie cookie = new SimpleCookie("rememberMe"); cookie.setDomain(domain); cookie.setPath(path); cookie.setHttpOnly(httpOnly); cookie.setMaxAge(maxAge * 24 * 60 * 60); return cookie; } /** * 记住我 */ public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("fCq+/xW488hMTCD+cmJ3aQ==")); return cookieRememberMeManager; } /** * 同一个用户多设备登录限制 */ public KickoutSessionFilter kickoutSessionFilter() { KickoutSessionFilter kickoutSessionFilter = new KickoutSessionFilter(); kickoutSessionFilter.setCacheManager(getEhCacheManager()); kickoutSessionFilter.setSessionManager(sessionManager()); // 同一个用户最大的会话数,默认-1无限制;比如2的意思是同一个用户允许最多同时两个人登录 kickoutSessionFilter.setMaxSession(maxSession); // 是否踢出后来登录的,默认是false;即后者登录的用户踢出前者登录的用户;踢出顺序 kickoutSessionFilter.setKickoutAfter(kickoutAfter); // 被踢出后重定向到的地址; kickoutSessionFilter.setKickoutUrl("/login?kickout=1"); return kickoutSessionFilter; } /** * thymeleaf模板引擎和shiro框架的整合 */ @Bean public ShiroDialect shiroDialect() { return new ShiroDialect(); } /** * 开启Shiro注解通知器 */ @Bean public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor( @Qualifier("securityManager") SecurityManager securityManager) { AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor(); authorizationAttributeSourceAdvisor.setSecurityManager(securityManager); return authorizationAttributeSourceAdvisor; } }
12,066
ShiroConfig
java
en
java
code
{"qsc_code_num_words": 873, "qsc_code_num_chars": 12066.0, "qsc_code_mean_word_length": 9.48568156, "qsc_code_frac_words_unique": 0.32302405, "qsc_code_frac_chars_top_2grams": 0.01630238, "qsc_code_frac_chars_top_3grams": 0.0202874, "qsc_code_frac_chars_top_4grams": 0.02415167, "qsc_code_frac_chars_dupe_5grams": 0.08573844, "qsc_code_frac_chars_dupe_6grams": 0.05736022, "qsc_code_frac_chars_dupe_7grams": 0.03151793, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00293932, "qsc_code_frac_chars_whitespace": 0.21050887, "qsc_code_size_file_byte": 12066.0, "qsc_code_num_lines": 372.0, "qsc_code_num_chars_line_max": 125.0, "qsc_code_num_chars_line_mean": 32.43548387, "qsc_code_frac_chars_alphabet": 0.86636574, "qsc_code_frac_chars_comments": 0.11147025, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.05761317, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07443336, "qsc_code_frac_chars_long_word_length": 0.0408544, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.06995885, "qsc_codejava_score_lines_no_logic": 0.33333333, "qsc_codejava_frac_words_no_modifier": 0.94444444, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
package com.ruoyi.framework.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import com.ruoyi.common.config.Global; import com.ruoyi.common.constant.Constants; import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; /** * 通用配置 * * @author ruoyi */ @Configuration public class ResourcesConfig implements WebMvcConfigurer { /** * 首页地址 */ @Value("${shiro.user.indexUrl}") private String indexUrl; @Autowired private RepeatSubmitInterceptor repeatSubmitInterceptor; /** * 默认首页的设置,当输入域名是可以自动跳转到默认指定的网页 */ @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/").setViewName("forward:" + indexUrl); } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { /** 本地文件上传路径 */ registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + Global.getProfile() + "/"); /** swagger配置 */ registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); } /** * 自定义拦截规则 */ @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**"); } }
1,894
ResourcesConfig
java
en
java
code
{"qsc_code_num_words": 156, "qsc_code_num_chars": 1894.0, "qsc_code_mean_word_length": 8.96794872, "qsc_code_frac_words_unique": 0.44230769, "qsc_code_frac_chars_top_2grams": 0.04503217, "qsc_code_frac_chars_top_3grams": 0.12008578, "qsc_code_frac_chars_top_4grams": 0.077198, "qsc_code_frac_chars_dupe_5grams": 0.27305218, "qsc_code_frac_chars_dupe_6grams": 0.20872051, "qsc_code_frac_chars_dupe_7grams": 0.14295926, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0, "qsc_code_frac_chars_whitespace": 0.14308342, "qsc_code_size_file_byte": 1894.0, "qsc_code_num_lines": 59.0, "qsc_code_num_chars_line_max": 130.0, "qsc_code_num_chars_line_mean": 32.10169492, "qsc_code_frac_chars_alphabet": 0.86198398, "qsc_code_frac_chars_comments": 0.08606125, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.08333333, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07909931, "qsc_code_frac_chars_long_word_length": 0.05196305, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.08333333, "qsc_codejava_score_lines_no_logic": 0.44444444, "qsc_codejava_frac_words_no_modifier": 0.75, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ВыборРолиИсполнителя/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Роль = Параметры.РольИсполнителя; ОсновнойОбъектАдресации = Параметры.ОсновнойОбъектАдресации; ДополнительныйОбъектАдресации = Параметры.ДополнительныйОбъектАдресации; УстановитьТипыОбъектовАдресации(); УстановитьСостояниеЭлементов(); Если Параметры.ВыборОбъектаАдресации Тогда ТекущийЭлемент = Элементы.ОсновнойОбъектАдресации; КонецЕсли; КонецПроцедуры &НаСервере Процедура ОбработкаПроверкиЗаполненияНаСервере(Отказ, ПроверяемыеРеквизиты) Если ИспользуетсяБезОбъектовАдресации Тогда Возврат; КонецЕсли; ЗаданыТипыОсновногоОбъектаАдресации = ИспользуетсяСОбъектамиАдресации И ЗначениеЗаполнено(ТипыОсновногоОбъектаАдресации); ЗаданыТипыДополнительногоОбъектаАдресации = ИспользуетсяСОбъектамиАдресации И ЗначениеЗаполнено(ТипыДополнительногоОбъектаАдресации); Если ЗаданыТипыОсновногоОбъектаАдресации И ОсновнойОбъектАдресации = Неопределено Тогда ОбщегоНазначения.СообщитьПользователю( СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(НСтр("ru = 'Поле ""%1"" не заполнено.'"), ОбщегоНазначения.ЗначениеРеквизитаОбъекта(Роль, "ТипыОсновногоОбъектаАдресации")),,, "ОсновнойОбъектАдресации", Отказ); ИначеЕсли ЗаданыТипыДополнительногоОбъектаАдресации И ДополнительныйОбъектАдресации = Неопределено Тогда ОбщегоНазначения.СообщитьПользователю( СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(НСтр("ru = 'Поле ""%1"" не заполнено.'"), ОбщегоНазначения.ЗначениеРеквизитаОбъекта(Роль, "ТипыДополнительногоОбъектаАдресации")),,, "ДополнительныйОбъектАдресации", Отказ); КонецЕсли; КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовШапкиФормы &НаКлиенте Процедура ИсполнительПриИзменении(Элемент) ОсновнойОбъектАдресации = Неопределено; ДополнительныйОбъектАдресации = Неопределено; УстановитьТипыОбъектовАдресации(); УстановитьСостояниеЭлементов(); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура OKВыполнить() ОчиститьСообщения(); Если НЕ ПроверитьЗаполнение() Тогда Возврат; КонецЕсли; РезультатВыбора = ПараметрыЗакрытия(); ОповеститьОВыборе(РезультатВыбора); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервере Процедура УстановитьТипыОбъектовАдресации() ТипыОсновногоОбъектаАдресации = Неопределено; ТипыДополнительногоОбъектаАдресации = Неопределено; ИспользуетсяСОбъектамиАдресации = Ложь; ИспользуетсяБезОбъектовАдресации = Ложь; Если Не Роль.Пустая() Тогда СведенияОРоли = ОбщегоНазначения.ЗначенияРеквизитовОбъекта(Роль, "ИспользуетсяСОбъектамиАдресации,ИспользуетсяБезОбъектовАдресации,ТипыОсновногоОбъектаАдресации,ТипыДополнительногоОбъектаАдресации"); ИспользуетсяСОбъектамиАдресации = СведенияОРоли.ИспользуетсяСОбъектамиАдресации; ИспользуетсяБезОбъектовАдресации = СведенияОРоли.ИспользуетсяБезОбъектовАдресации; Если ИспользуетсяСОбъектамиАдресации Тогда ТипыОсновногоОбъектаАдресации = ОбщегоНазначения.ЗначениеРеквизитаОбъекта(СведенияОРоли.ТипыОсновногоОбъектаАдресации, "ТипЗначения"); ТипыДополнительногоОбъектаАдресации = ОбщегоНазначения.ЗначениеРеквизитаОбъекта(СведенияОРоли.ТипыДополнительногоОбъектаАдресации, "ТипЗначения"); КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервере Процедура УстановитьСостояниеЭлементов() ЗаданыТипыОсновногоОбъектаАдресации = ИспользуетсяСОбъектамиАдресации И ЗначениеЗаполнено(ТипыОсновногоОбъектаАдресации); ЗаданыТипыДополнительногоОбъектаАдресации = ИспользуетсяСОбъектамиАдресации И ЗначениеЗаполнено(ТипыДополнительногоОбъектаАдресации); СведенияОРоли = ОбщегоНазначения.ЗначенияРеквизитовОбъекта(Роль, "ТипыОсновногоОбъектаАдресации,ТипыДополнительногоОбъектаАдресации"); Элементы.ОсновнойОбъектАдресации.Заголовок = Строка(СведенияОРоли.ТипыОсновногоОбъектаАдресации); Элементы.ОсновнойОбъектАдресации.Доступность = ЗаданыТипыОсновногоОбъектаАдресации; Элементы.ОсновнойОбъектАдресации.АвтоОтметкаНезаполненного = ЗаданыТипыОсновногоОбъектаАдресации И НЕ ИспользуетсяБезОбъектовАдресации; Элементы.ОсновнойОбъектАдресации.ОграничениеТипа = ТипыОсновногоОбъектаАдресации; Элементы.ДополнительныйОбъектАдресации.Заголовок = Строка(СведенияОРоли.ТипыДополнительногоОбъектаАдресации); Элементы.ДополнительныйОбъектАдресации.Доступность = ЗаданыТипыДополнительногоОбъектаАдресации; Элементы.ДополнительныйОбъектАдресации.АвтоОтметкаНезаполненного = ЗаданыТипыДополнительногоОбъектаАдресации И НЕ ИспользуетсяБезОбъектовАдресации; Элементы.ДополнительныйОбъектАдресации.ОграничениеТипа = ТипыДополнительногоОбъектаАдресации; КонецПроцедуры &НаСервере Функция ПараметрыЗакрытия() Результат = Новый Структура; Результат.Вставить("РольИсполнителя", Роль); Результат.Вставить("ОсновнойОбъектАдресации", ОсновнойОбъектАдресации); Результат.Вставить("ДополнительныйОбъектАдресации", ДополнительныйОбъектАдресации); Если ОбщегоНазначения.ЭтоСсылка(ТипЗнч(Результат.ОсновнойОбъектАдресации)) И Результат.ОсновнойОбъектАдресации.Пустая() Тогда Результат.ОсновнойОбъектАдресации = Неопределено; КонецЕсли; Если ОбщегоНазначения.ЭтоСсылка(ТипЗнч(Результат.ДополнительныйОбъектАдресации)) И Результат.ДополнительныйОбъектАдресации.Пустая() Тогда Результат.ДополнительныйОбъектАдресации = Неопределено; КонецЕсли; Возврат Результат; КонецФункции #КонецОбласти
5,901
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 332, "qsc_code_num_chars": 5901.0, "qsc_code_mean_word_length": 14.66566265, "qsc_code_frac_words_unique": 0.33433735, "qsc_code_frac_chars_top_2grams": 0.03183405, "qsc_code_frac_chars_top_3grams": 0.04025467, "qsc_code_frac_chars_top_4grams": 0.01684124, "qsc_code_frac_chars_dupe_5grams": 0.18689669, "qsc_code_frac_chars_dupe_6grams": 0.16882317, "qsc_code_frac_chars_dupe_7grams": 0.16882317, "qsc_code_frac_chars_dupe_8grams": 0.16882317, "qsc_code_frac_chars_dupe_9grams": 0.16882317, "qsc_code_frac_chars_dupe_10grams": 0.16882317, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00240163, "qsc_code_frac_chars_whitespace": 0.08269785, "qsc_code_size_file_byte": 5901.0, "qsc_code_num_lines": 156.0, "qsc_code_num_chars_line_max": 150.0, "qsc_code_num_chars_line_mean": 37.82692308, "qsc_code_frac_chars_alphabet": 0.89691483, "qsc_code_frac_chars_comments": 0.98220641, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java
package com.ruoyi.framework.config; import java.util.HashMap; import java.util.Map; import javax.servlet.DispatcherType; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.xss.XssFilter; /** * Filter配置 * * @author ruoyi */ @Configuration public class FilterConfig { @Value("${xss.enabled}") private String enabled; @Value("${xss.excludes}") private String excludes; @Value("${xss.urlPatterns}") private String urlPatterns; @SuppressWarnings({ "rawtypes", "unchecked" }) @Bean public FilterRegistrationBean xssFilterRegistration() { FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setDispatcherTypes(DispatcherType.REQUEST); registration.setFilter(new XssFilter()); registration.addUrlPatterns(StringUtils.split(urlPatterns, ",")); registration.setName("xssFilter"); registration.setOrder(Integer.MAX_VALUE); Map<String, String> initParameters = new HashMap<String, String>(); initParameters.put("excludes", excludes); initParameters.put("enabled", enabled); registration.setInitParameters(initParameters); return registration; } }
1,461
FilterConfig
java
en
java
code
{"qsc_code_num_words": 133, "qsc_code_num_chars": 1461.0, "qsc_code_mean_word_length": 8.03759398, "qsc_code_frac_words_unique": 0.44360902, "qsc_code_frac_chars_top_2grams": 0.03367633, "qsc_code_frac_chars_top_3grams": 0.08980355, "qsc_code_frac_chars_top_4grams": 0.05799813, "qsc_code_frac_chars_dupe_5grams": 0.0767072, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0, "qsc_code_frac_chars_whitespace": 0.15263518, "qsc_code_size_file_byte": 1461.0, "qsc_code_num_lines": 46.0, "qsc_code_num_chars_line_max": 76.0, "qsc_code_num_chars_line_mean": 31.76086957, "qsc_code_frac_chars_alphabet": 0.8634895, "qsc_code_frac_chars_comments": 0.02669405, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0625879, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.02777778, "qsc_codejava_score_lines_no_logic": 0.41666667, "qsc_codejava_frac_words_no_modifier": 0.5, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ФормаВариантаОтчета/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) ОпределитьПоведениеВМобильномКлиенте(); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ЦентрМониторинга") Тогда // Подсчитываем количество созданий формы, стандартный разделитель ".". Комментарий = Строка(ПолучитьСкоростьКлиентскогоСоединения()); МодульЦентрМониторинга = ОбщегоНазначения.ОбщийМодуль("ЦентрМониторинга"); МодульЦентрМониторинга.ЗаписатьОперациюБизнесСтатистики("ОбщаяФорма.ФормаВариантаОтчета", 1, Комментарий); КонецЕсли; ФормаПараметры = ВариантыОтчетов.СохраняемыеПараметрыФормыОтчета(Параметры); Если ЗначениеЗаполнено(Параметры.ПредставлениеВарианта) Тогда АвтоЗаголовок = Ложь; Заголовок = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(НСтр("ru = 'Изменение варианта отчета ""%1""'"), Параметры.ПредставлениеВарианта); КонецЕсли; Если Параметры.НастройкиОтчета <> Неопределено Тогда НастройкиОтчета = Параметры.НастройкиОтчета; Если НастройкиОтчета.СхемаМодифицирована Тогда Отчет.КомпоновщикНастроек.Инициализировать(Новый ИсточникДоступныхНастроекКомпоновкиДанных(НастройкиОтчета.АдресСхемы)); КонецЕсли; КонецЕсли; Если Не ЗначениеЗаполнено(Параметры.ПредставлениеВарианта) Тогда Параметры.ПредставлениеВарианта = Параметры.ВариантНаименование; КонецЕсли; НастройкиКД = ОбщегоНазначенияКлиентСервер.СвойствоСтруктуры(Параметры, "Вариант"); Если НастройкиКД = Неопределено Тогда НастройкиКД = Отчет.КомпоновщикНастроек.Настройки; КонецЕсли; ИдентификаторЭлементаСтруктурыНастроек = Параметры.ИдентификаторЭлементаСтруктурыНастроек; ПутьКЭлементуСтруктурыНастроек = Параметры.ПутьКЭлементуСтруктурыНастроек; ЭлементСтруктуры = ОтчетыСервер.ЭлементНастроекПоПолномуПути(НастройкиКД, ПутьКЭлементуСтруктурыНастроек); Если ЭлементСтруктуры <> Неопределено Тогда ИдентификаторЭлементаСтруктурыНастроек = НастройкиКД.ПолучитьИдентификаторПоОбъекту(ЭлементСтруктуры); КонецЕсли; ВариантМодифицирован = Параметры.ВариантМодифицирован; ПользовательскиеНастройкиМодифицированы = Параметры.ПользовательскиеНастройкиМодифицированы; УстановитьТекущуюСтраницу(); КонецПроцедуры &НаСервере Процедура ПередЗагрузкойВариантаНаСервере(НовыеНастройкиКД) Если ТипЗнч(ФормаПараметры.Отбор) = Тип("Структура") Тогда ОтчетыСервер.УстановитьФиксированныеОтборы(ФормаПараметры.Отбор, НовыеНастройкиКД, НастройкиОтчета); КонецЕсли; КонецПроцедуры &НаСервере Процедура ПриЗагрузкеПользовательскихНастроекНаСервере(Настройки) НовыеНастройки = Отчет.КомпоновщикНастроек.ПолучитьНастройки(); Отчет.КомпоновщикНастроек.ЗагрузитьФиксированныеНастройки(Новый НастройкиКомпоновкиДанных); ОтчетыКлиентСервер.ЗагрузитьНастройки(Отчет.КомпоновщикНастроек, НовыеНастройки); КонецПроцедуры &НаКлиенте Процедура ПриОткрытии(Отказ) Если ТипЗнч(ИдентификаторЭлементаСтруктурыНастроек) = Тип("ИдентификаторКомпоновкиДанных") Тогда ПодключитьОбработчикОжидания("УстановитьТекущуюСтроку", 0.1, Истина); КонецЕсли; КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовТаблицыФормыПараметрыВывода &НаКлиенте Процедура КомпоновщикНастроекНастройкиПараметрыВыводаПриИзменении(Элемент) Строка = Элемент.ТекущиеДанные; ИдентификаторПараметра = "Заголовок"; Если Строка <> Неопределено И Строка.Свойство("Параметр") И Строка.Параметр = ИдентификаторПараметра Тогда Отчет.КомпоновщикНастроек.Настройки.ДополнительныеСвойства.Вставить( "ЗаголовокУстановленИнтерактивно", ЗначениеЗаполнено(Строка.Значение)); КонецЕсли; КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура ЗакрытьИСформировать(Команда) Если МодальныйРежим Или РежимОткрытияОкна = РежимОткрытияОкнаФормы.БлокироватьВесьИнтерфейс Или ВладелецФормы = Неопределено Тогда Закрыть(Истина); Возврат; КонецЕсли; РезультатВыбора = ОтчетыКлиентСервер.ПараметрыОбновленияФормыОтчета( ВариантыОтчетовСлужебныйКлиентСервер.ИмяСобытияФормыНастроек()); РезультатВыбора.КомпоновщикНастроекКД = Отчет.КомпоновщикНастроек; РезультатВыбора.ВариантМодифицирован = ВариантМодифицирован; РезультатВыбора.ПользовательскиеНастройкиМодифицированы = ВариантМодифицирован Или ПользовательскиеНастройкиМодифицированы; РезультатВыбора.Переформировать = Истина; Если РезультатВыбора.ПользовательскиеНастройкиМодифицированы Тогда РезультатВыбора.СброситьПользовательскиеНастройки = Истина; КонецЕсли; ОповеститьОВыборе(РезультатВыбора); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервере Процедура ОпределитьПоведениеВМобильномКлиенте() ЭтоМобильныйКлиент = ОбщегоНазначения.ЭтоМобильныйКлиент(); Если Не ЭтоМобильныйКлиент Тогда Возврат; КонецЕсли; ПоложениеКоманднойПанели = ПоложениеКоманднойПанелиФормы.Авто; КонецПроцедуры &НаСервере Процедура УстановитьТекущуюСтраницу() Если Не ЗначениеЗаполнено(Параметры.ИмяСтраницы) Тогда Возврат; КонецЕсли; СвязиСтраниц = Новый Соответствие; СвязиСтраниц.Вставить("СтраницаОтборы", "СтраницаОтбора"); СвязиСтраниц.Вставить("СтраницаВыбранныеПоляИСортировки", "СтраницаПолейВыбора"); СвязиСтраниц.Вставить("СтраницаОформление", "СтраницаУсловногоОформления"); ИмяСтраницы = СвязиСтраниц[Параметры.ИмяСтраницы]; НайденнаяСтраница = Элементы.Найти(ИмяСтраницы); Если НайденнаяСтраница = Неопределено Тогда НайденнаяСтраница = Элементы.Найти(Параметры.ИмяСтраницы); КонецЕсли; Если НайденнаяСтраница <> Неопределено Тогда Элементы.СтраницыНастроек.ТекущаяСтраница = НайденнаяСтраница; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура УстановитьТекущуюСтроку() Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока = ИдентификаторЭлементаСтруктурыНастроек; КонецПроцедуры &НаКлиенте Процедура ПоляГруппировкиНедоступны() Элементы.СтраницыПолейГруппировки.ТекущаяСтраница = Элементы.НедоступныеНастройкиПолейГруппировки; КонецПроцедуры &НаКлиенте Процедура ВыбранныеПоляДоступны(ЭлементСтруктуры) Если Отчет.КомпоновщикНастроек.Настройки.НаличиеВыбораУЭлемента(ЭлементСтруктуры) Тогда ЛокальныеВыбранныеПоля = Истина; Элементы.СтраницыПолейВыбора.ТекущаяСтраница = Элементы.НастройкиВыбранныхПолей; Иначе ЛокальныеВыбранныеПоля = Ложь; Элементы.СтраницыПолейВыбора.ТекущаяСтраница = Элементы.ОтключенныеНастройкиВыбранныхПолей; КонецЕсли; Элементы.ЛокальныеВыбранныеПоля.ТолькоПросмотр = Ложь; КонецПроцедуры &НаКлиенте Процедура ВыбранныеПоляНедоступны() ЛокальныеВыбранныеПоля = Ложь; Элементы.ЛокальныеВыбранныеПоля.ТолькоПросмотр = Истина; Элементы.СтраницыПолейВыбора.ТекущаяСтраница = Элементы.НедоступныеНастройкиВыбранныхПолей; КонецПроцедуры &НаКлиенте Процедура ОтборДоступен(ЭлементСтруктуры) Если Отчет.КомпоновщикНастроек.Настройки.НаличиеОтбораУЭлемента(ЭлементСтруктуры) Тогда ЛокальныйОтбор = Истина; Элементы.СтраницыОтбора.ТекущаяСтраница = Элементы.НастройкиОтбора; Иначе ЛокальныйОтбор = Ложь; Элементы.СтраницыОтбора.ТекущаяСтраница = Элементы.ОтключенныеНастройкиОтбора; КонецЕсли; Элементы.ЛокальныйОтбор.ТолькоПросмотр = Ложь; КонецПроцедуры &НаКлиенте Процедура ОтборНедоступен() ЛокальныйОтбор = Ложь; Элементы.ЛокальныйОтбор.ТолькоПросмотр = Истина; Элементы.СтраницыОтбора.ТекущаяСтраница = Элементы.НедоступныеНастройкиОтбора; КонецПроцедуры &НаКлиенте Процедура ПорядокДоступен(ЭлементСтруктуры) Если Отчет.КомпоновщикНастроек.Настройки.НаличиеПорядкаУЭлемента(ЭлементСтруктуры) Тогда ЛокальныйПорядок = Истина; Элементы.СтраницыПорядка.ТекущаяСтраница = Элементы.НастройкиПорядка; Иначе ЛокальныйПорядок = Ложь; Элементы.СтраницыПорядка.ТекущаяСтраница = Элементы.ОтключенныеНастройкиПорядка; КонецЕсли; Элементы.ЛокальныйПорядок.ТолькоПросмотр = Ложь; КонецПроцедуры &НаКлиенте Процедура ПорядокНедоступен() ЛокальныйПорядок = Ложь; Элементы.ЛокальныйПорядок.ТолькоПросмотр = Истина; Элементы.СтраницыПорядка.ТекущаяСтраница = Элементы.НедоступныеНастройкиПорядка; КонецПроцедуры &НаКлиенте Процедура УсловноеОформлениеДоступно(ЭлементСтруктуры) Если Отчет.КомпоновщикНастроек.Настройки.НаличиеУсловногоОформленияУЭлемента(ЭлементСтруктуры) Тогда ЛокальноеУсловноеОформление = Истина; Элементы.СтраницыУсловногоОформления.ТекущаяСтраница = Элементы.НастройкиУсловногоОформления; Иначе ЛокальноеУсловноеОформление = Ложь; Элементы.СтраницыУсловногоОформления.ТекущаяСтраница = Элементы.ОтключенныеНастройкиУсловногоОформления; КонецЕсли; Элементы.ЛокальноеУсловноеОформление.ТолькоПросмотр = Ложь; КонецПроцедуры &НаКлиенте Процедура УсловноеОформлениеНедоступно() ЛокальноеУсловноеОформление = Ложь; Элементы.ЛокальноеУсловноеОформление.ТолькоПросмотр = Истина; Элементы.СтраницыУсловногоОформления.ТекущаяСтраница = Элементы.НедоступныеНастройкиУсловногоОформления; КонецПроцедуры &НаКлиенте Процедура ПараметрыВыводаДоступны(ЭлементСтруктуры) Если Отчет.КомпоновщикНастроек.Настройки.НаличиеПараметровВыводаУЭлемента(ЭлементСтруктуры) Тогда ЛокальныеПараметрыВывода = Истина; Элементы.СтраницыПараметровВывода.ТекущаяСтраница = Элементы.НастройкиПараметровВывода; Иначе ЛокальныеПараметрыВывода = Ложь; Элементы.СтраницыПараметровВывода.ТекущаяСтраница = Элементы.ОтключенныеНастройкиПараметровВывода; КонецЕсли; Элементы.ЛокальныеПараметрыВывода.ТолькоПросмотр = Ложь; КонецПроцедуры &НаКлиенте Процедура ПараметрыВыводаНедоступны() ЛокальныеПараметрыВывода = Ложь; Элементы.ЛокальныеПараметрыВывода.ТолькоПросмотр = Истина; Элементы.СтраницыПараметровВывода.ТекущаяСтраница = Элементы.НедоступныеНастройкиПараметровВывода; КонецПроцедуры &НаКлиенте Процедура КомпоновщикНастроекНастройкиПриАктивизацииПоля(Элемент) Перем ВыбраннаяСтраница; Если Элементы.КомпоновщикНастроекНастройки.ТекущийЭлемент.Имя = "КомпоновщикНастроекНастройкиНаличиеВыбора" Тогда ВыбраннаяСтраница = Элементы.СтраницаПолейВыбора; ИначеЕсли Элементы.КомпоновщикНастроекНастройки.ТекущийЭлемент.Имя = "КомпоновщикНастроекНастройкиНаличиеОтбора" Тогда ВыбраннаяСтраница = Элементы.СтраницаОтбора; ИначеЕсли Элементы.КомпоновщикНастроекНастройки.ТекущийЭлемент.Имя = "КомпоновщикНастроекНастройкиНаличиеПорядка" Тогда ВыбраннаяСтраница = Элементы.СтраницаПорядка; ИначеЕсли Элементы.КомпоновщикНастроекНастройки.ТекущийЭлемент.Имя = "КомпоновщикНастроекНастройкиНаличиеУсловногоОформления" Тогда ВыбраннаяСтраница = Элементы.СтраницаУсловногоОформления; ИначеЕсли Элементы.КомпоновщикНастроекНастройки.ТекущийЭлемент.Имя = "КомпоновщикНастроекНастройкиНаличиеПараметровВывода" Тогда ВыбраннаяСтраница = Элементы.СтраницаПараметровВывода; КонецЕсли; Если ВыбраннаяСтраница <> Неопределено Тогда Элементы.СтраницыНастроек.ТекущаяСтраница = ВыбраннаяСтраница; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура КомпоновщикНастроекНастройкиПриАктивизацииСтроки(Элемент) ЭлементСтруктуры = Отчет.КомпоновщикНастроек.Настройки.ПолучитьОбъектПоИдентификатору(Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока); ТипЭлемента = ТипЗнч(ЭлементСтруктуры); Если ТипЭлемента = Неопределено Или ТипЭлемента = Тип("КоллекцияЭлементовСтруктурыДиаграммыКомпоновкиДанных") Или ТипЭлемента = Тип("КоллекцияЭлементовСтруктурыТаблицыКомпоновкиДанных") Тогда ПоляГруппировкиНедоступны(); ВыбранныеПоляНедоступны(); ОтборНедоступен(); ПорядокНедоступен(); УсловноеОформлениеНедоступно(); ПараметрыВыводаНедоступны(); ИначеЕсли ТипЭлемента = Тип("НастройкиКомпоновкиДанных") Или ТипЭлемента = Тип("НастройкиВложенногоОбъектаКомпоновкиДанных") Тогда ПоляГруппировкиНедоступны(); ЛокальныеВыбранныеПоля = Истина; Элементы.ЛокальныеВыбранныеПоля.ТолькоПросмотр = Истина; Элементы.СтраницыПолейВыбора.ТекущаяСтраница = Элементы.НастройкиВыбранныхПолей; ЛокальныйОтбор = Истина; Элементы.ЛокальныйОтбор.ТолькоПросмотр = Истина; Элементы.СтраницыОтбора.ТекущаяСтраница = Элементы.НастройкиОтбора; ЛокальныйПорядок = Истина; Элементы.ЛокальныйПорядок.ТолькоПросмотр = Истина; Элементы.СтраницыПорядка.ТекущаяСтраница = Элементы.НастройкиПорядка; ЛокальноеУсловноеОформление = Истина; Элементы.ЛокальноеУсловноеОформление.ТолькоПросмотр = Истина; Элементы.СтраницыУсловногоОформления.ТекущаяСтраница = Элементы.НастройкиУсловногоОформления; ЛокальныеПараметрыВывода = Истина; Элементы.ЛокальныеПараметрыВывода.ТолькоПросмотр = Истина; Элементы.СтраницыПараметровВывода.ТекущаяСтраница = Элементы.НастройкиПараметровВывода; ИначеЕсли ТипЭлемента = Тип("ГруппировкаКомпоновкиДанных") Или ТипЭлемента = Тип("ГруппировкаТаблицыКомпоновкиДанных") Или ТипЭлемента = Тип("ГруппировкаДиаграммыКомпоновкиДанных") Тогда Элементы.СтраницыПолейГруппировки.ТекущаяСтраница = Элементы.НастройкиПолейГруппировки; ВыбранныеПоляДоступны(ЭлементСтруктуры); ОтборДоступен(ЭлементСтруктуры); ПорядокДоступен(ЭлементСтруктуры); УсловноеОформлениеДоступно(ЭлементСтруктуры); ПараметрыВыводаДоступны(ЭлементСтруктуры); ИначеЕсли ТипЭлемента = Тип("ТаблицаКомпоновкиДанных") Или ТипЭлемента = Тип("ДиаграммаКомпоновкиДанных") Тогда ПоляГруппировкиНедоступны(); ВыбранныеПоляДоступны(ЭлементСтруктуры); ОтборНедоступен(); ПорядокНедоступен(); УсловноеОформлениеДоступно(ЭлементСтруктуры); ПараметрыВыводаДоступны(ЭлементСтруктуры); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПерейтиКОтчету(Элемент) ЭлементСтруктуры = Отчет.КомпоновщикНастроек.Настройки.ПолучитьОбъектПоИдентификатору(Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока); НастройкиЭлемента = Отчет.КомпоновщикНастроек.Настройки.НастройкиЭлемента(ЭлементСтруктуры); Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока = Отчет.КомпоновщикНастроек.Настройки.ПолучитьИдентификаторПоОбъекту(НастройкиЭлемента); КонецПроцедуры &НаКлиенте Процедура ЛокальныеВыбранныеПоляПриИзменении(Элемент) Если ЛокальныеВыбранныеПоля Тогда Элементы.СтраницыПолейВыбора.ТекущаяСтраница = Элементы.НастройкиВыбранныхПолей; Иначе Элементы.СтраницыПолейВыбора.ТекущаяСтраница = Элементы.ОтключенныеНастройкиВыбранныхПолей; ЭлементСтруктуры = Отчет.КомпоновщикНастроек.Настройки.ПолучитьОбъектПоИдентификатору(Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока); Отчет.КомпоновщикНастроек.Настройки.ОчиститьВыборЭлемента(ЭлементСтруктуры); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЛокальныйОтборПриИзменении(Элемент) Если ЛокальныйОтбор Тогда Элементы.СтраницыОтбора.ТекущаяСтраница = Элементы.НастройкиОтбора; Иначе Элементы.СтраницыОтбора.ТекущаяСтраница = Элементы.ОтключенныеНастройкиОтбора; ЭлементСтруктуры = Отчет.КомпоновщикНастроек.Настройки.ПолучитьОбъектПоИдентификатору(Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока); Отчет.КомпоновщикНастроек.Настройки.ОчиститьОтборЭлемента(ЭлементСтруктуры); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЛокальныйПорядокПриИзменении(Элемент) Если ЛокальныйПорядок Тогда Элементы.СтраницыПорядка.ТекущаяСтраница = Элементы.НастройкиПорядка; Иначе Элементы.СтраницыПорядка.ТекущаяСтраница = Элементы.ОтключенныеНастройкиПорядка; ЭлементСтруктуры = Отчет.КомпоновщикНастроек.Настройки.ПолучитьОбъектПоИдентификатору(Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока); Отчет.КомпоновщикНастроек.Настройки.ОчиститьПорядокЭлемента(ЭлементСтруктуры); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЛокальноеУсловноеОформлениеПриИзменении(Элемент) Если ЛокальноеУсловноеОформление Тогда Элементы.СтраницыУсловногоОформления.ТекущаяСтраница = Элементы.НастройкиУсловногоОформления; Иначе Элементы.СтраницыУсловногоОформления.ТекущаяСтраница = Элементы.ОтключенныеНастройкиУсловногоОформления; ЭлементСтруктуры = Отчет.КомпоновщикНастроек.Настройки.ПолучитьОбъектПоИдентификатору(Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока); Отчет.КомпоновщикНастроек.Настройки.ОчиститьУсловноеОформлениеЭлемента(ЭлементСтруктуры); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЛокальныеПараметрыВыводаПриИзменении(Элемент) Если ЛокальныеПараметрыВывода Тогда Элементы.СтраницыПараметровВывода.ТекущаяСтраница = Элементы.НастройкиПараметровВывода; Иначе Элементы.СтраницыПараметровВывода.ТекущаяСтраница = Элементы.ОтключенныеНастройкиПараметровВывода; ЭлементСтруктуры = Отчет.КомпоновщикНастроек.Настройки.ПолучитьОбъектПоИдентификатору(Элементы.КомпоновщикНастроекНастройки.ТекущаяСтрока); Отчет.КомпоновщикНастроек.Настройки.ОчиститьПараметрыВыводаЭлемента(ЭлементСтруктуры); КонецЕсли; КонецПроцедуры #КонецОбласти
17,055
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 1046, "qsc_code_num_chars": 17055.0, "qsc_code_mean_word_length": 13.64913958, "qsc_code_frac_words_unique": 0.25047801, "qsc_code_frac_chars_top_2grams": 0.05155145, "qsc_code_frac_chars_top_3grams": 0.04853961, "qsc_code_frac_chars_top_4grams": 0.02010226, "qsc_code_frac_chars_dupe_5grams": 0.35385585, "qsc_code_frac_chars_dupe_6grams": 0.21433074, "qsc_code_frac_chars_dupe_7grams": 0.1449184, "qsc_code_frac_chars_dupe_8grams": 0.1449184, "qsc_code_frac_chars_dupe_9grams": 0.07529593, "qsc_code_frac_chars_dupe_10grams": 0.05638439, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00096812, "qsc_code_frac_chars_whitespace": 0.09152741, "qsc_code_size_file_byte": 17055.0, "qsc_code_num_lines": 519.0, "qsc_code_num_chars_line_max": 153.0, "qsc_code_num_chars_line_mean": 32.86127168, "qsc_code_frac_chars_alphabet": 0.92042081, "qsc_code_frac_chars_comments": 0.99384345, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/МониторСинхронизацииДанныхВМоделиСервиса/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <CommandBarLocation>None</CommandBarLocation> <VerticalScroll>useIfNecessary</VerticalScroll> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <Autofill>false</Autofill> </AutoCommandBar> <Events> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <Table name="СписокСостоянияУзлов" id="1"> <Representation>List</Representation> <ChangeRowSet>false</ChangeRowSet> <ChangeRowOrder>false</ChangeRowOrder> <SelectionMode>SingleRow</SelectionMode> <RowSelectionMode>Row</RowSelectionMode> <UseAlternationRowColor>true</UseAlternationRowColor> <AutoInsertNewRow>true</AutoInsertNewRow> <FileDragMode>AsFile</FileDragMode> <DataPath>СписокСостоянияУзлов</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния узлов</v8:content> </v8:item> </Title> <CommandSet> <ExcludedCommand>Add</ExcludedCommand> <ExcludedCommand>Change</ExcludedCommand> <ExcludedCommand>Copy</ExcludedCommand> <ExcludedCommand>Delete</ExcludedCommand> <ExcludedCommand>EndEdit</ExcludedCommand> <ExcludedCommand>MoveDown</ExcludedCommand> <ExcludedCommand>MoveUp</ExcludedCommand> <ExcludedCommand>SortListAsc</ExcludedCommand> <ExcludedCommand>SortListDesc</ExcludedCommand> </CommandSet> <SearchStringLocation>None</SearchStringLocation> <ViewStatusLocation>None</ViewStatusLocation> <SearchControlLocation>None</SearchControlLocation> <RowFilter xsi:nil="true"/> <ContextMenu name="СписокСостоянияУзловКонтекстноеМеню" id="2"> <Autofill>false</Autofill> <ChildItems> <ButtonGroup name="СписокСостоянияУзловКонтекстноеМенюГруппа2" id="38"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния узлов контекстное меню группа 2</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловКонтекстноеМенюГруппа2РасширеннаяПодсказка" id="55"/> <ChildItems> <Button name="СписокСостоянияУзловКонтекстноеМенюПерейтиВЖурналРегистрацииСобытийВыгрузкиДанных" id="39"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ПерейтиВЖурналРегистрацииСобытийВыгрузкиДанных</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>События отправки данных...</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловКонтекстноеМенюПерейтиВЖурналРегистрацииСобытийВыгрузкиДанныхРасширеннаяПодсказка" id="56"/> </Button> <Button name="СписокСостоянияУзловКонтекстноеМенюПерейтиВЖурналРегистрацииСобытийЗагрузкиДанных" id="40"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ПерейтиВЖурналРегистрацииСобытийЗагрузкиДанных</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>События получения данных...</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловКонтекстноеМенюПерейтиВЖурналРегистрацииСобытийЗагрузкиДанныхРасширеннаяПодсказка" id="57"/> </Button> </ChildItems> </ButtonGroup> <ButtonGroup name="СписокСостоянияУзловКонтекстноеМенюГруппа1" id="37"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния узлов контекстное меню группа 1</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловКонтекстноеМенюГруппа1РасширеннаяПодсказка" id="58"/> <ChildItems> <Button name="СписокСостоянияУзловКонтекстноеМенюВывестиСписок" id="36"> <Type>CommandBarButton</Type> <CommandName>Form.Item.СписокСостоянияУзлов.StandardCommand.OutputList</CommandName> <ExtendedTooltip name="СписокСостоянияУзловКонтекстноеМенюВывестиСписокРасширеннаяПодсказка" id="59"/> </Button> <Button name="СписокСостоянияУзловКонтекстноеМенюКопироватьВБуферОбмена" id="33"> <Type>CommandBarButton</Type> <CommandName>Form.Item.СписокСостоянияУзлов.StandardCommand.CopyToClipboard</CommandName> <ExtendedTooltip name="СписокСостоянияУзловКонтекстноеМенюКопироватьВБуферОбменаРасширеннаяПодсказка" id="60"/> </Button> </ChildItems> </ButtonGroup> </ChildItems> </ContextMenu> <AutoCommandBar name="СписокСостоянияУзловКоманднаяПанель" id="3"> <Autofill>false</Autofill> <ChildItems> <ButtonGroup name="СписокСостоянияУзловГруппаНайти" id="27"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния узлов группа найти</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловГруппаНайтиРасширеннаяПодсказка" id="61"/> <ChildItems> <Button name="СписокСостоянияУзловНайти" id="23"> <Type>CommandBarButton</Type> <CommandName>Form.Item.СписокСостоянияУзлов.StandardCommand.Find</CommandName> <LocationInCommandBar>InCommandBarAndInAdditionalSubmenu</LocationInCommandBar> <ExtendedTooltip name="СписокСостоянияУзловНайтиРасширеннаяПодсказка" id="62"/> </Button> <Button name="СписокСостоянияУзловОтменитьПоиск" id="24"> <Type>CommandBarButton</Type> <CommandName>Form.Item.СписокСостоянияУзлов.StandardCommand.CancelSearch</CommandName> <LocationInCommandBar>InCommandBarAndInAdditionalSubmenu</LocationInCommandBar> <ExtendedTooltip name="СписокСостоянияУзловОтменитьПоискРасширеннаяПодсказка" id="63"/> </Button> </ChildItems> </ButtonGroup> <ButtonGroup name="СписокСостоянияУзловГруппаОбновитьМонитор" id="28"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния узлов группа обновить монитор</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловГруппаОбновитьМониторРасширеннаяПодсказка" id="64"/> <ChildItems> <Button name="СписокСостоянияУзловОбновитьМонитор" id="20"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ОбновитьМонитор</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обновить</v8:content> </v8:item> </Title> <LocationInCommandBar>InCommandBarAndInAdditionalSubmenu</LocationInCommandBar> <ExtendedTooltip name="СписокСостоянияУзловОбновитьМониторРасширеннаяПодсказка" id="65"/> </Button> </ChildItems> </ButtonGroup> <Button name="СписокСостоянияУзловПодробно" id="49"> <Type>CommandBarButton</Type> <CommandName>Form.Command.Подробно</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Подробно</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловПодробноРасширеннаяПодсказка" id="66"/> </Button> <ButtonGroup name="СписокСостоянияУзловГруппаВывестиСписок" id="50"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния узлов группа вывести список</v8:content> </v8:item> </Title> <ExtendedTooltip name="СписокСостоянияУзловГруппаВывестиСписокРасширеннаяПодсказка" id="67"/> <ChildItems> <Button name="СписокСостоянияУзловКопироватьВБуферОбмена" id="26"> <Type>CommandBarButton</Type> <CommandName>Form.Item.СписокСостоянияУзлов.StandardCommand.CopyToClipboard</CommandName> <LocationInCommandBar>InAdditionalSubmenu</LocationInCommandBar> <ExtendedTooltip name="СписокСостоянияУзловКопироватьВБуферОбменаРасширеннаяПодсказка" id="68"/> </Button> <Button name="СписокСостоянияУзловВывестиСписок" id="25"> <Type>CommandBarButton</Type> <CommandName>Form.Item.СписокСостоянияУзлов.StandardCommand.OutputList</CommandName> <LocationInCommandBar>InAdditionalSubmenu</LocationInCommandBar> <ExtendedTooltip name="СписокСостоянияУзловВывестиСписокРасширеннаяПодсказка" id="69"/> </Button> </ChildItems> </ButtonGroup> <Button name="СписокСостоянияУзловИзменитьФорму" id="53"> <Type>CommandBarButton</Type> <CommandName>Form.StandardCommand.CustomizeForm</CommandName> <ExtendedTooltip name="СписокСостоянияУзловИзменитьФормуРасширеннаяПодсказка" id="70"/> </Button> <Button name="СписокСостоянияУзловСправка" id="54"> <Type>CommandBarButton</Type> <CommandName>Form.StandardCommand.Help</CommandName> <ExtendedTooltip name="СписокСостоянияУзловСправкаРасширеннаяПодсказка" id="71"/> </Button> </ChildItems> </AutoCommandBar> <ExtendedTooltip name="СписокСостоянияУзловРасширеннаяПодсказка" id="72"/> <SearchStringAddition name="СписокСостоянияУзловСтрокаПоиска" id="86"> <AdditionSource> <Item>СписокСостоянияУзлов</Item> <Type>SearchStringRepresentation</Type> </AdditionSource> <ContextMenu name="СписокСостоянияУзловСтрокаПоискаКонтекстноеМеню" id="87"/> <ExtendedTooltip name="СписокСостоянияУзловСтрокаПоискаРасширеннаяПодсказка" id="88"/> </SearchStringAddition> <ViewStatusAddition name="СписокСостоянияУзловСостояниеПросмотра" id="89"> <AdditionSource> <Item>СписокСостоянияУзлов</Item> <Type>ViewStatusRepresentation</Type> </AdditionSource> <ContextMenu name="СписокСостоянияУзловСостояниеПросмотраКонтекстноеМеню" id="90"/> <ExtendedTooltip name="СписокСостоянияУзловСостояниеПросмотраРасширеннаяПодсказка" id="91"/> </ViewStatusAddition> <SearchControlAddition name="СписокСостоянияУзловУправлениеПоиском" id="92"> <AdditionSource> <Item>СписокСостоянияУзлов</Item> <Type>SearchControl</Type> </AdditionSource> <ContextMenu name="СписокСостоянияУзловУправлениеПоискомКонтекстноеМеню" id="93"/> <ExtendedTooltip name="СписокСостоянияУзловУправлениеПоискомРасширеннаяПодсказка" id="94"/> </SearchControlAddition> <ChildItems> <InputField name="СписокСостоянияУзловОбластьДанных" id="51"> <DataPath>СписокСостоянияУзлов.ОбластьДанных</DataPath> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Область данных</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <ContextMenu name="СписокСостоянияУзловОбластьДанныхКонтекстноеМеню" id="52"/> <ExtendedTooltip name="СписокСостоянияУзловОбластьДанныхРасширеннаяПодсказка" id="73"/> </InputField> <InputField name="СписокСостоянияУзловИмяПланаОбмена" id="45"> <DataPath>СписокСостоянияУзлов.ИмяПланаОбмена</DataPath> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>План обмена</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <ContextMenu name="СписокСостоянияУзловИмяПланаОбменаКонтекстноеМеню" id="46"/> <ExtendedTooltip name="СписокСостоянияУзловИмяПланаОбменаРасширеннаяПодсказка" id="74"/> </InputField> <InputField name="СписокСостоянияУзловУзелИнформационнойБазы" id="10"> <DataPath>СписокСостоянияУзлов.УзелИнформационнойБазы</DataPath> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Приложение</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <ContextMenu name="СписокСостоянияУзловУзелИнформационнойБазыКонтекстноеМеню" id="11"/> <ExtendedTooltip name="СписокСостоянияУзловУзелИнформационнойБазыРасширеннаяПодсказка" id="75"/> </InputField> <ColumnGroup name="ГруппаВыгрузки" id="47"> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Выгрузки</v8:content> </v8:item> </Title> <ExtendedTooltip name="ГруппаВыгрузкиРасширеннаяПодсказка" id="76"/> <ChildItems> <ColumnGroup name="ГруппаСостоянияВыгрузки" id="19"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния выгрузки</v8:content> </v8:item> </Title> <Group>InCell</Group> <ExtendedTooltip name="ГруппаСостоянияВыгрузкиРасширеннаяПодсказка" id="77"/> <ChildItems> <PictureField name="СписокСостоянияУзловРезультатПоследнейВыгрузкиДанных" id="6"> <DataPath>СписокСостоянияУзлов.РезультатПоследнейВыгрузкиДанных</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат последней выгрузки данных</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <EditMode>EnterOnInput</EditMode> <ValuesPicture> <xr:Ref>CommonPicture.СостояниеОбменаДанными</xr:Ref> <xr:LoadTransparent>false</xr:LoadTransparent> </ValuesPicture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="СписокСостоянияУзловРезультатПоследнейВыгрузкиДанныхКонтекстноеМеню" id="7"/> <ExtendedTooltip name="СписокСостоянияУзловРезультатПоследнейВыгрузкиДанныхРасширеннаяПодсказка" id="78"/> </PictureField> <InputField name="СписокСостоянияУзловДатаПоследнейВыгрузки" id="16"> <DataPath>СписокСостоянияУзлов.ПредставлениеДатыПоследнейВыгрузки</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Последняя попытка отправки</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <Format> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </Format> <EditFormat> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </EditFormat> <ContextMenu name="СписокСостоянияУзловДатаПоследнейВыгрузкиКонтекстноеМеню" id="17"/> <ExtendedTooltip name="СписокСостоянияУзловДатаПоследнейВыгрузкиРасширеннаяПодсказка" id="79"/> </InputField> </ChildItems> </ColumnGroup> <InputField name="СписокСостоянияУзловДатаПоследнейУспешнойВыгрузки" id="4"> <DataPath>СписокСостоянияУзлов.ПредставлениеДатыПоследнейУспешнойВыгрузки</DataPath> <Visible>false</Visible> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Данные отправлены</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <Format> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </Format> <EditFormat> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </EditFormat> <ContextMenu name="СписокСостоянияУзловДатаПоследнейУспешнойВыгрузкиКонтекстноеМеню" id="5"/> <ExtendedTooltip name="СписокСостоянияУзловДатаПоследнейУспешнойВыгрузкиРасширеннаяПодсказка" id="80"/> </InputField> </ChildItems> </ColumnGroup> <ColumnGroup name="ГруппаЗагрузка" id="48"> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Загрузки</v8:content> </v8:item> </Title> <ExtendedTooltip name="ГруппаЗагрузкаРасширеннаяПодсказка" id="81"/> <ChildItems> <ColumnGroup name="ГруппаСостоянияЗагрузки" id="18"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Состояния загрузки</v8:content> </v8:item> </Title> <Group>InCell</Group> <ExtendedTooltip name="ГруппаСостоянияЗагрузкиРасширеннаяПодсказка" id="82"/> <ChildItems> <PictureField name="СписокСостоянияУзловРезультатПоследнейЗагрузкиДанных" id="8"> <DataPath>СписокСостоянияУзлов.РезультатПоследнейЗагрузкиДанных</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат последней загрузки данных</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <EditMode>EnterOnInput</EditMode> <ValuesPicture> <xr:Ref>CommonPicture.СостояниеОбменаДанными</xr:Ref> <xr:LoadTransparent>false</xr:LoadTransparent> </ValuesPicture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="СписокСостоянияУзловРезультатПоследнейЗагрузкиДанныхКонтекстноеМеню" id="9"/> <ExtendedTooltip name="СписокСостоянияУзловРезультатПоследнейЗагрузкиДанныхРасширеннаяПодсказка" id="83"/> </PictureField> <InputField name="СписокСостоянияУзловДатаПоследнейЗагрузки" id="14"> <DataPath>СписокСостоянияУзлов.ПредставлениеДатыПоследнейЗагрузки</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Последняя попытка получения</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <Format> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </Format> <EditFormat> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </EditFormat> <ContextMenu name="СписокСостоянияУзловДатаПоследнейЗагрузкиКонтекстноеМеню" id="15"/> <ExtendedTooltip name="СписокСостоянияУзловДатаПоследнейЗагрузкиРасширеннаяПодсказка" id="84"/> </InputField> </ChildItems> </ColumnGroup> <InputField name="СписокСостоянияУзловДатаПоследнейУспешнойЗагрузки" id="12"> <DataPath>СписокСостоянияУзлов.ПредставлениеДатыПоследнейУспешнойЗагрузки</DataPath> <Visible>false</Visible> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Данные получены</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <Format> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </Format> <EditFormat> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=DDT; ДП=Никогда</v8:content> </v8:item> </EditFormat> <ContextMenu name="СписокСостоянияУзловДатаПоследнейУспешнойЗагрузкиКонтекстноеМеню" id="13"/> <ExtendedTooltip name="СписокСостоянияУзловДатаПоследнейУспешнойЗагрузкиРасширеннаяПодсказка" id="85"/> </InputField> </ChildItems> </ColumnGroup> </ChildItems> </Table> </ChildItems> <Attributes> <Attribute name="СписокСостоянияУзлов" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Список состояния узлов</v8:content> </v8:item> </Title> <Type> <v8:Type>v8:ValueTable</v8:Type> </Type> <Columns> <Column name="ДатаПоследнейУспешнойВыгрузки" id="1"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="РезультатПоследнейВыгрузкиДанных" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат последней выгрузки данных</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>1</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Nonnegative</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Column> <Column name="РезультатПоследнейЗагрузкиДанных" id="3"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат последней загрузки данных</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>1</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Nonnegative</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Column> <Column name="УзелИнформационнойБазы" id="4"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Приложение</v8:content> </v8:item> </Title> <Type> <v8:TypeSet>cfg:ExchangePlanRef</v8:TypeSet> </Type> </Column> <Column name="ДатаПоследнейУспешнойЗагрузки" id="5"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ДатаПоследнейЗагрузки" id="6"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ДатаПоследнейВыгрузки" id="7"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ИмяПланаОбмена" id="8"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>План обмена</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ОбластьДанных" id="9"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Область данных</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>7</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Nonnegative</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Column> <Column name="ПредставлениеДатыПоследнейЗагрузки" id="10"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Последняя попытка получения</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ПредставлениеДатыПоследнейВыгрузки" id="11"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Последняя попытка отправки</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ПредставлениеДатыПоследнейУспешнойЗагрузки" id="12"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Данные получены</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ПредставлениеДатыПоследнейУспешнойВыгрузки" id="13"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Данные отправлены</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> </Columns> </Attribute> </Attributes> <Commands> <Command name="ОбновитьМонитор" id="3"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обновить</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обновить монитор</v8:content> </v8:item> </ToolTip> <Shortcut>F5</Shortcut> <Picture> <xr:Ref>StdPicture.Refresh</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Action>ОбновитьМонитор</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="ПерейтиВЖурналРегистрацииСобытийВыгрузкиДанных" id="4"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>События отправки данных...</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Перейти в журнал регистрации событий выгрузки данных</v8:content> </v8:item> </ToolTip> <Picture> <xr:Ref>StdPicture.EventLog</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Action>ПерейтиВЖурналРегистрацииСобытийВыгрузкиДанных</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="ПерейтиВЖурналРегистрацииСобытийЗагрузкиДанных" id="6"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>События получения данных...</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Перейти в журнал регистрации событий загрузки данных</v8:content> </v8:item> </ToolTip> <Picture> <xr:Ref>StdPicture.EventLog</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Action>ПерейтиВЖурналРегистрацииСобытийЗагрузкиДанных</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="Подробно" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Подробно</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Показать подробную информацию</v8:content> </v8:item> </ToolTip> <Action>Подробно</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> </Commands> </Form>
26,959
Form
xml
ru
xml
data
{"qsc_code_num_words": 2400, "qsc_code_num_chars": 26959.0, "qsc_code_mean_word_length": 7.44208333, "qsc_code_frac_words_unique": 0.16333333, "qsc_code_frac_chars_top_2grams": 0.03292089, "qsc_code_frac_chars_top_3grams": 0.02194726, "qsc_code_frac_chars_top_4grams": 0.03292089, "qsc_code_frac_chars_dupe_5grams": 0.51867197, "qsc_code_frac_chars_dupe_6grams": 0.48765467, "qsc_code_frac_chars_dupe_7grams": 0.43821735, "qsc_code_frac_chars_dupe_8grams": 0.40747998, "qsc_code_frac_chars_dupe_9grams": 0.3856447, "qsc_code_frac_chars_dupe_10grams": 0.37427916, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0313322, "qsc_code_frac_chars_whitespace": 0.19614971, "qsc_code_size_file_byte": 26959.0, "qsc_code_num_lines": 711.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 37.91701828, "qsc_code_frac_chars_alphabet": 0.79281067, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.73558368, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.20238139, "qsc_code_frac_chars_long_word_length": 0.16454616, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/util/ShiroUtils.java
package com.ruoyi.framework.util; import org.apache.shiro.SecurityUtils; import org.apache.shiro.crypto.SecureRandomNumberGenerator; import org.apache.shiro.mgt.RealmSecurityManager; import org.apache.shiro.session.Session; import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.subject.SimplePrincipalCollection; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.framework.shiro.realm.UserRealm; import com.ruoyi.system.domain.SysUser; /** * shiro 工具类 * * @author ruoyi */ public class ShiroUtils { public static Subject getSubject() { return SecurityUtils.getSubject(); } public static Session getSession() { return SecurityUtils.getSubject().getSession(); } public static void logout() { getSubject().logout(); } public static SysUser getSysUser() { SysUser user = null; Object obj = getSubject().getPrincipal(); if (StringUtils.isNotNull(obj)) { user = new SysUser(); BeanUtils.copyBeanProp(user, obj); } return user; } public static void setSysUser(SysUser user) { Subject subject = getSubject(); PrincipalCollection principalCollection = subject.getPrincipals(); String realmName = principalCollection.getRealmNames().iterator().next(); PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(user, realmName); // 重新加载Principal subject.runAs(newPrincipalCollection); } public static void clearCachedAuthorizationInfo() { RealmSecurityManager rsm = (RealmSecurityManager) SecurityUtils.getSecurityManager(); UserRealm realm = (UserRealm) rsm.getRealms().iterator().next(); realm.clearCachedAuthorizationInfo(); } public static Long getUserId() { return getSysUser().getUserId().longValue(); } public static String getLoginName() { return getSysUser().getLoginName(); } public static String getIp() { return getSubject().getSession().getHost(); } public static String getSessionId() { return String.valueOf(getSubject().getSession().getId()); } /** * 生成随机盐 */ public static String randomSalt() { // 一个Byte占两个字节,此处生成的3字节,字符串长度为6 SecureRandomNumberGenerator secureRandom = new SecureRandomNumberGenerator(); String hex = secureRandom.nextBytes(3).toHex(); return hex; } }
2,607
ShiroUtils
java
en
java
code
{"qsc_code_num_words": 224, "qsc_code_num_chars": 2607.0, "qsc_code_mean_word_length": 7.82589286, "qsc_code_frac_words_unique": 0.36607143, "qsc_code_frac_chars_top_2grams": 0.07529949, "qsc_code_frac_chars_top_3grams": 0.05989732, "qsc_code_frac_chars_top_4grams": 0.07986309, "qsc_code_frac_chars_dupe_5grams": 0.07472904, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00148148, "qsc_code_frac_chars_whitespace": 0.22324511, "qsc_code_size_file_byte": 2607.0, "qsc_code_num_lines": 96.0, "qsc_code_num_chars_line_max": 101.0, "qsc_code_num_chars_line_mean": 27.15625, "qsc_code_frac_chars_alphabet": 0.86419753, "qsc_code_frac_chars_comments": 0.04296126, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.18918919, "qsc_codejava_score_lines_no_logic": 0.37837838, "qsc_codejava_frac_words_no_modifier": 0.73333333, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/МониторСинхронизацииДанныхВМоделиСервиса/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Если Не Пользователи.ЭтоПолноправныйПользователь(Неопределено, Истина, Ложь) Тогда ВызватьИсключение НСтр("ru = 'Нет прав на администрирование обменов данными.'"); КонецЕсли; УстановитьПривилегированныйРежим(Истина); ОбновитьСписокСостоянияУзлов(); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура ПерейтиВЖурналРегистрацииСобытийВыгрузкиДанных(Команда) ТекущиеДанные = Элементы.СписокСостоянияУзлов.ТекущиеДанные; Если ТекущиеДанные = Неопределено Тогда Возврат; КонецЕсли; Если ТекущиеДанные.УзелИнформационнойБазы = Неопределено Тогда Возврат; КонецЕсли; ОбменДаннымиКлиент.ПерейтиВЖурналРегистрацииСобытийДанныхМодально(ТекущиеДанные.УзелИнформационнойБазы, ЭтотОбъект, "ВыгрузкаДанных"); КонецПроцедуры &НаКлиенте Процедура ПерейтиВЖурналРегистрацииСобытийЗагрузкиДанных(Команда) ТекущиеДанные = Элементы.СписокСостоянияУзлов.ТекущиеДанные; Если ТекущиеДанные = Неопределено Тогда Возврат; КонецЕсли; Если ТекущиеДанные.УзелИнформационнойБазы = Неопределено Тогда Возврат; КонецЕсли; ОбменДаннымиКлиент.ПерейтиВЖурналРегистрацииСобытийДанныхМодально(ТекущиеДанные.УзелИнформационнойБазы, ЭтотОбъект, "ЗагрузкаДанных"); КонецПроцедуры &НаКлиенте Процедура ОбновитьМонитор(Команда) ОбновитьДанныеМонитора(); КонецПроцедуры &НаКлиенте Процедура Подробно(Команда) ПодробноНаСервере(); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервере Процедура ОбновитьСписокСостоянияУзлов() СписокСостоянияУзлов.Очистить(); СписокСостоянияУзлов.Загрузить( ОбменДаннымиВМоделиСервиса.ТаблицаМонитораОбменаДанными(ОбменДаннымиПовтИсп.РазделенныеПланыОбменаБСП())); КонецПроцедуры &НаКлиенте Процедура ОбновитьДанныеМонитора() ИндексСтрокиСписокСостоянияУзлов = ПолучитьТекущийИндексСтроки(); // выполняем обновление таблиц монитора на сервере ОбновитьСписокСостоянияУзлов(); // выполняем позиционирование курсора ВыполнитьПозиционированиеКурсора(ИндексСтрокиСписокСостоянияУзлов); КонецПроцедуры &НаКлиенте Функция ПолучитьТекущийИндексСтроки() // возвращаемое значение функции ИндексСтроки = Неопределено; // при обновлении монитора выполняем позиционирование курсора ТекущиеДанные = Элементы.СписокСостоянияУзлов.ТекущиеДанные; Если ТекущиеДанные <> Неопределено Тогда ИндексСтроки = СписокСостоянияУзлов.Индекс(ТекущиеДанные); КонецЕсли; Возврат ИндексСтроки; КонецФункции &НаКлиенте Процедура ВыполнитьПозиционированиеКурсора(ИндексСтроки) Если ИндексСтроки <> Неопределено Тогда // выполняем проверки позиционирования курсора после получения новых данных Если СписокСостоянияУзлов.Количество() <> 0 Тогда Если ИндексСтроки > СписокСостоянияУзлов.Количество() - 1 Тогда ИндексСтроки = СписокСостоянияУзлов.Количество() - 1; КонецЕсли; // позиционируем курсор Элементы.СписокСостоянияУзлов.ТекущаяСтрока = СписокСостоянияУзлов[ИндексСтроки].ПолучитьИдентификатор(); КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервере Процедура ПодробноНаСервере() Элементы.СписокСостоянияУзловПодробно.Пометка = Не Элементы.СписокСостоянияУзловПодробно.Пометка; Элементы.СписокСостоянияУзловДатаПоследнейУспешнойВыгрузки.Видимость = Элементы.СписокСостоянияУзловПодробно.Пометка; Элементы.СписокСостоянияУзловДатаПоследнейУспешнойЗагрузки.Видимость = Элементы.СписокСостоянияУзловПодробно.Пометка; Элементы.СписокСостоянияУзловИмяПланаОбмена.Видимость = Элементы.СписокСостоянияУзловПодробно.Пометка; КонецПроцедуры #КонецОбласти
4,155
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 278, "qsc_code_num_chars": 4155.0, "qsc_code_mean_word_length": 11.76258993, "qsc_code_frac_words_unique": 0.46043165, "qsc_code_frac_chars_top_2grams": 0.03302752, "qsc_code_frac_chars_top_3grams": 0.06574924, "qsc_code_frac_chars_top_4grams": 0.04036697, "qsc_code_frac_chars_dupe_5grams": 0.24220183, "qsc_code_frac_chars_dupe_6grams": 0.20550459, "qsc_code_frac_chars_dupe_7grams": 0.20550459, "qsc_code_frac_chars_dupe_8grams": 0.20550459, "qsc_code_frac_chars_dupe_9grams": 0.17859327, "qsc_code_frac_chars_dupe_10grams": 0.17859327, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00376952, "qsc_code_frac_chars_whitespace": 0.10613718, "qsc_code_size_file_byte": 4155.0, "qsc_code_num_lines": 155.0, "qsc_code_num_chars_line_max": 136.0, "qsc_code_num_chars_line_mean": 26.80645161, "qsc_code_frac_chars_alphabet": 0.87641357, "qsc_code_frac_chars_comments": 0.97472924, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/util/LogUtils.java
package com.ruoyi.framework.util; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.shiro.SecurityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.json.JSON; import com.ruoyi.common.utils.IpUtils; /** * 处理并记录日志文件 * * @author ruoyi */ public class LogUtils { public static final Logger ERROR_LOG = LoggerFactory.getLogger("sys-error"); public static final Logger ACCESS_LOG = LoggerFactory.getLogger("sys-access"); /** * 记录访问日志 [username][jsessionid][ip][accept][UserAgent][url][params][Referer] * * @param request * @throws Exception */ public static void logAccess(HttpServletRequest request) throws Exception { String username = getUsername(); String jsessionId = request.getRequestedSessionId(); String ip = IpUtils.getIpAddr(request); String accept = request.getHeader("accept"); String userAgent = request.getHeader("User-Agent"); String url = request.getRequestURI(); String params = getParams(request); StringBuilder s = new StringBuilder(); s.append(getBlock(username)); s.append(getBlock(jsessionId)); s.append(getBlock(ip)); s.append(getBlock(accept)); s.append(getBlock(userAgent)); s.append(getBlock(url)); s.append(getBlock(params)); s.append(getBlock(request.getHeader("Referer"))); getAccessLog().info(s.toString()); } /** * 记录异常错误 格式 [exception] * * @param message * @param e */ public static void logError(String message, Throwable e) { String username = getUsername(); StringBuilder s = new StringBuilder(); s.append(getBlock("exception")); s.append(getBlock(username)); s.append(getBlock(message)); ERROR_LOG.error(s.toString(), e); } /** * 记录页面错误 错误日志记录 [page/eception][username][statusCode][errorMessage][servletName][uri][exceptionName][ip][exception] * * @param request */ public static void logPageError(HttpServletRequest request) { String username = getUsername(); Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code"); String message = (String) request.getAttribute("javax.servlet.error.message"); String uri = (String) request.getAttribute("javax.servlet.error.request_uri"); Throwable t = (Throwable) request.getAttribute("javax.servlet.error.exception"); if (statusCode == null) { statusCode = 0; } StringBuilder s = new StringBuilder(); s.append(getBlock(t == null ? "page" : "exception")); s.append(getBlock(username)); s.append(getBlock(statusCode)); s.append(getBlock(message)); s.append(getBlock(IpUtils.getIpAddr(request))); s.append(getBlock(uri)); s.append(getBlock(request.getHeader("Referer"))); StringWriter sw = new StringWriter(); while (t != null) { t.printStackTrace(new PrintWriter(sw)); t = t.getCause(); } s.append(getBlock(sw.toString())); getErrorLog().error(s.toString()); } public static String getBlock(Object msg) { if (msg == null) { msg = ""; } return "[" + msg.toString() + "]"; } protected static String getParams(HttpServletRequest request) throws Exception { Map<String, String[]> params = request.getParameterMap(); return JSON.marshal(params); } protected static String getUsername() { return (String) SecurityUtils.getSubject().getPrincipal(); } public static Logger getAccessLog() { return ACCESS_LOG; } public static Logger getErrorLog() { return ERROR_LOG; } }
3,980
LogUtils
java
en
java
code
{"qsc_code_num_words": 390, "qsc_code_num_chars": 3980.0, "qsc_code_mean_word_length": 6.35128205, "qsc_code_frac_words_unique": 0.27435897, "qsc_code_frac_chars_top_2grams": 0.05369398, "qsc_code_frac_chars_top_3grams": 0.11505854, "qsc_code_frac_chars_top_4grams": 0.05006056, "qsc_code_frac_chars_dupe_5grams": 0.19539766, "qsc_code_frac_chars_dupe_6grams": 0.16633024, "qsc_code_frac_chars_dupe_7grams": 0.10173597, "qsc_code_frac_chars_dupe_8grams": 0.03794913, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.001001, "qsc_code_frac_chars_whitespace": 0.24698492, "qsc_code_size_file_byte": 3980.0, "qsc_code_num_lines": 136.0, "qsc_code_num_chars_line_max": 121.0, "qsc_code_num_chars_line_mean": 29.26470588, "qsc_code_frac_chars_alphabet": 0.82549216, "qsc_code_frac_chars_comments": 0.10904523, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.13402062, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.05386351, "qsc_code_frac_chars_long_word_length": 0.03327693, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.08247423, "qsc_codejava_score_lines_no_logic": 0.20618557, "qsc_codejava_frac_words_no_modifier": 0.88888889, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/НастройкаДоступаКСервисуMorpher/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <CommandBarLocation>Bottom</CommandBarLocation> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <HorizontalAlign>Right</HorizontalAlign> <Autofill>false</Autofill> <ChildItems> <Button name="ФормаОК" id="10"> <Type>CommandBarButton</Type> <DefaultButton>true</DefaultButton> <CommandName>Form.Command.ОК</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ОК</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаОКРасширеннаяПодсказка" id="11"/> </Button> <Button name="ФормаКнопкаОтмена" id="12"> <Type>CommandBarButton</Type> <CommandName>Form.StandardCommand.Cancel</CommandName> <ExtendedTooltip name="ФормаКнопкаОтменаРасширеннаяПодсказка" id="13"/> </Button> </ChildItems> </AutoCommandBar> <Events> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <RadioButtonField name="ВидДоступаКСервисуMorher" id="1"> <DataPath>ВидДоступаКСервисуMorher</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Использовать для доступа к сервису</v8:content> </v8:item> </Title> <RadioButtonType>Auto</RadioButtonType> <ColumnsCount>1</ColumnsCount> <ChoiceList> <xr:Item> <xr:Presentation/> <xr:CheckState>0</xr:CheckState> <xr:Value xsi:type="FormChoiceListDesTimeValue"> <Presentation> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Анонимный вход</v8:content> </v8:item> </Presentation> <Value xsi:type="xs:decimal">0</Value> </xr:Value> </xr:Item> <xr:Item> <xr:Presentation/> <xr:CheckState>0</xr:CheckState> <xr:Value xsi:type="FormChoiceListDesTimeValue"> <Presentation> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Вход для зарегистрированных пользователей</v8:content> </v8:item> </Presentation> <Value xsi:type="xs:decimal">1</Value> </xr:Value> </xr:Item> </ChoiceList> <ContextMenu name="ВидДоступаКСервисуMorherКонтекстноеМеню" id="2"/> <ExtendedTooltip name="ВидДоступаКСервисуMorherРасширеннаяПодсказка" id="3"/> <Events> <Event name="OnChange">ВидДоступаКСервисуMorherПриИзменении</Event> </Events> </RadioButtonField> <InputField name="Токен" id="17"> <DataPath>Токен</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Токен</v8:content> </v8:item> </Title> <PasswordMode>true</PasswordMode> <ContextMenu name="ТокенКонтекстноеМеню" id="18"/> <ExtendedTooltip name="ТокенРасширеннаяПодсказка" id="19"/> <Events> <Event name="OnChange">ТокенПриИзменении</Event> </Events> </InputField> <LabelDecoration name="ИнфоНадписьДоступКСервису" id="14"> <TextColor>style:ПоясняющийТекст</TextColor> <Title formatted="true"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Анонимное использование сервиса имеет &lt;link http://www.morpher.ru/ws3/#limitations&gt;ограничения&lt;/&gt;. Получить токен можно в &lt;link http://www.morpher.ru/My/Token.aspx&gt;личном кабинете&lt;/&gt; после регистрации. </v8:content> </v8:item> </Title> <ContextMenu name="ИнфоНадписьДоступКСервисуКонтекстноеМеню" id="15"/> <ExtendedTooltip name="ИнфоНадписьДоступКСервисуРасширеннаяПодсказка" id="16"/> </LabelDecoration> </ChildItems> <Attributes> <Attribute name="ВидДоступаКСервисуMorher" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Вид доступа к сервису morher</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>1</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Attribute> <Attribute name="Токен" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Токен</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>40</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ТокенИзменен" id="5"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> </Attributes> <Commands> <Command name="ОК" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ОК</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ОК</v8:content> </v8:item> </ToolTip> <Action>ОК</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> </Commands> </Form>
5,680
Form
xml
ru
xml
data
{"qsc_code_num_words": 699, "qsc_code_num_chars": 5680.0, "qsc_code_mean_word_length": 5.42918455, "qsc_code_frac_words_unique": 0.26323319, "qsc_code_frac_chars_top_2grams": 0.03162055, "qsc_code_frac_chars_top_3grams": 0.03162055, "qsc_code_frac_chars_top_4grams": 0.03952569, "qsc_code_frac_chars_dupe_5grams": 0.34677207, "qsc_code_frac_chars_dupe_6grams": 0.32674572, "qsc_code_frac_chars_dupe_7grams": 0.30197628, "qsc_code_frac_chars_dupe_8grams": 0.28985507, "qsc_code_frac_chars_dupe_9grams": 0.24611331, "qsc_code_frac_chars_dupe_10grams": 0.18814229, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.04039571, "qsc_code_frac_chars_whitespace": 0.14577465, "qsc_code_size_file_byte": 5680.0, "qsc_code_num_lines": 161.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 35.27950311, "qsc_code_frac_chars_alphabet": 0.74154988, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.54037267, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.21795775, "qsc_code_frac_chars_long_word_length": 0.06725352, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java
package com.ruoyi.framework.config; import java.util.Locale; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; import org.springframework.web.servlet.i18n.SessionLocaleResolver; /** * 资源文件配置加载 * * @author ruoyi */ @Configuration public class I18nConfig implements WebMvcConfigurer { @Bean public LocaleResolver localeResolver() { SessionLocaleResolver slr = new SessionLocaleResolver(); // 默认语言 slr.setDefaultLocale(Locale.SIMPLIFIED_CHINESE); return slr; } @Bean public LocaleChangeInterceptor localeChangeInterceptor() { LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); // 参数名 lci.setParamName("lang"); return lci; } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(localeChangeInterceptor()); } }
1,225
I18nConfig
java
en
java
code
{"qsc_code_num_words": 105, "qsc_code_num_chars": 1225.0, "qsc_code_mean_word_length": 8.72380952, "qsc_code_frac_words_unique": 0.42857143, "qsc_code_frac_chars_top_2grams": 0.06877729, "qsc_code_frac_chars_top_3grams": 0.18340611, "qsc_code_frac_chars_top_4grams": 0.14737991, "qsc_code_frac_chars_dupe_5grams": 0.31877729, "qsc_code_frac_chars_dupe_6grams": 0.19213974, "qsc_code_frac_chars_dupe_7grams": 0.10917031, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0058651, "qsc_code_frac_chars_whitespace": 0.16489796, "qsc_code_size_file_byte": 1225.0, "qsc_code_num_lines": 43.0, "qsc_code_num_chars_line_max": 78.0, "qsc_code_num_chars_line_mean": 28.48837209, "qsc_code_frac_chars_alphabet": 0.88954057, "qsc_code_frac_chars_comments": 0.04326531, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0625, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00341006, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.09375, "qsc_codejava_score_lines_no_logic": 0.4375, "qsc_codejava_frac_words_no_modifier": 0.75, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 1, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/НастройкаДоступаКСервисуMorpher/Ext/Help/ru.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><link rel="stylesheet" type="text/css" href="v8help://service_book/service_style"></link><meta name="GENERATOR" content="MSHTML 11.00.10570.1001"></meta></head><body> <p>Предназначена для ввода данных регистрации на сервисе склонений <a href="http://morpher.ru/">http://morpher.ru/</a>.</p> <p>Открывается по команде <strong>Настройка доступа к сервису "Морфер"</strong> в разделе <strong>Администрирование - Интернет-Поддержка и Сервисы</strong>.</p> <h3>Анонимный вход</h3> <ul><li>По умолчанию используется <strong>Анонимный вход</strong>, который обеспечивает базовые возможности использования сервиса. Анонимное использование сервиса склонений имеет ограничения. </li><li>Для того чтобы узнать об условиях доступа к сервису склонений и регистрации на сайте, перейдите по ссылке <strong>ограничения</strong>.</li></ul><h3>Вход для зарегистрированных пользователей</h3> <ul><li>Для использования возможностей сервиса без ограничений переключатель установите в положение <strong>Вход для зарегистрированных пользователей</strong>. </li><li>Введите <strong>Токен</strong>. Получить токен можно в <strong>личном кабинете</strong>, перейдя по соответствующей ссылке.</li></ul><h3>См. также:</h3> <ul><li> <div><a href="CommonForm.Склонения/Help">Склонения</a>.</div></li></ul></body></html>
1,440
ru
html
ru
html
code
{"qsc_code_num_words": 202, "qsc_code_num_chars": 1440.0, "qsc_code_mean_word_length": 5.43069307, "qsc_code_frac_words_unique": 0.55445545, "qsc_code_frac_chars_top_2grams": 0.01093892, "qsc_code_frac_chars_top_3grams": 0.01640839, "qsc_code_frac_chars_top_4grams": 0.06927985, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01807229, "qsc_code_frac_chars_whitespace": 0.07777778, "qsc_code_size_file_byte": 1440.0, "qsc_code_num_lines": 10.0, "qsc_code_num_chars_line_max": 316.0, "qsc_code_num_chars_line_mean": 144.0, "qsc_code_frac_chars_alphabet": 0.80722892, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.14375, "qsc_code_frac_chars_long_word_length": 0.04166667, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.55277778, "qsc_codehtml_num_chars_text": 796.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 1, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1wilkens/rdm
docs/other_dms.md
# other_dms.md ## lightdm ### General - [Design](https://www.freedesktop.org/wiki/Software/LightDM/Design/L) - Provides DBUS service - Aquires seats via logind (DBUS) exclusively?! ### Hierarchy - main.c - display\_manager\_new - seat_start - seat\_real\_start - display\_server\_start ## SDDM ### General - Provides DBUS service ## Hierarchy - DaemonApp - SeatManager - Seat - Display - DisplayServer ## GDM ### General - [Wayland progress](https://wiki.gnome.org/Initiatives/Wayland/gdm) ### daemon/main.c - `main` - block sigusr1 - set locale? - parse options - check root - init logging - init settings - lookup user - names from settings - ensure dirs - sets up `/var/run/gdm`, `/var/log/gdm` - connects DBUS (`bus_reconnect`) - creates `g_main_loop` - SIGTERM, SIGINT -> `on_shutdown_signal_cb` - SIGHUP -> `on_sighup_cb` - runs main loop - < RUNNING > - shutdown settings - shutdown log ### daemon/main.c - `bus_reconnect` - get system bus - own name - `on_name_acquired` -> spin up manager object, set `show_local_greeter` and `xdmcp_enabled` and start the manager - `on_name_lost` -> cleanup manager instance and setup reconnect in 3 seconds ### daemon/gdm-manager.c - `gdm_manager_start` - if !xdmcp || show_local_greeter => gdm_display_factory_start ### daemon/gdm-display-factory.c - `gdm_display_factory_start` - TODO
1,404
other_dms
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.06060606, "qsc_doc_num_sentences": 14.0, "qsc_doc_num_words": 183, "qsc_doc_num_chars": 1404.0, "qsc_doc_num_lines": 73.0, "qsc_doc_mean_word_length": 5.12021858, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.55737705, "qsc_doc_entropy_unigram": 4.39470201, "qsc_doc_frac_words_all_caps": 0.04040404, "qsc_doc_frac_lines_dupe_lines": 0.09615385, "qsc_doc_frac_chars_dupe_lines": 0.06176701, "qsc_doc_frac_chars_top_2grams": 0.01600854, "qsc_doc_frac_chars_top_3grams": 0.05442903, "qsc_doc_frac_chars_top_4grams": 0.04695838, "qsc_doc_frac_chars_dupe_5grams": 0.0, "qsc_doc_frac_chars_dupe_6grams": 0.0, "qsc_doc_frac_chars_dupe_7grams": 0.0, "qsc_doc_frac_chars_dupe_8grams": 0.0, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 14.96590909, "qsc_doc_frac_chars_hyperlink_html_tag": 0.08475783, "qsc_doc_frac_chars_alphabet": 0.8123371, "qsc_doc_frac_chars_digital": 0.00173762, "qsc_doc_frac_chars_whitespace": 0.18019943, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1wilkens/rdm
data/login1.xml
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node> <!--interface name="org.freedesktop.DBus.Peer"> <method name="Ping"/> <method name="GetMachineId"> <arg type="s" name="machine_uuid" direction="out"/> </method> </interface> <interface name="org.freedesktop.DBus.Introspectable"> <method name="Introspect"> <arg name="data" type="s" direction="out"/> </method> </interface> <interface name="org.freedesktop.DBus.Properties"> <method name="Get"> <arg name="interface" direction="in" type="s"/> <arg name="property" direction="in" type="s"/> <arg name="value" direction="out" type="v"/> </method> <method name="GetAll"> <arg name="interface" direction="in" type="s"/> <arg name="properties" direction="out" type="a{sv}"/> </method> <method name="Set"> <arg name="interface" direction="in" type="s"/> <arg name="property" direction="in" type="s"/> <arg name="value" direction="in" type="v"/> </method> <signal name="PropertiesChanged"> <arg type="s" name="interface"/> <arg type="a{sv}" name="changed_properties"/> <arg type="as" name="invalidated_properties"/> </signal> </interface --> <interface name="org.freedesktop.login1.Manager"> <!--property name="EnableWallMessages" type="b" access="readwrite"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> </property> <property name="WallMessage" type="s" access="readwrite"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> </property> <property name="NAutoVTs" type="u" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="KillOnlyUsers" type="as" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="KillExcludeUsers" type="as" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="KillUserProcesses" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="RebootToFirmwareSetup" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="IdleHint" type="b" access="read"></property> <property name="IdleSinceHint" type="t" access="read"></property> <property name="IdleSinceHintMonotonic" type="t" access="read"></property> <property name="BlockInhibited" type="s" access="read"></property> <property name="DelayInhibited" type="s" access="read"></property> <property name="InhibitDelayMaxUSec" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="HandlePowerKey" type="s" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="HandleSuspendKey" type="s" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="HandleHibernateKey" type="s" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="HandleLidSwitch" type="s" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="HandleLidSwitchDocked" type="s" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="HoldoffTimeoutUSec" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="IdleAction" type="s" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="IdleActionUSec" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="PreparingForShutdown" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> </property> <property name="PreparingForSleep" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> </property> <property name="ScheduledShutdown" type="(st)" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> </property> <property name="Docked" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> </property> <property name="RemoveIPC" type="b" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="RuntimeDirectorySize" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="InhibitorsMax" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="NCurrentInhibitors" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> </property> <property name="SessionsMax" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="NCurrentSessions" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> </property> <property name="UserTasksMax" type="t" access="read"> <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <method name="GetSession"> <arg type="s" direction="in"/> <arg type="o" direction="out"/> </method> <method name="GetSessionByPID"> <arg type="u" direction="in"/> <arg type="o" direction="out"/> </method> <method name="GetUser"> <arg type="u" direction="in"/> <arg type="o" direction="out"/> </method> <method name="GetUserByPID"> <arg type="u" direction="in"/> <arg type="o" direction="out"/> </method> <method name="GetSeat"> <arg type="s" direction="in"/> <arg type="o" direction="out"/> </method> <method name="ListSessions"> <arg type="a(susso)" direction="out"/> </method> <method name="ListUsers"> <arg type="a(uso)" direction="out"/> </method --> <method name="ListSeats"> <arg type="a(so)" direction="out"/> </method> <!-- method name="ListInhibitors"> <arg type="a(ssssuu)" direction="out"/> </method> <!-- method name="CreateSession"> <arg type="u" direction="in"/> <arg type="u" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="u" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="b" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="a(sv)" direction="in"/> <arg type="s" direction="out"/> <arg type="o" direction="out"/> <arg type="s" direction="out"/> <arg type="h" direction="out"/> <arg type="u" direction="out"/> <arg type="s" direction="out"/> <arg type="u" direction="out"/> <arg type="b" direction="out"/> <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> </method> <method name="ReleaseSession"> <arg type="s" direction="in"/> <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> </method> <method name="ActivateSession"> <arg type="s" direction="in"/> </method> <method name="ActivateSessionOnSeat"> <arg type="s" direction="in"/> <arg type="s" direction="in"/> </method> <method name="LockSession"> <arg type="s" direction="in"/> </method> <method name="UnlockSession"> <arg type="s" direction="in"/> </method> <method name="LockSessions"></method> <method name="UnlockSessions"></method> <method name="KillSession"> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="i" direction="in"/> </method> <method name="KillUser"> <arg type="u" direction="in"/> <arg type="i" direction="in"/> </method> <method name="TerminateSession"> <arg type="s" direction="in"/> </method> <method name="TerminateUser"> <arg type="u" direction="in"/> </method> <method name="TerminateSeat"> <arg type="s" direction="in"/> </method> <method name="SetUserLinger"> <arg type="u" direction="in"/> <arg type="b" direction="in"/> <arg type="b" direction="in"/> </method> <method name="AttachDevice"> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="b" direction="in"/> </method> <method name="FlushDevices"> <arg type="b" direction="in"/> </method --> <method name="PowerOff"> <arg type="b" direction="in"/> </method> <method name="Reboot"> <arg type="b" direction="in"/> </method> <method name="Halt"> <arg type="b" direction="in"/> </method> <method name="Suspend"> <arg type="b" direction="in"/> </method> <method name="Hibernate"> <arg type="b" direction="in"/> </method> <method name="HybridSleep"> <arg type="b" direction="in"/> </method> <method name="CanPowerOff"> <arg type="s" direction="out"/> </method> <method name="CanReboot"> <arg type="s" direction="out"/> </method> <method name="CanHalt"> <arg type="s" direction="out"/> </method> <method name="CanSuspend"> <arg type="s" direction="out"/> </method> <method name="CanHibernate"> <arg type="s" direction="out"/> </method> <method name="CanHybridSleep"> <arg type="s" direction="out"/> </method> <!-- method name="ScheduleShutdown"> <arg type="s" direction="in"/> <arg type="t" direction="in"/> </method> <method name="CancelScheduledShutdown"> <arg type="b" direction="out"/> </method> <!-- method name="Inhibit"> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="s" direction="in"/> <arg type="h" direction="out"/> </method> <method name="CanRebootToFirmwareSetup"> <arg type="s" direction="out"/> </method> <!-- method name="SetRebootToFirmwareSetup"> <arg type="b" direction="in"/> </method> <!--method name="SetWallMessage"> <arg type="s" direction="in"/> <arg type="b" direction="in"/> </method> <signal name="SessionNew"> <arg type="s"/> <arg type="o"/> </signal> <signal name="SessionRemoved"> <arg type="s"/> <arg type="o"/> </signal> <signal name="UserNew"> <arg type="u"/> <arg type="o"/> </signal> <signal name="UserRemoved"> <arg type="u"/> <arg type="o"/> </signal --> <signal name="SeatNew"> <arg type="s"/> <arg type="o"/> </signal> <signal name="SeatRemoved"> <arg type="s"/> <arg type="o"/> </signal> <signal name="PrepareForShutdown"> <arg type="b"/> </signal> <signal name="PrepareForSleep"> <arg type="b"/> </signal> </interface> <node name="user"/> <node name="session"/> <node name="seat"/> </node>
13,984
login1
xml
en
xml
data
{"qsc_code_num_words": 1365, "qsc_code_num_chars": 13984.0, "qsc_code_mean_word_length": 5.64542125, "qsc_code_frac_words_unique": 0.11501832, "qsc_code_frac_chars_top_2grams": 0.08992992, "qsc_code_frac_chars_top_3grams": 0.04671684, "qsc_code_frac_chars_top_4grams": 0.08603685, "qsc_code_frac_chars_dupe_5grams": 0.7675837, "qsc_code_frac_chars_dupe_6grams": 0.71892032, "qsc_code_frac_chars_dupe_7grams": 0.71749286, "qsc_code_frac_chars_dupe_8grams": 0.68933299, "qsc_code_frac_chars_dupe_9grams": 0.59550999, "qsc_code_frac_chars_dupe_10grams": 0.53270179, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00088933, "qsc_code_frac_chars_whitespace": 0.27631579, "qsc_code_size_file_byte": 13984.0, "qsc_code_num_lines": 326.0, "qsc_code_num_chars_line_max": 96.0, "qsc_code_num_chars_line_mean": 42.89570552, "qsc_code_frac_chars_alphabet": 0.76057312, "qsc_code_frac_chars_comments": 0.85898169, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.56451613, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.19412063, "qsc_code_frac_chars_long_word_length": 0.01520527, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/УстановкаВнешнейКомпонентыНевозможна/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <Customizable>false</Customizable> <CommandBarLocation>Bottom</CommandBarLocation> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <HorizontalAlign>Right</HorizontalAlign> <Autofill>false</Autofill> <ChildItems> <Button name="ФормаПродолжитьПопыткуУстановки" id="102"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ПродолжитьПопыткуУстановки</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Продолжить попытку установки</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаПродолжитьПопыткуУстановкиРасширеннаяПодсказка" id="103"/> </Button> <Button name="Закрыть" id="100"> <Type>CommandBarButton</Type> <DefaultButton>true</DefaultButton> <CommandName>Form.StandardCommand.Close</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Закрыть</v8:content> </v8:item> </Title> <ExtendedTooltip name="ЗакрытьРасширеннаяПодсказка" id="101"/> </Button> </ChildItems> </AutoCommandBar> <Events> <Event name="OnOpen">ПриОткрытии</Event> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <UsualGroup name="Шапка" id="90"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Шапка</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>NormalSeparation</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ШапкаРасширеннаяПодсказка" id="91"/> <ChildItems> <PictureDecoration name="Предупреждение32" id="95"> <SkipOnInput>false</SkipOnInput> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предупреждение32</v8:content> </v8:item> </Title> <Picture> <xr:Ref>StdPicture.DialogExclamation</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="Предупреждение32КонтекстноеМеню" id="96"/> <ExtendedTooltip name="Предупреждение32РасширеннаяПодсказка" id="97"/> </PictureDecoration> <LabelDecoration name="ДекорацияПояснение" id="92"> <Width>40</Width> <HorizontalStretch>true</HorizontalStretch> <Font ref="style:NormalTextFont" kind="StyleItem" scale="100"/> <Title formatted="true"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>%1 Не предусмотрена работа внешней компоненты в клиентском приложении %2. Используйте &lt;link about:blank&gt;поддерживаемое клиентское приложение&lt;/&gt; или обратитесь к разработчику внешней компоненты.</v8:content> </v8:item> </Title> <ContextMenu name="ДекорацияПояснениеКонтекстноеМеню" id="93"/> <ExtendedTooltip name="ДекорацияПояснениеРасширеннаяПодсказка" id="94"/> <Events> <Event name="URLProcessing">ДекорацияПояснениеОбработкаНавигационнойСсылки</Event> </Events> </LabelDecoration> </ChildItems> </UsualGroup> </ChildItems> <Attributes/> <Commands> <Command name="ПродолжитьПопыткуУстановки" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Продолжить попытку установки</v8:content> </v8:item> </Title> <Action>ПродолжитьПопыткуУстановки</Action> </Command> </Commands> <Parameters> <Parameter name="ТекстПояснения"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <KeyParameter>true</KeyParameter> </Parameter> <Parameter name="ПоддерживаемыеКлиенты"> <Type/> <KeyParameter>true</KeyParameter> </Parameter> <Parameter name="ПослеОшибкиПодключения"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Parameter> </Parameters> </Form>
4,841
Form
xml
ru
xml
data
{"qsc_code_num_words": 561, "qsc_code_num_chars": 4841.0, "qsc_code_mean_word_length": 5.98573975, "qsc_code_frac_words_unique": 0.32442068, "qsc_code_frac_chars_top_2grams": 0.02680167, "qsc_code_frac_chars_top_3grams": 0.03573556, "qsc_code_frac_chars_top_4grams": 0.04466945, "qsc_code_frac_chars_dupe_5grams": 0.28082192, "qsc_code_frac_chars_dupe_6grams": 0.26295414, "qsc_code_frac_chars_dupe_7grams": 0.24806432, "qsc_code_frac_chars_dupe_8grams": 0.18493151, "qsc_code_frac_chars_dupe_9grams": 0.13549732, "qsc_code_frac_chars_dupe_10grams": 0.07444908, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0404473, "qsc_code_frac_chars_whitespace": 0.13179095, "qsc_code_size_file_byte": 4841.0, "qsc_code_num_lines": 125.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 38.728, "qsc_code_frac_chars_alphabet": 0.7582679, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.43089431, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.25015493, "qsc_code_frac_chars_long_word_length": 0.07043999, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java
package com.ruoyi.framework.shiro.session; import javax.servlet.http.HttpServletRequest; import org.apache.shiro.session.Session; import org.apache.shiro.session.mgt.SessionContext; import org.apache.shiro.session.mgt.SessionFactory; import org.apache.shiro.web.session.mgt.WebSessionContext; import org.springframework.stereotype.Component; import com.ruoyi.common.utils.IpUtils; import com.ruoyi.common.utils.ServletUtils; import eu.bitwalker.useragentutils.UserAgent; /** * 自定义sessionFactory会话 * * @author ruoyi */ @Component public class OnlineSessionFactory implements SessionFactory { @Override public Session createSession(SessionContext initData) { OnlineSession session = new OnlineSession(); if (initData != null && initData instanceof WebSessionContext) { WebSessionContext sessionContext = (WebSessionContext) initData; HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest(); if (request != null) { UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); // 获取客户端操作系统 String os = userAgent.getOperatingSystem().getName(); // 获取客户端浏览器 String browser = userAgent.getBrowser().getName(); session.setHost(IpUtils.getIpAddr(request)); session.setBrowser(browser); session.setOs(os); } } return session; } }
1,544
OnlineSessionFactory
java
en
java
code
{"qsc_code_num_words": 132, "qsc_code_num_chars": 1544.0, "qsc_code_mean_word_length": 7.96212121, "qsc_code_frac_words_unique": 0.47727273, "qsc_code_frac_chars_top_2grams": 0.04281637, "qsc_code_frac_chars_top_3grams": 0.05708849, "qsc_code_frac_chars_top_4grams": 0.07611798, "qsc_code_frac_chars_dupe_5grams": 0.13035205, "qsc_code_frac_chars_dupe_6grams": 0.05708849, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0, "qsc_code_frac_chars_whitespace": 0.22409326, "qsc_code_size_file_byte": 1544.0, "qsc_code_num_lines": 43.0, "qsc_code_num_chars_line_max": 121.0, "qsc_code_num_chars_line_mean": 35.90697674, "qsc_code_frac_chars_alphabet": 0.87729549, "qsc_code_frac_chars_comments": 0.04792746, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00680272, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.02941176, "qsc_codejava_score_lines_no_logic": 0.35294118, "qsc_codejava_frac_words_no_modifier": 0.5, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java
package com.ruoyi.framework.shiro.realm; import java.util.HashSet; import java.util.Set; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.ExcessiveAttemptsException; import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.LockedAccountException; import org.apache.shiro.authc.SimpleAuthenticationInfo; import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.authz.SimpleAuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import com.ruoyi.common.exception.user.CaptchaException; import com.ruoyi.common.exception.user.RoleBlockedException; import com.ruoyi.common.exception.user.UserBlockedException; import com.ruoyi.common.exception.user.UserNotExistsException; import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.exception.user.UserPasswordRetryLimitExceedException; import com.ruoyi.framework.shiro.service.SysLoginService; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysUser; import com.ruoyi.system.service.ISysMenuService; import com.ruoyi.system.service.ISysRoleService; /** * 自定义Realm 处理登录 权限 * * @author ruoyi */ public class UserRealm extends AuthorizingRealm { private static final Logger log = LoggerFactory.getLogger(UserRealm.class); @Autowired private ISysMenuService menuService; @Autowired private ISysRoleService roleService; @Autowired private SysLoginService loginService; /** * 授权 */ @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection arg0) { SysUser user = ShiroUtils.getSysUser(); // 角色列表 Set<String> roles = new HashSet<String>(); // 功能列表 Set<String> menus = new HashSet<String>(); SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); // 管理员拥有所有权限 if (user.isAdmin()) { info.addRole("admin"); info.addStringPermission("*:*:*"); } else { roles = roleService.selectRoleKeys(user.getUserId()); menus = menuService.selectPermsByUserId(user.getUserId()); // 角色加入AuthorizationInfo认证对象 info.setRoles(roles); // 权限加入AuthorizationInfo认证对象 info.setStringPermissions(menus); } return info; } /** * 登录认证 */ @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { UsernamePasswordToken upToken = (UsernamePasswordToken) token; String username = upToken.getUsername(); String password = ""; if (upToken.getPassword() != null) { password = new String(upToken.getPassword()); } SysUser user = null; try { user = loginService.login(username, password); } catch (CaptchaException e) { throw new AuthenticationException(e.getMessage(), e); } catch (UserNotExistsException e) { throw new UnknownAccountException(e.getMessage(), e); } catch (UserPasswordNotMatchException e) { throw new IncorrectCredentialsException(e.getMessage(), e); } catch (UserPasswordRetryLimitExceedException e) { throw new ExcessiveAttemptsException(e.getMessage(), e); } catch (UserBlockedException e) { throw new LockedAccountException(e.getMessage(), e); } catch (RoleBlockedException e) { throw new LockedAccountException(e.getMessage(), e); } catch (Exception e) { log.info("对用户[" + username + "]进行登录验证..验证未通过{}", e.getMessage()); throw new AuthenticationException(e.getMessage(), e); } SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(user, password, getName()); return info; } /** * 清理缓存权限 */ public void clearCachedAuthorizationInfo() { this.clearCachedAuthorizationInfo(SecurityUtils.getSubject().getPrincipals()); } }
4,651
UserRealm
java
en
java
code
{"qsc_code_num_words": 401, "qsc_code_num_chars": 4651.0, "qsc_code_mean_word_length": 7.93266833, "qsc_code_frac_words_unique": 0.3117207, "qsc_code_frac_chars_top_2grams": 0.04809808, "qsc_code_frac_chars_top_3grams": 0.06601698, "qsc_code_frac_chars_top_4grams": 0.08802263, "qsc_code_frac_chars_dupe_5grams": 0.22288588, "qsc_code_frac_chars_dupe_6grams": 0.11945929, "qsc_code_frac_chars_dupe_7grams": 0.03017919, "qsc_code_frac_chars_dupe_8grams": 0.03017919, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00082622, "qsc_code_frac_chars_whitespace": 0.21930768, "qsc_code_size_file_byte": 4651.0, "qsc_code_num_lines": 141.0, "qsc_code_num_chars_line_max": 115.0, "qsc_code_num_chars_line_mean": 32.9858156, "qsc_code_frac_chars_alphabet": 0.87524098, "qsc_code_frac_chars_comments": 0.0427865, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.09734513, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00673854, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.02654867, "qsc_codejava_score_lines_no_logic": 0.34513274, "qsc_codejava_frac_words_no_modifier": 0.75, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/УстановкаВнешнейКомпонентыНевозможна/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Элементы.ФормаПродолжитьПопыткуУстановки.Видимость = Не Параметры.ПослеОшибкиПодключения; КонецПроцедуры &НаКлиенте Процедура ПриОткрытии(Отказ) Элементы.ДекорацияПояснение.Заголовок = ВнешниеКомпонентыСлужебныйКлиент.ТекстУстановкаВнешнейКомпонентыНевозможна( Параметры.ТекстПояснения); КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовШапкиФормы &НаКлиенте Процедура ДекорацияПояснениеОбработкаНавигационнойСсылки(Элемент, НавигационнаяСсылкаФорматированнойСтроки, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; ПараметрыФормы = Новый Структура; ПараметрыФормы.Вставить("ПоддерживаемыеКлиенты", Параметры.ПоддерживаемыеКлиенты); ОткрытьФорму("ОбщаяФорма.ПоддерживаемыеКлиентскиеПриложения", ПараметрыФормы); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура ПродолжитьПопыткуУстановки(Команда) Закрыть(Истина); КонецПроцедуры #КонецОбласти
1,541
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 103, "qsc_code_num_chars": 1541.0, "qsc_code_mean_word_length": 10.90291262, "qsc_code_frac_words_unique": 0.73786408, "qsc_code_frac_chars_top_2grams": 0.00534283, "qsc_code_frac_chars_top_3grams": 0.00712378, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00777935, "qsc_code_frac_chars_whitespace": 0.08241402, "qsc_code_size_file_byte": 1541.0, "qsc_code_num_lines": 54.0, "qsc_code_num_chars_line_max": 130.0, "qsc_code_num_chars_line_mean": 28.53703704, "qsc_code_frac_chars_alphabet": 0.78571429, "qsc_code_frac_chars_comments": 0.93186243, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1wilkens/rdm
rdm-greeter/src/ui.rs
use std::cell::RefCell; use std::path::{Path, PathBuf}; use std::rc::Rc; use gdk::keys; use gdk_pixbuf::Pixbuf; use gtk::prelude::*; use gtk::{Builder, Entry, Image, Window}; use slog::Logger; use rdmcommon::util; use rdmgreeter::RdmGreeter; use crate::constants::*; // Regarding Rc/RefCell see: https://stackoverflow.com/a/31967816 pub struct Ui { window: Window, background: Image, user: Entry, secret: Entry, greeter: RefCell<RdmGreeter>, log: Logger, } #[allow(clippy::expect_fun_call)] impl Ui { pub fn from_theme<T: AsRef<Path>>(theme_name: T, greeter: RdmGreeter) -> Rc<Self> { let theme_path = get_theme_path(theme_name, false); let mut theme_file = theme_path.clone(); theme_file.push(THEME_MAIN_FILE_NAME); theme_file.set_extension(THEME_MAIN_FILE_EXT); let mut bg_file = theme_path; bg_file.push(THEME_BACKGROUND_NAME); bg_file.set_extension(THEME_BACKGROUND_EXT); let b = Builder::from_file(theme_file.to_str().unwrap()); let window: Window = b .object(THEME_COMPONENT_WINDOW) .expect("[ui]: Failed to get main window from theme!"); let background: Image = b .object(THEME_COMPONENT_BG) .expect("[ui]: Failed to get background image from theme!"); let user: Entry = b .object(THEME_COMPONENT_USER) .expect("[ui]: Failed to get user entry from theme!"); let secret: Entry = b .object(THEME_COMPONENT_SECRET) .expect("[ui]: Failed to get secret entry from theme!"); // fit to screen dimensions //let (width, heigth) = (Screen::width(), Screen::height()); //w.set_default_size(width, heigth); //let pb = Pixbuf::from_file_at_scale(bg_file.to_str().unwrap(), width, heigth, false) let pb = Pixbuf::from_file(bg_file.to_str().unwrap()) .expect(&format!("[ui]: Failed to get background image pixbuf: {:?}", bg_file)); background.set_from_pixbuf(Some(&pb)); let instance = Rc::new(Ui { window, background, user, secret, greeter: RefCell::from(greeter), log: util::plain_logger(), }); { let secret = instance.secret.clone(); instance.user.connect_key_release_event(move |_, e| { let val = (*e).keyval(); if val == keys::constants::ISO_Enter { secret.grab_focus(); } Inhibit(true) }); } { let _i = instance.clone(); let user = instance.user.clone(); let secret = instance.secret.clone(); instance.secret.connect_key_release_event(move |_, e| { let val = (*e).keyval(); if val == keys::constants::ISO_Enter { let _user = user.text(); let _password = secret.text(); // TODO: use librdmgreeter to talk to daemon to authenticate /*i.greeter.borrow_mut().request_authentication(&user, &password);*/ } Inhibit(true) }); } instance } pub fn show(&self) { info!(self.log, "[ui]: Showing window"); self.window.show_all(); } } /*fn start_session(name: &str) { use users::os::unix::UserExt; use std::os::unix::io::AsRawFd; use std::os::unix::io::FromRawFd; use std::os::unix::process::CommandExt; info!("[ui]: Starting session"); // Setup variables let user = ::users::get_user_by_name(name) .expect(&format!("[ui]: Could not get user by name: {}!", name)); let dir = user.home_dir(); let shell = user.shell() .to_str() .expect("[ui]: Shell was not valid unicode!"); let args = format!("exec {} --login .xinitrc", shell); // Need these later in `before_exec` to setup supplimentary groups let name_c = CString::new(name).unwrap(); let uid = user.uid(); let gid = user.primary_group_id(); // Open session log file for stderr // // Currently we mirror sddm's behaviour which discards session's stdout // and redirects stderr to a log file in the home directory let stderr = File::create(format!("{}/{}", dir.to_str().unwrap(), DEFAULT_SESSION_LOG_FILE)) .map(|f| { info!("[ui]: Redirecting session's stderr to {:?}", f); unsafe { Stdio::from_raw_fd(f.as_raw_fd()) } }) .unwrap_or_else(|_| { info!("[ui]: Failed to create session log file, falling back to inherit.."); Stdio::inherit() }); // Start session loading .xinitrc info!("[ui]: Starting session"); info!("[ui]: Session command '{} -c {}'", shell, args); /*let mut child = */ Command::new(shell) // Arguments .arg("-c") .arg(args) // Process setup .current_dir(dir) // TODO: Figure out why these are set / how to properly handle them .env_remove("INVOCATION_ID") .env_remove("JOURNAL_STREAM") // Cannot use this as it does not add supplimentary groups //.uid(user.uid()) .gid(gid) .before_exec(move || { // This sets the supplimentary groups for the session if unsafe { initgroups(name_c.as_ptr(), gid) } != 0 { error!("[ui:session] initgroups returned non-zero!"); Err(Error::last_os_error()) } else if unsafe { setuid(uid) } != 0 { error!("[ui:session] setuid returned non-zero!"); Err(Error::last_os_error()) } else { Ok(()) } }) // Output redirection .stdout(Stdio::null()) .stderr(stderr) .spawn() .unwrap_or_else(|e| panic!("[ui]: Failed to start session: {}!", e)); info!("[ui]: Spawned session process & waiting for result"); //TODO: Waiting for the child causes an "invisible window" in i3.. Investigate further //let result = child.wait() // .unwrap_or_else(|e| panic!("[ui]: Failed to join session thread: {:?}!", e)); //info!("[ui]: Session exited with return code: {}", result); }*/ fn get_theme_path<T: AsRef<Path>>(theme_name: T, default: bool) -> PathBuf { let mut theme_path = PathBuf::new(); theme_path.push(THEME_BASE_PATH); theme_path.push(theme_name); if theme_path.is_dir() { theme_path } else if !default { get_theme_path(THEME_NAME_DEFAULT, true) } else { panic!("[ui]: Could not load default configuration!") } }
6,292
ui
rs
en
rust
code
{"qsc_code_num_words": 811, "qsc_code_num_chars": 6292.0, "qsc_code_mean_word_length": 4.53390875, "qsc_code_frac_words_unique": 0.30826141, "qsc_code_frac_chars_top_2grams": 0.02692412, "qsc_code_frac_chars_top_3grams": 0.02175687, "qsc_code_frac_chars_top_4grams": 0.01767745, "qsc_code_frac_chars_dupe_5grams": 0.19662769, "qsc_code_frac_chars_dupe_6grams": 0.11748708, "qsc_code_frac_chars_dupe_7grams": 0.07179766, "qsc_code_frac_chars_dupe_8grams": 0.07179766, "qsc_code_frac_chars_dupe_9grams": 0.05656785, "qsc_code_frac_chars_dupe_10grams": 0.03589883, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00230753, "qsc_code_frac_chars_whitespace": 0.24237127, "qsc_code_size_file_byte": 6292.0, "qsc_code_num_lines": 206.0, "qsc_code_num_chars_line_max": 95.0, "qsc_code_num_chars_line_mean": 30.54368932, "qsc_code_frac_chars_alphabet": 0.76903713, "qsc_code_frac_chars_comments": 0.46106167, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.11578947, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0852256, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.01456311, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 1, "qsc_code_frac_lines_assert": 0}
1wilkens/rdm
rdm-greeter/src/main.rs
#[macro_use] extern crate slog; #[allow(dead_code)] mod constants; mod ui; use std::{io::stdin, rc::Rc, sync::Mutex}; use slog::{Drain, Logger}; use slog_async::Async; use slog_term::{FullFormat, TermDecorator}; fn setup_logger() -> Logger { let decor = TermDecorator::new().build(); let drain = FullFormat::new(decor).build().fuse(); let drain = Async::new(drain).build().fuse(); let log = Logger::root(drain, o!()); debug!(&log, "[setup_logger] Initialized logging"); log } #[tokio::main] async fn main() { let log = setup_logger(); let _greeter = rdmgreeter::RdmGreeter::new(log.clone()) .await .expect("Failed to get greeter"); debug!(&log, "[main] Got greeter! Press any key to to continue"); let mut res = String::new(); let _c = stdin().read_line(&mut res); return; // Init gtk (::gtk::init()).expect("Failed to initialize gtk"); // Setup the Ui /*let mut ui = ui::Ui::from_theme(constants::THEME_NAME_DEFAULT, greeter); ui.show();*/ // Start gtk event loop ::gtk::main(); }
1,083
main
rs
en
rust
code
{"qsc_code_num_words": 147, "qsc_code_num_chars": 1083.0, "qsc_code_mean_word_length": 4.46258503, "qsc_code_frac_words_unique": 0.47619048, "qsc_code_frac_chars_top_2grams": 0.0320122, "qsc_code_frac_chars_top_3grams": 0.03658537, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0, "qsc_code_frac_chars_whitespace": 0.19759926, "qsc_code_size_file_byte": 1083.0, "qsc_code_num_lines": 44.0, "qsc_code_num_chars_line_max": 79.0, "qsc_code_num_chars_line_mean": 24.61363636, "qsc_code_frac_chars_alphabet": 0.75489068, "qsc_code_frac_chars_comments": 0.13204063, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.13510638, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
package com.ruoyi.framework.interceptor; import java.lang.reflect.Method; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import com.ruoyi.common.annotation.RepeatSubmit; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.json.JSON; import com.ruoyi.common.utils.ServletUtils; /** * 防止重复提交拦截器 * * @author ruoyi */ @Component public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (handler instanceof HandlerMethod) { HandlerMethod handlerMethod = (HandlerMethod) handler; Method method = handlerMethod.getMethod(); RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); if (annotation != null) { if (this.isRepeatSubmit(request)) { AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试"); ServletUtils.renderString(response, JSON.marshal(ajaxResult)); return false; } } return true; } else { return super.preHandle(request, response, handler); } } /** * 验证是否重复提交由子类实现具体的防重复提交的规则 * * @param request * @return * @throws Exception */ public abstract boolean isRepeatSubmit(HttpServletRequest request) throws Exception; }
1,748
RepeatSubmitInterceptor
java
en
java
code
{"qsc_code_num_words": 147, "qsc_code_num_chars": 1748.0, "qsc_code_mean_word_length": 7.95918367, "qsc_code_frac_words_unique": 0.44897959, "qsc_code_frac_chars_top_2grams": 0.03418803, "qsc_code_frac_chars_top_3grams": 0.04786325, "qsc_code_frac_chars_top_4grams": 0.06837607, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0, "qsc_code_frac_chars_whitespace": 0.24771167, "qsc_code_size_file_byte": 1748.0, "qsc_code_num_lines": 55.0, "qsc_code_num_chars_line_max": 120.0, "qsc_code_num_chars_line_mean": 31.78181818, "qsc_code_frac_chars_alphabet": 0.88973384, "qsc_code_frac_chars_comments": 0.08810069, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00815558, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.025, "qsc_codejava_score_lines_no_logic": 0.35, "qsc_codejava_frac_words_no_modifier": 0.5, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ПустойРабочийСтол/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Элементы.Надпись.Заголовок = СтроковыеФункции.ФорматированнаяСтрока( СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Вход в информационную базу был выполнен в целях автоматического тестирования |с параметром запуска <b>%1</b>. | |Работа пользователей в этом режиме настоятельно не рекомендуется, |так как это приведет к рассогласованию или потере данных.'"), "ОтключитьЛогикуНачалаРаботыСистемы")); КонецПроцедуры &НаКлиенте Процедура ПриОткрытии(Отказ) Если Не СтандартныеПодсистемыКлиент.ОтключенаЛогикаНачалаРаботыСистемы() Тогда Возврат; КонецЕсли; Элементы.ТестовыйРежим.Видимость = Истина; ЗаголовокТестовогоРежима = "{" + НСтр("ru = 'Тестирование'") + "} "; ТекущийЗаголовок = КлиентскоеПриложение.ПолучитьЗаголовок(); Если СтрНачинаетсяС(ТекущийЗаголовок, ЗаголовокТестовогоРежима) Тогда Возврат; КонецЕсли; КлиентскоеПриложение.УстановитьЗаголовок(ЗаголовокТестовогоРежима + ТекущийЗаголовок); ЗарегистрироватьОтключениеЛогикиНачалаРаботыСистемы(); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервереБезКонтекста Процедура ЗарегистрироватьОтключениеЛогикиНачалаРаботыСистемы() Если Не ОбщегоНазначения.ДоступноИспользованиеРазделенныхДанных() Тогда Возврат; КонецЕсли; УстановитьПривилегированныйРежим(Истина); ВладелецДанных = Справочники.ИдентификаторыОбъектовМетаданных.ПолучитьСсылку( Новый УникальныйИдентификатор("627a6fb8-872a-11e3-bb87-005056c00008")); // Константы. ДатыОтключения = ОбщегоНазначения.ПрочитатьДанныеИзБезопасногоХранилища(ВладелецДанных); // Массив Если ТипЗнч(ДатыОтключения) <> Тип("Массив") Тогда ДатыОтключения = Новый Массив; КонецЕсли; ДатыОтключения.Добавить(ТекущаяДатаСеанса()); ОбщегоНазначения.ЗаписатьДанныеВБезопасноеХранилище(ВладелецДанных, ДатыОтключения); КонецПроцедуры #КонецОбласти
2,518
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 179, "qsc_code_num_chars": 2518.0, "qsc_code_mean_word_length": 10.31843575, "qsc_code_frac_words_unique": 0.70949721, "qsc_code_frac_chars_top_2grams": 0.00324851, "qsc_code_frac_chars_top_3grams": 0.03410937, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01616524, "qsc_code_frac_chars_whitespace": 0.11556791, "qsc_code_size_file_byte": 2518.0, "qsc_code_num_lines": 73.0, "qsc_code_num_chars_line_max": 105.0, "qsc_code_num_chars_line_mean": 34.49315068, "qsc_code_frac_chars_alphabet": 0.81275258, "qsc_code_frac_chars_comments": 0.95830024, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
package com.ruoyi.framework.aspectj; import java.lang.reflect.Method; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.stereotype.Component; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysRole; import com.ruoyi.system.domain.SysUser; /** * 数据过滤处理 * * @author ruoyi */ @Aspect @Component public class DataScopeAspect { /** * 全部数据权限 */ public static final String DATA_SCOPE_ALL = "1"; /** * 自定数据权限 */ public static final String DATA_SCOPE_CUSTOM = "2"; /** * 部门数据权限 */ public static final String DATA_SCOPE_DEPT = "3"; /** * 部门及以下数据权限 */ public static final String DATA_SCOPE_DEPT_AND_CHILD = "4"; /** * 仅本人数据权限 */ public static final String DATA_SCOPE_SELF = "5"; /** * 数据权限过滤关键字 */ public static final String DATA_SCOPE = "dataScope"; // 配置织入点 @Pointcut("@annotation(com.ruoyi.common.annotation.DataScope)") public void dataScopePointCut() { } @Before("dataScopePointCut()") public void doBefore(JoinPoint point) throws Throwable { handleDataScope(point); } protected void handleDataScope(final JoinPoint joinPoint) { // 获得注解 DataScope controllerDataScope = getAnnotationLog(joinPoint); if (controllerDataScope == null) { return; } // 获取当前的用户 SysUser currentUser = ShiroUtils.getSysUser(); if (currentUser != null) { // 如果是超级管理员,则不过滤数据 if (!currentUser.isAdmin()) { dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias()); } } } /** * 数据范围过滤 * * @param joinPoint 切点 * @param user 用户 * @param deptAlias 部门别名 * @param userAlias 用户别名 */ public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) { StringBuilder sqlString = new StringBuilder(); for (SysRole role : user.getRoles()) { String dataScope = role.getDataScope(); if (DATA_SCOPE_ALL.equals(dataScope)) { sqlString = new StringBuilder(); break; } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { sqlString.append(StringUtils.format( " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId())); } else if (DATA_SCOPE_DEPT.equals(dataScope)) { sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId())); } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { sqlString.append(StringUtils.format( " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, user.getDeptId(), user.getDeptId())); } else if (DATA_SCOPE_SELF.equals(dataScope)) { if (StringUtils.isNotBlank(userAlias)) { sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId())); } else { // 数据权限为仅本人且没有userAlias别名不查询任何数据 sqlString.append(" OR 1=0 "); } } } if (StringUtils.isNotBlank(sqlString.toString())) { BaseEntity baseEntity = (BaseEntity) joinPoint.getArgs()[0]; baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")"); } } /** * 是否存在注解,如果存在就获取 */ private DataScope getAnnotationLog(JoinPoint joinPoint) { Signature signature = joinPoint.getSignature(); MethodSignature methodSignature = (MethodSignature) signature; Method method = methodSignature.getMethod(); if (method != null) { return method.getAnnotation(DataScope.class); } return null; } }
4,675
DataScopeAspect
java
zh
java
code
{"qsc_code_num_words": 464, "qsc_code_num_chars": 4675.0, "qsc_code_mean_word_length": 5.7262931, "qsc_code_frac_words_unique": 0.32112069, "qsc_code_frac_chars_top_2grams": 0.04064735, "qsc_code_frac_chars_top_3grams": 0.03613097, "qsc_code_frac_chars_top_4grams": 0.04516372, "qsc_code_frac_chars_dupe_5grams": 0.28754234, "qsc_code_frac_chars_dupe_6grams": 0.18178397, "qsc_code_frac_chars_dupe_7grams": 0.14866391, "qsc_code_frac_chars_dupe_8grams": 0.14866391, "qsc_code_frac_chars_dupe_9grams": 0.10801656, "qsc_code_frac_chars_dupe_10grams": 0.05720738, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00282132, "qsc_code_frac_chars_whitespace": 0.31764706, "qsc_code_size_file_byte": 4675.0, "qsc_code_num_lines": 162.0, "qsc_code_num_chars_line_max": 130.0, "qsc_code_num_chars_line_mean": 28.85802469, "qsc_code_frac_chars_alphabet": 0.83009404, "qsc_code_frac_chars_comments": 0.09475936, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.01851852, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01851852, "qsc_code_frac_chars_string_length": 0.07443289, "qsc_code_frac_chars_long_word_length": 0.01181474, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.0462963, "qsc_codejava_score_lines_no_logic": 0.2037037, "qsc_codejava_frac_words_no_modifier": 0.83333333, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/Вопрос/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <EnterKeyBehavior>DefaultButton</EnterKeyBehavior> <AutoTitle>false</AutoTitle> <AutoURL>false</AutoURL> <AutoFillCheck>false</AutoFillCheck> <Customizable>false</Customizable> <CommandBarLocation>Bottom</CommandBarLocation> <CommandSet> <ExcludedCommand>Abort</ExcludedCommand> <ExcludedCommand>Cancel</ExcludedCommand> <ExcludedCommand>Help</ExcludedCommand> <ExcludedCommand>Ignore</ExcludedCommand> <ExcludedCommand>No</ExcludedCommand> <ExcludedCommand>OK</ExcludedCommand> <ExcludedCommand>RestoreValues</ExcludedCommand> <ExcludedCommand>Retry</ExcludedCommand> <ExcludedCommand>SaveValues</ExcludedCommand> <ExcludedCommand>Yes</ExcludedCommand> </CommandSet> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <HorizontalAlign>Right</HorizontalAlign> <Autofill>false</Autofill> </AutoCommandBar> <Events> <Event name="OnOpen">ПриОткрытии</Event> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <UsualGroup name="Колонки" id="15"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Колонки</v8:content> </v8:item> </Title> <Group>AlwaysHorizontal</Group> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="КолонкиРасширеннаяПодсказка" id="17"/> <ChildItems> <PictureDecoration name="Предупреждение" id="5" DisplayImportance="VeryHigh"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предупреждение</v8:content> </v8:item> </Title> <Picture> <xr:Ref>StdPicture.DialogQuestion</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="ПредупреждениеКонтекстноеМеню" id="6"/> <ExtendedTooltip name="ПредупреждениеРасширеннаяПодсказка" id="18"/> </PictureDecoration> <UsualGroup name="Строки" id="16" DisplayImportance="VeryHigh"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Строки</v8:content> </v8:item> </Title> <Width>35</Width> <Group>Vertical</Group> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="СтрокиРасширеннаяПодсказка" id="19"/> <ChildItems> <UsualGroup name="ТекстСообщенияФорматированнаяСтрокаГруппа" id="26"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Текст сообщения форматированная строка (группа)</v8:content> </v8:item> </Title> <Representation>NormalSeparation</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ТекстСообщенияФорматированнаяСтрокаГруппаРасширеннаяПодсказка" id="27"/> <ChildItems> <LabelDecoration name="ТекстСообщенияФорматированнаяСтрока" id="23"> <Visible>false</Visible> <AutoMaxWidth>false</AutoMaxWidth> <AutoMaxHeight>false</AutoMaxHeight> <Title formatted="true"/> <ContextMenu name="ТекстСообщенияФорматированнаяСтрокаКонтекстноеМеню" id="24"/> <ExtendedTooltip name="ТекстСообщенияФорматированнаяСтрокаРасширеннаяПодсказка" id="25"/> </LabelDecoration> </ChildItems> </UsualGroup> <InputField name="МногострочныйТекстСообщения" id="10"> <DataPath>ТекстСообщения</DataPath> <ReadOnly>true</ReadOnly> <SkipOnInput>true</SkipOnInput> <TitleLocation>None</TitleLocation> <AutoMaxWidth>false</AutoMaxWidth> <VerticalStretch>true</VerticalStretch> <MultiLine>true</MultiLine> <BorderColor>style:FormBackColor</BorderColor> <ContextMenu name="МногострочныйТекстСообщенияКонтекстноеМеню" id="11"/> <ExtendedTooltip name="МногострочныйТекстСообщенияРасширеннаяПодсказка" id="21"/> </InputField> <CheckBoxField name="БольшеНеЗадаватьЭтотВопрос" id="3"> <DataPath>БольшеНеЗадаватьЭтотВопрос</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Больше не задавать этот вопрос</v8:content> </v8:item> </Title> <TitleLocation>Right</TitleLocation> <CheckBoxType>Auto</CheckBoxType> <ContextMenu name="БольшеНеЗадаватьЭтотВопросКонтекстноеМеню" id="4"/> <ExtendedTooltip name="БольшеНеЗадаватьЭтотВопросРасширеннаяПодсказка" id="22"/> </CheckBoxField> </ChildItems> </UsualGroup> </ChildItems> </UsualGroup> </ChildItems> <Attributes> <Attribute name="СоответствиеКнопокИВозвращаемыхЗначений" id="1"> <Type/> </Attribute> <Attribute name="БольшеНеЗадаватьЭтотВопрос" id="3"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Больше не задавать этот вопрос</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="ОжиданиеСчетчик" id="4"> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>5</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Nonnegative</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Attribute> <Attribute name="ОжиданиеИмяКнопки" id="5"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ОжиданиеЗаголовокКнопки" id="6"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ТекстСообщения" id="2"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> </Attributes> <Parameters> <Parameter name="Заголовок"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> <Parameter name="Кнопки"> <Type> <v8:Type>v8:ValueListType</v8:Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <KeyParameter>true</KeyParameter> </Parameter> <Parameter name="ТекстСообщения"> <Type> <v8:Type>v8ui:FormattedString</v8:Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> <Parameter name="Таймаут"> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>5</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Nonnegative</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Parameter> <Parameter name="КнопкаПоУмолчанию"> <Type/> </Parameter> <Parameter name="КнопкаТаймаута"> <Type/> </Parameter> <Parameter name="ПредлагатьБольшеНеЗадаватьЭтотВопрос"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Parameter> <Parameter name="ТекстФлажка"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> <Parameter name="БлокироватьВесьИнтерфейс"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Parameter> <Parameter name="Картинка"> <Type> <v8:Type>v8ui:Picture</v8:Type> </Type> </Parameter> </Parameters> </Form>
8,855
Form
xml
ru
xml
data
{"qsc_code_num_words": 925, "qsc_code_num_chars": 8855.0, "qsc_code_mean_word_length": 6.51891892, "qsc_code_frac_words_unique": 0.23459459, "qsc_code_frac_chars_top_2grams": 0.02985075, "qsc_code_frac_chars_top_3grams": 0.0199005, "qsc_code_frac_chars_top_4grams": 0.02487562, "qsc_code_frac_chars_dupe_5grams": 0.40248756, "qsc_code_frac_chars_dupe_6grams": 0.38922056, "qsc_code_frac_chars_dupe_7grams": 0.37164179, "qsc_code_frac_chars_dupe_8grams": 0.36401327, "qsc_code_frac_chars_dupe_9grams": 0.33167496, "qsc_code_frac_chars_dupe_10grams": 0.30248756, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03428495, "qsc_code_frac_chars_whitespace": 0.15347261, "qsc_code_size_file_byte": 8855.0, "qsc_code_num_lines": 249.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 35.562249, "qsc_code_frac_chars_alphabet": 0.77001067, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.58634538, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.19017504, "qsc_code_frac_chars_long_word_length": 0.08300395, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
package com.ruoyi.framework.aspectj; import java.lang.reflect.Method; import java.util.Map; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessStatus; import com.ruoyi.common.json.JSON; import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysOperLog; import com.ruoyi.system.domain.SysUser; /** * 操作日志记录处理 * * @author ruoyi */ @Aspect @Component public class LogAspect { private static final Logger log = LoggerFactory.getLogger(LogAspect.class); // 配置织入点 @Pointcut("@annotation(com.ruoyi.common.annotation.Log)") public void logPointCut() { } /** * 处理完请求后执行 * * @param joinPoint 切点 */ @AfterReturning(pointcut = "logPointCut()", returning = "jsonResult") public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) { handleLog(joinPoint, null, jsonResult); } /** * 拦截异常操作 * * @param joinPoint 切点 * @param e 异常 */ @AfterThrowing(value = "logPointCut()", throwing = "e") public void doAfterThrowing(JoinPoint joinPoint, Exception e) { handleLog(joinPoint, e, null); } protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult) { try { // 获得注解 Log controllerLog = getAnnotationLog(joinPoint); if (controllerLog == null) { return; } // 获取当前的用户 SysUser currentUser = ShiroUtils.getSysUser(); // *========数据库日志=========*// SysOperLog operLog = new SysOperLog(); operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); // 请求的地址 String ip = ShiroUtils.getIp(); operLog.setOperIp(ip); // 返回参数 operLog.setJsonResult(JSON.marshal(jsonResult)); operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); if (currentUser != null) { operLog.setOperName(currentUser.getLoginName()); if (StringUtils.isNotNull(currentUser.getDept()) && StringUtils.isNotEmpty(currentUser.getDept().getDeptName())) { operLog.setDeptName(currentUser.getDept().getDeptName()); } } if (e != null) { operLog.setStatus(BusinessStatus.FAIL.ordinal()); operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); } // 设置方法名称 String className = joinPoint.getTarget().getClass().getName(); String methodName = joinPoint.getSignature().getName(); operLog.setMethod(className + "." + methodName + "()"); // 设置请求方式 operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); // 处理设置注解上的参数 getControllerMethodDescription(controllerLog, operLog); // 保存数据库 AsyncManager.me().execute(AsyncFactory.recordOper(operLog)); } catch (Exception exp) { // 记录本地异常日志 log.error("==前置通知异常=="); log.error("异常信息:{}", exp.getMessage()); exp.printStackTrace(); } } /** * 获取注解中对方法的描述信息 用于Controller层注解 * * @param log 日志 * @param operLog 操作日志 * @throws Exception */ public void getControllerMethodDescription(Log log, SysOperLog operLog) throws Exception { // 设置action动作 operLog.setBusinessType(log.businessType().ordinal()); // 设置标题 operLog.setTitle(log.title()); // 设置操作人类别 operLog.setOperatorType(log.operatorType().ordinal()); // 是否需要保存request,参数和值 if (log.isSaveRequestData()) { // 获取参数的信息,传入到数据库中。 setRequestValue(operLog); } } /** * 获取请求的参数,放到log中 * * @param operLog 操作日志 * @throws Exception 异常 */ private void setRequestValue(SysOperLog operLog) throws Exception { Map<String, String[]> map = ServletUtils.getRequest().getParameterMap(); String params = JSON.marshal(map); operLog.setOperParam(StringUtils.substring(params, 0, 2000)); } /** * 是否存在注解,如果存在就获取 */ private Log getAnnotationLog(JoinPoint joinPoint) throws Exception { Signature signature = joinPoint.getSignature(); MethodSignature methodSignature = (MethodSignature) signature; Method method = methodSignature.getMethod(); if (method != null) { return method.getAnnotation(Log.class); } return null; } }
5,323
LogAspect
java
en
java
code
{"qsc_code_num_words": 449, "qsc_code_num_chars": 5323.0, "qsc_code_mean_word_length": 7.22494432, "qsc_code_frac_words_unique": 0.36525612, "qsc_code_frac_chars_top_2grams": 0.02959309, "qsc_code_frac_chars_top_3grams": 0.0431566, "qsc_code_frac_chars_top_4grams": 0.0431566, "qsc_code_frac_chars_dupe_5grams": 0.12268804, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00310961, "qsc_code_frac_chars_whitespace": 0.27503288, "qsc_code_size_file_byte": 5323.0, "qsc_code_num_lines": 176.0, "qsc_code_num_chars_line_max": 94.0, "qsc_code_num_chars_line_mean": 30.24431818, "qsc_code_frac_chars_alphabet": 0.83752267, "qsc_code_frac_chars_comments": 0.11779072, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.02150767, "qsc_code_frac_chars_long_word_length": 0.00936968, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.06140351, "qsc_codejava_score_lines_no_logic": 0.28070175, "qsc_codejava_frac_words_no_modifier": 0.875, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/Вопрос/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Если Не ПустаяСтрока(Параметры.Заголовок) Тогда Заголовок = Параметры.Заголовок; ШиринаЗаголовка = 1.3 * СтрДлина(Заголовок); Если ШиринаЗаголовка > 40 И ШиринаЗаголовка < 80 Тогда Ширина = ШиринаЗаголовка; ИначеЕсли ШиринаЗаголовка >= 80 Тогда Ширина = 80; КонецЕсли; КонецЕсли; Если Параметры.БлокироватьВесьИнтерфейс Тогда РежимОткрытияОкна = РежимОткрытияОкнаФормы.БлокироватьВесьИнтерфейс; КонецЕсли; Если Параметры.Картинка.Вид <> ВидКартинки.Пустая Тогда Элементы.Предупреждение.Картинка = Параметры.Картинка; КонецЕсли; Если ТипЗнч(Параметры.ТекстСообщения) = Тип("Строка") Тогда ТекстСообщения = Параметры.ТекстСообщения; Элементы.МногострочныйТекстСообщения.Видимость = Истина; Элементы.ТекстСообщенияФорматированнаяСтрока.Видимость = Ложь; ИначеЕсли ТипЗнч(Параметры.ТекстСообщения) = Тип("ФорматированнаяСтрока") Тогда Элементы.ТекстСообщенияФорматированнаяСтрока.Заголовок = Параметры.ТекстСообщения; Элементы.МногострочныйТекстСообщения.Видимость = Ложь; Элементы.ТекстСообщенияФорматированнаяСтрока.Видимость = Истина; ИначеЕсли ТипЗнч(Параметры.ТекстСообщения) = Тип("Неопределено") Тогда // для обратной совместимости ТекстСообщения = ""; Иначе ОбщегоНазначенияКлиентСервер.ПроверитьПараметр(Метаданные.ОбщиеФормы.Вопрос.ПолноеИмя(), "ТекстСообщения", Параметры.ТекстСообщения, Новый ОписаниеТипов("Строка, ФорматированнаяСтрока")); КонецЕсли; МинимальнаяШиринаПоля = 50; ПримернаяВысотаПоля = ЧислоСтрок(Параметры.ТекстСообщения, МинимальнаяШиринаПоля); Элементы.МногострочныйТекстСообщения.Ширина = МинимальнаяШиринаПоля; Элементы.МногострочныйТекстСообщения.Высота = Мин(ПримернаяВысотаПоля, 10); // Размещение флажка. Если ЗначениеЗаполнено(Параметры.ТекстФлажка) Тогда Элементы.БольшеНеЗадаватьЭтотВопрос.Заголовок = Параметры.ТекстФлажка; ИначеЕсли НЕ ПравоДоступа("СохранениеДанныхПользователя", Метаданные) ИЛИ НЕ Параметры.ПредлагатьБольшеНеЗадаватьЭтотВопрос Тогда Элементы.БольшеНеЗадаватьЭтотВопрос.Видимость = Ложь; КонецЕсли; // Размещение кнопок. ДобавитьКомандыИКнопкиНаФорму(Параметры.Кнопки); УстановитьКнопкуПоУмолчанию(Параметры.КнопкаПоУмолчанию, Истина); УстановитьКнопкуОжидания(Параметры.КнопкаТаймаута); ОжиданиеСчетчик = Параметры.Таймаут; СтандартныеПодсистемыСервер.СброситьРазмерыИПоложениеОкна(ЭтотОбъект); Если ОбщегоНазначения.ЭтоМобильныйКлиент() Тогда Элементы.Переместить(Элементы.БольшеНеЗадаватьЭтотВопрос, ЭтотОбъект); ПоложениеКоманднойПанели = ПоложениеКоманднойПанелиФормы.Верх; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПриОткрытии(Отказ) // Запуск обратного отсчета. Если ОжиданиеСчетчик >= 1 Тогда ОжиданиеСчетчик = ОжиданиеСчетчик + 1; ПродолжитьОбратныйОтсчет(); КонецЕсли; ТекущийЭлемент = Элементы.Колонки; КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовШапкиФормы // Параметры: // Команда - КомандаФормы // &НаКлиенте Процедура Подключаемый_ОбработчикКоманды(Команда) ВыбранноеЗначение = СоответствиеКнопокИВозвращаемыхЗначений.Получить(Команда.Имя); РезультатВыбора = Новый Структура; РезультатВыбора.Вставить("БольшеНеЗадаватьЭтотВопрос", БольшеНеЗадаватьЭтотВопрос); РезультатВыбора.Вставить("Значение", КодВозвратаДиалогаПоЗначению(ВыбранноеЗначение)); Закрыть(РезультатВыбора); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции #Область Клиент &НаКлиенте Процедура ПродолжитьОбратныйОтсчет() ОжиданиеСчетчик = ОжиданиеСчетчик - 1; Если ОжиданиеСчетчик <= 0 Тогда Закрыть(Новый Структура("БольшеНеЗадаватьЭтотВопрос, Значение", Ложь, КодВозвратаДиалога.Таймаут)); Иначе Если ОжиданиеИмяКнопки <> "" Тогда НовыйЗаголовок = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = '%1 (осталось %2 сек.)'"), ОжиданиеЗаголовокКнопки, Строка(ОжиданиеСчетчик)); ЭлементФормы = Элементы[ОжиданиеИмяКнопки]; // ВсеЭлементыФормы ЭлементФормы.Заголовок = НовыйЗаголовок; КонецЕсли; ПодключитьОбработчикОжидания("ПродолжитьОбратныйОтсчет", 1, Истина); КонецЕсли; КонецПроцедуры &НаКлиенте Функция КодВозвратаДиалогаПоЗначению(Значение) Если ТипЗнч(Значение) <> Тип("Строка") Тогда Возврат Значение; КонецЕсли; Если Значение = "КодВозвратаДиалога.Да" Тогда Результат = КодВозвратаДиалога.Да; ИначеЕсли Значение = "КодВозвратаДиалога.Нет" Тогда Результат = КодВозвратаДиалога.Нет; ИначеЕсли Значение = "КодВозвратаДиалога.ОК" Тогда Результат = КодВозвратаДиалога.ОК; ИначеЕсли Значение = "КодВозвратаДиалога.Отмена" Тогда Результат = КодВозвратаДиалога.Отмена; ИначеЕсли Значение = "КодВозвратаДиалога.Повторить" Тогда Результат = КодВозвратаДиалога.Повторить; ИначеЕсли Значение = "КодВозвратаДиалога.Прервать" Тогда Результат = КодВозвратаДиалога.Прервать; ИначеЕсли Значение = "КодВозвратаДиалога.Пропустить" Тогда Результат = КодВозвратаДиалога.Пропустить; Иначе Результат = Значение; КонецЕсли; Возврат Результат; КонецФункции #КонецОбласти #Область Сервер &НаСервере Процедура ДобавитьКомандыИКнопкиНаФорму(Кнопки) // Добавляет команды и соответствующие им кнопки на форму. // // Параметры: // Кнопки - Строка / СписокЗначений - набор кнопок // если строка - строковый идентификатор в формате "РежимДиалогаВопрос.<одно из значений РежимДиалогаВопрос>", // например "РежимДиалогаВопрос.ДаНет" // если СписокЗначений - для каждой записи, // Значение - значение возвращаемое формой при нажатии кнопки. // Представление - заголовок кнопки. Если ТипЗнч(Кнопки) = Тип("Строка") Тогда КнопкиСписокЗначений = СтандартныйНабор(Кнопки); Иначе КнопкиСписокЗначений = Кнопки; КонецЕсли; СоответствиеКнопокЗначениям = Новый Соответствие; Индекс = 0; Для Каждого ЭлементОписаниеКнопки Из КнопкиСписокЗначений Цикл Индекс = Индекс + 1; ИмяКоманды = "Команда" + XMLСтрока(Индекс); Команда = Команды.Добавить(ИмяКоманды); Команда.Действие = "Подключаемый_ОбработчикКоманды"; Команда.Заголовок = ЭлементОписаниеКнопки.Представление; Команда.ИзменяетСохраняемыеДанные = Ложь; Кнопка= Элементы.Добавить(ИмяКоманды, Тип("КнопкаФормы"), КоманднаяПанель); Кнопка.ПоложениеВКоманднойПанели = ПоложениеКнопкиВКоманднойПанели.ВКоманднойПанели; Кнопка.ИмяКоманды = ИмяКоманды; СоответствиеКнопокЗначениям.Вставить(ИмяКоманды, ЭлементОписаниеКнопки.Значение); КонецЦикла; СоответствиеКнопокИВозвращаемыхЗначений = Новый ФиксированноеСоответствие(СоответствиеКнопокЗначениям); КонецПроцедуры &НаСервере Процедура УстановитьКнопкуПоУмолчанию(КнопкаПоУмолчанию, ВыделятьКнопкуПоУмолчанию) Если СоответствиеКнопокИВозвращаемыхЗначений.Количество() = 0 Тогда Возврат; КонецЕсли; Кнопка = Неопределено; Для Каждого Элемент Из СоответствиеКнопокИВозвращаемыхЗначений Цикл Если Элемент.Значение = КнопкаПоУмолчанию Тогда Кнопка = Элементы[Элемент.Ключ]; Прервать; КонецЕсли; КонецЦикла; Если Кнопка = Неопределено Тогда Кнопка = КоманднаяПанель.ПодчиненныеЭлементы[0]; КонецЕсли; Если ВыделятьКнопкуПоУмолчанию Тогда Кнопка.КнопкаПоУмолчанию = Истина; КонецЕсли; ТекущийЭлемент = Кнопка; КонецПроцедуры &НаСервере Процедура УстановитьКнопкуОжидания(ЗначениеКнопкиОжидания) Если СоответствиеКнопокИВозвращаемыхЗначений.Количество() = 0 Тогда Возврат; КонецЕсли; Для Каждого Элемент Из СоответствиеКнопокИВозвращаемыхЗначений Цикл Если Элемент.Значение = ЗначениеКнопкиОжидания Тогда ОжиданиеИмяКнопки = Элемент.Ключ; КомандаФормы = Команды[ОжиданиеИмяКнопки]; // КомандаФормы ОжиданиеЗаголовокКнопки = КомандаФормы.Заголовок; Возврат; КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервереБезКонтекста Функция СтандартныйНабор(Кнопки) Результат = Новый СписокЗначений; Если Кнопки = "РежимДиалогаВопрос.ДаНет" Тогда Результат.Добавить("КодВозвратаДиалога.Да", НСтр("ru = 'Да'")); Результат.Добавить("КодВозвратаДиалога.Нет", НСтр("ru = 'Нет'")); ИначеЕсли Кнопки = "РежимДиалогаВопрос.ДаНетОтмена" Тогда Результат.Добавить("КодВозвратаДиалога.Да", НСтр("ru = 'Да'")); Результат.Добавить("КодВозвратаДиалога.Нет", НСтр("ru = 'Нет'")); Результат.Добавить("КодВозвратаДиалога.Отмена", НСтр("ru = 'Отмена'")); ИначеЕсли Кнопки = "РежимДиалогаВопрос.ОК" Тогда Результат.Добавить("КодВозвратаДиалога.ОК", НСтр("ru = 'ОК'")); ИначеЕсли Кнопки = "РежимДиалогаВопрос.ОКОтмена" Тогда Результат.Добавить("КодВозвратаДиалога.ОК", НСтр("ru = 'ОК'")); Результат.Добавить("КодВозвратаДиалога.Отмена", НСтр("ru = 'Отмена'")); ИначеЕсли Кнопки = "РежимДиалогаВопрос.ПовторитьОтмена" Тогда Результат.Добавить("КодВозвратаДиалога.Повторить", НСтр("ru = 'Повторить'")); Результат.Добавить("КодВозвратаДиалога.Отмена", НСтр("ru = 'Отмена'")); ИначеЕсли Кнопки = "РежимДиалогаВопрос.ПрерватьПовторитьПропустить" Тогда Результат.Добавить("КодВозвратаДиалога.Прервать", НСтр("ru = 'Прервать'")); Результат.Добавить("КодВозвратаДиалога.Повторить", НСтр("ru = 'Повторить'")); Результат.Добавить("КодВозвратаДиалога.Пропустить", НСтр("ru = 'Пропустить'")); КонецЕсли; Возврат Результат; КонецФункции // Определяет примерное число строк с учетом переносов. &НаСервереБезКонтекста Функция ЧислоСтрок(Текст, ОтсечкаПоШирине, ПриводитьКРазмерамЭлементовФормы = Истина) ЧислоСтрок = СтрЧислоСтрок(Текст); ЧислоПереносов = 0; Для НомерСтроки = 1 По ЧислоСтрок Цикл Строка = СтрПолучитьСтроку(Текст, НомерСтроки); ЧислоПереносов = ЧислоПереносов + Цел(СтрДлина(Строка)/ОтсечкаПоШирине); КонецЦикла; ПримерноеЧислоСтрок = ЧислоСтрок + ЧислоПереносов; Если ПриводитьКРазмерамЭлементовФормы Тогда Коэффициент = 2/3; // В такси в высоту 2 вмещается примерно 3 строки текста. ПримерноеЧислоСтрок = Цел((ПримерноеЧислоСтрок+1)*Коэффициент); КонецЕсли; Если ПримерноеЧислоСтрок = 2 Тогда ПримерноеЧислоСтрок = 3; КонецЕсли; Возврат ПримерноеЧислоСтрок; КонецФункции #КонецОбласти #КонецОбласти
10,455
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 834, "qsc_code_num_chars": 10455.0, "qsc_code_mean_word_length": 9.81414868, "qsc_code_frac_words_unique": 0.30455635, "qsc_code_frac_chars_top_2grams": 0.01026268, "qsc_code_frac_chars_top_3grams": 0.05558949, "qsc_code_frac_chars_top_4grams": 0.02932193, "qsc_code_frac_chars_dupe_5grams": 0.15064142, "qsc_code_frac_chars_dupe_6grams": 0.12425168, "qsc_code_frac_chars_dupe_7grams": 0.12425168, "qsc_code_frac_chars_dupe_8grams": 0.10592547, "qsc_code_frac_chars_dupe_9grams": 0.093708, "qsc_code_frac_chars_dupe_10grams": 0.0739157, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00496439, "qsc_code_frac_chars_whitespace": 0.11372549, "qsc_code_size_file_byte": 10455.0, "qsc_code_num_lines": 291.0, "qsc_code_num_chars_line_max": 116.0, "qsc_code_num_chars_line_mean": 35.92783505, "qsc_code_frac_chars_alphabet": 0.87826462, "qsc_code_frac_chars_comments": 0.98995696, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
package com.ruoyi.framework.aspectj; import java.lang.reflect.Method; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder; import com.ruoyi.common.utils.StringUtils; /** * 多数据源处理 * * @author ruoyi */ @Aspect @Order(1) @Component public class DataSourceAspect { protected Logger logger = LoggerFactory.getLogger(getClass()); @Pointcut("@annotation(com.ruoyi.common.annotation.DataSource)" + "|| @within(com.ruoyi.common.annotation.DataSource)") public void dsPointCut() { } @Around("dsPointCut()") public Object around(ProceedingJoinPoint point) throws Throwable { DataSource dataSource = getDataSource(point); if (StringUtils.isNotNull(dataSource)) { DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name()); } try { return point.proceed(); } finally { // 销毁数据源 在执行方法之后 DynamicDataSourceContextHolder.clearDataSourceType(); } } /** * 获取需要切换的数据源 */ public DataSource getDataSource(ProceedingJoinPoint point) { MethodSignature signature = (MethodSignature) point.getSignature(); Class<? extends Object> targetClass = point.getTarget().getClass(); DataSource targetDataSource = targetClass.getAnnotation(DataSource.class); if (StringUtils.isNotNull(targetDataSource)) { return targetDataSource; } else { Method method = signature.getMethod(); DataSource dataSource = method.getAnnotation(DataSource.class); return dataSource; } } }
2,132
DataSourceAspect
java
en
java
code
{"qsc_code_num_words": 183, "qsc_code_num_chars": 2132.0, "qsc_code_mean_word_length": 7.91803279, "qsc_code_frac_words_unique": 0.38251366, "qsc_code_frac_chars_top_2grams": 0.05590062, "qsc_code_frac_chars_top_3grams": 0.05521049, "qsc_code_frac_chars_top_4grams": 0.06901311, "qsc_code_frac_chars_dupe_5grams": 0.13250518, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0018018, "qsc_code_frac_chars_whitespace": 0.21904315, "qsc_code_size_file_byte": 2132.0, "qsc_code_num_lines": 76.0, "qsc_code_num_chars_line_max": 89.0, "qsc_code_num_chars_line_mean": 28.05263158, "qsc_code_frac_chars_alphabet": 0.86846847, "qsc_code_frac_chars_comments": 0.03893058, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.05514885, "qsc_code_frac_chars_long_word_length": 0.04782821, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.05084746, "qsc_codejava_score_lines_no_logic": 0.3220339, "qsc_codejava_frac_words_no_modifier": 0.75, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/НастройкиРегистрацииСобытийДоступаКПерсональнымДанным/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Регистрация событий доступа к персональным данным</v8:content> </v8:item> </Title> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <AutoTitle>false</AutoTitle> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <ChildItems> <Button name="ФормаЗаписатьИЗакрыть" id="6"> <Type>CommandBarButton</Type> <DefaultButton>true</DefaultButton> <CommandName>Form.Command.ЗаписатьИЗакрыть</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Записать и закрыть</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаЗаписатьИЗакрытьРасширеннаяПодсказка" id="10"/> </Button> </ChildItems> </AutoCommandBar> <Events> <Event name="BeforeClose">ПередЗакрытием</Event> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <UsualGroup name="ПредупреждениеНастройкаВСервисе" id="22"> <Visible>false</Visible> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предупреждение настройка в сервисе</v8:content> </v8:item> </Title> <Group>AlwaysHorizontal</Group> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ПредупреждениеНастройкаВСервисеРасширеннаяПодсказка" id="23"/> <ChildItems> <PictureDecoration name="ПредупреждениеНастройкаВСервисеКартинка" id="24"> <SkipOnInput>false</SkipOnInput> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предупреждение настройка в сервисе картинка</v8:content> </v8:item> </Title> <Picture> <xr:Ref>StdPicture.DialogExclamation</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="ПредупреждениеНастройкаВСервисеКартинкаКонтекстноеМеню" id="25"/> <ExtendedTooltip name="ПредупреждениеНастройкаВСервисеКартинкаРасширеннаяПодсказка" id="26"/> </PictureDecoration> <LabelDecoration name="ПредупреждениеНастройкаВСервисеПояснение" id="27"> <SkipOnInput>false</SkipOnInput> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Для приложений в сервисе настройки устанавливаются администратором сервиса</v8:content> </v8:item> </Title> <VerticalAlign>Center</VerticalAlign> <ContextMenu name="ПредупреждениеНастройкаВСервисеПояснениеКонтекстноеМеню" id="28"/> <ExtendedTooltip name="ПредупреждениеНастройкаВСервисеПояснениеРасширеннаяПодсказка" id="29"/> </LabelDecoration> </ChildItems> </UsualGroup> <Table name="КатегорииПерсональныхДанных" id="7"> <Representation>Tree</Representation> <AutoInsertNewRow>true</AutoInsertNewRow> <EnableStartDrag>true</EnableStartDrag> <EnableDrag>true</EnableDrag> <FileDragMode>AsFile</FileDragMode> <DataPath>КатегорииПерсональныхДанных</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Категории персональных данных</v8:content> </v8:item> </Title> <ContextMenu name="КатегорииПерсональныхДанныхКонтекстноеМеню" id="8"/> <AutoCommandBar name="КатегорииПерсональныхДанныхКоманднаяПанель" id="9"/> <ExtendedTooltip name="КатегорииПерсональныхДанныхРасширеннаяПодсказка" id="11"/> <SearchStringAddition name="КатегорииПерсональныхДанныхСтрокаПоиска" id="13"> <AdditionSource> <Item>КатегорииПерсональныхДанных</Item> <Type>SearchStringRepresentation</Type> </AdditionSource> <ContextMenu name="КатегорииПерсональныхДанныхСтрокаПоискаКонтекстноеМеню" id="14"/> <ExtendedTooltip name="КатегорииПерсональныхДанныхСтрокаПоискаРасширеннаяПодсказка" id="15"/> </SearchStringAddition> <ViewStatusAddition name="КатегорииПерсональныхДанныхСостояниеПросмотра" id="16"> <AdditionSource> <Item>КатегорииПерсональныхДанных</Item> <Type>ViewStatusRepresentation</Type> </AdditionSource> <ContextMenu name="КатегорииПерсональныхДанныхСостояниеПросмотраКонтекстноеМеню" id="17"/> <ExtendedTooltip name="КатегорииПерсональныхДанныхСостояниеПросмотраРасширеннаяПодсказка" id="18"/> </ViewStatusAddition> <SearchControlAddition name="КатегорииПерсональныхДанныхУправлениеПоиском" id="19"> <AdditionSource> <Item>КатегорииПерсональныхДанных</Item> <Type>SearchControl</Type> </AdditionSource> <ContextMenu name="КатегорииПерсональныхДанныхУправлениеПоискомКонтекстноеМеню" id="20"/> <ExtendedTooltip name="КатегорииПерсональныхДанныхУправлениеПоискомРасширеннаяПодсказка" id="21"/> </SearchControlAddition> </Table> <LabelDecoration name="ДекорацияРегистрацияСобытияДоступНадпись" id="4"> <AutoMaxWidth>false</AutoMaxWidth> <Height>2</Height> <TextColor>style:ПоясняющийТекст</TextColor> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Для выбранных областей данных выполняется регистрация событий доступа в соответствии с требованиями Федерального закона от 27.07.2006 N152-ФЗ "О персональных данных".</v8:content> </v8:item> </Title> <ContextMenu name="ДекорацияРегистрацияСобытияДоступНадписьКонтекстноеМеню" id="5"/> <ExtendedTooltip name="ДекорацияРегистрацияСобытияДоступНадписьРасширеннаяПодсказка" id="12"/> </LabelDecoration> </ChildItems> <Attributes> <Attribute name="КатегорииПерсональныхДанных" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Категории персональных данных</v8:content> </v8:item> </Title> <Type> <v8:Type>v8:ValueTree</v8:Type> </Type> <SavedData>true</SavedData> </Attribute> </Attributes> <Commands> <Command name="ЗаписатьИЗакрыть" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Записать и закрыть</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Записать и закрыть</v8:content> </v8:item> </ToolTip> <Picture> <xr:Ref>StdPicture.WriteAndClose</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Action>ЗаписатьИЗакрыть</Action> <Representation>Text</Representation> <CurrentRowUse>DontUse</CurrentRowUse> </Command> </Commands> </Form>
7,253
Form
xml
ru
xml
data
{"qsc_code_num_words": 734, "qsc_code_num_chars": 7253.0, "qsc_code_mean_word_length": 7.16757493, "qsc_code_frac_words_unique": 0.30245232, "qsc_code_frac_chars_top_2grams": 0.02280935, "qsc_code_frac_chars_top_3grams": 0.02280935, "qsc_code_frac_chars_top_4grams": 0.02851169, "qsc_code_frac_chars_dupe_5grams": 0.2885383, "qsc_code_frac_chars_dupe_6grams": 0.24310967, "qsc_code_frac_chars_dupe_7grams": 0.23360578, "qsc_code_frac_chars_dupe_8grams": 0.22486219, "qsc_code_frac_chars_dupe_9grams": 0.17430146, "qsc_code_frac_chars_dupe_10grams": 0.13343471, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.031766, "qsc_code_frac_chars_whitespace": 0.12325934, "qsc_code_size_file_byte": 7253.0, "qsc_code_num_lines": 168.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 43.17261905, "qsc_code_frac_chars_alphabet": 0.79540808, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.47619048, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.29118985, "qsc_code_frac_chars_long_word_length": 0.1764787, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/РедактированиеТабличногоДокумента/Ext/Help/ru.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta content="text/html;charset=utf-8" http-equiv="content-type"></meta><link rel="stylesheet" type="text/css" href="v8help://service_book/service_style"></link><meta name="GENERATOR" content="MSHTML 11.00.10570.1001"></meta></head><body> <p>Предназначена для редактирования табличного документа. </p> <p>Для редактирования табличного документа, макета печатной формы или макета файла выгрузки выполните команду <strong>Изменить макет</strong> меню <strong>Еще</strong>. </p> <p><strong>Важно: </strong>при редактировании макетов печатных форм или макетов файлов выгрузки необходимо иметь в виду, что изменение имен областей, а также параметров макета может привести к потере работоспособности. </p> <h3>Редактирование</h3> <ul><li>Для редактирования можно использовать стандартные кнопки форматирования: можно изменить <img src="CommonPicture.ИзменитьШрифт"></img> размер и тип шрифта, <img src="CommonPicture.ВыравниваниеПоЛевомуКраю"></img>выравнивание. Остальные команды форматирования (например, цвет фона и шрифта, границы и т.п.) можно найти в меню <strong>Еще</strong>. </li> <li>Можно <strong>Объединить ячейки</strong> с помощью соответствующей команды меню <strong>Еще</strong>, а также разъединить выделенные ячейки с помощью повторного выполнения этой же команды. </li> <li>Можно <strong>Вставить примечание</strong> с помощью соответствующей команды меню <strong>Еще</strong>. </li> <li>По окончании редактирования нажмите <strong>Записать и закрыть</strong>.</li></ul><h3>Создание или редактирование макета</h3> <div>В списке макетов нажмите кнопку <b>Создать</b> или <b>Копировать</b>. </div> <div><br></div> <div>С помощью кнопок панели навигации верхнего ряда можно: <ul><li><img src="CommonPicture.ПредварительныйПросмотрКартинка"></img>проверить вид макета на бумаге;</li> <li>Для макета печатной формы можно задать колонтитулы;</li> <li><img src="StdPicture.ShowData"></img><img src=""></img>сформировать образец печатной формы и файла выгрузки по макету;</li> <li>Переключиться на макет на другом языке;</li></ul></div> <div>В нижнем ряду панели навигации также предусмотрены стандартные кнопки редактирования и форматирования, а также можно:</div> <div> <ul><li><img src="StdPicture.SpreadsheetInsertComment"></img> открыть меню работы над ячейками (перейти к ячейке, объединить ячейки и т.д.).</li> <li><img src="StdPicture.Picture"></img> открыть меню работы над картинками.</li> <li><img src="CommonPicture.РазмещениеТекстаАвто"></img> автоматически разместить текст в ячейке. </li> <li><img src="CommonPicture.РазмещениеТекстаПереносить"></img> перенести текст в ячейке.</li> <li>в поле <b>Назначение </b>перейдите по ссылке, с помощью флажков выберите, для какого объекта предназначен макет печатной формы или макет выгрузки. </li></ul>Окно редактирования печатной формы состоит из четырех частей:<br><ul><li>В левой верхней части строится макет печатной формы или макет файлов выгрузки;</li> <li>В левой нижней части можно просмотреть или написать текст выбранной ячейки;</li> <li>В правой верхней части находится список доступных полей документа для использования в макете;</li> <ul><li>Список доступных полей содержит следующие колонки:</li> <ul><li><b>Поле</b> - доступное поле элемента-владельца макета. Поле можно перетаскивать в макет. Можно вставить поля табличной части документа.</li> <li><b>Образец</b> - показывает, как будет выглядеть поле при выводе на печать. В качестве образца для заполнения полей берется случайный элемент списка. </li> <li><b><img src="StdPicture.DataCompositionOutputParameters"></img> Формат поля</b> - предусмотрена настройка формата поля. Например, можно выбрать формат даты, отличный от стандартного.</li></ul></ul><li>В правой нижней части находится список операторов и функций для создания выражений. Подробное описание операторов и функций можно найти в <a href="https://its.1c.ru/bmk/bsp_print_templates">Инструкции по созданию макетов печатных форм</a>;</li></ul><div>С помощью кнопки <b>Доступные поля</b> панели навигации можно убрать правую часть для просмотра всего макета.</div></div> <div>Для сохранения новой печатной формы или файла выгрузки нажмите <b>Записать и закрыть</b>.</div> <h3>Формат сохранения выгрузки</h3> <p>В макете выгрузки необходимо указать формат сохранения выгрузки. На панели навигации доступны стандартные кнопки редактирования и форматирования. В зависимости от формата сохранения выгрузки могут быть ограничены определенные кнопки: </p> <p></p> <ul><a name="СтандартныеПодсистемы.Печать"></a> <li>в макетах формата <b>XML</b>, <b>JSON</b>, <b>DBF </b>недоступны кнопки настройки форматирования текста;</li> <li>в макетах формата <b>XML</b>, <b>JSON</b> доступны команды <b>Назначить имя</b>/<b>Убрать имя</b> для управления областями строк. </li> <li>некоторые форматы имеют свои структурные ограничения, которые необходимо учитывать при настройке макетов для корректного формирования файлов: </li> <ul><li><b>DBF</b> - структура макета должна представлять собой таблицу: заголовок и его назначение. Наименование колонок должно содержать только латинские буквы. Длина наименования колонки не более 10 символов. Объединение колонок запрещено. </li> <li><b>XML</b> и <b>JSON </b>- структура макетов должна состоять из двух столбцов: наименование поля и его значение. Поля могут быть объединены в один элемент - тогда они должны входить в одну область строки. При записи макета производится проверка написания имен элементов согласно спецификации форматов (использование тех или иных символов). </li> <li><b>DBF</b>, <b>HTML</b>, <b>TXT</b>, <b>XLS</b>, <b>MXL</b> - запрещено использование областей строк/столбцов/ячеек (проверяется при записи макета). </li> <li><b>XLS</b>, <b>XLSX</b>, <b>HTML</b>, <b>MXL</b> - поддерживается использование изображений и форматированный текст. </li></ul></ul><h3>Перевод макета на другой язык</h3> <p>Приложение позволяет формировать печатные формы и файлы выгрузки на других языках. Это может быть полезно, например, если необходимо предоставить какие-либо документы иностранному контрагенту: прайс-лист, счет на оплату и т.д.</p> <p>Для этого необходимо:</p> <p></p> <ul><a name="СтандартныеПодсистемы.Печать"></a> <li>Выбрать<a name="СтандартныеПодсистемы.Печать"> </a><a href="Catalog.ЯзыкиПечатныхФорм/Help">дополнительные языки</a>.</li> <li>Ввести на дополнительном языке наименования, выводимые в печатной форме или файле выгрузки - элементы различных списков приложения. После специальных настроек можно использовать автоматический перевод.</li> <li>Добавить перевод на дополнительный язык.</li> <ul><li>После добавления других языков при редактировании макета появляется кнопка выбора языка.</li> <li>Откройте на редактирование нужный макет, переключите на дополнительный язык и выполните перевод.</li> <li>В макете следует переводить только статический текст, например заголовки, подписи и т.д.</li> <li>Не нужно переводить имена областей и параметры. Параметры в печатной форме отображаются в угловых скобках, например, <b>&lt;Наименование&gt;</b>. Параметры могут находиться внутри шаблонов текста, в этом случае они отображаются в квадратных скобках, например, <b>&lt;Счет на оплату №[Номер]от[Дата]&gt;</b>, в этом случае переводить следует только текст шаблона за скобками.</li> <li>Кнопка <img src="StdPicture.Document"></img>позволяет рядом расположить оригинал и переводимую форму для удобства перевода и его проверки.</li></ul></ul>После сохранения макета в колонке <b>Доступные языки</b> добавляется язык, на который был выполнен перевод.<br><h3>Переключение режимов редактирования и просмотра</h3> <ul><li>Для переключения режимов нажмите кнопку <strong>Редактирование</strong>. В режиме просмотра кнопки редактирования макета становится неактивными.</li></ul><h3>Печать макета</h3> <ul><li> <div>Выполните команду <strong>Печать</strong> меню <strong>Еще</strong>, для того чтобы распечатать макет.</div> </li> <li> <div>Для <strong>Предварительного просмотра</strong> макета перед печатью выполните соответствующую команду меню <strong>Еще</strong>.</div> </li> <li> <div>Для того чтобы изменить настройки печати, нажмите <strong>Еще - Параметры страницы</strong>.</div></li></ul><h3>Выгрузка и загрузка макета</h3> <ul><li>Выполните команду <strong>Выгрузить в файл</strong> меню <strong>Еще</strong>, для того чтобы выгрузить макет .</li> <li>Выполните команду <b>Загрузить из файла </b>меню Еще, для того чтобы загрузить макет из файла. </li></ul><h3>См. также:</h3> <ul><li><a href="v8help://frame/form_common">Работа с формами</a>.</li></ul></body></html>
8,604
ru
html
ru
html
code
{"qsc_code_num_words": 1237, "qsc_code_num_chars": 8604.0, "qsc_code_mean_word_length": 5.37752627, "qsc_code_frac_words_unique": 0.37348424, "qsc_code_frac_chars_top_2grams": 0.01683704, "qsc_code_frac_chars_top_3grams": 0.0136801, "qsc_code_frac_chars_top_4grams": 0.01999399, "qsc_code_frac_chars_dupe_5grams": 0.11410102, "qsc_code_frac_chars_dupe_6grams": 0.0518641, "qsc_code_frac_chars_dupe_7grams": 0.04780517, "qsc_code_frac_chars_dupe_8grams": 0.04780517, "qsc_code_frac_chars_dupe_9grams": 0.0366807, "qsc_code_frac_chars_dupe_10grams": 0.02014432, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00492037, "qsc_code_frac_chars_whitespace": 0.10239424, "qsc_code_size_file_byte": 8604.0, "qsc_code_num_lines": 68.0, "qsc_code_num_chars_line_max": 581.0, "qsc_code_num_chars_line_mean": 126.52941176, "qsc_code_frac_chars_alphabet": 0.8560145, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.16176471, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07612738, "qsc_code_frac_chars_long_word_length": 0.05334728, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.72175732, "qsc_codehtml_num_chars_text": 6210.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 1, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css
/** * 通用css样式布局处理 * Copyright (c) 2019 ruoyi */ /** 基础通用 **/ .pt5 { padding-top: 5px; } .pr5 { padding-right: 5px; } .pb5 { padding-bottom: 5px; } .mt5 { margin-top: 5px; } .mr5 { margin-right: 5px; } .mb5 { margin-bottom: 5px; } .ml5 { margin-left: 5px; } .mt10 { margin-top: 10px; } .mr10 { margin-right: 10px; } .mb10 { margin-bottom: 10px; } .ml0 { margin-left: 10px; } .mt20 { margin-top: 20px; } .mr20 { margin-right: 20px; } .mb20 { margin-bottom: 20px; } .m20 { margin-left: 20px; } .m50 { margin-left: 50px; } .img-xs { width: 32px; height: 32px; } .img-sm { width: 64px; height: 64px; } .img-md { width: 96px; height: 96px; } .img-lg { width: 120px; height: 120px; } .section-content { min-height: 250px; margin-right: auto; margin-left: auto; padding: 5px 5px 5px 5px; width: 100%; height: 100%; position: absolute; } .ibox { margin-bottom: 25px; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; height: 100%; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); } .list-group-striped > .list-group-item { border-left: 0; border-right: 0; border-radius: 0; padding-left: 0; padding-right: 0 } .ibox-title-gray { height: 41px; background-color: #f0f3f4; color: #333; font-weight: 700; border-radius: 2px 2px 0 0; padding: 13px !important; border-bottom: 1px solid #eee; display: block; clear: both; } .dashboard-header h5 { padding: 8px 0 0 0; display: inline-block; font-size: 14px; text-overflow: ellipsis; float: left; font-weight: 400; } .ibox-title-gray h5 { display: inline-block; font-size: 14px; margin: 0 0 7px; padding: 0; text-overflow: ellipsis; float: left; } /* 导航页签 */ .nav-tabs-custom { margin-bottom: 20px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,0.1); border-radius: 3px } .nav-tabs-custom>.nav-tabs { margin: 0; border-bottom-color: #f4f4f4; border-top-right-radius: 3px; border-top-left-radius: 3px } .nav-tabs-custom>.nav-tabs>li { border-top: 3px solid transparent; margin-bottom: -2px; margin-right: 5px } .nav-tabs-custom>.nav-tabs>li.header { padding-left: 5px; font-size: 16px; line-height: 30px; } .nav-tabs-custom>.nav-tabs>li.disabled>a { color: #777 } .nav-tabs-custom>.nav-tabs>li>a { color: #444; font-weight: normal; border-radius: 0 } .nav-tabs-custom>.nav-tabs>li>a,.nav-tabs-custom>.nav-tabs>li>a:hover { background: transparent; margin: 0 } .nav-tabs-custom>.nav-tabs>li>a:hover { color: #999 } .nav-tabs-custom>.nav-tabs>li:not(.active)>a:hover,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:focus,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:active { border-color: transparent } .nav-tabs-custom>.nav-tabs>li.active { border-top-color: #1890ff } .nav-tabs-custom>.nav-tabs>li.active>a,.nav-tabs-custom>.nav-tabs>li.active:hover>a { background-color: #fff; color: #444 } .nav-tabs-custom>.nav-tabs>li.active>a { border-top-color: transparent; border-bottom-color: transparent; border-left-color: #f4f4f4; border-right-color: #f4f4f4 } .nav-tabs-custom>.tab-content { background: #fff; padding: 10px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px } /** 弹层组件 禁用样式 **/ .layer-disabled { border: 1px #dedede solid !important; background-color: #f1f1f1 !important; color: #333 !important; pointer-events: none; } /** 用户管理 样式布局 **/ .box { position: relative; border-radius: 3px; background: #ffffff; border-top: 3px solid #d2d6de; margin-bottom: 20px; width: 100%; box-shadow: 0 1px 1px rgba(0,0,0,0.1) } .box-header:before,.box-body:before,.box-footer:before,.box-header:after,.box-body:after,.box-footer:after { content: " "; display: table } .box-header:after,.box-body:after,.box-footer:after { clear: both } .btn-box-tool { padding: 5px; font-size: 12px; background: transparent; color: #97a0b3; } .open .btn-box-tool, .btn-box-tool:hover { color: #606c84; } .box-main { margin: 0; border: 0; padding-top: 2px; border-radius: 0; box-shadow: none } .box-main>.box-header { border-bottom: 1px solid #eee; padding: 12px 10px 2px 15px } .box-header .box-title { display: inline-block; font-size: 18px; margin: 0; line-height: 1; } .box-main>.box-header .box-title { font-size: 16px; margin-bottom: 13px; float: left } .box-main>.box-header .box-title .fa { font-size: 14px; padding-right: 3px; margin-top: -2px } .box-main>.box-header .box-tools { position: relative; top: -5px; right: 0 } .box-main>.box-header .box-tools .btn { padding: 3px 10px 5px 10px; font-size: 14px; margin-bottom: 2px } .box-main>.box-header .box-tools .btn-box-tool { padding: 4px 2px } .box-main form>.box-footer,.nav-main form>.box-footer { background: #fafafa } .box-main form>.box-footer .row,.nav-main form>.box-footer .row { margin: 5px 0 5px -25px } @media ( min-width : 768px) { .section-content .about { padding-left: 0px } } /** select2 样式修改 **/ .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #1AB394; border-color: #1AB394; padding: 1px 10px; color: #fff } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { margin-right: 5px; color: rgba(255,255,255,0.7) } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #fff } .select2-container .select2-selection--single .select2-selection__rendered { padding-right: 10px } /** 表单验证 样式布局 **/ .control-label.is-required:before { content: '* '; color: red; } label.error { position: absolute; right: 18px; top: 10px; color: #ef392b; font-size: 12px; z-index:99; } .input-group label.error { z-index:99; right: 42px } .input-group.date label.error { z-index:99; right: 3px } .Validform_error,input.error,select.error { background-color: #fbe2e2; border-color: #c66161; color: #c00 } .Validform_wrong,.Validform_right,.Validform_warning { display: inline-block; height: 20px; font-size: 12px; vertical-align: middle; padding-left: 25px } .i-checks label.error, .check-box label.error, .radio-box label.error { right: auto; width: 150px; left: 210px; top: 1px; max-width: none; } /** 复选框&单选框 **/ .check-box,.radio-box { display: inline-block; box-sizing: border-box; cursor: pointer; position: relative; padding-left: 25px; padding-right: 15px; padding-top: 8px; } .icheckbox, .icheckbox-blue, .iradio, .iradio-blue, .iradio-purple { position: absolute; top: 8px; left: 0 } /** iCheck **/ .icheckbox-blue,.iradio-blue { display: block; margin: 0; padding: 0; width: 18px; height: 18px; background: url(../../img/blue.png) no-repeat; border: none; cursor: pointer } .icheckbox-blue,.icheckbox-blue.static:hover { background-position: 0 0 } .icheckbox-blue.hover,.icheckbox-blue:hover { background-position: -20px 0 } .icheckbox-blue.checked { background-position: -40px 0 } .icheckbox-blue.disabled { background-position: -60px 0; cursor: default } .icheckbox-blue.checked.disabled { background-position: -80px 0 } .iradio-blue,.iradio-blue.static:hover { background-position: -100px 0 } .iradio-blue.hover,.iradio-blue:hover { background-position: -120px 0 } .iradio-blue.checked { background-position: -140px 0 } .iradio-blue.disabled { background-position: -160px 0; cursor: default } .iradio-blue.checked.disabled { background-position: -180px 0 } /* 切换开关 */ .toggle-switch { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center; margin-bottom: 0; padding-top: 8px; } .toggle-switch input { height: 0; width: 0; position: absolute; opacity: 0; } .toggle-switch span { display: inline-block; position: relative; width: 40px; height: 10px; -webkit-border-radius: 10px; border-radius: 10px; background-color: #ebebeb; border: 2px solid #ebebeb; cursor: pointer; -webkit-transition: all .1s ease; -o-transition: all .1s ease; transition: all .1s ease } .toggle-switch span:after { content: ''; height: 20px; width: 20px; -webkit-border-radius: 50%; border-radius: 50%; position: absolute; left: 1px; top: -7px; color: #aaa; -webkit-transition: all .1s ease; -o-transition: all .1s ease; transition: all .1s ease; text-align: center; font-size: 13px; background-color: #fff; -webkit-box-shadow: rgba(0,0,0,.12) 0 1px 6px,rgba(0,0,0,.12) 0 1px 4px; box-shadow: rgba(0,0,0,.12) 0 1px 6px,rgba(0,0,0,.12) 0 1px 4px } .toggle-switch input:checked~span:after { left: -webkit-calc(100% - 20px); left: calc(100% - 20px); background-color: #33cabb } .toggle-switch.switch-solid span { height: 20px; } .toggle-switch.switch-solid span:after { top: -2px; } .switch-solid input:checked~span { background-color: #33cabb; border-color: #33cabb } .switch-solid input:checked~span:after { background-color: #fff; color: #33cabb } /** 遮罩层 **/ .loaderbox { display: inline-block; min-width: 125px; padding: 10px; margin: 0 auto; color: #000 !important; font-size: 13px; font-weight: 400; text-align: center; vertical-align: middle; border: 1px solid #ddd; background-color: #eee; -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; -webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1); } .loaderbox .loading-activity { float: left; width: 18px; height: 18px; border: solid 2px transparent; border-top-color: #000; border-left-color: #000; border-radius: 10px; -webkit-animation: pace-spinner 400ms linear infinite; -moz-animation: pace-spinner 400ms linear infinite; -ms-animation: pace-spinner 400ms linear infinite; -o-animation: pace-spinner 400ms linear infinite; animation: pace-spinner 400ms linear infinite; } @media (max-width: 767px) { .loading-activity { width: 18px; height: 18px; } } @-ms-keyframes pace-spinner { 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes pace-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /** 表单查询条件 **/ .select-list ul, .layui-layer-content ul { margin: 0; padding: 0; -webkit-tap-highlight-color: rgba(0,0,0,0); } .select-list li, .layui-layer-content li { list-style: none; } .time-input { display: block; width: 100%; padding-left: 10px; } label { font-weight: normal; } .container-div { padding: 0px 28px; height: 100%; } .container-div .row { height: 100%; } .search-collapse,.select-table { width: 100%; background: #fff; border-radius: 6px; margin-top: 10px; padding-top: 5px; padding-bottom: 13px; box-shadow: 1px 1px 3px rgba(0,0,0,.2); } .search-collapse { position: relative; } .search-collapse .col-sm-6 .control-label { color: #333; } @media ( max-width : 768px) { .search-collapse { display: none; } } @media ( min-width : 768px) { .select-list li { float: left; } } .select-list li { color: #333; margin: 5px 15px 5px 0px; } .select-list li p, .select-list li label:not(.radio-box){ float: left; width: 65px; margin: 5px 5px 5px 0px; text-align:right; } .select-list li input { border: 1px solid #ddd; border-radius: 4px; background: transparent; outline: none; height: 30px; width: 200px; padding-left: 5px; } .select-list li .submit-btn { border: 0px; border-radius: 4px; background: transparent; outline: none; width: 40px; height: 23px; } .select-list li select { border: 1px solid #ddd; border-radius: 4px; background: transparent; outline: none; height: 30px; width: 200px; } .bootstrap-select.form-control .btn-default { color: inherit; padding: 6px 12px; border-radius: 1px; border: 1px solid #e5e6e7; outline: none; height: 34px; background: #FFFFFF none } .file-input .btn-default { color: inherit; background: white; border: 1px solid #e7eaec; } .select-list .btn-default { color: #555; padding: 5px 5px; border: 1px solid #ddd; border-radius: 4px; background: transparent; outline: none; height: 30px; width: 200px; } .select-list .btn-default:hover,.select-list .btn-default:focus,.select-list .btn-default:active,.select-list .btn-default.active,.open .dropdown-toggle.btn-default { color: #555; background-color: #e4e4e4; border-color: #b2b2b2 } .select-list .bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { height: 30px; width: 200px; } .select-list .bootstrap-select > .dropdown-toggle.bs-placeholder, .select-list .bootstrap-select > .dropdown-toggle.bs-placeholder:hover, .select-list .bootstrap-select > .dropdown-toggle.bs-placeholder:focus, .select-list .bootstrap-select > .dropdown-toggle.bs-placeholder:active { color: inherit; font-size: 13px; } .select-list .bootstrap-select .dropdown-toggle .caret { position: inherit; } .select-list .select-selectpicker li { float: none; } .select-list .dropdown-menu>li>a,.bootstrap-select.form-control .dropdown-menu>li>a { line-height: inherit; } .select-list .dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a,.bootstrap-select.form-control .dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{ color: #fff; text-decoration: none; background-color: #12889a } .select-list .select2-container--bootstrap { width: 200px!important; display: inline-block; } .select-list .select2-container--bootstrap .select2-selection { border-radius: 6px; } .select-list .select2-container--bootstrap .select2-selection--single { height: 30px!important; padding: 5px 10px; } .select-list .select-time input { width: 93px; } .select-time label,.select-time span,.select-time input { float: left; } @media (max-width:767px) { .select-time label,.select-time span,.select-time input { float: none; } .select-list .select-time input { width: 200px; } } .select-time label { margin-top: 5px; } .select-time span { display: block; margin: 5px 5px; } .search-btn { background-color: #1ab394; border-color: #1ab394; color: #FFF; margin-bottom: 5px; display: inline-block; padding: 6px 12px; margin-bottom: 0; font-size: 14px; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; border-radius: 3px; vertical-align: middle; cursor: pointer; } .select-title{ color:#3d5266; font-size:15px; padding:10px 0px; font-weight: normal; } /** 表格查询数据 **/ .table-striped { min-height: 75%; } .table-striped .bootstrap-table { border: 0px!important; } .table-striped table>thead>tr>th, .table-striped table>tbody>tr>th, .table-striped table>tfoot>tr>th, .table-striped table>thead>tr>td, .table-striped table>tbody>tr>td, .table-striped table>tfoot>tr>td { border-bottom: 1px solid #e7eaec!important; background-color: transparent; border: 0px; } .table-bordered table>thead>tr>th:first-child, .table-bordered table>tbody>tr>td:first-child { border-left: 1px solid #ddd; } .table-bordered table>thead>tr>th:last-child, .table-bordered table>tbody>tr>td:last-child { border-right: 1px solid #ddd; } .table-bordered table>thead>tr>th, .table-bordered table>tbody>tr>td { border-top: 1px solid #ddd!important; border-bottom: 1px solid #ddd; } .fixed-table-footer { border-top: 0px solid #ddd; } .fixed-table-container { border: 0px solid #ddd; } .table-striped .table>thead>tr>th, .table-striped .table>tbody>tr>th { border-bottom: 1px solid #ccc!important; border-top: 0px!important; } .table-striped .table>thead:first-child>tr:first-child>th { font-weight: normal; font-size: 13px } .table-striped table thead { background-color: #eff3f8; } .fixed-table-container thead th >.both{ display: inline-block } .editable-input .input-sm { height: 32px!important; } /** 表格冻结列样式 **/ .left-fixed-table-columns, .left-fixed-body-columns { position: absolute; background-color: #fff; display: none; box-sizing: border-box; overflow: hidden; } .left-fixed-table-columns .table, .left-fixed-body-columns .table { border-right: 1px solid #ddd; } .left-fixed-table-columns .table.table-no-bordered, .left-fixed-body-columns .table.table-no-bordered { border-right: 1px solid transparent; } .left-fixed-body-columns table { position: absolute; animation: none; } .bootstrap-table .table-hover > tbody > tr.hover > td { background-color: #f5f5f5; } .right-fixed-table-columns{ position: absolute; right:63px; border-left:1px solid #ddd; display: none; z-index:100; } /** 表格树样式 **/ .bootstrap-tree-table .treetable-indent {width:16px; height: 16px; display: inline-block; position: relative;} .bootstrap-tree-table .treetable-expander {width:16px; height: 16px; display: inline-block; position: relative; cursor: pointer;} .bootstrap-tree-table .treetable-selected{background: #f5f5f5 !important;} .bootstrap-tree-table .treetable-table{border:0 !important;margin-bottom:0} .bootstrap-tree-table .treetable-table tbody {display:block;height:auto;overflow-y:auto;} .bootstrap-tree-table .treetable-table thead, .treetable-table tbody tr {display:table;width:100%;table-layout:fixed;} .bootstrap-tree-table .treetable-thead th{line-height:24px;border: 0 !important;border-radius: 4px;border-left:0px solid #e7eaec !important;border-bottom:1px solid #ccc!important;text-align: left;} .bootstrap-tree-table .treetable-thead tr :first-child{border-left:0 !important} .bootstrap-tree-table .treetable-tbody td{border: 0 !important;border-left:0px solid #e7eaec !important;border-bottom:1px solid #e7eaec!important;white-space: nowrap; text-overflow: ellipsis;} .bootstrap-tree-table .treetable-tbody tr :first-child{border-left:0 !important} .bootstrap-tree-table .treetable-bars .tool-left, .bootstrap-tree-table .treetable-bars .tool-right{margin-top: 10px; margin-bottom: 10px;} .bootstrap-tree-table .treetable-bars .tool-left{float: left;} .bootstrap-tree-table .treetable-bars .tool-right{float: right;} .bootstrap-tree-table .treetable-bars .columns li label{display: block;padding: 3px 20px;clear: both;font-weight: 400;line-height: 1.428571429;max-width: 100%;margin-bottom: 5px;cursor:pointer;} .bootstrap-tree-table .table{border-bottom: 0px solid #e7eaec!important;} /** 首页样式 **/ .ax_close_max { position: fixed; top: 5px; left: 5px; z-index: 9999; display: none; color: #ccc; } .navbar-right > .user-menu > .dropdown-menu { border-top-right-radius:0; border-top-left-radius:0; padding:1px 0 0 0; border-top-width:0; width:138px; } .navbar-right > .user-menu .user-image { float:left; width:27px; height:27px; border-radius:50%; margin-right:8px; margin-top:-3px; } @media (max-width:767px) { .navbar-right > .user-menu .user-image { float:none; margin-right:0; margin-top:-8px; line-height:10px; } }.dropdown-menu > li > a > .glyphicon,.dropdown-menu > li > a > .fa,.dropdown-menu > li > a > .ion { margin-right:10px; } .dropdown-menu > li > a:hover { background-color:#e1e3e9; color:#333; } .dropdown-menu > .divider { background-color:#eee; } /** 表单布局 **/ .form-header { font-size:15px; color:#6379bb; border-bottom:1px solid #ddd; margin:8px 10px 25px 10px; padding-bottom:5px } .main-content { background-color: #ffffff; color: inherit; padding: 10px 15px 15px 15px; border-color: #e7eaec; -webkit-border-image: none; -o-border-image: none; border-image: none; border-width: 1px 0px; } /** 表格跳转样式 **/ .pageGo input { height: 32px; width: 50px; margin-left: 5px; margin-right: 5px; text-align: center; display: block; float:left; } .pageGo button { height: 32px; display: block; float:left; } /** 表格拖拽样式 **/ .reorder_rows_onDragClass td { color:yellow!important; background-color:#999!important; text-shadow:0 0 10px black,0 0 10px black,0 0 8px black,0 0 6px black,0 0 6px black; box-shadow:0 12px 14px -12px #111 inset,0 -2px 2px -1px #333 inset } /** 表格选中样式 **/ .fixed-table-container .selected { background-color: #E8F7FD; color: #1890ff; } /** 滚动条样式 **/ ::-webkit-scrollbar-track { background-color: #F5F5F5; } /** 气泡弹出框样式 **/ .popover { font-size: 13px; max-width: unset; } .popover-title { padding: 8px 14px; margin: 0 !important; font-size: 14px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; } .popover-content { padding: 5px; } /** 向上滚动样式 **/ #scroll-up { border-width: 0; position: fixed; right: 2px; z-index: 99; -webkit-transition-duration: .3s; transition-duration: .3s; opacity: 0; filter: alpha(opacity=0); bottom: -24px; visibility: hidden; background-color: #aaa; color: #fff; font-size: 14px; display: none; } #scroll-up.display { opacity: .7; filter: alpha(opacity=70); bottom: 2px; visibility: visible; } ::-webkit-scrollbar { width: 6px; height: 10px; background-color: #F5F5F5; } ::-webkit-scrollbar-thumb { border-radius: 6px; background-color: #999; }
21,337
ry-ui
css
en
css
data
{"qsc_code_num_words": 2970, "qsc_code_num_chars": 21337.0, "qsc_code_mean_word_length": 4.92154882, "qsc_code_frac_words_unique": 0.13164983, "qsc_code_frac_chars_top_2grams": 0.00588356, "qsc_code_frac_chars_top_3grams": 0.00410481, "qsc_code_frac_chars_top_4grams": 0.01641924, "qsc_code_frac_chars_dupe_5grams": 0.34774578, "qsc_code_frac_chars_dupe_6grams": 0.25449819, "qsc_code_frac_chars_dupe_7grams": 0.19292605, "qsc_code_frac_chars_dupe_8grams": 0.15310939, "qsc_code_frac_chars_dupe_9grams": 0.12334952, "qsc_code_frac_chars_dupe_10grams": 0.08791134, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.05636213, "qsc_code_frac_chars_whitespace": 0.1510053, "qsc_code_size_file_byte": 21337.0, "qsc_code_num_lines": 1070.0, "qsc_code_num_chars_line_max": 205.0, "qsc_code_num_chars_line_mean": 19.9411215, "qsc_code_frac_chars_alphabet": 0.75053823, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.2792696, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00089043, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/src/cheat/skins/skinchanger.cpp
#include "skinchanger.h" uintptr_t offsets::modbase = (uintptr_t)GetModuleHandleW(L"client.dll"); uintptr_t offsets::secondengine = (uintptr_t)GetModuleHandleW(L"engine2.dll"); uintptr_t offsets::eng_dwnetworkwhatever = *(uintptr_t*)(secondengine + engine::dwNetworkGameClient); constexpr const int GetWeaponPaint(const short itemDef) { switch (itemDef) { case 1: return 711; case 2: return 38; case 7: return cheatsetting::akID; case 9: return 344; case 61: return 653; default: return 0; } } const int firstskinID{}; void dotheskinchangershit() { std::cout << "\n\n\n||___|| Called SkinChanger"; uintptr_t local = *(uintptr_t*)(offsets::modbase + offsets::client::dwLocalPlayerPawn); if (!local) { std::cout << "\n||___|| Failed to find local player"; return; } int localhp = *(int*)(local + 0x344); if (localhp <= 0) return; std::cout << "\n||___|| Debug: PlayerHP: " << localhp; uintptr_t curWeapon = *(uintptr_t*)(local + offsets::client::m_pClippingWeapon); if (!curWeapon) { std::cout << "\n||___|| Failed to get current weapon"; return; } short itemDef = *(short*)(curWeapon + offsets::client::m_AttributeManager + offsets::client::m_Item + offsets::client::m_iItemDefinitionIndex); std::cout << "\n||___|| currently holding : " << itemDef; if (const auto paint = GetWeaponPaint(itemDef)) { int curFB = *(int*)(curWeapon + offsets::client::m_nFallbackPaintKit); std::cout << "\n||___|| current fallback id : " << curFB << "\n||___|| paint: " << paint; const bool bChangeSkin = (*(uintptr_t*)curWeapon + offsets::client::m_nFallbackPaintKit) != paint; std::cout << "\n||___|| Inside SkinChanger: bSwap = " << bChangeSkin << "\n||___|| Current skin = " << *(uint32_t*)(curWeapon + offsets::client::m_nFallbackPaintKit); std::cout << "\n||___|| Initial SkinID: " << firstskinID; *(DWORD*)(curWeapon + offsets::client::m_AttributeManager + offsets::client::m_Item + offsets::client::m_iItemID) = -1; *(DWORD*)(curWeapon + offsets::client::m_AttributeManager + offsets::client::m_Item + offsets::client::m_iItemIDHigh) = -1; *(uint32_t*)(curWeapon + offsets::client::m_AttributeManager + offsets::client::m_Item + offsets::client::m_iItemIDLow) = -1; *(uint32_t*)(curWeapon + offsets::client::m_nFallbackPaintKit) = paint; *(float*)(curWeapon + offsets::client::m_flFallbackWear) = 0.01f; if (bChangeSkin) { std::cout << "\n||___|| Updating skin"; uintptr_t u = *(uintptr_t*)(offsets::eng_dwnetworkwhatever + offsets::engine::dwNetworkGameClient); *(uintptr_t*)(u + offsets::engine::dwNetworkGameClient_deltaTick) = -1; } } }
2,614
skinchanger
cpp
en
cpp
code
{"qsc_code_num_words": 303, "qsc_code_num_chars": 2614.0, "qsc_code_mean_word_length": 5.67986799, "qsc_code_frac_words_unique": 0.30363036, "qsc_code_frac_chars_top_2grams": 0.14352121, "qsc_code_frac_chars_top_3grams": 0.1464265, "qsc_code_frac_chars_top_4grams": 0.12027891, "qsc_code_frac_chars_dupe_5grams": 0.35212086, "qsc_code_frac_chars_dupe_6grams": 0.29285299, "qsc_code_frac_chars_dupe_7grams": 0.29285299, "qsc_code_frac_chars_dupe_8grams": 0.22661243, "qsc_code_frac_chars_dupe_9grams": 0.17083091, "qsc_code_frac_chars_dupe_10grams": 0.17083091, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01632833, "qsc_code_frac_chars_whitespace": 0.1331293, "qsc_code_size_file_byte": 2614.0, "qsc_code_num_lines": 72.0, "qsc_code_num_chars_line_max": 169.0, "qsc_code_num_chars_line_mean": 36.30555556, "qsc_code_frac_chars_alphabet": 0.74315975, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.05357143, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.13738997, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.00191351, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecpp_frac_lines_preprocessor_directives": 0.01785714, "qsc_codecpp_frac_lines_func_ratio": 0.03571429, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.10714286, "qsc_codecpp_frac_lines_print": 0.16071429}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/src/cheat/skins/skinchanger.h
#pragma once #pragma once #include <Windows.h> #include <iostream> #include "../../globals.h" namespace offsets { extern uintptr_t modbase; extern uintptr_t secondengine; extern uintptr_t eng_dwnetworkwhatever; namespace client { //organization is my strength in this 5 minute project constexpr std::ptrdiff_t dwLocalPlayerPawn = 0x18560D0; constexpr std::ptrdiff_t m_pWeaponServices = 0x11A8; constexpr std::ptrdiff_t m_pClippingWeapon = 0x13A0; constexpr std::ptrdiff_t m_AttributeManager = 0x1148; //econ entity constexpr std::ptrdiff_t m_Item = 0x50; constexpr std::ptrdiff_t m_iItemDefinitionIndex = 0x1BA; constexpr std::ptrdiff_t m_nFallbackPaintKit = 0x15F8; constexpr std::ptrdiff_t m_iItemID = 0x1C8; constexpr std::ptrdiff_t m_iItemIDHigh = 0x1D0; constexpr std::ptrdiff_t m_iItemIDLow = 0x1D4; constexpr std::ptrdiff_t m_flFallbackWear = 0x1600; } namespace engine { constexpr std::ptrdiff_t dwNetworkGameClient = 0x53FCE0; constexpr std::ptrdiff_t dwNetworkGameClient_deltaTick = 0x27C; } } void dotheskinchangershit();
1,086
skinchanger
h
en
c
code
{"qsc_code_num_words": 133, "qsc_code_num_chars": 1086.0, "qsc_code_mean_word_length": 6.08270677, "qsc_code_frac_words_unique": 0.45864662, "qsc_code_frac_chars_top_2grams": 0.19283066, "qsc_code_frac_chars_top_3grams": 0.3053152, "qsc_code_frac_chars_top_4grams": 0.32138443, "qsc_code_frac_chars_dupe_5grams": 0.35599506, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.05519481, "qsc_code_frac_chars_whitespace": 0.14917127, "qsc_code_size_file_byte": 1086.0, "qsc_code_num_lines": 49.0, "qsc_code_num_chars_line_max": 70.0, "qsc_code_num_chars_line_mean": 22.16326531, "qsc_code_frac_chars_alphabet": 0.82034632, "qsc_code_frac_chars_comments": 0.06353591, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.06666667, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.01473477, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.07465619, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.03333333, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.13333333, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 1, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/src/cheat/visuals/visuals.cpp
#include "visuals.h" namespace device { extern float resX = GetSystemMetrics(SM_CXSCREEN); extern float resY = GetSystemMetrics(SM_CYSCREEN); const ImVec2 midPoint = { (resX / 2), (resY / 2) }; const ImVec2 midTop = { (resX / 2), 0 }; } namespace visual { float(*ViewMatrix)[4][4] = (float(*)[4][4])(globals::modBase + o::client::dwViewMatrix); Vec2 screenfeet{}; Vec2 screenhead{}; Vec2 v2head{}; Vec2 v2spine2{}; Vec2 v2pelvis{}; Vec2 v2_L_elbow{}; Vec2 v2_L_hand{}; Vec2 v2_R_elbow{}; Vec2 v2_R_hand{}; Vec2 v2_L_thigh{}; Vec2 v2_L_foot{}; Vec2 v2_R_thigh{}; Vec2 v2_R_foot{}; void PlayerESP() { for (int i = 1; i <= entlist::entcount; i++) { auto& player = entlist::players[i]; Vec2 feet, head; if (!player.pos.W2S(feet, ViewMatrix) || !player.headpos.W2S(head, ViewMatrix)) continue; float height = feet.y - head.y; float width = height / 2.0f; ImVec2 topLeft = { head.x - width / 2.0f, head.y - 5 }; ImVec2 bottomRight = { head.x + width / 2.0f, feet.y }; ImGui::GetBackgroundDrawList()->AddRect(topLeft, bottomRight, ImColor(255, 255, 255)); } } void NameESP() { for (int i = 0; i <= entlist::entcount; i++) { if (!entlist::players[i].pos.W2S(screenfeet, ViewMatrix) && entlist::players[i].headpos.W2S(screenhead, ViewMatrix)) continue; std::string playername; uint32_t controller = *(uint32_t*)(globals::modBase + o::client::dwLocalPlayerController); playername = *(std::string*)(controller + o::CCSPlayerController::m_sSanitizedPlayerName); if (playername.empty()) break; ImGui::GetBackgroundDrawList()->AddText(ImVec2({ screenhead.x, screenhead.y - 10.f }), ImColor(255, 255, 255), playername.c_str()); } } void BoneESP() { for (int i = 0; i <= entlist::entcount; i++) { //check if localplayer - entlist::players[i].team can be done for a team check if (entlist::players[i].pos.x == entlist::players[0].pos.x) continue; if (entlist::players[i].health <= 0) continue; if (entlist::players[i].team == entlist::players[0].team) continue; //step through to bone array uintptr_t entity = *(uintptr_t*)(globals::modBase + o::client::dwEntityList + (0x10 * i)); if (!entity) break; uintptr_t gamescene = *(uintptr_t*)(entity + 0x328); uintptr_t bonearray = *(uintptr_t*)(gamescene + 0x170 + 0x80); //initialize 3d co-ordinates of the bones Vec3 v3head = *(Vec3*)(bonearray + 6 * 32); Vec3 v3spine2 = *(Vec3*)(bonearray + 3 * 32); Vec3 v3pelvis = *(Vec3*)(bonearray + 0 * 32); Vec3 v3_L_elbow = *(Vec3*)(bonearray + 8 * 32); Vec3 v3_L_hand = *(Vec3*)(bonearray + 10 * 32); Vec3 v3_R_elbow = *(Vec3*)(bonearray + 13 * 32); Vec3 v3_R_hand = *(Vec3*)(bonearray + 15 * 32); Vec3 v3_L_thigh = *(Vec3*)(bonearray + 22 * 32); Vec3 v3_L_foot = *(Vec3*)(bonearray + 24 * 32); Vec3 v3_R_thigh = *(Vec3*)(bonearray + 25 * 32); Vec3 v3_R_foot = *(Vec3*)(bonearray + 27 * 32); //check they are in view : if ( !v3head.W2S(v2head, ViewMatrix) && !v3spine2.W2S(v2spine2, ViewMatrix) && !v3pelvis.W2S(v2pelvis, ViewMatrix) && !v3_L_elbow.W2S(v2_L_elbow, ViewMatrix) && !v3_L_hand.W2S(v2_L_hand, ViewMatrix) && !v3_R_elbow.W2S(v2_R_elbow, ViewMatrix) && !v3_R_hand.W2S(v2_R_hand, ViewMatrix) && !v3_L_thigh.W2S(v2_L_thigh, ViewMatrix) && !v3_L_foot.W2S(v2_L_foot, ViewMatrix) && !v3_R_thigh.W2S(v2_R_thigh, ViewMatrix) && !v3_R_foot.W2S(v2_R_foot, ViewMatrix) ) continue; //need to play around with this more, as the previous lines should do this for me but it wasnt running each W2S v3head.W2S(v2head, ViewMatrix); v3spine2.W2S(v2spine2, ViewMatrix); v3pelvis.W2S(v2pelvis, ViewMatrix); v3_L_elbow.W2S(v2_L_elbow, ViewMatrix); v3_L_hand.W2S(v2_L_hand, ViewMatrix); v3_R_elbow.W2S(v2_R_elbow, ViewMatrix); v3_R_hand.W2S(v2_R_hand, ViewMatrix); v3_L_thigh.W2S(v2_L_thigh, ViewMatrix); v3_L_foot.W2S(v2_L_foot, ViewMatrix); v3_R_thigh.W2S(v2_R_thigh, ViewMatrix); v3_R_foot.W2S(v2_R_foot, ViewMatrix); //draw the lines ImGui::GetBackgroundDrawList()->AddLine({ v2head.x, v2head.y }, { v2spine2.x, v2spine2.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //head to spine [maybe i should do neck] ImGui::GetBackgroundDrawList()->AddLine({ v2spine2.x, v2spine2.y }, { v2pelvis.x, v2pelvis.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //spine to pelvis ImGui::GetBackgroundDrawList()->AddLine({ v2spine2.x, v2spine2.y }, { v2_L_elbow.x, v2_L_elbow.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //spine to left_elbow ImGui::GetBackgroundDrawList()->AddLine({ v2spine2.x, v2spine2.y }, { v2_R_elbow.x, v2_R_elbow.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //spine to right_elbow ImGui::GetBackgroundDrawList()->AddLine({ v2_L_elbow.x, v2_L_elbow.y }, { v2_L_hand.x, v2_L_hand.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //left elbow to left hand ImGui::GetBackgroundDrawList()->AddLine({ v2_R_elbow.x, v2_R_elbow.y }, { v2_R_hand.x, v2_R_hand.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //right elbow to right hand ImGui::GetBackgroundDrawList()->AddLine({ v2pelvis.x, v2pelvis.y }, { v2_L_thigh.x, v2_L_thigh.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //pelvis to left_thigh ImGui::GetBackgroundDrawList()->AddLine({ v2pelvis.x, v2pelvis.y }, { v2_R_thigh.x, v2_R_thigh.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //pelvis to right_thigh ImGui::GetBackgroundDrawList()->AddLine({ v2_L_thigh.x, v2_L_thigh.y }, { v2_L_foot.x, v2_L_foot.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //left_thigh to left_foot ImGui::GetBackgroundDrawList()->AddLine({ v2_R_thigh.x, v2_R_thigh.y }, { v2_R_foot.x, v2_R_foot.y }, ImColor(color::r_bone, color::g_bone, color::b_bone), cheatsetting::bone_thickness); //right_thigh to right_foot } } void Tracers() { for (int i = 0; i <= entlist::entcount; i++) { //if in view, render if (!entlist::players[i].headpos.W2S(screenhead, ViewMatrix)) continue; //if not local player, render if (entlist::players[i].pos.x == entlist::players[0].pos.x) continue; ImGui::GetBackgroundDrawList()->AddLine(device::midTop, {screenhead.x, screenhead.y}, ImColor(255, 255, 255)); } } void HealthESP() { for (int i = 1; i <= entlist::entcount; i++) { auto& player = entlist::players[i]; Vec2 feet, head; //player.headpos.y + 5.f; if (!player.pos.W2S(feet, ViewMatrix) || !player.headpos.W2S(head, ViewMatrix)) continue; float height = feet.y - head.y; float width = height / 2.0f; int& hp = player.health; float pc_hp = hp / 100; head.y = head.y * pc_hp; ImVec2 topLeft = { head.x - width / 2.0f, head.y }; ImVec2 bottomRight = { head.x + (width / 100) / 2.0f, feet.y }; ImGui::GetBackgroundDrawList()->AddRectFilled(topLeft, bottomRight, ImColor(0, 255, 0)); //ImGui::GetBackgroundDrawList()->AddRect(topLeft, bottomRight, ImColor(255, 255, 255)); } } void Glow(bool val) { if (val == 1) { for (int i = 1; i <= entlist::entcount; i++) { entlist::pawn[i].Glow(100000.f); } } if (val == 0) { for (int i = 1; i <= entlist::entcount; i++) { entlist::pawn[i].Glow(0.f); } } } }
7,724
visuals
cpp
en
cpp
code
{"qsc_code_num_words": 1108, "qsc_code_num_chars": 7724.0, "qsc_code_mean_word_length": 4.4232852, "qsc_code_frac_words_unique": 0.16425993, "qsc_code_frac_chars_top_2grams": 0.01469088, "qsc_code_frac_chars_top_3grams": 0.07406652, "qsc_code_frac_chars_top_4grams": 0.0285656, "qsc_code_frac_chars_dupe_5grams": 0.60783514, "qsc_code_frac_chars_dupe_6grams": 0.54172618, "qsc_code_frac_chars_dupe_7grams": 0.5331565, "qsc_code_frac_chars_dupe_8grams": 0.52275046, "qsc_code_frac_chars_dupe_9grams": 0.42991226, "qsc_code_frac_chars_dupe_10grams": 0.40624362, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.05382569, "qsc_code_frac_chars_whitespace": 0.17257897, "qsc_code_size_file_byte": 7724.0, "qsc_code_num_lines": 230.0, "qsc_code_num_chars_line_max": 221.0, "qsc_code_num_chars_line_mean": 33.5826087, "qsc_code_frac_chars_alphabet": 0.71303395, "qsc_code_frac_chars_comments": 0.09476955, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.19480519, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.001287, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.002574, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecpp_frac_lines_preprocessor_directives": 0.00649351, "qsc_codecpp_frac_lines_func_ratio": 0.03896104, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.05194805, "qsc_codecpp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/src/cheat/sdk/hooks.cpp
#include "hooks.h" std::vector<std::pair<uint8_t, bool>> PatternToBytes(const std::string& pattern) { std::vector<std::pair<uint8_t, bool>> patternBytes; const char* start = pattern.c_str(); const char* end = start + pattern.size(); for (const char* current = start; current < end; ++current) { if (*current == ' ') continue; if (*current == '?') { patternBytes.emplace_back(0, false); if (*(current + 1) == '?') ++current; } else { patternBytes.emplace_back(strtoul(current, nullptr, 16), true); if (*(current + 1) != ' ') ++current; } } return patternBytes; } uintptr_t patternScan(const std::string& module, const std::string& pattern) { uintptr_t baseAddress = globals::modBase; HMODULE hModule = reinterpret_cast<HMODULE>(baseAddress); if (!hModule) return 0; MODULEINFO moduleInfo; GetModuleInformation(GetCurrentProcess(), hModule, &moduleInfo, sizeof(MODULEINFO)); size_t moduleSize = moduleInfo.SizeOfImage; std::vector<std::pair<uint8_t, bool>> patternBytes = PatternToBytes(pattern); size_t patternLength = patternBytes.size(); for (size_t i = 0; i < moduleSize - patternLength; ++i) { bool found = true; for (size_t j = 0; j < patternLength; ++j) { if (patternBytes[j].second && patternBytes[j].first != *reinterpret_cast<uint8_t*>(baseAddress + i + j)) { found = false; break; } } if (found) { return baseAddress + i; } } return 0; } std::uint8_t* FindPattern(const char* module_name, const std::string& byte_sequence) { // retrieve the handle to the specified module const HMODULE module = GetModuleHandleA(module_name); if (module == nullptr) return nullptr; // retrieve the DOS header of the module const auto dos_header = reinterpret_cast<PIMAGE_DOS_HEADER>(module); if (dos_header->e_magic != IMAGE_DOS_SIGNATURE) return nullptr; // retrieve the NT headers of the module const auto nt_headers = reinterpret_cast<PIMAGE_NT_HEADERS>(reinterpret_cast<std::uint8_t*>(module) + dos_header->e_lfanew); if (nt_headers->Signature != IMAGE_NT_SIGNATURE) return nullptr; // get the size and base address of the code section DWORD m_size = nt_headers->OptionalHeader.SizeOfCode; std::uint8_t* m_base = reinterpret_cast<std::uint8_t*>(module) + nt_headers->OptionalHeader.BaseOfCode; using SeqByte_t = std::pair< std::uint8_t, bool >; std::string str{ }; std::vector< std::pair< std::uint8_t, bool > > byte_sequence_vec{ }; std::stringstream stream(byte_sequence); // parse the byte sequence string into a vector of byte sequence elements while (stream >> str) { // wildcard byte if (str[0u] == '?') { byte_sequence_vec.emplace_back(0u, true); continue; } // invalid hex digit, skip this byte if (!std::isxdigit(str[0u]) || !std::isxdigit(str[1u])) continue; byte_sequence_vec.emplace_back(static_cast<std::uint8_t>(std::strtoul(str.data(), nullptr, 16)), false); } // end pointer of the code section const auto end = reinterpret_cast<std::uint8_t*>(m_base + m_size); // search for the byte sequence within the code section const auto ret = std::search(reinterpret_cast<std::uint8_t*>(m_base), end, byte_sequence_vec.begin(), byte_sequence_vec.end(), [](const std::uint8_t byte, const std::pair< std::uint8_t, bool >& seq_byte) { return std::get< bool >(seq_byte) || byte == std::get< std::uint8_t >(seq_byte); }); // byte sequence found, return the pointer if (ret) return ret; #ifdef _DEBUG // failed to find byte sequence, log error and return std::cout << "failed to find pattern:" << byte_sequence.c_str() << " | inside: " << module_name << std::endl; #endif return nullptr; } namespace hook { //ts aint working - gonna set up a seperate projct to see if i can do it void __fastcall hkCreateMove(int* a1, int a2, char a3) { { std::cout << "\nInCreateMove a1: " << a1; std::cout << "\n\npattern | hardcode\n" << std::hex << o::client::dwLocalPlayer << " | " << patternScan("client.dll", "66 0F 7F 05 ? ? ? ? C7 05 ? ? ? ? ? ? ? ? C6 05 ? ? ? ? ? 0F 11 05"); oCreateMove(a1, a2, a3); } } void __fastcall hkFrameStageNotify(void* a1, int stage) { std::cout << "\n[FrameStageNotify] stage " << stage; if (stage == 5 || stage == 6) { dotheskinchangershit(); } } void init() { ///* std::cout << "\nCalled INIT"; //MH_Initialize(); auto o_cm = patternScan("client.dll", "85 D2 0F 85 ? ? ? ? 48 8B C4 44 88 40"); std::cout << "\nCreateMove Located @ 0x" << o_cm; if (!o_cm) return; auto fsnpat = patternScan("client.dll", "48 89 5C 24 ? 56 48 83 EC 30 8B 05 ? ? ? ?"); if (!fsnpat) { std::cout << "\nFailed to find FrameStageNotify"; return; } //MH_CreateHook((LPVOID)fsnpat, (LPVOID)hkFrameStageNotify, (LPVOID*)&oFrameStageNotify); //MH_CreateHook((LPVOID)o_cm, (LPVOID)hkCreateMove, (LPVOID*)&oCreateMove); //MH_EnableHook((LPVOID)o_cm); //MH_EnableHook((LPVOID)fsnpat); std::cout << "\nEnabledHook"; //MH_DisableHook((LPVOID)o_cm); //when this is here the hook doesnt even get called std::cout << "\nDone\n\n"; //*/ } }
5,109
hooks
cpp
en
cpp
code
{"qsc_code_num_words": 688, "qsc_code_num_chars": 5109.0, "qsc_code_mean_word_length": 4.80813953, "qsc_code_frac_words_unique": 0.30232558, "qsc_code_frac_chars_top_2grams": 0.02902056, "qsc_code_frac_chars_top_3grams": 0.03264813, "qsc_code_frac_chars_top_4grams": 0.01964933, "qsc_code_frac_chars_dupe_5grams": 0.1305925, "qsc_code_frac_chars_dupe_6grams": 0.08464329, "qsc_code_frac_chars_dupe_7grams": 0.04836759, "qsc_code_frac_chars_dupe_8grams": 0.02297461, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02238628, "qsc_code_frac_chars_whitespace": 0.17811705, "qsc_code_size_file_byte": 5109.0, "qsc_code_num_lines": 180.0, "qsc_code_num_chars_line_max": 192.0, "qsc_code_num_chars_line_mean": 28.38333333, "qsc_code_frac_chars_alphabet": 0.76542034, "qsc_code_frac_chars_comments": 0.17889998, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.06837607, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00854701, "qsc_code_frac_chars_string_length": 0.09249106, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecpp_frac_lines_preprocessor_directives": 0.03418803, "qsc_codecpp_frac_lines_func_ratio": 0.05128205, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.13675214, "qsc_codecpp_frac_lines_print": 0.07692308}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/src/cheat/sdk/CEntity.h
#pragma once #include <cstdint> #include "../../globals.h" struct CEntity { uintptr_t CSSPlayerController{}; uintptr_t C_CSPlayerPawn{}; int health{}; int shield{}; Vec3 pos{}; Vec3 headpos{}; //x = pitch. y = yaw. z = roll Vec3 angle{}; //x = pitch. y = yaw. z = roll int team{}; //1 = SPEC. 2 = T. 3 = CT int GetHealth() { return *(int*)(C_CSPlayerPawn + o::C_CSPlayerPawn::m_iHealth); } }; struct C_CSPlayerPawn { private: uintptr_t base; public: //sets address of the pawns base void SetBase(uintptr_t input) { base = input; } //int pawnHealth int GetHealth() const { return *(int*)(base + o::C_CSPlayerPawn::m_iHealth); } //bool 1 = left, 0 = right bool GetHandedness() const { return *(bool*)(base + o::C_CSPlayerPawn::m_bLeftHanded); } //float shouldGlow void Glow(float val) { *(float*)(base + o::C_CSPlayerPawn::m_pGlowServices) = val; // 100000.f = on 0.f = off } //Vec3 bonePosition Vec3 GetBonePos(unsigned int bone) { uintptr_t gamescene = *(uintptr_t*)(base + 0x328); uintptr_t bonearray = *(uintptr_t*)(gamescene + 0x170 + 0x80); return *(Vec3*)(bonearray + bone * 32); } //Vec3 pawnOrigin Vec3 GetOrigin() { return *(Vec3*)(base + o::C_CSPlayerPawn::m_vOrigin); } int GetTeam() { return *(int*)(base + o::C_CSPlayerPawn::m_iTeamNum); } }; struct CCSPlayerController { private: uintptr_t base; public: void SetCCSPlayerController(uintptr_t input) { base = input; } int GetPing() const { int ping = *(int*)(base + o::CCSPlayerController::m_iPing); if (!ping) return 0; return ping; } std::string GetName() const { uintptr_t nameaddr = *(uintptr_t*)(base + o::CCSPlayerController::m_sSanitizedPlayerName); if (!nameaddr) return "Unknown"; return *(std::string*)(base + o::CCSPlayerController::m_sSanitizedPlayerName); } }; /* namespace util { bool ingame(); } */
1,907
CEntity
h
en
c
code
{"qsc_code_num_words": 237, "qsc_code_num_chars": 1907.0, "qsc_code_mean_word_length": 5.08438819, "qsc_code_frac_words_unique": 0.40084388, "qsc_code_frac_chars_top_2grams": 0.07966805, "qsc_code_frac_chars_top_3grams": 0.06970954, "qsc_code_frac_chars_top_4grams": 0.0746888, "qsc_code_frac_chars_dupe_5grams": 0.30041494, "qsc_code_frac_chars_dupe_6grams": 0.11286307, "qsc_code_frac_chars_dupe_7grams": 0.04647303, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02271252, "qsc_code_frac_chars_whitespace": 0.19192449, "qsc_code_size_file_byte": 1907.0, "qsc_code_num_lines": 117.0, "qsc_code_num_chars_line_max": 93.0, "qsc_code_num_chars_line_mean": 16.2991453, "qsc_code_frac_chars_alphabet": 0.75924724, "qsc_code_frac_chars_comments": 0.15312008, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.15068493, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.01361386, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.00866337, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.15068493, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.21917808, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/РедактированиеТабличногоДокумента/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОписаниеПеременных &НаКлиенте Перем ПолучательПеретаскиваемогоЗначения, АдресПараметровДляОбработкиОжидания; #КонецОбласти #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Если ОбщегоНазначения.ЭтоМобильныйКлиент() Тогда ВызватьИсключение НСтр("ru = 'Редактирование табличного документа недоступно в мобильном клиенте. |Используйте тонкий клиент или веб-клиент.'"); КонецЕсли; Если Параметры.РежимОткрытияОкна <> Неопределено Тогда РежимОткрытияОкна = Параметры.РежимОткрытияОкна; КонецЕсли; ТабличныйДокумент.КодЯзыка = ОбщегоНазначения.КодОсновногоЯзыка(); ИдентификаторМакета = Параметры.ИмяОбъектаМетаданныхМакета; СсылкаМакета = Параметры.Ссылка; Если ЗначениеЗаполнено(СсылкаМакета) Тогда КлючОбъектаРедактирования = СсылкаМакета; ЗаблокироватьДанныеДляРедактирования(КлючОбъектаРедактирования,, УникальныйИдентификатор); ИначеЕсли ЗначениеЗаполнено(ИдентификаторМакета) Тогда Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); КлючОбъектаРедактирования = МодульУправлениеПечатью.ПолучитьКлючЗаписиМакета(ИдентификаторМакета); Если КлючОбъектаРедактирования <> Неопределено Тогда ЗаблокироватьДанныеДляРедактирования(КлючОбъектаРедактирования,, УникальныйИдентификатор); КонецЕсли; КонецЕсли; КонецЕсли; ЭтоПечатнаяФорма = Параметры.ЭтоПечатнаяФорма; ЭтоМакет = Не ПустаяСтрока(ИдентификаторМакета) Или ЭтоПечатнаяФорма; ТабличныйДокумент.Макет = ЭтоМакет; Элементы.КнопкаПоказатьСкрытьОригинал.Видимость = ЭтоМакет; Элементы.КнопкаПоказатьСкрытьОригиналВсеДействия.Видимость = ЭтоМакет; Элементы.УдалитьШтампЭП.Видимость = ЭтоМакет; МакетДляВыгрузкиОбъекта = Параметры.МакетДляВыгрузкиОбъекта; ФорматСохраненияВыгрузки = Параметры.ФорматСохраненияВыгрузки; Если МакетДляВыгрузкиОбъекта И НЕ ЗначениеЗаполнено(ФорматСохраненияВыгрузки) Тогда ФорматСохраненияВыгрузки = Перечисления.ФорматыВыгрузкиОбъектов.XLSX; КонецЕсли; Элементы.ФорматСохраненияВыгрузки.Видимость = МакетДляВыгрузкиОбъекта; Элементы.ТекстНазначение.Доступность = НЕ МакетДляВыгрузкиОбъекта; Элементы.ЗаголовокНазначение.Доступность = НЕ МакетДляВыгрузкиОбъекта; ФорматыВыгрузкиСОбластями = ФорматыВыгрузкиТребующиеНаличиеОбластей(); ВыводитьКомандыИменОбластей = (МакетДляВыгрузкиОбъекта И ФорматыВыгрузкиСОбластями.Найти(ФорматСохраненияВыгрузки) <> Неопределено); Элементы.НазначитьИмя.Видимость = ВыводитьКомандыИменОбластей; Элементы.УдалитьИмя.Видимость = ВыводитьКомандыИменОбластей; Если ЭтоМакет Тогда Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); ИсточникиДанныхМакета = МодульУправлениеПечатью.ИсточникиДанныхМакета(ИдентификаторМакета); Для Каждого ИсточникДанных Из ИсточникиДанныхМакета Цикл ИсточникиДанных.Добавить(ИсточникДанных); КонецЦикла; КонецЕсли; КонецЕсли; Если ЗначениеЗаполнено(Параметры.ИсточникДанных) Тогда Если Не ЗначениеЗаполнено(ИсточникиДанных) Тогда ИсточникиДанных.Добавить(Параметры.ИсточникДанных); КонецЕсли; КонецЕсли; Элементы.ТекстНазначение.Заголовок = ПредставлениеИсточниковДанных(ИсточникиДанных); ИмяДокумента = Параметры.ИмяДокумента; ОсновнаяПечатнаяФорма = Параметры.ОсновнаяПечатнаяФорма; НаименованиеПечатнойФормы = Параметры.НаименованиеПечатнойФормы; Элементы.ИзменитьНастройкиМакета.Видимость = ЗначениеЗаполнено(Параметры.Ссылка) Или ПустаяСтрока(ИдентификаторМакета) И ПустаяСтрока(Параметры.ПутьКФайлу); Элементы.УдалитьЯзыкМакета.Видимость = Не ЗначениеЗаполнено(Параметры.Ссылка) И ПустаяСтрока(Параметры.ПутьКФайлу); Если Параметры.ТабличныйДокумент = Неопределено Тогда Если Не ПустаяСтрока(ИдентификаторМакета) Тогда РедактированиеЗапрещено = Не Параметры.Редактирование; ЗагрузитьТабличныйДокументИзМетаданных(Параметры.КодЯзыка); Если Параметры.Копирование Тогда ИдентификаторКопируемогоМакета = ИдентификаторМакета; ИдентификаторМакета = ""; КонецЕсли; КонецЕсли; ИначеЕсли ТипЗнч(Параметры.ТабличныйДокумент) = Тип("ТабличныйДокумент") Тогда ЗаполнитьТабличныйДокумент(ТабличныйДокумент, Параметры.ТабличныйДокумент); Иначе ТабличныйДокумент.КодЯзыка = Неопределено; ДвоичныеДанные = ПолучитьИзВременногоХранилища(Параметры.ТабличныйДокумент); // ДвоичныеДанные ИмяВременногоФайла = ПолучитьИмяВременногоФайла("mxl"); ДвоичныеДанные.Записать(ИмяВременногоФайла); ТабличныйДокумент.Прочитать(ИмяВременногоФайла); УдалитьФайлы(ИмяВременногоФайла); КонецЕсли; Элементы.ТабличныйДокумент.Редактирование = Параметры.Редактирование; Элементы.ТабличныйДокумент.ОтображатьГруппировки = Истина; Элементы.ТабличныйДокумент.ОтображатьИменаСтрокИКолонок = ТабличныйДокумент.Макет; Элементы.ТабличныйДокумент.ОтображатьИменаЯчеек = ТабличныйДокумент.Макет; Элементы.Предупреждение.Видимость = ЭтоМакет И Не ЭтоПечатнаяФорма И Параметры.Редактирование; Элементы.РедактироватьВоВнешнейПрограмме.Видимость = ОбщегоНазначения.ЭтоВебКлиент() И Не ПустаяСтрока(ИдентификаторМакета) И ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать"); ДоступенПереводМакета = Ложь; Если ЭтоМакет Тогда Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Мультиязычность.Печать") Тогда МодульУправлениеПечатьюМультиязычность = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатьюМультиязычность"); ДоступенПереводМакета = МодульУправлениеПечатьюМультиязычность.ДоступенПереводМакета(ИдентификаторМакета); Если ЭтоПечатнаяФорма Или МодульУправлениеПечатьюМультиязычность.ДоступенПереводМакета(ИдентификаторМакета) Тогда МодульУправлениеПечатьюМультиязычность.ЗаполнитьПодменюЯзык(ЭтотОбъект, Параметры.КодЯзыка); ДоступенАвтоматическийПеревод = МодульУправлениеПечатьюМультиязычность.ДоступенАвтоматическийПеревод(ТекущийЯзык); КонецЕсли; КонецЕсли; КонецЕсли; Элементы.Язык.Доступность = (ЭтоПечатнаяФорма Или ДоступенПереводМакета) И ЗначениеЗаполнено(ИдентификаторМакета); Элементы.ЯзыкВсеДействия.Доступность = Элементы.Язык.Доступность; Элементы.Перевести.Видимость = ДоступенАвтоматическийПеревод; Элементы.ПеревестиВсеДействия.Видимость = Элементы.Перевести.Видимость; Если ОбщегоНазначения.ЭтоМобильныйКлиент() Тогда ОбщегоНазначенияКлиентСервер.УстановитьСвойствоЭлементаФормы(Элементы, "КоманднаяПанель", "Видимость", Ложь); ОбщегоНазначенияКлиентСервер.УстановитьСвойствоЭлементаФормы(Элементы, "Предупреждение", "Видимость", Ложь); КонецЕсли; Если ЭтоПечатнаяФорма И ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормул = ОбщегоНазначения.ОбщийМодуль("КонструкторФормул"); ИсточникДанных = Параметры.ИсточникДанных; Если Не ЗначениеЗаполнено(Параметры.ИсточникДанных) Тогда ИсточникДанных = ИсточникиДанных[0].Значение; КонецЕсли; ОбъектМетаданных = ОбщегоНазначения.ОбъектМетаданныхПоИдентификатору(ИсточникДанных); ПодобратьОбразец(ОбъектМетаданных); Элементы.Редактирование.Видимость = Ложь; ЦветФонаВыделенияПоля = ЦветаСтиля.ЦветНавигации; Элементы.ТекстДляКопирования.Видимость = ОбщегоНазначения.ЭтоВебКлиент(); ПараметрыДобавления = МодульКонструкторФормул.ПараметрыДобавленияСпискаПолей(); ПараметрыДобавления.ИмяСписка = ИмяСпискаПолей(); ПараметрыДобавления.МестоРазмещенияСписка = Элементы.ГруппаДоступныеПоля; ПараметрыДобавления.КоллекцииПолей = КоллекцииПолей(ИсточникиДанных.ВыгрузитьЗначения(), ПараметрыРедактирования()); ПараметрыДобавления.ПодсказкаВводаСтрокиПоиска = ПодсказкаВводаСтрокиПоискаСпискаПолей(); ПараметрыДобавления.ПриОпределенииИсточниковДоступныхПолей = "УправлениеПечатью"; ПараметрыДобавления.ОбработчикиСписка.Вставить("Выбор", "Подключаемый_СписокПолейВыбор"); ПараметрыДобавления.ОбработчикиСписка.Вставить("ПередНачаломИзменения", "Подключаемый_ДоступныеПоляПередНачаломИзменения"); ПараметрыДобавления.ОбработчикиСписка.Вставить("ПриОкончанииРедактирования", "Подключаемый_ДоступныеПоляПриОкончанииРедактирования"); ПараметрыДобавления.ИспользоватьФоновыйПоиск = Истина; МодульКонструкторФормул.ДобавитьСписокПолейНаФорму(ЭтотОбъект, ПараметрыДобавления); ПараметрыДобавления = МодульКонструкторФормул.ПараметрыДобавленияСпискаПолей(); ПараметрыДобавления.ИмяСписка = ИмяСпискаОператоров(); ПараметрыДобавления.МестоРазмещенияСписка = Элементы.ГруппаОператорыИФункции; ПараметрыДобавления.КоллекцииПолей.Добавить(СписокОператоров()); ПараметрыДобавления.ПодсказкаВводаСтрокиПоиска = НСтр("ru = 'Найти оператор или функцию...'"); ПараметрыДобавления.СкобкиПредставлений = Ложь; ПараметрыДобавления.ОбработчикиСписка.Вставить("Выбор", "Подключаемый_СписокПолейВыбор"); ПараметрыДобавления.ОбработчикиСписка.Вставить("НачалоПеретаскивания", "Подключаемый_ОператорыНачалоПеретаскивания"); ПараметрыДобавления.ОбработчикиСписка.Вставить("ОкончаниеПеретаскивания", "Подключаемый_ОператорыОкончаниеПеретаскивания"); МодульКонструкторФормул.ДобавитьСписокПолейНаФорму(ЭтотОбъект, ПараметрыДобавления); ЗаполнитьТабличныйДокумент(ТабличныйДокумент, ПрочитатьМакет()); ПрочитатьТекстВПолеКолонтитула(ТабличныйДокумент.ВерхнийКолонтитул.ТекстСлева, ТекстСлеваСверху); ПрочитатьТекстВПолеКолонтитула(ТабличныйДокумент.ВерхнийКолонтитул.ТекстВЦентре, ТекстВЦентреСверху); ПрочитатьТекстВПолеКолонтитула(ТабличныйДокумент.ВерхнийКолонтитул.ТекстСправа, ТекстСправаСверху); ПрочитатьТекстВПолеКолонтитула(ТабличныйДокумент.НижнийКолонтитул.ТекстСлева, ТекстСлеваСнизу); ПрочитатьТекстВПолеКолонтитула(ТабличныйДокумент.НижнийКолонтитул.ТекстВЦентре, ТекстВЦентреСнизу); ПрочитатьТекстВПолеКолонтитула(ТабличныйДокумент.НижнийКолонтитул.ТекстСправа, ТекстСправаСнизу); РасширитьСписокПолей(); ТабличныйДокумент.Макет = Истина; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.РаботаСФайлами") Тогда МодульРаботаСФайламиСлужебный = ОбщегоНазначения.ОбщийМодуль("РаботаСФайламиСлужебный"); ТипыПрисоединенныхФайлов = МодульРаботаСФайламиСлужебный.ТипыПрисоединенныхФайлов(); КонецЕсли; КонецЕсли; Если Не ЭтоПечатнаяФорма Тогда Элементы.ПоказыватьКолонтитулы.Видимость = Ложь; Элементы.НастройкиТекущейОбласти.Видимость = Ложь; Элементы.КнопкаДоступныеПоля.Видимость = Ложь; Элементы.ПосмотретьПечатнуюФорму.Видимость = Ложь; Элементы.ПовторятьВНачалеСтраницы.Видимость = Ложь; Элементы.ПовторятьВКонцеСтраницы.Видимость = Ложь; КонецЕсли; ВидимостьКнопокУправленияТекстом(ЭтотОбъект); Элементы.ВерхнийКолонтитул.Видимость = Ложь; Элементы.НижнийКолонтитул.Видимость = Ложь; Элементы.ГруппаНазначениеМакета.Видимость = ЭтоПечатнаяФорма; Элементы.ГруппаНазначениеМакета.Доступность = Параметры.ДоступноНазначение; КонецПроцедуры &НаКлиенте Процедура ПриОткрытии(Отказ) Если Не ПустаяСтрока(Параметры.ПутьКФайлу) Тогда Файл = Новый Файл(Параметры.ПутьКФайлу); Если ПустаяСтрока(ИмяДокумента) Тогда ИмяДокумента = Файл.ИмяБезРасширения; КонецЕсли; Файл.НачатьПолучениеТолькоЧтения(Новый ОписаниеОповещения("ПриЗавершенииПолученияТолькоЧтения", ЭтотОбъект)); Возврат; КонецЕсли; УстановитьНачальныеНастройкиФормы(); КонецПроцедуры &НаКлиенте Процедура ПередЗакрытием(Отказ, ЗавершениеРаботы, ТекстПредупреждения, СтандартнаяОбработка) Если Элементы.ПосмотретьПечатнуюФорму.Пометка Тогда Отказ = Истина; ПосмотретьПечатнуюФорму(Неопределено); Возврат; КонецЕсли; ОписаниеОповещения = Новый ОписаниеОповещения("ПодтвердитьИЗакрыть", ЭтотОбъект); ТекстВопроса = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(НСтр("ru = 'Сохранить изменения в %1?'"), ИмяДокумента); ОбщегоНазначенияКлиент.ПоказатьПодтверждениеЗакрытияФормы(ОписаниеОповещения, Отказ, ЗавершениеРаботы, ТекстВопроса); Если Модифицированность Или ЗавершениеРаботы Тогда Возврат; КонецЕсли; Если Не ЭтоНовый() Тогда ОповеститьОЗаписиТабличногоДокумента(); КонецЕсли; Если Не Отказ И Не ЗавершениеРаботы И ЗначениеЗаполнено(КлючОбъектаРедактирования) Тогда РазблокироватьНаСервере(); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПодтвердитьИЗакрыть(Результат = Неопределено, ДополнительныеПараметры = Неопределено) Экспорт ОписаниеОповещения = Новый ОписаниеОповещения("ЗакрытьФормуПослеЗаписиТабличногоДокумента", ЭтотОбъект); ЗаписатьТабличныйДокумент(ОписаниеОповещения); КонецПроцедуры &НаКлиенте Процедура ОбработкаОповещения(ИмяСобытия, Параметр, Источник) Если ИмяСобытия = "ЗапросИменРедактируемыхТабличныхДокументов" И Источник <> ЭтотОбъект Тогда ИменаДокументов = Параметр; // Массив - ИменаДокументов.Добавить(ИмяДокумента); ИначеЕсли ИмяСобытия = "ЗакрытиеФормыВладельца" И Источник = ВладелецФормы Тогда Закрыть(); Если Открыта() Тогда Параметр.Отказ = Истина; КонецЕсли; КонецЕсли; КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовШапкиФормы &НаКлиенте Процедура ТабличныйДокументПриАктивизации(Элемент) ОбновитьПометкиКнопокКоманднойПанели(); СинхронизироватьОбластьПросмотраМакетов(); ПодключитьОбработчикОжидания("ОчиститьПодсветку", 0.1, Истина); ПодключитьОбработчикОжидания("ОбновитьОбластьНастройкиВыбранныхЯчеек", 0.1, Истина); КонецПроцедуры &НаКлиенте Процедура ПоставляемыйМакетПриАктивизации(Элемент) СинхронизироватьОбластьПросмотраМакетов(); КонецПроцедуры &НаКлиенте Процедура ВладельцыМакетаНажатие(Элемент) ПараметрыПодбора = СтандартныеПодсистемыКлиентСервер.ПараметрыВыбораОбъектовМетаданных(); ПараметрыПодбора.ВыбранныеОбъектыМетаданных = ОбщегоНазначенияКлиент.СкопироватьРекурсивно(ИсточникиДанных); ПараметрыПодбора.ВыбиратьСсылки = Истина; ПараметрыПодбора.Заголовок = НСтр("ru = 'Назначение макета'"); ПараметрыПодбора.ФильтрПоОбъектамМетаданных = ОбъектыСКомандамиПечати(); ОписаниеОповещения = Новый ОписаниеОповещения("ПриВыбореВладельцевМакета", ЭтотОбъект); СтандартныеПодсистемыКлиент.ВыбратьОбъектыМетаданных(ПараметрыПодбора, ОписаниеОповещения); КонецПроцедуры &НаКлиенте Процедура ФорматСохраненияВыгрузкиПриИзменении(Элемент) ФорматыВыгрузкиСОбластями = ФорматыВыгрузкиТребующиеНаличиеОбластей(); ВыводитьКомандыИменОбластей = (МакетДляВыгрузкиОбъекта И ФорматыВыгрузкиСОбластями.Найти(ФорматСохраненияВыгрузки) <> Неопределено); Элементы.НазначитьИмя.Видимость = ВыводитьКомандыИменОбластей; Элементы.УдалитьИмя.Видимость = ВыводитьКомандыИменОбластей; ВидимостьКнопокУправленияТекстом(ЭтотОбъект); Модифицированность = Истина; КонецПроцедуры &НаКлиенте Процедура ФорматСохраненияВыгрузкиОчистка(Элемент, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы // Действия с документом &НаКлиенте Процедура ЗаписатьИЗакрыть(Команда) ОписаниеОповещения = Новый ОписаниеОповещения("ЗакрытьФормуПослеЗаписиТабличногоДокумента", ЭтотОбъект); ЗаписатьТабличныйДокумент(ОписаниеОповещения, Истина); КонецПроцедуры &НаКлиенте Процедура Записать(Команда) ЗаписатьТабличныйДокумент(); ОповеститьОЗаписиТабличногоДокумента(); КонецПроцедуры &НаКлиенте Процедура Редактирование(Команда) Элементы.ТабличныйДокумент.Редактирование = Не Элементы.ТабличныйДокумент.Редактирование; НастроитьПредставлениеКоманд(); НастроитьОтображениеТабличногоДокумента(); КонецПроцедуры &НаКлиенте Процедура РедактироватьВоВнешнейПрограмме(Команда) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда ПараметрыОткрытия = Новый Структура; ПараметрыОткрытия.Вставить("ТабличныйДокумент", ТабличныйДокумент); ПараметрыОткрытия.Вставить("ИмяОбъектаМетаданныхМакета", ИдентификаторМакета); ПараметрыОткрытия.Вставить("ИдентификаторМакета", ИдентификаторМакета); ПараметрыОткрытия.Вставить("ТипМакета", "MXL"); ОписаниеОповещения = Новый ОписаниеОповещения("РедактироватьВоВнешнейПрограммеЗавершение", ЭтотОбъект); МодульУправлениеПечатьюКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("УправлениеПечатьюКлиент"); МодульУправлениеПечатьюКлиент.РедактироватьМакетВоВнешнейПрограмме(ОписаниеОповещения, ПараметрыОткрытия, ЭтотОбъект); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура СохранитьВФайл(Команда) ОчиститьПодсветку(); ДиалогВыбораФайла = Новый ДиалогВыбораФайла(РежимДиалогаВыбораФайла.Сохранение); ДиалогВыбораФайла.ПолноеИмяФайла = ОбщегоНазначенияКлиентСервер.ЗаменитьНедопустимыеСимволыВИмениФайла(ИмяДокумента); ДиалогВыбораФайла.Фильтр = НСтр("ru = 'Табличный документ'") + " (*.mxl)|*.mxl"; ОписаниеОповещения = Новый ОписаниеОповещения("ПродолжитьСохранениеВФайл", ЭтотОбъект); ФайловаяСистемаКлиент.ПоказатьДиалогВыбора(ОписаниеОповещения, ДиалогВыбораФайла); КонецПроцедуры &НаКлиенте Процедура ЗагрузитьИзФайла(Команда) ДиалогВыбораФайла = Новый ДиалогВыбораФайла(РежимДиалогаВыбораФайла.Открытие); ДиалогВыбораФайла.Фильтр = НСтр("ru = 'Табличный документ'") + " (*.mxl)|*.mxl"; ДиалогВыбораФайла.МножественныйВыбор = Ложь; ОписаниеОповещения = Новый ОписаниеОповещения("ПродолжитьЗагрузкуИзФайла", ЭтотОбъект); ФайловаяСистемаКлиент.ПоказатьДиалогВыбора(ОписаниеОповещения, ДиалогВыбораФайла); КонецПроцедуры &НаКлиенте Процедура ИзменитьШрифт(Команда) Если Элементы.ТабличныйДокумент.ТекущаяОбласть = Неопределено Тогда Возврат; КонецЕсли; ОписаниеОповещения = Новый ОписаниеОповещения("ИзменитьШрифтПродолжение", ЭтотОбъект); ОткрытьФорму("ОбщаяФорма.ФормаВыбораШрифта",, ЭтотОбъект,,,, ОписаниеОповещения); КонецПроцедуры // Форматирование &НаКлиенте Процедура УвеличитьРазмерШрифта(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Размер = Область.Шрифт.Размер; Размер = Размер + ШагИзмененияРазмераШрифтаУвеличение(Размер); Область.Шрифт = Новый Шрифт(Область.Шрифт,,Размер); // АПК:1345 - Применение стиля не требуется. КонецЦикла; КонецПроцедуры &НаКлиенте Процедура УменьшитьРазмерШрифта(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Размер = Область.Шрифт.Размер; Размер = Размер - ШагИзмененияРазмераШрифтаУменьшение(Размер); Если Размер < 1 Тогда Размер = 1; КонецЕсли; Область.Шрифт = Новый Шрифт(Область.Шрифт,,Размер); // АПК:1345 - Применение стиля не требуется. КонецЦикла; КонецПроцедуры &НаКлиенте Процедура Зачеркивание(Команда) УстанавливаемоеЗначение = Неопределено; Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Если УстанавливаемоеЗначение = Неопределено Тогда УстанавливаемоеЗначение = Не Область.Шрифт.Зачеркивание = Истина; КонецЕсли; Область.Шрифт = Новый Шрифт(Область.Шрифт,,,,,,УстанавливаемоеЗначение); // АПК:1345 - Применение стиля не требуется. КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры &НаКлиенте Процедура Перевести(Команда) ТекстВопроса = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Выполнить автоматический перевод на %1 язык?'"), Элементы.Язык.Заголовок); Кнопки = Новый СписокЗначений; Кнопки.Добавить(КодВозвратаДиалога.Да, НСтр("ru = 'Выполнить перевод'")); Кнопки.Добавить(КодВозвратаДиалога.Нет, НСтр("ru = 'Не выполнять'")); ОписаниеОповещения = Новый ОписаниеОповещения("ПриОтветеНаВопросОПереводеМакета", ЭтотОбъект); ПоказатьВопрос(ОписаниеОповещения, ТекстВопроса, Кнопки); КонецПроцедуры &НаКлиенте Процедура ТекстСлеваСверхуПриИзменении(Элемент) ТабличныйДокумент.ВерхнийКолонтитул.ТекстСлева = ТекстСлеваСверху.ПолучитьФорматированнуюСтроку(); УстановитьВыводКолонтитула(ТабличныйДокумент.ВерхнийКолонтитул); Модифицированность = Истина; ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры &НаКлиенте Процедура ТекстВЦентреСверхуПриИзменении(Элемент) ТабличныйДокумент.ВерхнийКолонтитул.ТекстВЦентре = ТекстВЦентреСверху.ПолучитьФорматированнуюСтроку(); УстановитьВыводКолонтитула(ТабличныйДокумент.ВерхнийКолонтитул); Модифицированность = Истина; ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры &НаКлиенте Процедура ТекстСправаСверхуПриИзменении(Элемент) ТабличныйДокумент.ВерхнийКолонтитул.ТекстСправа = ТекстСправаСверху.ПолучитьФорматированнуюСтроку(); УстановитьВыводКолонтитула(ТабличныйДокумент.ВерхнийКолонтитул); Модифицированность = Истина; ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры &НаКлиенте Процедура ТекстСлеваСнизуПриИзменении(Элемент) ТабличныйДокумент.НижнийКолонтитул.ТекстСлева = ТекстСлеваСнизу.ПолучитьФорматированнуюСтроку(); УстановитьВыводКолонтитула(ТабличныйДокумент.НижнийКолонтитул); Модифицированность = Истина; ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры &НаКлиенте Процедура ТекстВЦентреСнизуПриИзменении(Элемент) ТабличныйДокумент.НижнийКолонтитул.ТекстВЦентре = ТекстВЦентреСнизу.ПолучитьФорматированнуюСтроку(); УстановитьВыводКолонтитула(ТабличныйДокумент.НижнийКолонтитул); Модифицированность = Истина; ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры &НаКлиенте Процедура ТекстСправаСнизуПриИзменении(Элемент) ТабличныйДокумент.НижнийКолонтитул.ТекстСправа = ТекстСправаСнизу.ПолучитьФорматированнуюСтроку(); УстановитьВыводКолонтитула(ТабличныйДокумент.НижнийКолонтитул); Модифицированность = Истина; ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры &НаКлиенте Процедура ВыровнятьПоВерхнемуКраю(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Область.ВертикальноеПоложение = ВертикальноеПоложение.Верх; КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры &НаКлиенте Процедура ВыровнятьПоСередине(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Область.ВертикальноеПоложение = ВертикальноеПоложение.Центр; КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры &НаКлиенте Процедура ВыровнятьПоНижнемуКраю(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Область.ВертикальноеПоложение = ВертикальноеПоложение.Низ; КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры &НаКлиенте Процедура ИзменитьНастройкиМакета(Команда) СтруктураПараметров = Новый Структура; СтруктураПараметров.Вставить("НаименованиеМакета", ИмяДокумента); СтруктураПараметров.Вставить("ИдентификаторМакета", ИдентификаторМакета); СтруктураПараметров.Вставить("КодЯзыка", ТекущийЯзык); СтруктураПараметров.Вставить("ВладелецМакета", Образец); ПриИзмененииНастроекМакета(СтруктураПараметров); КонецПроцедуры &НаКлиенте Процедура ИзменитьЦветГраницы(Команда) ОписаниеОповещения = Новый ОписаниеОповещения("ЗавершениеИзменитьЦветГраницы", ЭтотОбъект); ОткрытьФорму("ОбщаяФорма.ФормаВыбораЦвета",, ЭтотОбъект,,,, ОписаниеОповещения); КонецПроцедуры &НаКлиенте Процедура ИзменитьЦветТекста(Команда) ОписаниеОповещения = Новый ОписаниеОповещения("ЗавершениеИзменитьЦветТекста", ЭтотОбъект); ОткрытьФорму("ОбщаяФорма.ФормаВыбораЦвета",, ЭтотОбъект,,,, ОписаниеОповещения); КонецПроцедуры &НаКлиенте Процедура ИзменитьЦветФона(Команда) ОписаниеОповещения = Новый ОписаниеОповещения("ЗавершениеИзменитьЦветФона", ЭтотОбъект); ОткрытьФорму("ОбщаяФорма.ФормаВыбораЦвета",, ЭтотОбъект,,,, ОписаниеОповещения); КонецПроцедуры &НаКлиенте Процедура РазмещениеАвто(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Авто; КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры &НаКлиенте Процедура РазмещениеЗабивать(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Забивать; КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры &НаКлиенте Процедура РазмещениеОбрезать(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Обрезать; КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры &НаКлиенте Процедура РазмещениеПереносить(Команда) Для Каждого Область Из СписокОбластейДляИзмененияШрифта() Цикл Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Переносить; КонецЦикла; ОбновитьПометкиКнопокКоманднойПанели(); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервере Процедура ЗагрузитьТабличныйДокументИзМетаданных(Знач КодЯзыка = Неопределено) ТребуетсяПеревод = Ложь; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); МакетПечатнойФормы = МодульУправлениеПечатью.МакетПечатнойФормы(ИдентификаторМакета, КодЯзыка); ЗаполнитьТабличныйДокумент(ТабличныйДокумент, МакетПечатнойФормы); Если Не ЗначениеЗаполнено(СсылкаМакета) Тогда ПоставляемыйМакет = МодульУправлениеПечатью.ПоставляемыйМакет(ИдентификаторМакета, КодЯзыка); КонецЕсли; КонецЕсли; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Мультиязычность.Печать") Тогда МодульУправлениеПечатьюМультиязычность = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатьюМультиязычность"); Если ЗначениеЗаполнено(КодЯзыка) Тогда ДоступныеЯзыкиТабличногоДокумента = МодульУправлениеПечатьюМультиязычность.ЯзыкиМакета(ИдентификаторМакета); ТребуетсяПеревод = ДоступныеЯзыкиТабличногоДокумента.Найти(КодЯзыка) = Неопределено; КонецЕсли; Если КодЯзыка <> "" Тогда ЯзыкиМакета = МодульУправлениеПечатьюМультиязычность.ЯзыкиМакета(ИдентификаторМакета); Модифицированность = Модифицированность Или (ЯзыкиМакета.Найти(КодЯзыка) = Неопределено); КонецЕсли; ДоступенАвтоматическийПеревод = МодульУправлениеПечатьюМультиязычность.ДоступенАвтоматическийПеревод(ТекущийЯзык); Элементы.Перевести.Видимость = ДоступенАвтоматическийПеревод; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура УстановитьВыводКолонтитула(Колонтитул) Колонтитул.Выводить = Не ПустаяСтрока(Колонтитул.ТекстСлева) Или Не ПустаяСтрока(Колонтитул.ТекстСправа) Или Не ПустаяСтрока(Колонтитул.ТекстВЦентре); Колонтитул.НачальнаяСтраница = 1; КонецПроцедуры &НаКлиенте Процедура НастроитьОтображениеТабличногоДокумента() Элементы.ТабличныйДокумент.ОтображатьЗаголовки = Элементы.ТабличныйДокумент.Редактирование; Элементы.ТабличныйДокумент.ОтображатьСетку = Элементы.ТабличныйДокумент.Редактирование; КонецПроцедуры &НаКлиенте Процедура ОбновитьПометкиКнопокКоманднойПанели(); #Если Не ВебКлиент И НЕ МобильныйКлиент Тогда Область = Элементы.ТабличныйДокумент.ТекущаяОбласть; Если ТипЗнч(Область) <> Тип("ОбластьЯчеекТабличногоДокумента") Тогда Возврат; КонецЕсли; // Шрифт Шрифт = Область.Шрифт; Элементы.ТабличныйДокументЖирный.Пометка = Шрифт <> Неопределено И Шрифт.Полужирный = Истина; Элементы.ТабличныйДокументНаклонный.Пометка = Шрифт <> Неопределено И Шрифт.Наклонный = Истина; Элементы.ТабличныйДокументПодчеркивание.Пометка = Шрифт <> Неопределено И Шрифт.Подчеркивание = Истина; Элементы.ТабличныйДокументПодчеркиваниеВсеДействия.Пометка = Элементы.ТабличныйДокументЖирный.Пометка; Элементы.ТабличныйДокументНаклонныйВсеДействия.Пометка = Элементы.ТабличныйДокументНаклонный.Пометка; Элементы.ТабличныйДокументПодчеркиваниеВсеДействия.Пометка = Элементы.ТабличныйДокументПодчеркивание.Пометка; Элементы.ЗачеркиваниеВсеДействия.Пометка = Шрифт <> Неопределено И Шрифт.Зачеркивание = Истина; // Горизонтальное положение Элементы.ТабличныйДокументВыровнятьВлево.Пометка = Область.ГоризонтальноеПоложение = ГоризонтальноеПоложение.Лево; Элементы.ТабличныйДокументВыровнятьПоЦентру.Пометка = Область.ГоризонтальноеПоложение = ГоризонтальноеПоложение.Центр; Элементы.ТабличныйДокументВыровнятьВправо.Пометка = Область.ГоризонтальноеПоложение = ГоризонтальноеПоложение.Право; Элементы.ТабличныйДокументВыровнятьПоШирине.Пометка = Область.ГоризонтальноеПоложение = ГоризонтальноеПоложение.ПоШирине; Элементы.ТабличныйДокументВыровнятьВлевоВсеДействия.Пометка = Элементы.ТабличныйДокументВыровнятьВлево.Пометка; Элементы.ТабличныйДокументВыровнятьПоЦентруВсеДействия.Пометка = Элементы.ТабличныйДокументВыровнятьПоЦентру.Пометка; Элементы.ТабличныйДокументВыровнятьВправоВсеДействия.Пометка = Элементы.ТабличныйДокументВыровнятьВправо.Пометка; Элементы.ТабличныйДокументВыровнятьПоШиринеВсеДействия.Пометка = Элементы.ТабличныйДокументВыровнятьПоШирине.Пометка; // Вертикальное положение Элементы.ВыровнятьПоВерхнемуКраю.Пометка = Область.ВертикальноеПоложение = ВертикальноеПоложение.Верх; Элементы.ВыровнятьПоСередине.Пометка = Область.ВертикальноеПоложение = ВертикальноеПоложение.Центр; Элементы.ВыровнятьПоНижнемуКраю.Пометка = Область.ВертикальноеПоложение = ВертикальноеПоложение.Низ; Элементы.ВыровнятьПоВерхнемуКраюВсеДействия.Пометка = Элементы.ВыровнятьПоВерхнемуКраю.Пометка; Элементы.ВыровнятьПоСерединеВсеДействия.Пометка = Элементы.ВыровнятьПоСередине.Пометка; Элементы.ВыровнятьПоНижнемуКраюВсеДействия.Пометка = Элементы.ВыровнятьПоНижнемуКраю.Пометка; // Размещение Элементы.РазмещениеАвто.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Авто); Элементы.РазмещениеПереносить.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Переносить); Элементы.РазмещениеЗабивать.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Забивать); Элементы.РазмещениеОбрезать.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Обрезать); Элементы.РазмещениеАвтоЕще.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Авто); Элементы.РазмещениеПереноситьЕще.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Переносить); Элементы.РазмещениеЗабиватьЕще.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Забивать); Элементы.РазмещениеОбрезатьЕще.Пометка = (Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Обрезать); #КонецЕсли КонецПроцедуры &НаКлиенте Функция ШагИзмененияРазмераШрифтаУвеличение(Размер) Если Размер = -1 Тогда Возврат 10; КонецЕсли; Если Размер < 10 Тогда Возврат 1; ИначеЕсли 10 <= Размер И Размер < 20 Тогда Возврат 2; ИначеЕсли 20 <= Размер И Размер < 48 Тогда Возврат 4; ИначеЕсли 48 <= Размер И Размер < 72 Тогда Возврат 6; ИначеЕсли 72 <= Размер И Размер < 96 Тогда Возврат 8; Иначе Возврат Окр(Размер / 10); КонецЕсли; КонецФункции &НаКлиенте Функция ШагИзмененияРазмераШрифтаУменьшение(Размер) Если Размер = -1 Тогда Возврат -8; КонецЕсли; Если Размер <= 11 Тогда Возврат 1; ИначеЕсли 11 < Размер И Размер <= 23 Тогда Возврат 2; ИначеЕсли 23 < Размер И Размер <= 53 Тогда Возврат 4; ИначеЕсли 53 < Размер И Размер <= 79 Тогда Возврат 6; ИначеЕсли 79 < Размер И Размер <= 105 Тогда Возврат 8; Иначе Возврат Окр(Размер / 11); КонецЕсли; КонецФункции // Возвращаемое значение: // Массив из ОбластьЯчеекТабличногоДокумента // &НаКлиенте Функция СписокОбластейДляИзмененияШрифта() Результат = Новый Массив; Для Каждого ОбрабатываемаяОбласть Из Элементы.ТабличныйДокумент.ПолучитьВыделенныеОбласти() Цикл Если ОбрабатываемаяОбласть.Шрифт <> Неопределено Тогда Результат.Добавить(ОбрабатываемаяОбласть); Продолжить; КонецЕсли; ОбрабатываемаяОбластьВерх = ОбрабатываемаяОбласть.Верх; ОбрабатываемаяОбластьНиз = ОбрабатываемаяОбласть.Низ; ОбрабатываемаяОбластьЛево = ОбрабатываемаяОбласть.Лево; ОбрабатываемаяОбластьПраво = ОбрабатываемаяОбласть.Право; Если ОбрабатываемаяОбластьВерх = 0 Тогда ОбрабатываемаяОбластьВерх = 1; КонецЕсли; Если ОбрабатываемаяОбластьНиз = 0 Тогда ОбрабатываемаяОбластьНиз = ТабличныйДокумент.ВысотаТаблицы; КонецЕсли; Если ОбрабатываемаяОбластьЛево = 0 Тогда ОбрабатываемаяОбластьЛево = 1; КонецЕсли; Если ОбрабатываемаяОбластьПраво = 0 Тогда ОбрабатываемаяОбластьПраво = ТабличныйДокумент.ШиринаТаблицы; КонецЕсли; Если ОбрабатываемаяОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Колонки Тогда ОбрабатываемаяОбластьВерх = ОбрабатываемаяОбласть.Низ; ОбрабатываемаяОбластьНиз = ТабличныйДокумент.ВысотаТаблицы; КонецЕсли; Для НомерКолонки = ОбрабатываемаяОбластьЛево По ОбрабатываемаяОбластьПраво Цикл ШиринаКолонки = Неопределено; Для НомерСтроки = ОбрабатываемаяОбластьВерх По ОбрабатываемаяОбластьНиз Цикл Ячейка = ТабличныйДокумент.Область(НомерСтроки, НомерКолонки, НомерСтроки, НомерКолонки); Если ОбрабатываемаяОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Колонки Тогда Если ШиринаКолонки = Неопределено Тогда ШиринаКолонки = Ячейка.ШиринаКолонки; КонецЕсли; Если Ячейка.ШиринаКолонки <> ШиринаКолонки Тогда Продолжить; КонецЕсли; КонецЕсли; Если Ячейка.Шрифт <> Неопределено Тогда Результат.Добавить(Ячейка); КонецЕсли; КонецЦикла; КонецЦикла; КонецЦикла; Возврат Результат; КонецФункции &НаКлиенте Процедура ЗакрытьФормуПослеЗаписиТабличногоДокумента(Закрывать, ДополнительныеПараметры) Экспорт Если Закрывать Тогда Закрыть(); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЗаписатьТабличныйДокумент(ОбработчикЗавершения = Неопределено, ОсвободитьФайл = Ложь) ОчиститьПодсветку(); Если МакетДляВыгрузкиОбъекта Тогда Если НЕ ЗначениеЗаполнено(ФорматСохраненияВыгрузки) Тогда ТекстСообщения = Нстр("ru = 'Поле ""Формат сохранения"" не заполнено'"); ОбщегоНазначенияКлиент.СообщитьПользователю(ТекстСообщения,, "ФорматСохраненияВыгрузки"); Возврат; Иначе ПроверитьНаличиеНеИспользуемыхСвойств(ОбработчикЗавершения, ОсвободитьФайл); КонецЕсли; Иначе ЕстьСсылка = ЗначениеЗаполнено(Параметры.Ссылка); Если ЭтоНовый() И Не ЭтоМакет И Не ЕстьСсылка Или РедактированиеЗапрещено Тогда НачатьДиалогСохраненияФайла(ОбработчикЗавершения, ОсвободитьФайл); Возврат; КонецЕсли; ЗаписатьТабличныйДокументИмяФайлаВыбрано(ОбработчикЗавершения, ОсвободитьФайл); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЗаписатьТабличныйДокументИмяФайлаВыбрано(Знач ОбработчикЗавершения, ОсвободитьФайл) ДополнительныеПараметры = Новый Структура; ДополнительныеПараметры.Вставить("ОбработчикЗавершения", ОбработчикЗавершения); ДополнительныеПараметры.Вставить("ОсвободитьФайл", ОсвободитьФайл); Если ПустаяСтрока(Параметры.ПутьКФайлу) Тогда АдресМакетаВоВременномХранилище = ""; ДополнительныеПараметры.Вставить("АдресМакетаВоВременномХранилище", АдресМакетаВоВременномХранилище); ОчиститьСообщения(); Если ЗаписатьМакет(Истина, ДополнительныеПараметры.АдресМакетаВоВременномХранилище) Тогда ПослеЗаписиТабличногоДокумента(ДополнительныеПараметры.ОбработчикЗавершения, ОсвободитьФайл); Иначе Если НЕ МакетДляВыгрузкиОбъекта Тогда ОписаниеОповещения = Новый ОписаниеОповещения( "ПродолжитьЗаписьТабличногоДокумента", ЭтотОбъект, ДополнительныеПараметры); ТекстВопроса = НСтр("ru = 'Макет заполнен некорректно. Продолжить запись?'"); ПоказатьВопрос( ОписаниеОповещения, ТекстВопроса, РежимДиалогаВопрос.ДаНет, , КодВозвратаДиалога.Нет); КонецЕсли; КонецЕсли; Иначе ТабличныйДокумент.НачатьЗапись( Новый ОписаниеОповещения("ОбработатьРезультатЗаписиТабличногоДокумента", ЭтотОбъект, ДополнительныеПараметры), Параметры.ПутьКФайлу); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПродолжитьЗаписьТабличногоДокумента(РезультатДиалога, ДополнительныеПараметры) Экспорт Если РезультатДиалога = КодВозвратаДиалога.Да Тогда ЗаписатьМакет(Ложь, ДополнительныеПараметры.АдресМакетаВоВременномХранилище); ПослеЗаписиТабличногоДокумента(ДополнительныеПараметры.ОбработчикЗавершения, ДополнительныеПараметры.ОсвободитьФайл); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ОбработатьРезультатЗаписиТабличногоДокумента(Результат, ДополнительныеПараметры) Экспорт Если Результат <> Истина Тогда Возврат; КонецЕсли; РедактированиеЗапрещено = Ложь; ПослеЗаписиТабличногоДокумента(ДополнительныеПараметры.ОбработчикЗавершения, ДополнительныеПараметры.ОсвободитьФайл); КонецПроцедуры &НаКлиенте Процедура ПослеЗаписиТабличногоДокумента(ОбработчикЗавершения, ОсвободитьФайл) ЗаписьВыполнена = Истина; Модифицированность = Ложь; УстановитьЗаголовок(); СохраненныеЯзыкиМакета.Добавить(ТекущийЯзык); Если Параметры.ОсновнаяПечатнаяФорма <> ОсновнаяПечатнаяФорма Тогда ОбновитьПовторноИспользуемыеЗначения(); Параметры.ОсновнаяПечатнаяФорма = ОсновнаяПечатнаяФорма КонецЕсли; Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.РаботаСФайлами") Тогда Если ЗначениеЗаполнено(Параметры.ПрисоединенныйФайл) Тогда МодульРаботаСФайламиСлужебныйКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("РаботаСФайламиСлужебныйКлиент"); Если ОсвободитьФайл Тогда ПараметрыОбновленияФайла = МодульРаботаСФайламиСлужебныйКлиент.ПараметрыОбновленияФайла( ОбработчикЗавершения, Параметры.ПрисоединенныйФайл, УникальныйИдентификатор); МодульРаботаСФайламиСлужебныйКлиент.ЗакончитьРедактированиеСОповещением(ПараметрыОбновленияФайла); Иначе МодульРаботаСФайламиСлужебныйКлиент.СохранитьИзмененияФайлаСОповещением(ОбработчикЗавершения, Параметры.ПрисоединенныйФайл, УникальныйИдентификатор); КонецЕсли; Возврат; КонецЕсли; КонецЕсли; ВыполнитьОбработкуОповещения(ОбработчикЗавершения, Истина); КонецПроцедуры &НаКлиенте Процедура НачатьДиалогСохраненияФайла(Знач ОбработчикЗавершения, ОсвободитьФайл) Перем ДиалогСохраненияФайла, ОписаниеОповещения; ДиалогСохраненияФайла = Новый ДиалогВыбораФайла(РежимДиалогаВыбораФайла.Сохранение); ДиалогСохраненияФайла.ПолноеИмяФайла = ОбщегоНазначенияКлиентСервер.ЗаменитьНедопустимыеСимволыВИмениФайла(ИмяДокумента); ДиалогСохраненияФайла.Фильтр = НСтр("ru = 'Табличный документ'") + " (*.mxl)|*.mxl"; ДополнительныеПараметры = Новый Структура; ДополнительныеПараметры.Вставить("ОбработчикЗавершения", ОбработчикЗавершения); ДополнительныеПараметры.Вставить("ОсвободитьФайл", ОсвободитьФайл); ОписаниеОповещения = Новый ОписаниеОповещения("ПриЗавершенииДиалогаВыбораФайла", ЭтотОбъект, ДополнительныеПараметры); ФайловаяСистемаКлиент.ПоказатьДиалогВыбора(ОписаниеОповещения, ДиалогСохраненияФайла); КонецПроцедуры &НаКлиенте Процедура ПриЗавершенииДиалогаВыбораФайла(ВыбранныеФайлы, ДополнительныеПараметры) Экспорт Если ВыбранныеФайлы = Неопределено Тогда Возврат; КонецЕсли; ПолноеИмяФайла = ВыбранныеФайлы[0]; Параметры.ПутьКФайлу = ПолноеИмяФайла; ИмяДокумента = Сред(ПолноеИмяФайла, СтрДлина(ОписаниеФайла(ПолноеИмяФайла).Путь) + 1); Если НРег(Прав(ИмяДокумента, 4)) = ".mxl" Тогда ИмяДокумента = Лев(ИмяДокумента, СтрДлина(ИмяДокумента) - 4); КонецЕсли; ЗаписатьТабличныйДокументИмяФайлаВыбрано(ДополнительныеПараметры.ОбработчикЗавершения, ДополнительныеПараметры.ОсвободитьФайл); КонецПроцедуры &НаКлиенте Функция ОписаниеФайла(ПолноеИмя) ПозицияРазделителя = СтрНайти(ПолноеИмя, ПолучитьРазделительПути(), НаправлениеПоиска.СКонца); Имя = Сред(ПолноеИмя, ПозицияРазделителя + 1); Путь = Лев(ПолноеИмя, ПозицияРазделителя); ПозицияРасширения = СтрНайти(Имя, ".", НаправлениеПоиска.СКонца); ИмяБезРасширения = Лев(Имя, ПозицияРасширения - 1); Расширение = Сред(Имя, ПозицияРасширения + 1); Результат = Новый Структура; Результат.Вставить("ПолноеИмя", ПолноеИмя); Результат.Вставить("Имя", Имя); Результат.Вставить("Путь", Путь); Результат.Вставить("ИмяБезРасширения", ИмяБезРасширения); Результат.Вставить("Расширение", Расширение); Возврат Результат; КонецФункции &НаКлиенте Функция ИмяНовогоДокумента() Возврат НСтр("ru = 'Новый'"); КонецФункции &НаКлиенте Процедура УстановитьЗаголовок() Заголовок = ИмяДокумента; Если ЗначениеЗаполнено(ТекущийЯзык) Тогда ТекущийЯзыкПредставление = Элементы["Язык_"+ТекущийЯзык].Заголовок; Заголовок = Заголовок + " ("+ТекущийЯзыкПредставление+")"; КонецЕсли; Если ЭтоНовый() Тогда Заголовок = Заголовок + " (" + НСтр("ru = 'создание'") + ")"; ИначеЕсли РедактированиеЗапрещено Тогда Заголовок = Заголовок + " (" + НСтр("ru = 'только просмотр'") + ")"; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура НастроитьПредставлениеКоманд() ДокументРедактируется = Элементы.ТабличныйДокумент.Редактирование; Элементы.Редактирование.Пометка = ДокументРедактируется; Элементы.КомандыРедактирования.Доступность = ДокументРедактируется; Элементы.ЗаписатьИЗакрыть.Доступность = ДокументРедактируется Или Модифицированность; Элементы.Записать.Доступность = ДокументРедактируется Или Модифицированность; Если ДокументРедактируется И ЭтоМакет И Не ЭтоПечатнаяФорма Тогда Элементы.Предупреждение.Видимость = Истина; КонецЕсли; Элементы.Редактирование.Доступность = ДокументРедактируется Или Не ЭтоМакет; Элементы.ЗагрузитьИзФайла.Доступность = ДокументРедактируется Или Не ЭтоМакет; Элементы.ЗачеркиваниеВсеДействия.Доступность = ДокументРедактируется Или Не ЭтоМакет; Элементы.ТекущееЗначение.Доступность = ДокументРедактируется; Элементы.ПоказыватьКолонтитулы.Доступность = ДокументРедактируется; Элементы.Перевести.Доступность = ДокументРедактируется; УстановитьДоступностьРекурсивно(Элементы.КомандыРедактирования); УстановитьДоступностьРекурсивно(Элементы.ДобавляемыеЯзыки, ДокументРедактируется); КонецПроцедуры &НаКлиенте Функция ЭтоНовый() Возврат Не ЗначениеЗаполнено(Параметры.Ссылка) И ПустаяСтрока(ИдентификаторМакета) И ПустаяСтрока(Параметры.ПутьКФайлу); КонецФункции &НаКлиенте Процедура РедактироватьВоВнешнейПрограммеЗавершение(ЗагруженныйТабличныйДокумент, ДополнительныеПараметры) Экспорт Если ЗагруженныйТабличныйДокумент = Неопределено Тогда Возврат; КонецЕсли; Модифицированность = Истина; ОбновитьТабличныйДокумент(ЗагруженныйТабличныйДокумент); КонецПроцедуры &НаСервере Процедура ОбновитьТабличныйДокумент(Знач ЗагруженныйТабличныйДокумент) ЗаполнитьТабличныйДокумент(ТабличныйДокумент, ЗагруженныйТабличныйДокумент); КонецПроцедуры // Параметры: // ТабличныйДокумент - ТабличныйДокумент - входной и выходной параметр. // ЗагруженныйТабличныйДокумент - ТабличныйДокумент // &НаСервереБезКонтекста Процедура ЗаполнитьТабличныйДокумент(ТабличныйДокумент, Знач ЗагруженныйТабличныйДокумент) Для НомерСтроки = 1 По ЗагруженныйТабличныйДокумент.ВысотаТаблицы Цикл Для НомерКолонки = 1 По ЗагруженныйТабличныйДокумент.ШиринаТаблицы Цикл ИсходнаяЯчейка = ЗагруженныйТабличныйДокумент.Область(НомерСтроки, НомерКолонки, НомерСтроки, НомерКолонки); Если ИсходнаяЯчейка.Заполнение <> ТипЗаполненияОбластиТабличногоДокумента.Текст Тогда ТабличныйДокумент = ЗагруженныйТабличныйДокумент; Возврат; КонецЕсли; КонецЦикла; КонецЦикла; ТабличныйДокумент.Очистить(); ТабличныйДокумент.Вывести(ЗагруженныйТабличныйДокумент); ТабличныйДокумент.ВерхнийКолонтитул.ТекстСлева = ЗагруженныйТабличныйДокумент.ВерхнийКолонтитул.ТекстСлева; ТабличныйДокумент.ВерхнийКолонтитул.ТекстВЦентре = ЗагруженныйТабличныйДокумент.ВерхнийКолонтитул.ТекстВЦентре; ТабличныйДокумент.ВерхнийКолонтитул.ТекстСправа = ЗагруженныйТабличныйДокумент.ВерхнийКолонтитул.ТекстСправа; ТабличныйДокумент.НижнийКолонтитул.ТекстСлева = ЗагруженныйТабличныйДокумент.НижнийКолонтитул.ТекстСлева; ТабличныйДокумент.НижнийКолонтитул.ТекстВЦентре = ЗагруженныйТабличныйДокумент.НижнийКолонтитул.ТекстВЦентре; ТабличныйДокумент.НижнийКолонтитул.ТекстСправа = ЗагруженныйТабличныйДокумент.НижнийКолонтитул.ТекстСправа; ТаблицаОбластей = ТаблицаОбластей(ЗагруженныйТабличныйДокумент); Для Каждого ТекущаяОбласть Из ТаблицаОбластей Цикл Область = ТабличныйДокумент.Области.Найти(ТекущаяОбласть.Имя); Если Область = Неопределено Тогда Продолжить; КонецЕсли; Если ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") И Область.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Или ТипЗнч(Область) = Тип("РисунокТабличногоДокумента") Тогда КопируемаяОбласть = ЗагруженныйТабличныйДокумент.Области.Найти(Область.Имя); Если КопируемаяОбласть = Неопределено Тогда Продолжить; КонецЕсли; Область.ПараметрРасшифровки = КопируемаяОбласть.ПараметрРасшифровки; КонецЕсли; КонецЦикла; КонецПроцедуры &НаКлиенте Процедура УстановитьНачальныеНастройкиФормы() Если Не ПустаяСтрока(Параметры.ПутьКФайлу) И Не РедактированиеЗапрещено Тогда Элементы.ТабличныйДокумент.Редактирование = Истина; КонецЕсли; УстановитьИмяДокумента(); УстановитьЗаголовок(); НастроитьПредставлениеКоманд(); НастроитьОтображениеТабличногоДокумента(); КонецПроцедуры &НаКлиенте Процедура УстановитьИмяДокумента() Если ПустаяСтрока(ИмяДокумента) Тогда ИспользованныеИмена = Новый Массив; Оповестить("ЗапросИменРедактируемыхТабличныхДокументов", ИспользованныеИмена, ЭтотОбъект); Индекс = 1; Пока ИспользованныеИмена.Найти(ИмяНовогоДокумента() + Индекс) <> Неопределено Цикл Индекс = Индекс + 1; КонецЦикла; ИмяДокумента = ИмяНовогоДокумента() + Индекс; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПриЗавершенииПолученияТолькоЧтения(ТолькоЧтение, ДополнительныеПараметры) Экспорт РедактированиеЗапрещено = ТолькоЧтение; УстановитьНачальныеНастройкиФормы(); КонецПроцедуры &НаКлиенте Процедура Подключаемый_ПереключитьЯзык(Команда) Если ЭтоНовый() Тогда Возврат; КонецЕсли; Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатьюКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("УправлениеПечатьюКлиент"); МодульУправлениеПечатьюКлиент.ПереключитьЯзык(ЭтотОбъект, Команда); Элементы.УдалитьЯзыкМакета.Видимость = Не ЗначениеЗаполнено(Параметры.Ссылка) Или ТекущийЯзык <> ОбщегоНазначенияКлиент.КодОсновногоЯзыка(); Элементы.КнопкаПоказатьСкрытьОригинал.Доступность = ПоставляемыйМакет.ВысотаТаблицы > 0; Если ЭтоПечатнаяФорма Тогда ЗаполнитьТабличныйДокумент(ТабличныйДокумент, ПрочитатьМакет()); КонецЕсли; Если ТекущийЯзык = ОбщегоНазначенияКлиент.КодОсновногоЯзыка() Тогда Элементы.УдалитьЯзыкМакета.Заголовок = НСтр("ru = 'Удалить все изменения макета'"); Иначе Элементы.УдалитьЯзыкМакета.Заголовок = НСтр("ru = 'Удалить макет на текущем языке'"); КонецЕсли; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура УдалитьЯзыкМакета(Команда) УдалитьМакетНаТекущемЯзыке(); ЗаписьВыполнена = Истина; ОповеститьОЗаписиТабличногоДокумента(); Элементы.УдалитьЯзыкМакета.Видимость = Не ЗначениеЗаполнено(Параметры.Ссылка) Или ТекущийЯзык <> ОбщегоНазначенияКлиент.КодОсновногоЯзыка(); УстановитьЗаголовок(); КонецПроцедуры &НаКлиенте Процедура Подключаемый_ПриПереключенииЯзыка(КодЯзыка, ДополнительныеПараметры) Экспорт УстановитьЗаголовок(); ЗагрузитьТабличныйДокументИзМетаданных(КодЯзыка); Если ТребуетсяПеревод И ДоступенАвтоматическийПеревод Тогда ТекстВопроса = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Макет еще не переведен на %1 язык. |Выполнить автоматический перевод?'"), Элементы.Язык.Заголовок); Кнопки = Новый СписокЗначений; Кнопки.Добавить(КодВозвратаДиалога.Да, НСтр("ru = 'Выполнить перевод'")); Кнопки.Добавить(КодВозвратаДиалога.Нет, НСтр("ru = 'Не выполнять'")); ОписаниеОповещения = Новый ОписаниеОповещения("ПриОтветеНаВопросОПереводеМакета", ЭтотОбъект); ПоказатьВопрос(ОписаниеОповещения, ТекстВопроса, Кнопки); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПриОтветеНаВопросОПереводеМакета(Ответ, ДополнительныеПараметры) Экспорт Если Ответ <> КодВозвратаДиалога.Да Тогда Возврат; КонецЕсли; Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.Мультиязычность.ПереводТекста") Тогда ОписаниеОповещения = Новый ОписаниеОповещения("ПриЗавершенииПеревода", ЭтотОбъект); МодульПереводТекстаНаДругиеЯзыкиКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("ПереводТекстаНаДругиеЯзыкиКлиент"); МодульПереводТекстаНаДругиеЯзыкиКлиент.ПеревестиТекстыТабличногоДокумента( ТабличныйДокумент, ТекущийЯзык, ОбщегоНазначенияКлиент.КодОсновногоЯзыка(), ЭтотОбъект, ОписаниеОповещения); КонецЕсли; Модифицированность = Истина; КонецПроцедуры &НаКлиенте Процедура ПриЗавершенииПеревода(ПереведенныйТабличныйДокумент, ДополнительныеПараметры) Экспорт Если ТипЗнч(ПереведенныйТабличныйДокумент) = Тип("ТабличныйДокумент") Тогда ТабличныйДокумент = ПереведенныйТабличныйДокумент; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПоказатьСкрытьОригинал(Команда) Элементы.КнопкаПоказатьСкрытьОригинал.Пометка = Не Элементы.КнопкаПоказатьСкрытьОригинал.Пометка; Элементы.ПоставляемыйМакет.Видимость = Элементы.КнопкаПоказатьСкрытьОригинал.Пометка; Если Элементы.КнопкаПоказатьСкрытьОригинал.Пометка Тогда Элементы.ТабличныйДокумент.ПоложениеЗаголовка = ПоложениеЗаголовкаЭлементаФормы.Авто; Иначе Элементы.ТабличныйДокумент.ПоложениеЗаголовка = ПоложениеЗаголовкаЭлементаФормы.Нет; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура СинхронизироватьОбластьПросмотраМакетов() Если Не Элементы.ПоставляемыйМакет.Видимость Тогда Возврат; КонецЕсли; УправляемыйЭлемент = Элементы.ПоставляемыйМакет; Если ТекущийЭлемент <> Элементы.ТабличныйДокумент Тогда УправляемыйЭлемент = Элементы.ТабличныйДокумент; ТекущийЭлемент = Элементы.ПоставляемыйМакет; КонецЕсли; Область = ТекущийЭлемент.ТекущаяОбласть; Если Область = Неопределено Тогда Возврат; КонецЕсли; Если ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") Тогда УправляемыйЭлемент.ТекущаяОбласть = ЭтотОбъект[ТекущийЭлемент.Имя].Область( Область.Верх, Область.Лево, Область.Низ, Область.Право); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ОповеститьОЗаписиТабличногоДокумента() ПараметрыОповещения = СтандартныеПодсистемыКлиент.НовыйПараметрОповещенияЗаписиТабличногоДокумента(); ПараметрыОповещения.ПутьКФайлу = Параметры.ПутьКФайлу; ПараметрыОповещения.ИмяОбъектаМетаданныхМакета = ИдентификаторМакета; ПараметрыОповещения.КодЯзыка = ТекущийЯзык; ПараметрыОповещения.Представление = ИмяДокумента; ПараметрыОповещения.ИсточникиДанных = ИсточникиДанных.ВыгрузитьЗначения(); ПараметрыОповещения.ОсновнаяПечатнаяФорма = ОсновнаяПечатнаяФорма; ПараметрыОповещения.НаименованиеПечатнойФормы = НаименованиеПечатнойФормы; ПараметрыОповещения.ФорматСохраненияВыгрузки = ФорматСохраненияВыгрузки; ПараметрыОповещения.МакетДляВыгрузкиОбъекта = МакетДляВыгрузкиОбъекта; Если ЗаписьВыполнена Тогда ИмяСобытия = "Запись_ТабличныйДокумент"; Иначе ИмяСобытия = "ОтменаРедактированияТабличногоДокумента"; КонецЕсли; Оповестить(ИмяСобытия, ПараметрыОповещения, ЭтотОбъект); ЗаписьВыполнена = Ложь; КонецПроцедуры &НаСервере Процедура РазблокироватьНаСервере() РазблокироватьДанныеДляРедактирования(КлючОбъектаРедактирования, УникальныйИдентификатор); КонецПроцедуры &НаКлиенте Процедура ИзменитьШрифтПродолжение(Результат, Параметры) Экспорт ТекущаяОбласть = Элементы.ТабличныйДокумент.ТекущаяОбласть; Если Результат = Неопределено Тогда Возврат; ИначеЕсли Результат = -1 Тогда ДиалогВыбораШрифта = Новый ДиалогВыбораШрифта; ОписаниеОповещения = Новый ОписаниеОповещения("ЗавершениеИзменитьШрифт", ЭтотОбъект); ДиалогВыбораШрифта.Шрифт = ТекущаяОбласть.Шрифт; ДиалогВыбораШрифта.Показать(ОписаниеОповещения); Иначе ТекущаяОбласть.Шрифт = Новый Шрифт(ТекущаяОбласть.Шрифт, Результат); Модифицированность = Истина; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЗавершениеИзменитьШрифт(Шрифт, Параметры) Экспорт Если Шрифт = Неопределено Тогда Возврат; КонецЕсли; ТекущаяОбласть = Элементы.ТабличныйДокумент.ТекущаяОбласть; ТекущаяОбласть.Шрифт = Шрифт; Модифицированность = Истина; КонецПроцедуры &НаКлиенте Процедура ЗавершениеИзменитьЦветГраницы(Цвет, Параметры) Экспорт УстановитьЦвет("ЦветРамки", Цвет); КонецПроцедуры &НаКлиенте Процедура ЗавершениеИзменитьЦветТекста(Цвет, Параметры) Экспорт УстановитьЦвет("ЦветТекста", Цвет); КонецПроцедуры &НаКлиенте Процедура ЗавершениеИзменитьЦветФона(Цвет, Параметры) Экспорт УстановитьЦвет("ЦветФона", Цвет); КонецПроцедуры &НаКлиенте Процедура УстановитьЦвет(ИмяПоля, Цвет) ТекущаяОбласть = Элементы.ТабличныйДокумент.ТекущаяОбласть; Если ТипЗнч(Цвет) = Тип("Цвет")Тогда ТекущаяОбласть[ИмяПоля] = Цвет; Модифицированность = Истина; ИначеЕсли Цвет = "ДругиеЦвета" Тогда ДиалогВыбораЦвета = Новый ДиалогВыбораЦвета(); ОписаниеОповещения = Новый ОписаниеОповещения("ПослеВыбораЦвета", ЭтотОбъект, ИмяПоля); ДиалогВыбораЦвета.Показать(ОписаниеОповещения); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ПослеВыбораЦвета(Цвет, ИмяПоля) Экспорт УстановитьЦвет(ИмяПоля, Цвет); КонецПроцедуры #Область КонструкторПечатныхФорм &НаСервере Функция ВладелецМакета() Если ЗначениеЗаполнено(ВладелецМакета) Тогда Возврат ОбщегоНазначения.ОбъектМетаданныхПоИдентификатору(ВладелецМакета); КонецЕсли; ПутьКМакету = ИдентификаторМакета; ЧастиПути = СтрРазделить(ПутьКМакету, ".", Истина); Если ЧастиПути.Количество() <> 2 И ЧастиПути.Количество() <> 3 Тогда Возврат Неопределено; КонецЕсли; Если ЧастиПути.Количество() <> 3 Тогда Возврат Неопределено; КонецЕсли; ЧастиПути.Удалить(ЧастиПути.ВГраница()); ИмяОбъекта = СтрСоединить(ЧастиПути, "."); Если ПустаяСтрока(ИмяОбъекта) Тогда Возврат Неопределено; КонецЕсли; Возврат ОбщегоНазначения.ОбъектМетаданныхПоПолномуИмени(ИмяОбъекта); КонецФункции &НаКлиенте Процедура ТабличныйДокументПеретаскивание(Элемент, ПараметрыПеретаскивания, СтандартнаяОбработка, Область) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); Если ТипЗнч(ПараметрыПеретаскивания.Значение) <> Тип("Строка") Тогда Возврат; КонецЕсли; ВыбранноеПоле = МодульКонструкторФормулКлиент.ВыбранноеПолеВСпискеПолей(ЭтотОбъект, ИмяСпискаПолей()); Если ВыбранноеПоле = Неопределено Тогда Возврат; КонецЕсли; РазместитьРисунокВТабличномДокументе(ВыбранноеПоле, Область.Лево, Область.Верх, СтандартнаяОбработка); Если СтандартнаяОбработка Тогда СтандартнаяОбработка = Ложь; Область = ТабличныйДокумент.Область(Область.Верх, Область.Лево); // Получение области объединенных ячеек. Область.Текст = ?(ЗначениеЗаполнено(Область.Текст), СокрП(Область.Текст) + " ", "") + ПараметрыПеретаскивания.Значение; КонецЕсли; КонецЕсли; ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры // Параметры: // ВыбранноеПоле - см. КонструкторФормулКлиент.ВыбранноеПолеВСпискеПолей // Лево - Число // Верх - Число // СтандартнаяОбработка - Число - выходной параметр. // &НаСервере Процедура РазместитьРисунокВТабличномДокументе(Знач ВыбранноеПоле, Знач Лево, Знач Верх, СтандартнаяОбработка) Область = ТабличныйДокумент.Область(Верх, Лево, Верх, Лево); Если СтрНачинаетсяС(ВыбранноеПоле.Имя, "Печать") Тогда СтандартнаяОбработка = Ложь; Рисунок = ТабличныйДокумент.Рисунки.Добавить(ТипРисункаТабличногоДокумента.Картинка); Рисунок.Имя = ПодобратьИмяОбласти(ТабличныйДокумент, ВыбранноеПоле.Имя); Рисунок.ПараметрРасшифровки = "[" + ВыбранноеПоле.ПутьКДанным + "]"; Рисунок.Картинка = БиблиотекаКартинок["ПечатьОрганизации"]; Рисунок.Расположить(Область); Рисунок.Высота = 40; Рисунок.Ширина = 40; Рисунок.Линия = Новый Линия(ТипЛинииРисункаТабличногоДокумента.НетЛинии); Рисунок.ЦветФона = ЦветПоУмолчанию(); Рисунок.РазмерКартинки = РазмерКартинки.Пропорционально; Элементы.ТабличныйДокумент.ТекущаяОбласть = Область; Возврат; КонецЕсли; Если СтрНачинаетсяС(ВыбранноеПоле.Имя, "Подпись") Тогда СтандартнаяОбработка = Ложь; Рисунок = ТабличныйДокумент.Рисунки.Добавить(ТипРисункаТабличногоДокумента.Картинка); Рисунок.Имя = ПодобратьИмяОбласти(ТабличныйДокумент, ВыбранноеПоле.Имя); Рисунок.ПараметрРасшифровки = "[" + ВыбранноеПоле.ПутьКДанным + "]"; Рисунок.Картинка = БиблиотекаКартинок["Подпись"]; Рисунок.Расположить(Область); Рисунок.Высота = 10; Рисунок.Ширина = 30; Рисунок.Линия = Новый Линия(ТипЛинииРисункаТабличногоДокумента.НетЛинии); Рисунок.ЦветФона = ЦветПоУмолчанию(); Рисунок.РазмерКартинки = РазмерКартинки.Пропорционально; Элементы.ТабличныйДокумент.ТекущаяОбласть = Область; Возврат; КонецЕсли; Если ВыбранноеПоле.Имя = "ШтампЭП" Тогда СтандартнаяОбработка = Ложь; ОбластьСтрок = ТабличныйДокумент.Область(Область.Верх, , Область.Верх + 6); ОбластьСтрок.СоздатьФорматСтрок(); ОбластьШтампа = ТабличныйДокумент.Область(Область.Верх, Область.Лево, Область.Верх + 6, Область.Лево + 1); ОбластьШтампа.Имя = ПодобратьИмяОбласти(ТабличныйДокумент, "ШтампЭП"); ОбластьШтампа = ТабличныйДокумент.Область(Область.Верх, Область.Лево, Область.Верх + 6, Область.Лево); ОбластьШтампа.ШиринаКолонки = 10; ОбластьШтампа = ТабличныйДокумент.Область(Область.Верх, Область.Лево + 1, Область.Верх + 6, Область.Лево + 1); ОбластьШтампа.ШиринаКолонки = 30; Элементы.ТабличныйДокумент.ТекущаяОбласть = Область; Возврат; КонецЕсли; Если ВыбранноеПоле.Имя = "QRКод" Тогда СтандартнаяОбработка = Ложь; Рисунок = ТабличныйДокумент.Рисунки.Добавить(ТипРисункаТабличногоДокумента.Картинка); Рисунок.Имя = ПодобратьИмяОбласти(ТабличныйДокумент, ВыбранноеПоле.Имя); Рисунок.ПараметрРасшифровки = "[" + ВыбранноеПоле.ПутьКДанным + "]"; Рисунок.Расположить(Область); Рисунок.Высота = 40; Рисунок.Ширина = 40; Рисунок.Линия = Новый Линия(ТипЛинииРисункаТабличногоДокумента.НетЛинии); Рисунок.ЦветФона = ЦветПоУмолчанию(); Рисунок.РазмерКартинки = РазмерКартинки.Пропорционально; Рисунок.Картинка = БиблиотекаКартинок["МестоДляQRКода"]; Элементы.ТабличныйДокумент.ТекущаяОбласть = Область; Возврат; КонецЕсли; Если ВыбранноеПоле.Имя = "КартинкаШтрихкода" Тогда СтандартнаяОбработка = Ложь; Рисунок = ТабличныйДокумент.Рисунки.Добавить(ТипРисункаТабличногоДокумента.Картинка); Рисунок.Имя = ПодобратьИмяОбласти(ТабличныйДокумент, ВыбранноеПоле.Имя); Рисунок.ПараметрРасшифровки = "[" + ВыбранноеПоле.ПутьКДанным + "]"; Рисунок.Расположить(Область); Рисунок.Высота = 25.93; Рисунок.Ширина = 37.29; Рисунок.Линия = Новый Линия(ТипЛинииРисункаТабличногоДокумента.НетЛинии); Рисунок.ЦветФона = ЦветПоУмолчанию(); Рисунок.РазмерКартинки = РазмерКартинки.Пропорционально; Рисунок.Картинка = БиблиотекаКартинок["МестоДляШтрихкода"]; Элементы.ТабличныйДокумент.ТекущаяОбласть = Область; Возврат; КонецЕсли; ЭтоПрисоединенныйФайл = ВыбранноеПоле.Тип.Типы().Количество() = 1 И ТипыПрисоединенныхФайлов.СодержитТип(ВыбранноеПоле.Тип.Типы()[0]); Если ЭтоПрисоединенныйФайл Тогда СтандартнаяОбработка = Ложь; Рисунок = ТабличныйДокумент.Рисунки.Добавить(ТипРисункаТабличногоДокумента.Картинка); Рисунок.Имя = ПодобратьИмяОбласти(ТабличныйДокумент, "Рисунок"); Рисунок.ПараметрРасшифровки = "[" + ВыбранноеПоле.ПутьКДанным + "]"; Рисунок.Картинка = БиблиотекаКартинок["МестоДляКартинки"]; Рисунок.Расположить(Область); Рисунок.Высота = 20; Рисунок.Ширина = 20; Рисунок.Линия = Новый Линия(ТипЛинииРисункаТабличногоДокумента.НетЛинии); Рисунок.ЦветФона = ЦветПоУмолчанию(); Рисунок.РазмерКартинки = РазмерКартинки.Пропорционально; Элементы.ТабличныйДокумент.ТекущаяОбласть = Область; Возврат; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ТабличныйДокументПроверкаПеретаскивания(Элемент, ПараметрыПеретаскивания, СтандартнаяОбработка, Область) Если ТипЗнч(ПараметрыПеретаскивания.Значение) <> Тип("Массив") Или ПараметрыПеретаскивания.Значение.Количество() <> 1 Или Не ПараметрыПеретаскивания.Значение[0].Таблица Тогда Возврат; КонецЕсли; КоличествоКолонок = ПараметрыПеретаскивания.Значение[0].Элементы.Количество(); Если КоличествоКолонок = 0 Тогда ШиринаОбласти = ?(Область.Лево > 1, 2, 1); Область = ТабличныйДокумент.Область(Область.Верх, Область.Лево, Область.Верх, Область.Лево + ШиринаОбласти - 1); Элемент.ТекущаяОбласть = Область; Возврат; КонецЕсли; СтандартнаяОбработка = Ложь; Область = ТабличныйДокумент.Область(Область.Верх, Область.Лево, Область.Верх + 1, Область.Лево + КоличествоКолонок - 1); Элемент.ТекущаяОбласть = Область; КонецПроцедуры &НаКлиенте Процедура ОбновитьПолеВводаЗначенияТекущейЯчейки() ТекущаяОбласть = ТабличныйДокумент.ТекущаяОбласть; ДоступноРедактирование = Элементы.ТабличныйДокумент.Редактирование И ТекущаяОбласть <> Неопределено И ТипЗнч(ТекущаяОбласть) = Тип("ОбластьЯчеекТабличногоДокумента"); Элементы.ТекущееЗначение.Доступность = ДоступноРедактирование; Если ДоступноРедактирование Тогда ТекущееЗначение = ТекущаяОбласть.Текст; Иначе ТекущееЗначение = ""; КонецЕсли; Элементы.ПовторятьВНачалеСтраницы.Доступность = Ложь; Элементы.ПовторятьВКонцеСтраницы.Доступность = Ложь; ПредставлениеОбласти = НСтр("ru = 'Текст выбранной ячейки'"); Если ТипЗнч(ТекущаяОбласть) = Тип("ОбластьЯчеекТабличногоДокумента") Тогда Если ТекущаяОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки И ЗначениеЗаполнено(ТекущаяОбласть.Верх) Тогда Диапазон = ТекущаяОбласть.Верх; Если ТекущаяОбласть.Верх <> ТекущаяОбласть.Низ Тогда Диапазон = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = '%1-%2'"), ТекущаяОбласть.Верх, ТекущаяОбласть.Низ); ПредставлениеОбласти = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Условия вывода строк %1'"), Диапазон); Иначе ПредставлениеОбласти = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Условия вывода строки %1'"), Диапазон); КонецЕсли; Элементы.ПовторятьВНачалеСтраницы.Доступность = Истина; Элементы.ПовторятьВКонцеСтраницы.Доступность = Истина; Если ЗначениеЗаполнено(ТекущаяОбласть.Имя) Тогда ТекущееЗначение = ТекущаяОбласть.ПараметрРасшифровки; КонецЕсли; КонецЕсли; Если ЗначениеЗаполнено(ТекущаяОбласть.Лево) И Не ЗначениеЗаполнено(ТекущаяОбласть.Верх) Тогда Диапазон = ТекущаяОбласть.Лево; Если ТекущаяОбласть.Лево <> ТекущаяОбласть.Право Тогда Диапазон = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = '%1-%2'"), ТекущаяОбласть.Лево, ТекущаяОбласть.Право); ПредставлениеОбласти = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Условия вывода колонок %1'"), Диапазон); Иначе ПредставлениеОбласти = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Условия вывода колонки %1'"), Диапазон); КонецЕсли; КонецЕсли; Если ЗначениеЗаполнено(ТекущаяОбласть.Лево) И ЗначениеЗаполнено(ТекущаяОбласть.Верх) Тогда Если ТекущаяОбласть.Лево <> ТекущаяОбласть.Право Или ТекущаяОбласть.Верх <> ТекущаяОбласть.Низ Тогда ПредставлениеОбласти = НСтр("ru = 'Текст в выбранной области'"); Иначе ПредставлениеОбласти = НСтр("ru = 'Текст выбранной ячейки'"); КонецЕсли; КонецЕсли; ИмяОбласти = ПредставлениеОбласти; КонецЕсли; Элементы.УдалитьШтампЭП.Доступность = ТипЗнч(ТекущаяОбласть) = Тип("ОбластьЯчеекТабличногоДокумента") И СтрНачинаетсяС(ТекущаяОбласть.Имя, "ШтампЭП"); Если ТипЗнч(ТекущаяОбласть) = Тип("ОбластьЯчеекТабличногоДокумента") И ТекущаяОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Тогда Элементы.ПовторятьВНачалеСтраницы.Пометка = ТекущаяОбласть.НачалоСтраницы; Элементы.ПовторятьВКонцеСтраницы.Пометка = ТекущаяОбласть.КонецСтраницы; Иначе Элементы.ПовторятьВНачалеСтраницы.Пометка = Ложь; Элементы.ПовторятьВКонцеСтраницы.Пометка = Ложь; КонецЕсли; ДоступностьКнопокУправленияТекстом(ТекущаяОбласть); КонецПроцедуры &НаСервере Процедура ПодобратьОбразец(ОбъектМетаданных) ТекстЗапроса = "ВЫБРАТЬ ПЕРВЫЕ 1 РАЗРЕШЕННЫЕ | ПсевдонимЗаданнойТаблицы.Ссылка КАК Ссылка |ИЗ | &Таблица КАК ПсевдонимЗаданнойТаблицы | |УПОРЯДОЧИТЬ ПО | Ссылка УБЫВ"; ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&Таблица", ОбъектМетаданных.ПолноеИмя()); Запрос = Новый Запрос(ТекстЗапроса); Выборка = Запрос.Выполнить().Выбрать(); Если Выборка.Следующий() Тогда Образец = Выборка.Ссылка; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура НастроитьКолонтитулы(Команда) Элементы.ПоказыватьКолонтитулы.Пометка = Не Элементы.ПоказыватьКолонтитулы.Пометка; Элементы.ВерхнийКолонтитул.Видимость = Элементы.ПоказыватьКолонтитулы.Пометка; Элементы.НижнийКолонтитул.Видимость = Элементы.ПоказыватьКолонтитулы.Пометка; Элементы.КомандыРедактирования.Видимость = Не Элементы.КомандыРедактирования.Видимость; Элементы.КоманднаяПанельКолонтитулов.Видимость = Не Элементы.КомандыРедактирования.Видимость; Элементы.ТекущееЗначение.Видимость = Не Элементы.ПоказыватьКолонтитулы.Пометка; Элементы.НастройкиТекущейОбласти.Видимость = Не Элементы.ПоказыватьКолонтитулы.Пометка; Элементы.ТабличныйДокумент.ТолькоПросмотр = Элементы.ПоказыватьКолонтитулы.Пометка; ТекстСостояния = ?(Элементы.ПоказыватьКолонтитулы.Пометка, НСтр("ru = 'Редактирование колонтитулов'"), ""); ОтобразитьСостояниеТекущейПечатнойФормы(ТекстСостояния); Если Элементы.ПоказыватьКолонтитулы.Пометка Тогда ПереключитьВидимостьКомандКолонтитулов(); Иначе ОтключитьОбработчикОжидания("ПереключитьВидимостьКомандКолонтитулов"); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ОчиститьФормат(Команда) ТекущаяОбласть = Элементы.ТабличныйДокумент.ТекущаяОбласть; ОчиститьФорматОбласти(ТекущаяОбласть); Модифицированность = Истина; КонецПроцедуры &НаКлиенте Процедура ОчиститьФорматОбласти(Область) Область.Шрифт = Неопределено; Область.ЦветРамки = ЦветПоУмолчанию(); Область.ЦветТекста = ЦветПоУмолчанию(); Область.ЦветУзора = ЦветПоУмолчанию(); Область.ЦветФона = ЦветПоУмолчанию(); Область.ВертикальноеПоложение = Неопределено; Область.ВертикальноеПоложениеКартинки = Неопределено; Область.ГоризонтальноеПоложение = Неопределено; Область.ГоризонтальноеПоложениеКартинки = Неопределено; КонецПроцедуры &НаКлиентеНаСервереБезКонтекста Функция ЦветПоУмолчанию() Возврат Новый Цвет; КонецФункции &НаСервере Процедура УстановитьПримерыЗначений(КоллекцияПолей = Неопределено, ДанныеПечати = Неопределено) Если Не ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда Возврат; КонецЕсли; МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Если КоллекцияПолей = Неопределено Тогда КоллекцияПолей = ЭтотОбъект[ИмяСпискаПолей()]; КонецЕсли; Если ДанныеПечати = Неопределено Тогда Если Не ЗначениеЗаполнено(Образец) Тогда Возврат; КонецЕсли; Объекты = ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(Образец); ОтображаемыеПоля = ЗаполнитьСписокОтображаемыхПолей(КоллекцияПолей); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда Попытка ДанныеПечати = МодульУправлениеПечатью.ДанныеПечати(Объекты, ОтображаемыеПоля, ТекущийЯзык); Исключение РазблокироватьДанныеДляРедактирования(КлючОбъектаРедактирования, УникальныйИдентификатор); ВызватьИсключение ОбработкаОшибок.ПодробноеПредставлениеОшибки(ИнформацияОбОшибке()); КонецПопытки; ПолучитьСообщенияПользователю(Истина); Иначе Возврат; КонецЕсли; КонецЕсли; МодульУправлениеПечатью.УстановитьПримерыЗначений(КоллекцияПолей, ДанныеПечати, Образец); КонецПроцедуры &НаСервере Процедура УстановитьФорматЗначенийПоУмолчанию(КоллекцияПолей = Неопределено) Если КоллекцияПолей = Неопределено Тогда КоллекцияПолей = ЭтотОбъект[ИмяСпискаПолей()]; КонецЕсли; Для Каждого Элемент Из КоллекцияПолей.ПолучитьЭлементы() Цикл Если Не ЗначениеЗаполнено(Элемент.ПутьКДанным) Тогда Продолжить; КонецЕсли; Если Не ЗначениеЗаполнено(Элемент.ФорматПоУмолчанию) Тогда Элемент.ФорматПоУмолчанию = ФорматПоУмолчанию(Элемент.Тип); КонецЕсли; Элемент.Формат = Элемент.ФорматПоУмолчанию; Если ЗначениеЗаполнено(Элемент.Формат) Тогда Элемент.Образец = Формат(Элемент.Образец, Элемент.Формат); Иначе Элемент.КнопкаНастройкиФормата = -1; КонецЕсли; УстановитьФорматЗначенийПоУмолчанию(Элемент); КонецЦикла; КонецПроцедуры &НаСервере Функция ФорматПоУмолчанию(ОписаниеТипов) Формат = ""; Если ОписаниеТипов.Типы().Количество() <> 1 Тогда Возврат Формат; КонецЕсли; Тип = ОписаниеТипов.Типы()[0]; Если Тип = Тип("Число") Тогда Формат = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'ЧЦ=%1; ЧДЦ=%2'"), ОписаниеТипов.КвалификаторыЧисла.Разрядность, ОписаниеТипов.КвалификаторыЧисла.РазрядностьДробнойЧасти); ИначеЕсли Тип = Тип("Дата") Тогда Если ОписаниеТипов.КвалификаторыДаты.ЧастиДаты = ЧастиДаты.Дата Тогда Формат = НСтр("ru = 'ДЛФ=D'"); Иначе Формат = НСтр("ru = 'ДЛФ=DT'"); КонецЕсли; ИначеЕсли Тип = Тип("Булево") Тогда Формат = НСтр("ru = 'БЛ=Нет; БИ=Да'"); КонецЕсли; Возврат Формат; КонецФункции &НаКлиенте Процедура ПодсветитьЯчейкиСВыбраннымПолем() ТекущиеДанные = Элементы[ИмяСпискаПолей()].ТекущиеДанные; Если ТекущиеДанные = Неопределено Или Не ЗначениеЗаполнено(ТекущиеДанные.ПредставлениеПутиКДанным) Тогда Возврат; КонецЕсли; ОчиститьПодсветку(); ОбработанныеОбласти = Новый Соответствие(); МодульУправлениеПечатьюКлиент = Неопределено; Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатьюКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("УправлениеПечатьюКлиент"); Иначе Возврат; КонецЕсли; Для НомерСтроки = 1 По ТабличныйДокумент.ВысотаТаблицы Цикл Для НомерКолонки = 1 По ТабличныйДокумент.ШиринаТаблицы Цикл Область = ТабличныйДокумент.Область(НомерСтроки, НомерКолонки); ИдентификаторОбласти = МодульУправлениеПечатьюКлиент.ИдентификаторОбласти(Область); Если ОбработанныеОбласти[ИдентификаторОбласти] <> Неопределено Тогда Продолжить; КонецЕсли; ОбработанныеОбласти[ИдентификаторОбласти] = Истина; Если ТекущиеДанные.Таблица И СтрНайти(Область.Текст, "[" + ТекущиеДанные.ПредставлениеПутиКДанным + ".") > 0 Или СтрНайти(Область.Текст, "[" + ТекущиеДанные.ПредставлениеПутиКДанным + "]") > 0 Тогда ПодсвеченныеОбласти.Добавить(Область.ЦветФона, Область.Имя); Область.ЦветФона = ЦветФонаВыделенияПоля; КонецЕсли; КонецЦикла; КонецЦикла; КонецПроцедуры &НаКлиенте Процедура ОчиститьПодсветку() Для Каждого Элемент Из ПодсвеченныеОбласти Цикл ЦветФона = Элемент.Значение; ИмяОбласти = Элемент.Представление; Область = ТабличныйДокумент.Область(ИмяОбласти); Область.ЦветФона = ЦветФона; КонецЦикла; ПодсвеченныеОбласти.Очистить(); КонецПроцедуры &НаКлиенте Процедура ДоступныеПоля(Команда) Элементы.КнопкаДоступныеПоля.Пометка = Не Элементы.КнопкаДоступныеПоля.Пометка; Элементы.ГруппаПоляИОператоры.Видимость = Элементы.КнопкаДоступныеПоля.Пометка; КонецПроцедуры &НаКлиенте Процедура ОтобразитьСостояниеТекущейПечатнойФормы(ТекстСостояния = "") ОтображатьСостояние = Не ПустаяСтрока(ТекстСостояния); ПолеТабличногоДокумента = Элементы.ТабличныйДокумент; ОтображениеСостояния = ПолеТабличногоДокумента.ОтображениеСостояния; ОтображениеСостояния.Текст = ТекстСостояния; ОтображениеСостояния.Видимость = ОтображатьСостояние; ОтображениеСостояния.ДополнительныйРежимОтображения = ?(ОтображатьСостояние, ДополнительныйРежимОтображения.Неактуальность, ДополнительныйРежимОтображения.НеИспользовать); ПолеТабличногоДокумента.ТолькоПросмотр = ОтображатьСостояние Или ПолеТабличногоДокумента.Вывод = ИспользованиеВывода.Запретить; КонецПроцедуры &НаКлиенте Процедура ОбновитьОбластьНастройкиВыбранныхЯчеек() ОбновитьПолеВводаЗначенияТекущейЯчейки(); КонецПроцедуры &НаКлиенте Процедура ПовторятьНаКаждойСтранице(Команда) ТекущаяОбласть = ТабличныйДокумент.ТекущаяОбласть; Если ТекущаяОбласть = Неопределено Или ТипЗнч(ТекущаяОбласть) <> Тип("ОбластьЯчеекТабличногоДокумента") Или ТекущаяОбласть.ТипОбласти <> ТипОбластиЯчеекТабличногоДокумента.Строки Тогда Возврат; КонецЕсли; Элементы.ПовторятьВНачалеСтраницы.Пометка = Не Элементы.ПовторятьВНачалеСтраницы.Пометка; ТекущаяОбласть.НачалоСтраницы = Элементы.ПовторятьВНачалеСтраницы.Пометка; КонецПроцедуры &НаКлиенте Процедура ПовторятьВКонцеСтраницы(Команда) ТекущаяОбласть = ТабличныйДокумент.ТекущаяОбласть; Если ТекущаяОбласть = Неопределено Или ТипЗнч(ТекущаяОбласть) <> Тип("ОбластьЯчеекТабличногоДокумента") Или ТекущаяОбласть.ТипОбласти <> ТипОбластиЯчеекТабличногоДокумента.Строки Тогда Возврат; КонецЕсли; Элементы.ПовторятьВКонцеСтраницы.Пометка = Не Элементы.ПовторятьВКонцеСтраницы.Пометка; ТекущаяОбласть.КонецСтраницы = Элементы.ПовторятьВКонцеСтраницы.Пометка; КонецПроцедуры &НаКлиенте Процедура ТекущееЗначениеПриИзменении(Элемент) ОбновитьТекстВОбластиЯчеек(); ПолучательПеретаскиваемогоЗначения = Элемент; КонецПроцедуры &НаСервереБезКонтекста Функция КоллекцииПолей(ИсточникиДанных, ПараметрыРедактирования) Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Попытка Возврат МодульУправлениеПечатью.КоллекцииПолейИсточниковДанных(ИсточникиДанных); Исключение РазблокироватьДанныеДляРедактирования(ПараметрыРедактирования.КлючОбъектаРедактирования, ПараметрыРедактирования.УникальныйИдентификатор); ВызватьИсключение ОбработкаОшибок.ПодробноеПредставлениеОшибки(ИнформацияОбОшибке()); КонецПопытки КонецЕсли; Возврат Новый Массив; КонецФункции &НаСервере Функция СписокОператоров() Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Возврат МодульУправлениеПечатью.СписокОператоров(); КонецЕсли; КонецФункции #Область ПодключаемыйСписокПолей &НаКлиенте Процедура Подключаемый_СписокПолейПередРазворачиванием(Элемент, Строка, Отказ) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); МодульКонструкторФормулКлиент.СписокПолейПередРазворачиванием(ЭтотОбъект, Элемент, Строка, Отказ); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_РазвернутьТекущийЭлементСпискаПолей() Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); МодульКонструкторФормулКлиент.РазвернутьТекущийЭлементСпискаПолей(ЭтотОбъект); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_ЗаполнитьСписокДоступныхПолей(ПараметрыЗаполнения) Экспорт // АПК:78 - вызывается из КонструкторФормулКлиент ЗаполнитьСписокДоступныхПолей(ПараметрыЗаполнения); КонецПроцедуры &НаСервере Процедура ЗаполнитьСписокДоступныхПолей(ПараметрыЗаполнения) Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормул = ОбщегоНазначения.ОбщийМодуль("КонструкторФормул"); МодульКонструкторФормул.ЗаполнитьСписокДоступныхПолей(ЭтотОбъект, ПараметрыЗаполнения); Если ПараметрыЗаполнения.ИмяСписка = ИмяСпискаПолей() Тогда ТекущиеДанные = ЭтотОбъект[ПараметрыЗаполнения.ИмяСписка].НайтиПоИдентификатору(ПараметрыЗаполнения.ИдентификаторСтроки); УстановитьПримерыЗначений(ТекущиеДанные); УстановитьФорматЗначенийПоУмолчанию(ТекущиеДанные); Если (ТекущиеДанные.Папка Или ТекущиеДанные.Таблица) И ТекущиеДанные.ПолучитьРодителя() = Неопределено Тогда ОтметитьОбщиеПоля(ТекущиеДанные); Иначе УстановитьПризнакОбщегоПоляДляПодчиненныхПолей(ТекущиеДанные); КонецЕсли; КонецЕсли КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_СписокПолейНачалоПеретаскивания(Элемент, ПараметрыПеретаскивания, Выполнение) Реквизит = ЭтотОбъект[ИмяСпискаПолей()].НайтиПоИдентификатору(ПараметрыПеретаскивания.Значение); Если Реквизит.Папка Или Реквизит.Таблица Или Элементы.ПоказыватьКолонтитулы.Пометка И Не СтрНачинаетсяС(Реквизит.ПутьКДанным, "ОбщиеРеквизиты.") Тогда Выполнение = Ложь; Возврат; КонецЕсли; ПараметрыПеретаскивания.Значение = "[" + Реквизит.ПредставлениеПутиКДанным + "]"; Если Элемент = Элементы[ИмяСпискаПолей()] И ЗначениеЗаполнено(Реквизит.Формат) И Реквизит.Формат <> Реквизит.ФорматПоУмолчанию Тогда ПараметрыПеретаскивания.Значение = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( "[Формат(%1, %2)]", ПараметрыПеретаскивания.Значение, """" + Реквизит.Формат + """"); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_СтрокаПоискаИзменениеТекстаРедактирования(Элемент, Текст, СтандартнаяОбработка) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); МодульКонструкторФормулКлиент.СтрокаПоискаИзменениеТекстаРедактирования(ЭтотОбъект, Элемент, Текст, СтандартнаяОбработка); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_ВыполнитьПоискВСпискеПолей() ВыполнитьПоискВСпискеПолей(); КонецПроцедуры &НаСервере Процедура ВыполнитьПоискВСпискеПолей() Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормул = ОбщегоНазначения.ОбщийМодуль("КонструкторФормул"); МодульКонструкторФормул.ВыполнитьПоискВСпискеПолей(ЭтотОбъект); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_СтрокаПоискаОчистка(Элемент, СтандартнаяОбработка) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); МодульКонструкторФормулКлиент.СтрокаПоискаОчистка(ЭтотОбъект, Элемент, СтандартнаяОбработка); КонецЕсли; КонецПроцедуры &НаСервере Процедура Подключаемый_ОбработчикКонструктораФормулСервер(Параметр, ДополнительныеПараметры) // АПК:1412 - параметры возвращаются на клиент. Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормул = ОбщегоНазначения.ОбщийМодуль("КонструкторФормул"); МодульКонструкторФормул.ОбработчикКонструктораФормул(ЭтотОбъект, Параметр, ДополнительныеПараметры); КонецЕсли; Если ДополнительныеПараметры.КлючОперации = "ОбработатьСообщениеПоиска" Тогда ОтметитьОбщиеПоля(); УстановитьФорматЗначенийПоУмолчанию(); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_ОбработчикКонструктораФормулКлиент(Параметр, ДополнительныеПараметры = Неопределено) Экспорт // АПК:78 Процедура вызывается из КонструкторФормулКлиент.НачатьПоискВСпискеПолей Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); МодульКонструкторФормулКлиент.ОбработчикКонструктораФормул(ЭтотОбъект, Параметр, ДополнительныеПараметры); Если ДополнительныеПараметры <> Неопределено И ДополнительныеПараметры.ВыполнитьНаСервере Тогда Подключаемый_ОбработчикКонструктораФормулСервер(Параметр, ДополнительныеПараметры); КонецЕсли; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_НачатьПоискВСпискеПолей() Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); МодульКонструкторФормулКлиент.НачатьПоискВСпискеПолей(ЭтотОбъект); КонецЕсли; КонецПроцедуры &НаКлиентеНаСервереБезКонтекста Функция ИмяСпискаПолей() Возврат "ДоступныеПоля"; КонецФункции &НаКлиентеНаСервереБезКонтекста Функция ИмяСпискаОператоров() Возврат "СписокОператоров"; КонецФункции #КонецОбласти #Область ДополнительныеОбработчикиПодключаемыхСписков // Параметры: // Элемент - ТаблицаФормы // ВыбраннаяСтрока - Число // Поле - ПолеФормы // СтандартнаяОбработка - Булево // &НаКлиенте Процедура Подключаемый_СписокПолейВыбор(Элемент, ВыбраннаяСтрока, Поле, СтандартнаяОбработка) МодульКонструкторФормулКлиент = Неопределено; Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); Иначе Возврат; КонецЕсли; Если Поле.Имя = Элемент.Имя + "Представление" Тогда СтандартнаяОбработка = Ложь; ВыбранноеПоле = МодульКонструкторФормулКлиент.ВыбранноеПолеВСпискеПолей(ЭтотОбъект); Если ЗначениеЗаполнено(ТекущееЗначение) Тогда ТекущееЗначение = СокрП(ТекущееЗначение) + " "; Иначе ТекущееЗначение = ""; КонецЕсли; Если Элемент.Имя = ИмяСпискаПолей() Тогда ТекущееЗначение = ТекущееЗначение + "[" + ВыбранноеПоле.ПредставлениеПутиКДанным + "]"; Иначе ТекущееЗначение = ТекущееЗначение + МодульКонструкторФормулКлиент.ВыражениеДляВставки(ВыбранноеПоле); КонецЕсли; ОбновитьТекстВОбластиЯчеек(); КонецЕсли; Если Поле = Элементы[ИмяСпискаПолей() + "КнопкаНастройкиФормата"] И ЗначениеЗаполнено(Элементы[ИмяСпискаПолей()].ТекущиеДанные.Формат) Тогда СтандартнаяОбработка = Ложь; Конструктор = Новый КонструкторФорматнойСтроки(Элементы[ИмяСпискаПолей()].ТекущиеДанные.Формат); Конструктор.ДоступныеТипы = Элементы[ИмяСпискаПолей()].ТекущиеДанные.Тип; ОписаниеОповещения = Новый ОписаниеОповещения("ПриВыбореФорматаПоля", ЭтотОбъект); Конструктор.Показать(ОписаниеОповещения); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_ОператорыНачалоПеретаскивания(Элемент, ПараметрыПеретаскивания, Выполнение) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); Оператор = МодульКонструкторФормулКлиент.ВыбранноеПолеВСпискеПолей(ЭтотОбъект, ИмяСпискаОператоров()); ПараметрыПеретаскивания.Значение = МодульКонструкторФормулКлиент.ВыражениеДляВставки(Оператор); Если Оператор.ПутьКДанным = "УправлениеПечатью_КоличествоСтрок" Тогда ПредставлениеТекущейТаблицы = ПредставлениеТекущейТаблицы(); Выполнение = ПредставлениеТекущейТаблицы <> Неопределено; ПараметрыПеретаскивания.Значение = СтрЗаменить(ПараметрыПеретаскивания.Значение, "()", "(["+ПредставлениеТекущейТаблицы+"])"); КонецЕсли; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_ОператорыОкончаниеПеретаскивания(Элемент, ПараметрыПеретаскивания, СтандартнаяОбработка) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); ВыбранноеПоле = МодульКонструкторФормулКлиент.ВыбранноеПолеВСпискеПолей(ЭтотОбъект, ИмяСпискаОператоров()); Контекст = Новый Структура("ПутьКДанным, Заголовок"); ЗаполнитьЗначенияСвойств(Контекст, ВыбранноеПоле); Если Контекст.ПутьКДанным = "Формат" Тогда ФорматСтроки = Новый КонструкторФорматнойСтроки; Контекст.Вставить("ФорматСтроки", ФорматСтроки); ОповещениеОкончанияПеретаскиванияЗавершение = Новый ОписаниеОповещения("ОператорыОкончаниеПеретаскиванияЗавершение", ЭтотОбъект, Контекст); ФорматСтроки.Показать(ОповещениеОкончанияПеретаскиванияЗавершение); КонецЕсли; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ОператорыОкончаниеПеретаскиванияЗавершение(Текст, Контекст) Экспорт Если Текст = Неопределено Тогда Возврат; КонецЕсли; ТекстыДляЗамены = Новый Структура("ДляПоиска, ДляЗамены", "", ""); Если Контекст.ПутьКДанным = "Формат" Тогда ФорматСтроки = Контекст.ФорматСтроки; Если ЗначениеЗаполнено(ФорматСтроки.Текст) Тогда ТекстыДляЗамены.ДляЗамены = Контекст.Заголовок + "( , """ + ФорматСтроки.Текст + """)"; ТекстыДляЗамены.ДляПоиска = Контекст.Заголовок + "(,,)"; КонецЕсли; КонецЕсли; АдресПараметровДляОбработкиОжидания = ПоместитьВоВременноеХранилище(ТекстыДляЗамены, УникальныйИдентификатор); ПодключитьОбработчикОжидания("УстановитьЗначениеПослеПеретаскивания", 0.1, Истина); КонецПроцедуры #КонецОбласти &НаКлиенте Процедура УстановитьЗначениеПослеПеретаскивания() ТекстыДляЗамены = ПолучитьИзВременногоХранилища(АдресПараметровДляОбработкиОжидания); Если ПолучательПеретаскиваемогоЗначения = Элементы.ТекущееЗначение ИЛИ ПолучательПеретаскиваемогоЗначения = Неопределено Тогда Элементы.ТекущееЗначение.ВыделенныйТекст = ТекстыДляЗамены.ДляЗамены; Иначе ТекущийРеквизит = ЭтотОбъект[ПолучательПеретаскиваемогоЗначения.Имя]; Если ТипЗнч(ТекущийРеквизит) = Тип("ФорматированныйДокумент") Тогда ТекстДляРазмещения = СтрЗаменить(ТекущийРеквизит.ПолучитьТекст(), ТекстыДляЗамены.ДляПоиска, ТекстыДляЗамены.ДляЗамены); ФорматированныйТекст = Новый ФорматированнаяСтрока(ТекстДляРазмещения); ТекущийРеквизит.Удалить(); ТекущийРеквизит.УстановитьФорматированнуюСтроку(ФорматированныйТекст); ИначеЕсли ТипЗнч(ТекущийРеквизит) = Тип("ТабличныйДокумент") Тогда ТекущийРеквизит.ТекущаяОбласть.Текст = СтрЗаменить(ТекущийРеквизит.ТекущаяОбласть.Текст, ТекстыДляЗамены.ДляПоиска, ТекстыДляЗамены.ДляЗамены); Иначе ТекущийРеквизит = СтрЗаменить(ТекущийРеквизит, ТекстыДляЗамены.ДляПоиска, ТекстыДляЗамены.ДляЗамены); КонецЕсли; КонецЕсли; ПолучательПеретаскиваемогоЗначения = Неопределено; КонецПроцедуры &НаКлиенте Функция ПредставлениеТекущейТаблицы() Для Каждого ПодключенныйСписокПолей Из ЭтотОбъект["ПодключенныеСпискиПолей"] Цикл Если ПодключенныйСписокПолей.ИмяСпискаПолей <> ИмяСпискаОператоров() Тогда Если Элементы[ПодключенныйСписокПолей.ИмяСпискаПолей].ТекущиеДанные <> Неопределено И Элементы[ПодключенныйСписокПолей.ИмяСпискаПолей].ТекущиеДанные.Таблица Тогда Возврат Элементы[ПодключенныйСписокПолей.ИмяСпискаПолей].ТекущиеДанные.ПредставлениеПутиКДанным; КонецЕсли; КонецЕсли; КонецЦикла; Возврат Неопределено; КонецФункции &НаСервере Процедура ЗаписатьМакетыНаДополнительныхЯзыках() ПараметрыМакета = Новый Структура; ПараметрыМакета.Вставить("ИдентификаторКопируемогоМакета", ИдентификаторКопируемогоМакета); ПараметрыМакета.Вставить("ТекущийЯзык", ТекущийЯзык); ПараметрыМакета.Вставить("УникальныйИдентификатор", УникальныйИдентификатор); ПараметрыМакета.Вставить("ИдентификаторМакета", ИдентификаторМакета); ПараметрыМакета.Вставить("ВладелецМакета", ВладелецМакета); ПараметрыМакета.Вставить("ИмяДокумента", ИмяДокумента); ПараметрыМакета.Вставить("СсылкаМакета", СсылкаМакета); ПараметрыМакета.Вставить("ТипМакета", "MXL"); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); МодульУправлениеПечатью.ЗаписатьМакетыНаДополнительныхЯзыках(ПараметрыМакета); КонецЕсли; КонецПроцедуры &НаСервере Функция ПодготовитьМакетДляЗаписи(УстановитьКодЯзыка = Истина, Отказ = Ложь) КодЯзыка = Неопределено; Если УстановитьКодЯзыка Тогда КодЯзыка = ТабличныйДокумент.КодЯзыка; КонецЕсли; Макет = СкопироватьТабличныйДокумент(ТабличныйДокумент, КодЯзыка); Если Не ЭтоПечатнаяФорма Тогда Возврат Макет; КонецЕсли; ОбработанныеОбласти = Новый Соответствие(); НомерПервойЗаполненнойСтроки = 0; НомерПервойЗаполненнойКолонки = 0; МассивИменКолонок = Новый Массив; // Массив из строка Для НомерСтроки = 1 По Макет.ВысотаТаблицы Цикл Для НомерКолонки = 1 По Макет.ШиринаТаблицы Цикл Область = Макет.Область(НомерСтроки, НомерКолонки); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); ИдентификаторОбласти = МодульУправлениеПечатью.ИдентификаторОбласти(Область); Если ОбработанныеОбласти[ИдентификаторОбласти] <> Неопределено Тогда Продолжить; КонецЕсли; ОбработанныеОбласти[ИдентификаторОбласти] = Истина; КонецЕсли; Если ЗначениеЗаполнено(Область.Текст) Тогда ПредставлениеПоля = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(НСтр("ru = 'стр. %1 кол. %2'"), НомерСтроки, НомерКолонки); ЗаменитьПредставленияПараметров(Область.Текст, , Отказ, ПредставлениеПоля); Если НомерПервойЗаполненнойСтроки = 0 Тогда НомерПервойЗаполненнойСтроки = НомерСтроки; НомерПервойЗаполненнойКолонки = НомерКолонки; КонецЕсли; КонецЕсли; Если МакетДляВыгрузкиОбъекта Тогда ДанныеДляПроверки = Новый Структура; ДанныеДляПроверки.Вставить("НомерПервойЗаполненнойСтроки", НомерПервойЗаполненнойСтроки); ДанныеДляПроверки.Вставить("НомерПервойЗаполненнойКолонки", НомерПервойЗаполненнойКолонки); ДанныеДляПроверки.Вставить("НомерСтроки", НомерСтроки); ДанныеДляПроверки.Вставить("НомерКолонки", НомерКолонки); ДанныеДляПроверки.Вставить("Макет", Макет); ДанныеДляПроверки.Вставить("Область", Область); ДанныеДляПроверки.Вставить("ТекстЯчейки", Область.Текст); ПроверитьПоляВыгрузки(ДанныеДляПроверки, МассивИменКолонок, Отказ); КонецЕсли; КонецЦикла; КонецЦикла; ЗаменитьПредставленияПараметров(Макет.ВерхнийКолонтитул.ТекстСлева, "ТекстСлеваСверху", Отказ, НСтр("ru = 'верхний колонтитул слева'")); ЗаменитьПредставленияПараметров(Макет.ВерхнийКолонтитул.ТекстВЦентре, "ТекстВЦентреСверху", Отказ, НСтр("ru = 'верхний колонтитул в центре'")); ЗаменитьПредставленияПараметров(Макет.ВерхнийКолонтитул.ТекстСправа, "ТекстСправаСверху", Отказ, НСтр("ru = 'верхний колонтитул справа'")); ЗаменитьПредставленияПараметров(Макет.НижнийКолонтитул.ТекстСлева, "ТекстСлеваСнизу", Отказ, НСтр("ru = 'нижний колонтитул слева'")); ЗаменитьПредставленияПараметров(Макет.НижнийКолонтитул.ТекстВЦентре, "ТекстВЦентреСнизу", Отказ, НСтр("ru = 'нижний колонтитул в центре'")); ЗаменитьПредставленияПараметров(Макет.НижнийКолонтитул.ТекстСправа, "ТекстСправаСнизу", Отказ, НСтр("ru = 'нижний колонтитул справа'")); Для Каждого Область Из Макет.Области Цикл Если ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") И Область.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Тогда Если МакетДляВыгрузкиОбъекта И НЕ ЗначениеЗаполнено(Область.ПараметрРасшифровки) Тогда Продолжить; КонецЕсли; Область.ПараметрРасшифровки = ФормулаИзПредставления(Область.ПараметрРасшифровки); КонецЕсли; КонецЦикла; ПереименоватьУсловныеОбласти(Макет, ПрефиксУсловнойОбласти(), МакетДляВыгрузкиОбъекта); Если МакетДляВыгрузкиОбъекта Тогда ПроверитьОбластиВыгрузки(Макет, Отказ); КонецЕсли; Возврат Макет; КонецФункции &НаСервереБезКонтекста Процедура ПроверитьЯчейкиОбъединены(Знач Область, Знач НомерСтроки, Знач НомерКолонки, Отказ) Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Шаблон = НСтр("ru = 'Объединение ячеек запрещено (стр. %1 кол. %2)'"); ИдентификаторОбласти = МодульУправлениеПечатью.ИдентификаторОбласти(Область); МассивАдреса = СтроковыеФункцииКлиентСервер.РазложитьСтрокуВМассивПодстрок(ИдентификаторОбласти, ":"); Если МассивАдреса[0] <> МассивАдреса[2] ИЛИ МассивАдреса[1] <> МассивАдреса[3] Тогда ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервереБезКонтекста Процедура ПроверитьИмяПоляDBF(Знач ТекстЯчейки, Знач НомерСтроки, Знач НомерКолонки, Отказ) Если СтрДлина(ТекстЯчейки) > 10 Тогда Шаблон = НСтр("ru = 'Имя поля не может превышать 10 знаков (стр. %1 кол. %2)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; ДопустимыеСимволы = "0123456789_"; Для Индекс = 1 По СтрДлина(ТекстЯчейки) Цикл Символ = Сред(ТекстЯчейки, Индекс, 1); Если СтрНайти(ДопустимыеСимволы, Символ) <> 0 Тогда Продолжить; КонецЕсли; КодСимвола = КодСимвола(Символ); ПервыйСимволЛатиницыВРег = 65; ПоследнийСимволЛатиницыВРег = 90; ПервыйСимволЛатиницыНРег = 97; ПоследнийСимволЛатиницыНРег = 122; ОшибкаКодаСимвола = ((КодСимвола < ПервыйСимволЛатиницыВРег) Или (КодСимвола > ПоследнийСимволЛатиницыВРег И КодСимвола < ПервыйСимволЛатиницыНРег) Или (КодСимвола > ПоследнийСимволЛатиницыНРег)); Если ОшибкаКодаСимвола Тогда Шаблон = НСтр("ru = 'Имена полей могут содержать только латинские буквы, цифры и символ подчеркивания (стр. %1 кол. %2)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); Прервать; КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервереБезКонтекста Процедура ПроверитьПоляВыгрузкиDBF(Знач ДанныеДляПроверки, МассивИменКолонок, Отказ) НомерСтрокиИменПолей = ДанныеДляПроверки.НомерПервойЗаполненнойСтроки; НомерСтроки = ДанныеДляПроверки.НомерСтроки; НомерКолонки = ДанныеДляПроверки.НомерКолонки; Макет = ДанныеДляПроверки.Макет; Область = ДанныеДляПроверки.Область; ТекстЯчейки = ДанныеДляПроверки.ТекстЯчейки; Если НомерСтрокиИменПолей = 0 Тогда Возврат; КонецЕсли; ПроверитьЯчейкиОбъединены(Область, НомерСтроки, НомерКолонки, Отказ); Если НЕ ПустаяСтрока(ТекстЯчейки) Тогда Если НомерСтроки = НомерСтрокиИменПолей Тогда Если МассивИменКолонок.Найти(ТекстЯчейки) <> Неопределено Тогда Шаблон = НСтр("ru = 'Неуникальное имя колонки (стр. %1 кол. %2)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); Иначе ПроверитьИмяПоляDBF(ТекстЯчейки, НомерСтроки, НомерКолонки, Отказ); МассивИменКолонок.Добавить(ТекстЯчейки); КонецЕсли; Иначе ОбластьИменКолонок = Макет.Область(НомерСтрокиИменПолей, НомерКолонки); ТекстЯчейкиИмен = ОбластьИменКолонок.Текст; Если НомерСтроки > НомерСтрокиИменПолей + 1 Тогда Шаблон = НСтр("ru = 'Данные выгрузки должны указываться в строке %1 (стр. %2 кол. %3)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерСтрокиИменПолей + 1, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; Если ПустаяСтрока(ТекстЯчейкиИмен) Тогда Шаблон = НСтр("ru = 'Не указано имя колонки (кол. %1)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервереБезКонтекста Процедура ПроверитьПоляВыгрузкиXML_JSON(Знач ДанныеДляПроверки, ЭтоXML, Отказ) НомерСтроки = ДанныеДляПроверки.НомерСтроки; НомерКолонки = ДанныеДляПроверки.НомерКолонки; Область = ДанныеДляПроверки.Область; Макет = ДанныеДляПроверки.Макет; ТекстЯчейки = ДанныеДляПроверки.ТекстЯчейки; ПроверитьЯчейкиОбъединены(Область, НомерСтроки, НомерКолонки, Отказ); НомерКолонкиИменПолей = 1; НомерКолонкиЗначений = 2; Если НомерКолонки > НомерКолонкиЗначений И НЕ ПустаяСтрока(ТекстЯчейки) Тогда Шаблон = НСтр("ru = 'Имена полей и их значения должны располагаться в %1 и во %2 колонке соответственно (стр. %3 кол. %4)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерКолонкиИменПолей, НомерКолонкиЗначений, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; Если НомерКолонки = НомерКолонкиИменПолей Тогда Если НЕ ПустаяСтрока(ТекстЯчейки) Тогда ПроверитьСимволыЯчейки(ТекстЯчейки, НомерСтроки, НомерКолонки, ЭтоXML, Отказ); КонецЕсли; ОбластьЗначение = Макет.Область(НомерСтроки, НомерКолонки + 1); ТекстЗначения = ОбластьЗначение.Текст; Если ПустаяСтрока(ТекстЯчейки) <> ПустаяСтрока(ТекстЗначения) Тогда Шаблон = НСтр("ru = 'Имя поля и его значение не сопоставлены (стр. %1)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, НомерСтроки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервереБезКонтекста Функция ТекстСоответствуетТребованиямКИменам(Знач Текст, ЭтоXML = Истина, ЗапрещеннаяПодстрока = Неопределено) Результат = Новый Структура; Результат.Вставить("СодержитЗапрещеннуюПодстроку", Ложь); Результат.Вставить("СоответствуетТребованиямКИменам", Истина); Если ЭтоXML Тогда ШаблонВыражения = "^[\p{L}_]+[\w.-]*$"; Иначе ШаблонВыражения = "^[\p{L}_]\w*$"; КонецЕсли; Если ЗапрещеннаяПодстрока <> Неопределено Тогда ДлинаЗапрещеннойПодстроки = СтрДлина(ЗапрещеннаяПодстрока); КоличествоСимволов = Мин(СтрДлина(СокрЛП(Текст)), ДлинаЗапрещеннойПодстроки); ПроверяемаяПодстрока = Лев(СокрЛП(Текст), КоличествоСимволов); Результат.СодержитЗапрещеннуюПодстроку = (НРег(ПроверяемаяПодстрока) = НРег(ЗапрещеннаяПодстрока)); КонецЕсли; Выражение = Текст; РезультатВыражения = СтрНайтиПоРегулярномуВыражению(Выражение, ШаблонВыражения); Результат.СоответствуетТребованиямКИменам = (РезультатВыражения.Длина <> 0); Возврат Результат; КонецФункции &НаСервереБезКонтекста Процедура ПроверитьСимволыЯчейки(Знач ТекстЯчейки, Знач НомерСтроки, Знач НомерКолонки, Знач ЭтоXML, Отказ) ЗапрещеннаяПодстрока = Неопределено; Если ЭтоXML Тогда ШаблонНеСоответствуетТребованиям = НСтр("ru = 'Имя поля ""%1"" не соответствует требованиям к именам токенов XML (стр. %2 кол. %3)'"); ЗапрещеннаяПодстрока = "xml"; Иначе ШаблонНеСоответствуетТребованиям = НСтр("ru = 'Имя поля ""%1"" не соответствует требованиям к именам переменных (стр. %2 кол. %3)'"); КонецЕсли; РезультатПроверки = ТекстСоответствуетТребованиямКИменам(ТекстЯчейки, ЭтоXML, ЗапрещеннаяПодстрока); Если РезультатПроверки.СодержитЗапрещеннуюПодстроку Тогда ШаблонЗапрещеннаяСтрока = НСтр("ru = 'Имя поля ""%1"" не может начинаться с ""%2"" (стр. %3 кол. %4)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонЗапрещеннаяСтрока, ТекстЯчейки, ЗапрещеннаяПодстрока, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; Если НЕ РезультатПроверки.СоответствуетТребованиямКИменам Тогда ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонНеСоответствуетТребованиям, ТекстЯчейки, НомерСтроки, НомерКолонки); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; КонецПроцедуры &НаСервере Процедура ПроверитьПоляВыгрузки(Знач ДанныеДляПроверки, МассивИменКолонок, Отказ) Если НЕ ЗначениеЗаполнено(ФорматСохраненияВыгрузки) ИЛИ НЕ ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВыгрузкаОбъектовВФайлы") Тогда Возврат; КонецЕсли; МассивФорматовБезИспользованияТД = Новый Массив; // Массив из ПеречислениеСсылка.ФорматыВыгрузкиОбъектов МодульВыгрузкаОбъектовВФайлы = ОбщегоНазначения.ОбщийМодуль("ВыгрузкаОбъектовВФайлы"); МассивФорматовБезИспользованияТД = МодульВыгрузкаОбъектовВФайлы.ФорматыВыгрузкиБезИспользованияТабличногоДокумента(); Если МассивФорматовБезИспользованияТД.Найти(ФорматСохраненияВыгрузки) = Неопределено Тогда Возврат; КонецЕсли; Если ФорматСохраненияВыгрузки = Перечисления.ФорматыВыгрузкиОбъектов.DBF Тогда ПроверитьПоляВыгрузкиDBF(ДанныеДляПроверки, МассивИменКолонок, Отказ); ИначеЕсли ФорматСохраненияВыгрузки = Перечисления.ФорматыВыгрузкиОбъектов.XML Тогда ПроверитьПоляВыгрузкиXML_JSON(ДанныеДляПроверки, Истина, Отказ); Иначе ПроверитьПоляВыгрузкиXML_JSON(ДанныеДляПроверки, Ложь, Отказ); КонецЕсли; КонецПроцедуры // Параметры: // Макет - ТабличныйДокумент // ВсеОбласти - Булево - все области // // Возвращаемое значение: // ТаблицаЗначений: // * Имя - Строка // * Верх - Число // * Низ - Число // * ПараметрРасшифровки - Строка // * Приоритет - Число // * ЭтоОбластьУсловияВывода - Булево // * НомерОбласти - Число // &НаСервереБезКонтекста Функция ТаблицаОбластей(Знач Макет, ВсеОбласти = Ложь) ОписаниеТиповСтрока = Новый ОписаниеТипов("Строка"); ОписаниеТиповЧисло = Новый ОписаниеТипов("Число"); ОписаниеТиповБулево = Новый ОписаниеТипов("Булево"); ТаблицаОбластей = Новый ТаблицаЗначений; ТаблицаОбластей.Колонки.Добавить("Имя", ОписаниеТиповСтрока); ТаблицаОбластей.Колонки.Добавить("Верх", ОписаниеТиповЧисло); ТаблицаОбластей.Колонки.Добавить("Низ", ОписаниеТиповЧисло); ТаблицаОбластей.Колонки.Добавить("ПараметрРасшифровки", ОписаниеТиповСтрока); ТаблицаОбластей.Колонки.Добавить("Приоритет", ОписаниеТиповЧисло); ТаблицаОбластей.Колонки.Добавить("ЭтоОбластьУсловияВывода", ОписаниеТиповБулево); ТаблицаОбластей.Колонки.Добавить("ЭтоОбластьКартинки", ОписаниеТиповБулево); Для Каждого Область Из Макет.Области Цикл ДобавлятьОбластьВТаблицу = Ложь; Если ВсеОбласти ИЛИ ((ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") И Область.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки) ИЛИ ТипЗнч(Область) = Тип("РисунокТабличногоДокумента")) Тогда ДобавлятьОбластьВТаблицу = Истина; КонецЕсли; Если ДобавлятьОбластьВТаблицу Тогда НоваяСтрока = ТаблицаОбластей.Добавить(); ЗаполнитьЗначенияСвойств(НоваяСтрока, Область); НоваяСтрока.ЭтоОбластьКартинки = (ТипЗнч(Область) = Тип("РисунокТабличногоДокумента")); Если Не ПустаяСтрока(Область.ПараметрРасшифровки) И ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") И Область.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Тогда НоваяСтрока.ЭтоОбластьУсловияВывода = Истина; НоваяСтрока.Приоритет = 100; КонецЕсли; КонецЕсли; КонецЦикла; ТаблицаОбластей.Сортировать("Верх, Приоритет"); Возврат ТаблицаОбластей; КонецФункции &НаКлиенте Процедура ПроверитьНаличиеНеИспользуемыхСвойств(ОбработчикЗавершения, ОсвободитьФайл) Если НЕ ЗначениеЗаполнено(ФорматСохраненияВыгрузки) Тогда Возврат; КонецЕсли; ЕстьНеиспользуемыеСвойства = ЕстьФорматированиеИОбластиНеИспользуемыеФорматомВыгрузки(); Если ЕстьНеиспользуемыеСвойства Тогда НачатьДиалогУдаленияСвойств(ОбработчикЗавершения, ОсвободитьФайл); Иначе ЗаписатьТабличныйДокументИмяФайлаВыбрано(ОбработчикЗавершения, ОсвободитьФайл); КонецЕсли; КонецПроцедуры &НаКлиенте Асинх Процедура НачатьДиалогУдаленияСвойств(Знач ОбработчикЗавершения, ОсвободитьФайл) ПараметрыОповещения = Новый Структура; ПараметрыОповещения.Вставить("ОбработчикЗавершения", ОбработчикЗавершения); ПараметрыОповещения.Вставить("ОсвободитьФайл", ОсвободитьФайл); Оповещение = Новый ОписаниеОповещения("НачатьДиалогУдаленияСвойствЗавершение", ЭтотОбъект, ПараметрыОповещения); ТекстПредупреждения = НСтр("ru = 'Форматирование макета или его содержимое не соответствует требованиям формата. При сохранении макета будут очищены неподходящие настройки.'"); Кнопки = Новый СписокЗначений(); Кнопки.Добавить("ОчиститьИСохранить", НСтр("ru = 'Очистить и сохранить'")); Кнопки.Добавить("Отмена", НСтр("ru = 'Отмена'")); ПараметрыВопроса = СтандартныеПодсистемыКлиент.ПараметрыВопросаПользователю(); ПараметрыВопроса.Картинка = БиблиотекаКартинок.ДиалогВосклицание; ПараметрыВопроса.КнопкаПоУмолчанию = "ОчиститьИСохранить"; ПараметрыВопроса.ПредлагатьБольшеНеЗадаватьЭтотВопрос = Ложь; ПараметрыВопроса.Заголовок = ""; СтандартныеПодсистемыКлиент.ПоказатьВопросПользователю(Оповещение, ТекстПредупреждения, Кнопки, ПараметрыВопроса); КонецПроцедуры &НаКлиенте Процедура НачатьДиалогУдаленияСвойствЗавершение(РезультатВопроса, ДополнительныеПараметры) Экспорт Если РезультатВопроса <> Неопределено Тогда Если РезультатВопроса.Значение = "ОчиститьИСохранить" Тогда ОбработчикЗавершения = ДополнительныеПараметры.ОбработчикЗавершения; ОсвободитьФайл = ДополнительныеПараметры.ОсвободитьФайл; УдалитьНеИспользуемыеСвойства(); ЗаписатьТабличныйДокументИмяФайлаВыбрано(ОбработчикЗавершения, ОсвободитьФайл); ОповеститьОЗаписиТабличногоДокумента(); КонецЕсли; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура УдалитьНеИспользуемыеСвойства() ОбработатьОбластиТабличногоДокумента(); ФорматыБезФорматированияТекста = ФорматыВыгрузкиНеТребующиеРаботыСТекстом(); Если ФорматыБезФорматированияТекста.Найти(ФорматСохраненияВыгрузки) <> Неопределено Тогда Для НомерСтроки = 1 По ТабличныйДокумент.ВысотаТаблицы Цикл Для НомерКолонки = 1 По ТабличныйДокумент.ШиринаТаблицы Цикл Область = ТабличныйДокумент.Область(НомерСтроки, НомерКолонки); ОчиститьФорматОбласти(Область); Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Авто; КонецЦикла; КонецЦикла; КонецЕсли; КонецПроцедуры &НаСервере Процедура ОбработатьОбластиТабличногоДокумента() ФорматыВыгрузкиСОбластями = ФорматыВыгрузкиРазрешеноНаличияОбластей(); ФорматыСКартинками = ФорматыВыгрузкиРазрешеноНаличияКартинок(); МассивОбластейКартинок = Новый Массив; МассивЗапрещенныхОбластей = Новый Массив; Если ФорматыСКартинками.Найти(ФорматСохраненияВыгрузки) = Неопределено Тогда Для Каждого ТекущаяОбласть Из ТабличныйДокумент.Рисунки Цикл МассивОбластейКартинок.Добавить(ТекущаяОбласть); КонецЦикла; КонецЕсли; ТаблицаДляАнализа = ТаблицаОбластей(ТабличныйДокумент, Истина); Для Каждого ТекущаяСтрокаТаблицы Из ТаблицаДляАнализа Цикл Если ТекущаяСтрокаТаблицы.ЭтоОбластьУсловияВывода ИЛИ ТекущаяСтрокаТаблицы.ЭтоОбластьКартинки Тогда Продолжить; КонецЕсли; ТекущаяОбласть = ТабличныйДокумент.Область(ТекущаяСтрокаТаблицы.Имя); Если ФорматыВыгрузкиСОбластями.Найти(ФорматСохраненияВыгрузки) = Неопределено Тогда МассивЗапрещенныхОбластей.Добавить(ТекущаяОбласть); Иначе Если ТекущаяОбласть.ТипОбласти <> ТипОбластиЯчеекТабличногоДокумента.Строки Тогда МассивЗапрещенныхОбластей.Добавить(ТекущаяОбласть); КонецЕсли; КонецЕсли; КонецЦикла; Для Каждого ТекущаяОбласть Из МассивОбластейКартинок Цикл ТабличныйДокумент.Рисунки.Удалить(ТекущаяОбласть); КонецЦикла; Для Каждого ТекущаяОбласть Из МассивЗапрещенныхОбластей Цикл ТекущаяОбласть.Имя = ""; КонецЦикла; КонецПроцедуры &НаКлиенте Функция ЕстьФорматированиеИОбластиНеИспользуемыеФорматомВыгрузки() ЕстьНеИспользуемыеМодификации = ЕстьОбластиНеИспользуемыеФорматомВыгрузки(); ФорматыБезФорматированияТекста = ФорматыВыгрузкиНеТребующиеРаботыСТекстом(); Если НЕ ЕстьНеИспользуемыеМодификации И ФорматыБезФорматированияТекста.Найти(ФорматСохраненияВыгрузки) <> Неопределено Тогда НовыйТабличныйДокумент = Новый ТабличныйДокумент; ОбластьПоУмолчанию = НовыйТабличныйДокумент.Область(1, 1, 1, 1); ШрифтПоУмолчанию = ОбластьПоУмолчанию.Шрифт; ЦветПоУмолчанию = ЦветПоУмолчанию(); Для НомерСтроки = 1 По ТабличныйДокумент.ВысотаТаблицы Цикл Для НомерКолонки = 1 По ТабличныйДокумент.ШиринаТаблицы Цикл Область = ТабличныйДокумент.Область(НомерСтроки, НомерКолонки); ЕстьНеИспользуемыеМодификации = ОбластьМодифицирована( Область, ОбластьПоУмолчанию, ШрифтПоУмолчанию, ЦветПоУмолчанию); Если ЕстьНеИспользуемыеМодификации Тогда Прервать; КонецЕсли; КонецЦикла; Если ЕстьНеИспользуемыеМодификации Тогда Прервать; КонецЕсли; КонецЦикла; КонецЕсли; Возврат ЕстьНеИспользуемыеМодификации; КонецФункции &НаКлиенте Функция ОбластьМодифицирована(Область, ОбластьПоУмолчанию, ШрифтПоУмолчанию, ЦветПоУмолчанию) Возврат НЕ (Область.Шрифт = ШрифтПоУмолчанию И Область.ЦветРамки = ЦветПоУмолчанию И Область.ЦветТекста = ЦветПоУмолчанию И Область.ЦветУзора = ЦветПоУмолчанию И Область.ЦветФона = ЦветПоУмолчанию И Область.ВертикальноеПоложение = ОбластьПоУмолчанию.ВертикальноеПоложение И Область.ВертикальноеПоложениеКартинки = ОбластьПоУмолчанию.ВертикальноеПоложениеКартинки И Область.ГоризонтальноеПоложение = ОбластьПоУмолчанию.ГоризонтальноеПоложение И Область.ГоризонтальноеПоложениеКартинки = ОбластьПоУмолчанию.ГоризонтальноеПоложениеКартинки И Область.РазмещениеТекста = ТипРазмещенияТекстаТабличногоДокумента.Авто); КонецФункции &НаСервере Функция ЕстьОбластиНеИспользуемыеФорматомВыгрузки() ЕстьЗапрещенныеОбласти = Ложь; ЕстьОбластиСКартинками = Ложь; ФорматыВыгрузкиСОбластями = ФорматыВыгрузкиРазрешеноНаличияОбластей(); ФорматыСКартинками = ФорматыВыгрузкиРазрешеноНаличияКартинок(); ТаблицаДляАнализа = ТаблицаОбластей(ТабличныйДокумент, Истина); Для Каждого ТекущаяСтрокаТаблицы Из ТаблицаДляАнализа Цикл Если ТекущаяСтрокаТаблицы.ЭтоОбластьУсловияВывода ИЛИ ТекущаяСтрокаТаблицы.ЭтоОбластьКартинки Тогда Продолжить; КонецЕсли; Если ФорматыВыгрузкиСОбластями.Найти(ФорматСохраненияВыгрузки) = Неопределено Тогда ЕстьЗапрещенныеОбласти = Истина; Прервать; Иначе ТекущаяОбласть = ТабличныйДокумент.Область(ТекущаяСтрокаТаблицы.Имя); Если ТекущаяОбласть.ТипОбласти <> ТипОбластиЯчеекТабличногоДокумента.Строки Тогда ЕстьЗапрещенныеОбласти = Истина; Прервать; КонецЕсли; КонецЕсли; КонецЦикла; Если ФорматыСКартинками.Найти(ФорматСохраненияВыгрузки) = Неопределено Тогда ЕстьОбластиСКартинками = (ТабличныйДокумент.Рисунки.Количество() > 0); КонецЕсли; Возврат Макс(ЕстьЗапрещенныеОбласти, ЕстьОбластиСКартинками); КонецФункции &НаСервере Процедура ПроверитьОбластиУсловий(Знач ТаблицаОбластей, Отказ) НомерСтрокиОбласти = 0; Для Каждого ОбластьМакета Из ТаблицаОбластей Цикл Если НомерСтрокиОбласти <> ОбластьМакета.Верх Тогда НомерСтрокиОбласти = ОбластьМакета.Верх; Продолжить; КонецЕсли; Если ОбластьМакета.ЭтоОбластьУсловияВывода Тогда Шаблон = НСтр("ru = 'Область условия должна располагаться ниже области владельца хотя бы на одну строку (стр. %1)'"); ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, ОбластьМакета.Верх); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Процедура ПроверитьИмяОбластей(Знач ТаблицаОбластей, Отказ) Если ФорматСохраненияВыгрузки <> Перечисления.ФорматыВыгрузкиОбъектов.XML Тогда Возврат; КонецЕсли; ЗапрещеннаяПодстрока = "xml"; ШаблонНеСоответствуетТребованиям = НСтр("ru = 'Имя области ""%1"" не соответствует требованиям к именам токенов XML (стр. %2)'"); ШаблонЗапрещеннаяСтрока = НСтр("ru = 'Имя области ""%1"" не может начинаться с ""%2"" (стр. %3)'"); Для Каждого ОбластьМакета Из ТаблицаОбластей Цикл Если ОбластьМакета.ЭтоОбластьУсловияВывода Тогда Продолжить; КонецЕсли; ИмяОбласти = ОбластьМакета.Имя; МассивИмен = СтроковыеФункцииКлиентСервер.РазложитьСтрокуВМассивПодстрок(ИмяОбласти, "_"); Если МассивИмен.Количество() = 1 Тогда РезультатПроверки = ТекстСоответствуетТребованиямКИменам(ИмяОбласти,, ЗапрещеннаяПодстрока); Если РезультатПроверки.СодержитЗапрещеннуюПодстроку Тогда ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонЗапрещеннаяСтрока, ИмяОбласти, ЗапрещеннаяПодстрока, ОбластьМакета.Верх); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; Если НЕ РезультатПроверки.СоответствуетТребованиямКИменам Тогда ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонНеСоответствуетТребованиям, ИмяОбласти, ОбластьМакета.Верх); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; Иначе ПроверитьМассивИменОбласти(ИмяОбласти, МассивИмен, ОбластьМакета, ЗапрещеннаяПодстрока, Отказ); КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Процедура ПроверитьМассивИменОбласти(Знач ИмяОбласти, Знач МассивИмен, ОбластьМакета, ЗапрещеннаяПодстрока, Отказ) Верх = ОбластьМакета.Верх; СчетчикМассива = 0; НомерПервойПодстроки = 1; НомерВторойПодстроки = 2; ШаблонНеСоответствуетТребованиямДо = НСтр("ru = 'Часть имени области ""%1"" до первого символа ''_'' не соответствует требованиям к именам токенов XML (стр. %2)'"); ШаблонНеСоответствуетТребованиямПосле = НСтр("ru = 'Часть имени области ""%1"" после первого символа ''_'' не соответствует требованиям к именам токенов XML (стр. %2)'"); ШаблонЗапрещеннаяСтрока = НСтр("ru = 'Имя области не может начинаться с ""%1"" (стр. %2)'"); ШаблонЗапрещеннаяСтрокаПосле = НСтр("ru = 'Часть имени области ""%1"" после первого символа ''_'' не может начинаться с ""%2"" (стр. %3)'"); Для Каждого ТекущееИмя Из МассивИмен Цикл СчетчикМассива = СчетчикМассива + 1; Если СчетчикМассива > НомерВторойПодстроки Тогда Прервать; КонецЕсли; РезультатПроверки = ТекстСоответствуетТребованиямКИменам(ТекущееИмя,, ЗапрещеннаяПодстрока); Если РезультатПроверки.СодержитЗапрещеннуюПодстроку Тогда Если СчетчикМассива = НомерПервойПодстроки Тогда ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонЗапрещеннаяСтрока, ИмяОбласти, ЗапрещеннаяПодстрока, Верх); Иначе ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонЗапрещеннаяСтрокаПосле, ИмяОбласти, ЗапрещеннаяПодстрока, Верх); КонецЕсли; ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; Если НЕ РезультатПроверки.СоответствуетТребованиямКИменам Тогда Если СчетчикМассива = НомерПервойПодстроки Тогда ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонНеСоответствуетТребованиямДо, ИмяОбласти, Верх); Иначе ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонНеСоответствуетТребованиямПосле, ИмяОбласти, Верх); КонецЕсли; ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Процедура ПроверитьПересечениеОбластей(Знач ТаблицаОбластей, Отказ) ТаблицаОбластейВЗапрос = ТаблицаОбластей.Скопировать(); ТаблицаОбластейВЗапрос.Колонки.Добавить("НомерОбласти", Новый ОписаниеТипов("Число")); ТаблицаОбластейВЗапрос.Колонки.Верх.Имя = "ВерхОбласти"; ТаблицаОбластейВЗапрос.Колонки.Низ.Имя = "НизОбласти"; СчетчикСтрок = 0; Для Каждого ТекущаяСтрока Из ТаблицаОбластейВЗапрос Цикл СчетчикСтрок = СчетчикСтрок + 1; ТекущаяСтрока.НомерОбласти = СчетчикСтрок; КонецЦикла; Запрос = Новый Запрос; Запрос.УстановитьПараметр("ТаблицаОбластей", ТаблицаОбластейВЗапрос); Запрос.Текст = "ВЫБРАТЬ | ТаблицаОбластей.Имя КАК Имя, | ТаблицаОбластей.ВерхОбласти КАК ВерхОбласти, | ТаблицаОбластей.НизОбласти КАК НизОбласти, | ТаблицаОбластей.НомерОбласти КАК НомерОбласти |ПОМЕСТИТЬ ВТ_ТаблицаОбластей |ИЗ | &ТаблицаОбластей КАК ТаблицаОбластей |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ВТ_ТаблицаОбластей.Имя КАК ИмяОбласти, | ВТ_ТаблицаОбластейПересечение.Имя КАК ИмяОбластиПересечения |ИЗ | ВТ_ТаблицаОбластей КАК ВТ_ТаблицаОбластей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ВТ_ТаблицаОбластей КАК ВТ_ТаблицаОбластейПересечение | ПО ВТ_ТаблицаОбластей.ВерхОбласти < ВТ_ТаблицаОбластейПересечение.ВерхОбласти | И ВТ_ТаблицаОбластей.НизОбласти < ВТ_ТаблицаОбластейПересечение.НизОбласти | И ВТ_ТаблицаОбластей.НизОбласти >= ВТ_ТаблицаОбластейПересечение.ВерхОбласти | И ВТ_ТаблицаОбластей.НомерОбласти <> ВТ_ТаблицаОбластейПересечение.НомерОбласти | |УПОРЯДОЧИТЬ ПО | ВТ_ТаблицаОбластей.НомерОбласти"; Результат = Запрос.Выполнить(); Если НЕ Результат.Пустой() Тогда Шаблон = НСтр("ru = 'Для типа макета выгрузки ""%1"" не допускается пересечение областей ""%2"" и ""%3""'"); Выборка = Результат.Выбрать(); Пока Выборка.Следующий() Цикл ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, ФорматСохраненияВыгрузки, Выборка.ИмяОбласти, Выборка.ИмяОбластиПересечения); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); КонецЦикла; КонецЕсли; КонецПроцедуры &НаСервере Процедура ПроверитьВхождениеТаблиц(Знач Макет, Знач ТаблицаОбластей, Отказ) Если Не ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВыгрузкаОбъектовВФайлы") Тогда Возврат; КонецЕсли; Если Не ЗначениеЗаполнено(Образец) Тогда Возврат; КонецЕсли; МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); МодульВыгрузкаОбъектовВФайлы = ОбщегоНазначения.ОбщийМодуль("ВыгрузкаОбъектовВФайлы"); КоллекцияПолей = ЭтотОбъект[ИмяСпискаПолей()]; Объекты = ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(Образец); ОтображаемыеПоля = ЗаполнитьСписокОтображаемыхПолей(КоллекцияПолей); Попытка ДанныеПечати = МодульУправлениеПечатью.ДанныеПечати(Объекты, ОтображаемыеПоля, ТекущийЯзык); Исключение РазблокироватьДанныеДляРедактирования(КлючОбъектаРедактирования, УникальныйИдентификатор); ВызватьИсключение ОбработкаОшибок.ПодробноеПредставлениеОшибки(ИнформацияОбОшибке()); КонецПопытки; ОбластиМакета = МодульУправлениеПечатью.ОбластиМакета(Макет, ДанныеПечати); ОбластиТаблиц = ОбластиМакета.ОбластиТаблиц; ТаблицыМакета = МодульВыгрузкаОбъектовВФайлы.ТаблицыМакета(Макет, ОбластиТаблиц); ТаблицыМакетаОбластей = ТаблицыМакета.Скопировать(); ТаблицыМакетаОбластей.Очистить(); ТаблицыМакетаОбластей.Колонки.Добавить("ИмяОбласти", Новый ОписаниеТипов("Строка")); Для Каждого ТекущаяТаблицаМакета Из ТаблицыМакета Цикл ВерхТаблицы = ТекущаяТаблицаМакета.Верх; НизТаблицы = ТекущаяТаблицаМакета.Низ; МаксимальныйВерхОбласти = 0; МинимальныйНизОбласти = 9999999999; Для Каждого ТекущаяОбласть Из ТаблицаОбластей Цикл Если ТекущаяОбласть.ЭтоОбластьУсловияВывода Тогда Продолжить; КонецЕсли; ВерхОбласти = ТекущаяОбласть.Верх; НизОбласти = ТекущаяОбласть.Низ; Если ВерхОбласти <= ВерхТаблицы И НизОбласти >= НизТаблицы Тогда МаксимальныйВерхОбласти = Макс(МаксимальныйВерхОбласти, ВерхОбласти); МинимальныйНизОбласти = Мин(МинимальныйНизОбласти, НизОбласти); КонецЕсли; КонецЦикла; Если МаксимальныйВерхОбласти <> 0 Тогда Отбор = Новый Структура; Отбор.Вставить("Верх", МаксимальныйВерхОбласти); Отбор.Вставить("Низ", МинимальныйНизОбласти); НайденныеСтроки = ТаблицаОбластей.НайтиСтроки(Отбор); Если НайденныеСтроки.Количество() Тогда ИмяОбласти = НайденныеСтроки[0].Имя; НоваяСтрока = ТаблицыМакетаОбластей.Добавить(); ЗаполнитьЗначенияСвойств(НоваяСтрока, ТекущаяТаблицаМакета); НоваяСтрока.ИмяОбласти = ИмяОбласти; КонецЕсли; КонецЕсли; КонецЦикла; ТаблицыМакетаОбластей.Сортировать("ИмяОбласти, Верх"); АнализТаблицыМакетаОбластей(ТаблицыМакетаОбластей, ТаблицаОбластей, Отказ); КонецПроцедуры &НаСервере Процедура АнализТаблицыМакетаОбластей(Знач ТаблицыМакетаОбластей, Знач ТаблицаОбластей, Отказ) Если ТаблицыМакетаОбластей.Количество() <= 1 Тогда Возврат; КонецЕсли; Для Каждого ТекущаяОбласть Из ТаблицаОбластей Цикл Если ТекущаяОбласть.ЭтоОбластьУсловияВывода Тогда Продолжить; КонецЕсли; ИмяОбласти = ТекущаяОбласть.Имя; Отбор = Новый Структура; Отбор.Вставить("ИмяОбласти", ИмяОбласти); НайденныеСтроки = ТаблицыМакетаОбластей.НайтиСтроки(Отбор); Если НайденныеСтроки.Количество() <= 1 Тогда Продолжить; КонецЕсли; ИмяТаблицы = НайденныеСтроки[0].Имя; Для Каждого НайденнаяСтрока Из НайденныеСтроки Цикл ИмяТаблицыТекущее = НайденнаяСтрока.Имя; Если ИмяТаблицы = ИмяТаблицыТекущее Тогда Продолжить; КонецЕсли; Шаблон = НСтр("ru = 'В области ""%1"" уже есть таблица ""%2"". Область может содержать только одну таблицу (стр. %3)'"); ВерхОбласти = НайденнаяСтрока.Верх; НизОбласти = НайденнаяСтрока.Низ; Пока ВерхОбласти <= НизОбласти Цикл ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( Шаблон, ИмяОбласти, ИмяТаблицы, ВерхОбласти); ОбщегоНазначения.СообщитьПользователю(ТекстОшибки,,,, Отказ); ВерхОбласти = ВерхОбласти + 1; КонецЦикла; КонецЦикла; КонецЦикла; КонецПроцедуры &НаСервере Процедура ПроверитьОбластиВыгрузки(Знач Макет, Отказ) ТаблицаОбластей = ТаблицаОбластей(Макет); ОбластиПрисутствуют = (ТаблицаОбластей.Количество() > 0); Если ОбластиПрисутствуют Тогда ОшибкаОбластиУсловий = Ложь; ПроверитьОбластиУсловий(ТаблицаОбластей, ОшибкаОбластиУсловий); Если ОшибкаОбластиУсловий Тогда Отказ = Истина; КонецЕсли; Если ФорматСохраненияВыгрузки = Перечисления.ФорматыВыгрузкиОбъектов.XML ИЛИ ФорматСохраненияВыгрузки = Перечисления.ФорматыВыгрузкиОбъектов.JSON Тогда Если НЕ ОшибкаОбластиУсловий Тогда ПроверитьИмяОбластей(ТаблицаОбластей, Отказ); КонецЕсли; ПроверитьПересечениеОбластей(ТаблицаОбластей, Отказ); ПроверитьВхождениеТаблиц(Макет, ТаблицаОбластей, Отказ); КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервере Процедура ЗаменитьПредставленияПараметров(Строка, Поле = Неопределено, Отказ = Ложь, ПредставлениеПоля = "") ПараметрыЗамены = ФормулыИзТекста(Строка(Строка)); Для Каждого Параметр Из ПараметрыЗамены Цикл Формула = Параметр.Ключ; Если СтрЧислоВхождений(Формула, "[") > 1 Тогда Формула = Сред(Формула, 2, СтрДлина(Формула) - 2); КонецЕсли; ТекстОшибки = ""; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулСлужебный = ОбщегоНазначения.ОбщийМодуль("КонструкторФормулСлужебный"); ТекстОшибки = МодульКонструкторФормулСлужебный.ПроверитьФормулу(ЭтотОбъект, Формула); КонецЕсли; Если ЗначениеЗаполнено(ТекстОшибки) Тогда Если ЗначениеЗаполнено(ПредставлениеПоля) Тогда ТекстОшибки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = '%1 (%2)'"), ТекстОшибки, ПредставлениеПоля); КонецЕсли; ОбщегоНазначения.СообщитьПользователю(ТекстОшибки, , Поле, , Отказ); КонецЕсли; КонецЦикла; Если ТипЗнч(Строка) = Тип("ФорматированнаяСтрока") Тогда Строка = ЗаменитьВФорматированнойСтроке(Строка, ПараметрыЗамены); Иначе Строка = ЗаменитьВСтроке(Строка, ПараметрыЗамены); КонецЕсли; КонецПроцедуры &НаСервере Функция ЗаменитьВСтроке(Знач Строка, ПараметрыЗамены) Для Каждого Элемент Из ПараметрыЗамены Цикл ПодстрокаПоиска = Элемент.Ключ; ПодстрокаЗамены = Элемент.Значение; Строка = СтрЗаменить(Строка, ПодстрокаПоиска, ПодстрокаЗамены); КонецЦикла; Возврат Строка; КонецФункции &НаСервере Функция ЗаменитьВФорматированнойСтроке(Строка, ПараметрыЗамены) ФорматированныйДокумент = Новый ФорматированныйДокумент; ФорматированныйДокумент.УстановитьФорматированнуюСтроку(Строка); Для Каждого Элемент Из ПараметрыЗамены Цикл ПодстрокаПоиска = Элемент.Ключ; ПодстрокаЗамены = Элемент.Значение; НайденнаяОбласть = ФорматированныйДокумент.НайтиТекст(ПодстрокаПоиска); Пока НайденнаяОбласть <> Неопределено Цикл Фрагменты = ФорматированныйДокумент.СформироватьЭлементы(НайденнаяОбласть.ЗакладкаНачала, НайденнаяОбласть.ЗакладкаКонца); Для Индекс = 1 По Фрагменты.ВГраница() Цикл Фрагменты[0].Текст = Фрагменты[0].Текст + Фрагменты[Индекс].Текст; Фрагменты[Индекс].Текст = ""; КонецЦикла; Фрагменты[0].Текст = СтрЗаменить(Фрагменты[0].Текст, ПодстрокаПоиска, ПодстрокаЗамены); НайденнаяОбласть = ФорматированныйДокумент.НайтиТекст(ПодстрокаПоиска, НайденнаяОбласть.ЗакладкаКонца); КонецЦикла; КонецЦикла; Возврат ФорматированныйДокумент.ПолучитьФорматированнуюСтроку(); КонецФункции &НаСервере Функция ФормулыИзТекста(Знач Текст) Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Возврат МодульУправлениеПечатью.ФормулыИзТекста(Текст, ЭтотОбъект); КонецЕсли; КонецФункции &НаСервере Функция ФормулаИзПредставления(Представление) Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Возврат МодульУправлениеПечатью.ФормулаИзПредставления(ЭтотОбъект, Представление); КонецЕсли; Возврат Представление; КонецФункции &НаСервере Функция ПредставленияПараметровТекста(Знач Текст) Результат = Новый Соответствие(); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Возврат МодульУправлениеПечатью.ПредставленияПараметровТекста(Текст, ЭтотОбъект); КонецЕсли; Возврат Результат; КонецФункции &НаСервере Функция ПрочитатьМакет(Знач ДвоичныеДанные = Неопределено) КодЯзыка = ТабличныйДокумент.КодЯзыка; Если ДвоичныеДанные <> Неопределено Тогда ТабличныйДокумент.КодЯзыка = Неопределено; ТабличныйДокумент.Прочитать(ДвоичныеДанные.ОткрытьПотокДляЧтения()); КонецЕсли; Макет = СкопироватьТабличныйДокумент(ТабличныйДокумент, КодЯзыка); Если Не ЭтоПечатнаяФорма Тогда Возврат Макет; КонецЕсли; ОбработанныеОбласти = Новый Соответствие(); Для НомерСтроки = 1 По Макет.ВысотаТаблицы Цикл Для НомерКолонки = 1 По Макет.ШиринаТаблицы Цикл Область = Макет.Область(НомерСтроки, НомерКолонки); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); ИдентификаторОбласти = МодульУправлениеПечатью.ИдентификаторОбласти(Область); Если ОбработанныеОбласти[ИдентификаторОбласти] <> Неопределено Тогда Продолжить; КонецЕсли; ОбработанныеОбласти[ИдентификаторОбласти] = Истина; КонецЕсли; Если ЗначениеЗаполнено(Область.Текст) Тогда ЗаменитьПараметрыПредставлениями(Область.Текст); КонецЕсли; КонецЦикла; КонецЦикла; ЗаменитьПараметрыПредставлениями(Макет.ВерхнийКолонтитул.ТекстСлева); ЗаменитьПараметрыПредставлениями(Макет.ВерхнийКолонтитул.ТекстВЦентре); ЗаменитьПараметрыПредставлениями(Макет.ВерхнийКолонтитул.ТекстСправа); ЗаменитьПараметрыПредставлениями(Макет.НижнийКолонтитул.ТекстСлева); ЗаменитьПараметрыПредставлениями(Макет.НижнийКолонтитул.ТекстВЦентре); ЗаменитьПараметрыПредставлениями(Макет.НижнийКолонтитул.ТекстСправа); Для Каждого Область Из Макет.Области Цикл Если ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") И Область.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Тогда Если МакетДляВыгрузкиОбъекта И НЕ ЗначениеЗаполнено(Область.ПараметрРасшифровки) Тогда Продолжить; КонецЕсли; Область.ПараметрРасшифровки = ПредставлениеФормулы(Область.ПараметрРасшифровки); КонецЕсли; КонецЦикла; ПереименоватьУсловныеОбласти(Макет, ЛокализованныйПрефиксУсловнойОбласти(), МакетДляВыгрузкиОбъекта); Возврат Макет; КонецФункции &НаСервере Процедура ЗаменитьПараметрыПредставлениями(Строка) ПараметрыЗамены = ПредставленияПараметровТекста(Строка(Строка)); Если ТипЗнч(Строка) = Тип("ФорматированнаяСтрока") Тогда Строка = ЗаменитьВФорматированнойСтроке(Строка, ПараметрыЗамены); Иначе Строка = ЗаменитьВСтроке(Строка, ПараметрыЗамены); КонецЕсли; КонецПроцедуры &НаСервере Функция ПредставлениеФормулы(Знач Формула) Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Возврат МодульУправлениеПечатью.ПредставлениеФормулы(ЭтотОбъект, Формула); КонецЕсли; Возврат Формула; КонецФункции // Возвращаемое значение: // ТабличныйДокумент // &НаСервереБезКонтекста Функция СкопироватьТабличныйДокумент(ТабличныйДокумент, КодЯзыка) Результат = Новый ТабличныйДокумент; Результат.Макет = ТабличныйДокумент.Макет; Результат.КодЯзыка = КодЯзыка; Результат.Вывести(ТабличныйДокумент); ОбработанныеЯчейки = Новый Соответствие; Для НомерСтроки = 1 По ТабличныйДокумент.ВысотаТаблицы Цикл Для НомерСтолбца = 1 По ТабличныйДокумент.ШиринаТаблицы Цикл КопируемаяЯчейка = ТабличныйДокумент.Область(НомерСтроки, НомерСтолбца, НомерСтроки, НомерСтолбца); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); ИдентификаторОбласти = МодульУправлениеПечатью.ИдентификаторОбласти(КопируемаяЯчейка); Если ОбработанныеЯчейки[ИдентификаторОбласти] <> Неопределено Тогда Продолжить; КонецЕсли; ОбработанныеЯчейки[ИдентификаторОбласти] = Истина; КонецЕсли; Если КопируемаяЯчейка.Заполнение = ТипЗаполненияОбластиТабличногоДокумента.Текст Тогда Продолжить; КонецЕсли; Ячейка = Результат.Область(НомерСтроки, НомерСтолбца, НомерСтроки, НомерСтолбца); ЗаполнитьЗначенияСвойств(Ячейка, КопируемаяЯчейка, , "ФорматСтрок"); Если КопируемаяЯчейка.Заполнение = ТипЗаполненияОбластиТабличногоДокумента.Шаблон Тогда Ячейка.Текст = КопируемаяЯчейка.Текст; КонецЕсли; КонецЦикла; КонецЦикла; Результат.ВерхнийКолонтитул.ТекстСлева = ТабличныйДокумент.ВерхнийКолонтитул.ТекстСлева; Результат.ВерхнийКолонтитул.ТекстВЦентре = ТабличныйДокумент.ВерхнийКолонтитул.ТекстВЦентре; Результат.ВерхнийКолонтитул.ТекстСправа = ТабличныйДокумент.ВерхнийКолонтитул.ТекстСправа; Результат.НижнийКолонтитул.ТекстСлева = ТабличныйДокумент.НижнийКолонтитул.ТекстСлева; Результат.НижнийКолонтитул.ТекстВЦентре = ТабличныйДокумент.НижнийКолонтитул.ТекстВЦентре; Результат.НижнийКолонтитул.ТекстСправа = ТабличныйДокумент.НижнийКолонтитул.ТекстСправа; ТаблицаОбластей = ТаблицаОбластей(ТабличныйДокумент); Для Каждого ТекущаяОбласть Из ТаблицаОбластей Цикл Область = Результат.Области.Найти(ТекущаяОбласть.Имя); Если Область = Неопределено Тогда Продолжить; КонецЕсли; Если ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") И Область.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Или ТипЗнч(Область) = Тип("РисунокТабличногоДокумента") И Область.ТипРисунка <> ТипРисункаТабличногоДокумента.Группа Тогда КопируемаяОбласть = ТабличныйДокумент.Области.Найти(Область.Имя); Если КопируемаяОбласть = Неопределено Тогда Продолжить; КонецЕсли; Область.ПараметрРасшифровки = КопируемаяОбласть.ПараметрРасшифровки; КонецЕсли; КонецЦикла; Возврат Результат; КонецФункции &НаКлиентеНаСервереБезКонтекста Процедура ПрочитатьТекстВПолеКолонтитула(Знач Текст, Колонтитул) ФорматированнаяСтрока = Текст; Если ТипЗнч(Текст) = Тип("Строка") Тогда ФорматированнаяСтрока = Новый ФорматированнаяСтрока(Текст); КонецЕсли; Колонтитул.УстановитьФорматированнуюСтроку(ФорматированнаяСтрока); КонецПроцедуры &НаКлиенте Процедура ПереключитьВидимостьКомандКолонтитулов() Если ТекущийЭлемент = Элементы.ТекстСлеваСверху Или ТекущийЭлемент = Элементы.ТекстВЦентреСверху Или ТекущийЭлемент = Элементы.ТекстСправаСверху Или ТекущийЭлемент = Элементы.ТекстСлеваСнизу Или ТекущийЭлемент = Элементы.ТекстВЦентреСнизу Или ТекущийЭлемент = Элементы.ТекстСправаСнизу Тогда ПереключитьВидимостьЭлемента(Элементы.КомандыТекстаСлеваВерхнегоКолонтитула, ТекущийЭлемент = Элементы.ТекстСлеваСверху); ПереключитьВидимостьЭлемента(Элементы.КомандыТекстаВЦентреВерхнегоКолонтитула, ТекущийЭлемент = Элементы.ТекстВЦентреСверху); ПереключитьВидимостьЭлемента(Элементы.КомандыТекстаСправаВерхнегоКолонтитула, ТекущийЭлемент = Элементы.ТекстСправаСверху); ПереключитьВидимостьЭлемента(Элементы.КомандыТекстаСлеваНижнегоКолонтитула, ТекущийЭлемент = Элементы.ТекстСлеваСнизу); ПереключитьВидимостьЭлемента(Элементы.КомандыТекстаВЦентреНижнегоКолонтитула, ТекущийЭлемент = Элементы.ТекстВЦентреСнизу); ПереключитьВидимостьЭлемента(Элементы.КомандыТекстаСправаНижнегоКолонтитула, ТекущийЭлемент = Элементы.ТекстСправаСнизу); КонецЕсли; ПодключитьОбработчикОжидания("ПереключитьВидимостьКомандКолонтитулов", 0.5, Истина); КонецПроцедуры &НаКлиенте Процедура ПереключитьВидимостьЭлемента(Элемент, Видимость) Если Элемент.Видимость <> Видимость Тогда Элемент.Видимость = Видимость; КонецЕсли; КонецПроцедуры &НаСервере Функция ЗаписатьМакет(ПрерватьЗаписьПриНаличииОшибокВМакете = Ложь, АдресМакетаВоВременномХранилище = "") Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда Отказ = Ложь; Если Не ЗначениеЗаполнено(АдресМакетаВоВременномХранилище) Тогда Если ЭтоПечатнаяФорма Тогда Макет = ПодготовитьМакетДляЗаписи(, Отказ); Иначе Макет = ТабличныйДокумент; КонецЕсли; АдресМакетаВоВременномХранилище = ПоместитьВоВременноеХранилище(Макет, УникальныйИдентификатор); КонецЕсли; Если Отказ И ПрерватьЗаписьПриНаличииОшибокВМакете Тогда Возврат Ложь; КонецЕсли; МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); ОписаниеМакета = МодульУправлениеПечатью.ОписаниеМакета(); ОписаниеМакета.ИмяОбъектаМетаданныхМакета = ИдентификаторМакета; ОписаниеМакета.АдресМакетаВоВременномХранилище = АдресМакетаВоВременномХранилище; ОписаниеМакета.КодЯзыка = ТекущийЯзык; ОписаниеМакета.Наименование = ИмяДокумента; ОписаниеМакета.Ссылка = СсылкаМакета; ОписаниеМакета.ТипМакета = "MXL"; ОписаниеМакета.ИсточникиДанных = ИсточникиДанных.ВыгрузитьЗначения(); ОписаниеМакета.ОсновнаяПечатнаяФорма = ОсновнаяПечатнаяФорма; ОписаниеМакета.НаименованиеПечатнойФормы = НаименованиеПечатнойФормы; ОписаниеМакета.МакетДляВыгрузкиОбъекта = МакетДляВыгрузкиОбъекта; ОписаниеМакета.ФорматСохраненияВыгрузки = ФорматСохраненияВыгрузки; ИдентификаторМакета = МодульУправлениеПечатью.ЗаписатьМакет(ОписаниеМакета); Если Не ЗначениеЗаполнено(СсылкаМакета) Тогда СсылкаМакета = МодульУправлениеПечатью.СсылкаМакета(ИдентификаторМакета); КонецЕсли; ЗаписатьМакетыНаДополнительныхЯзыках(); Если Не Элементы.Язык.Доступность Тогда Элементы.Язык.Доступность = Истина; КонецЕсли; КонецЕсли; Возврат Истина; КонецФункции &НаСервере Процедура РасширитьСписокПолей() ДобавляемыеРеквизиты = Новый Массив; ДобавляемыеРеквизиты.Добавить(Новый РеквизитФормы("Образец", Новый ОписаниеТипов, ИмяСпискаПолей())); ДобавляемыеРеквизиты.Добавить(Новый РеквизитФормы("Формат", Новый ОписаниеТипов("Строка"), ИмяСпискаПолей())); ДобавляемыеРеквизиты.Добавить(Новый РеквизитФормы("ФорматПоУмолчанию", Новый ОписаниеТипов("Строка"), ИмяСпискаПолей())); ДобавляемыеРеквизиты.Добавить(Новый РеквизитФормы("КнопкаНастройкиФормата", Новый ОписаниеТипов("Число"), ИмяСпискаПолей())); ДобавляемыеРеквизиты.Добавить(Новый РеквизитФормы("Значение", Новый ОписаниеТипов, ИмяСпискаПолей())); ДобавляемыеРеквизиты.Добавить(Новый РеквизитФормы("Общее", Новый ОписаниеТипов("Булево"), ИмяСпискаПолей())); ИзменитьРеквизиты(ДобавляемыеРеквизиты); СписокПолей = Элементы[ИмяСпискаПолей()]; СписокПолей.Шапка = Истина; СписокПолей.УстановитьДействие("ПриАктивизацииСтроки", "Подключаемый_ДоступныеПоляПриАктивизацииСтроки"); ИмяКолонкиПредставление = ИмяСпискаПолей() + "Представление"; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулСлужебный = ОбщегоНазначения.ОбщийМодуль("КонструкторФормулСлужебный"); ИмяКолонкиПредставление = МодульКонструкторФормулСлужебный.ИмяКолонкиПредставление(ИмяСпискаПолей()); КонецЕсли; КолонкаПредставление = Элементы[ИмяКолонкиПредставление]; КолонкаПредставление.Заголовок = НСтр("ru = 'Поле'"); КолонкаОбразец = Элементы.Добавить(ИмяСпискаПолей() + "Образец", Тип("ПолеФормы"), СписокПолей); КолонкаОбразец.ПутьКДанным = ИмяСпискаПолей() + "." + "Образец"; КолонкаОбразец.Вид = ВидПоляФормы.ПолеВвода; КолонкаОбразец.Заголовок = НСтр("ru = 'Образец'"); КолонкаОбразец.УстановитьДействие("ПриИзменении", "Подключаемый_ОбразецПриИзменении"); КолонкаОбразец.ОтображатьВПодвале = Ложь; КолонкаОбразец.КнопкаОчистки = Истина; КнопкаНастройкиФормата = Элементы.Добавить(ИмяСпискаПолей() + "КнопкаНастройкиФормата", Тип("ПолеФормы"), СписокПолей); КнопкаНастройкиФормата.ПутьКДанным = ИмяСпискаПолей() + "." + "КнопкаНастройкиФормата"; КнопкаНастройкиФормата.Вид = ВидПоляФормы.ПолеКартинки; КнопкаНастройкиФормата.ОтображатьВШапке = Истина; КнопкаНастройкиФормата.КартинкаШапки = БиблиотекаКартинок.ПараметрыВыводаКомпоновкиДанных; КнопкаНастройкиФормата.КартинкаЗначений = БиблиотекаКартинок.ПараметрыВыводаКомпоновкиДанных; КнопкаНастройкиФормата.Заголовок = НСтр("ru = 'Настройка формата'"); КнопкаНастройкиФормата.ПоложениеЗаголовка = ПоложениеЗаголовкаЭлементаФормы.Нет; КнопкаНастройкиФормата.ГиперссылкаЯчейки = Истина; КнопкаНастройкиФормата.ОтображатьВПодвале = Ложь; УстановитьПримерыЗначений(); УстановитьФорматЗначенийПоУмолчанию(); НастроитьПолеОбразец(); ОтметитьОбщиеПоля(); Для Каждого ЭлементОформления Из УсловноеОформление.Элементы Цикл Для Каждого ОформляемоеПоле Из ЭлементОформления.Поля.Элементы Цикл Если ОформляемоеПоле.Поле = Новый ПолеКомпоновкиДанных(ИмяСпискаПолей() + "Представление") Тогда ОформляемоеПоле = ЭлементОформления.Поля.Элементы.Добавить(); ОформляемоеПоле.Поле = Новый ПолеКомпоновкиДанных(ИмяСпискаПолей() + "Образец"); ОформляемоеПоле = ЭлементОформления.Поля.Элементы.Добавить(); ОформляемоеПоле.Поле = Новый ПолеКомпоновкиДанных(ИмяСпискаПолей() + "КнопкаНастройкиФормата"); Прервать; КонецЕсли; КонецЦикла; КонецЦикла; // Цвет полей, не являющихся общими для выбранных объектов ЭлементОформления = УсловноеОформление.Элементы.Добавить(); ОформляемоеПоле = ЭлементОформления.Поля.Элементы.Добавить(); ОформляемоеПоле.Поле = Новый ПолеКомпоновкиДанных(ИмяСпискаПолей()); ЭлементОтбора = ЭлементОформления.Отбор.Элементы.Добавить(Тип("ЭлементОтбораКомпоновкиДанных")); ЭлементОтбора.ЛевоеЗначение = Новый ПолеКомпоновкиДанных(ИмяСпискаПолей() + ".Общее"); ЭлементОтбора.ВидСравнения = ВидСравненияКомпоновкиДанных.Равно; ЭлементОтбора.ПравоеЗначение = Ложь; ЭлементОформления.Оформление.УстановитьЗначениеПараметра("ЦветТекста", ЦветаСтиля.ТекстЗапрещеннойЯчейкиЦвет); КонецПроцедуры &НаКлиенте Процедура Подключаемый_ДоступныеПоляПриАктивизацииСтроки(Элемент) ТекущиеДанные = Элементы[ИмяСпискаПолей()].ТекущиеДанные; Если ТекущиеДанные = Неопределено Тогда Возврат; КонецЕсли; Если ТекущиеДанные.ПолучитьРодителя() = Неопределено Тогда Элементы["СтрокаПоиска" + ИмяСпискаПолей()].ПодсказкаВвода = ПодсказкаВводаСтрокиПоискаСпискаПолей(); Иначе Элементы["СтрокаПоиска" + ИмяСпискаПолей()].ПодсказкаВвода = ТекущиеДанные.ПредставлениеПутиКДанным; КонецЕсли; СистемнаяИнформация = Новый СистемнаяИнформация; ВерсияПлатформы = СистемнаяИнформация.ВерсияПриложения; ПодключитьОбработчикОжидания("ПодсветитьЯчейкиСВыбраннымПолем", 0.1, Истина); КонецПроцедуры &НаКлиенте Процедура Подключаемый_ДоступныеПоляПередНачаломИзменения(Элемент, Отказ) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.КонструкторФормул") Тогда МодульКонструкторФормулКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("КонструкторФормулКлиент"); ТекущиеДанные = Элементы[ИмяСпискаПолей()].ТекущиеДанные; ТекущиеДанные.Образец = ТекущиеДанные.Значение; ПолеВвода = Элементы[ИмяСпискаПолей() + "Образец"]; ВыбранноеПоле = МодульКонструкторФормулКлиент.ВыбранноеПолеВСпискеПолей(ЭтотОбъект, ИмяСпискаПолей()); ПолеВвода.ОграничениеТипа = ВыбранноеПоле.Тип; КонецЕсли; КонецПроцедуры &НаСервере Функция ЗаполнитьСписокОтображаемыхПолей(КоллекцияПолей, Результат = Неопределено) Если Результат = Неопределено Тогда Результат = Новый Массив; КонецЕсли; Для Каждого Элемент Из КоллекцияПолей.ПолучитьЭлементы() Цикл Если Не ЗначениеЗаполнено(Элемент.ПутьКДанным) Тогда Продолжить; КонецЕсли; Результат.Добавить(Элемент.ПутьКДанным); ЗаполнитьСписокОтображаемыхПолей(Элемент, Результат); КонецЦикла; Возврат Результат; КонецФункции &НаКлиенте Процедура ПриВыбореФорматаПоля(Формат, ДополнительныеПараметры) Экспорт Если Формат = Неопределено Тогда Возврат; КонецЕсли; ТекущиеДанные = Элементы[ИмяСпискаПолей()].ТекущиеДанные; Если ТекущиеДанные = Неопределено Тогда Возврат; КонецЕсли; ТекущиеДанные.Формат = Формат; ТекущиеДанные.Образец = Формат(ТекущиеДанные.Значение, ТекущиеДанные.Формат); КонецПроцедуры &НаКлиенте Процедура Подключаемый_ДоступныеПоляПриОкончанииРедактирования(Элемент, НоваяСтрока, ОтменаРедактирования) ТекущиеДанные = Элементы[ИмяСпискаПолей()].ТекущиеДанные; Если ЗначениеЗаполнено(ТекущиеДанные.Формат) Тогда ТекущиеДанные.Образец = Формат(ТекущиеДанные.Значение, ТекущиеДанные.Формат); КонецЕсли; Если ТекущиеДанные.ПутьКДанным = "Ссылка" Тогда Образец = ТекущиеДанные.Образец; КонецЕсли; ПодключитьОбработчикОжидания("ПриИзмененииОбразца", 0.1, Истина); КонецПроцедуры &НаКлиенте Процедура Подключаемый_ОбразецПриИзменении(Элемент) ТекущиеДанные = Элементы[ИмяСпискаПолей()].ТекущиеДанные; ТекущиеДанные.Значение = ТекущиеДанные.Образец; КонецПроцедуры &НаКлиенте Процедура ПриИзмененииОбразца() ПриИзмененииОбразцаНаСервере(); КонецПроцедуры &НаСервере Процедура ПриИзмененииОбразцаНаСервере() УстановитьПримерыЗначений(); Если Элементы.СтраницыМакетов.ТекущаяСтраница = Элементы.СтраницаОбразец Тогда СформироватьПечатнуюФорму(); КонецЕсли; КонецПроцедуры &НаКлиентеНаСервереБезКонтекста Процедура ПереименоватьУсловныеОбласти(Макет, Префикс, МакетДляВыгрузки) Области = Новый Массив; Для Каждого Область Из Макет.Области Цикл Если ТипЗнч(Область) = Тип("ОбластьЯчеекТабличногоДокумента") И Область.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Тогда Если МакетДляВыгрузки И НЕ ЗначениеЗаполнено(Область.ПараметрРасшифровки) Тогда Продолжить; КонецЕсли; Области.Добавить(Область); КонецЕсли; КонецЦикла; Для Каждого Область Из Области Цикл ПодобратьИмяОбласти(Макет, Префикс, Область); КонецЦикла; КонецПроцедуры &НаКлиентеНаСервереБезКонтекста Функция ПодобратьИмяОбласти(Знач ТабличныйДокумент, Знач Префикс, Область = Неопределено) ИспользованныеИмена = Новый Соответствие; Для Каждого Элемент Из ТабличныйДокумент.Области Цикл Если Область = Неопределено Или Элемент.Имя <> Область.Имя Тогда ИспользованныеИмена.Вставить(Элемент.Имя, Истина); КонецЕсли; КонецЦикла; Индекс = 1; Пока ИспользованныеИмена[ИмяОбласти(Префикс, Индекс)] <> Неопределено Цикл Индекс = Индекс + 1; КонецЦикла; НовоеИмяОбласти = ИмяОбласти(Префикс, Индекс); Если Область <> Неопределено И Область.Имя <> НовоеИмяОбласти Тогда Область.Имя = НовоеИмяОбласти; КонецЕсли; Возврат НовоеИмяОбласти; КонецФункции &НаКлиентеНаСервереБезКонтекста Функция ИмяОбласти(ИмяОбласти, Индекс) Возврат ИмяОбласти + Формат(Индекс, "ЧГ=0;"); КонецФункции &НаКлиентеНаСервереБезКонтекста Функция ПодсказкаВводаСтрокиПоискаСпискаПолей() Возврат НСтр("ru = 'Найти поле...'"); КонецФункции &НаКлиенте Процедура ПосмотретьПечатнуюФорму(Команда) Если Элементы.ПосмотретьПечатнуюФорму.Пометка Тогда Элементы.СтраницыМакетов.ТекущаяСтраница = Элементы.СтраницаМакет; Иначе Если Не ЗначениеЗаполнено(Образец) Тогда Элементы[ИмяСпискаПолей()].ТекущаяСтрока = ЭтотОбъект[ИмяСпискаПолей()].ПолучитьЭлементы()[0].ПолучитьИдентификатор(); ОбщегоНазначенияКлиент.СообщитьПользователю( НСтр("ru = 'Выберите образец, по данным которого будет формироваться печатная форма'"), , ИмяСпискаПолей() + "[0].Образец"); Возврат; КонецЕсли; ФорматыВыгрузки = Новый Массив; // Массив из ПеречислениеСсылка.ФорматыВыгрузкиОбъектов ФорматыВыгрузки.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.JSON")); ФорматыВыгрузки.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.XML")); Если ФорматыВыгрузки.Найти(ФорматСохраненияВыгрузки) <> Неопределено Тогда ОчиститьСообщения(); СформироватьСтруктуруВыгрузки(); Элементы.СтраницыМакетов.ТекущаяСтраница = Элементы.СтраницаОбразецВыгрузки; Иначе СформироватьПечатнуюФорму(); Элементы.СтраницыМакетов.ТекущаяСтраница = Элементы.СтраницаОбразец; КонецЕсли; КонецЕсли; Элементы.ПосмотретьПечатнуюФорму.Пометка = Не Элементы.ПосмотретьПечатнуюФорму.Пометка; Элементы.НастройкиТекущейОбласти.Видимость = Не Элементы.ПосмотретьПечатнуюФорму.Пометка; Элементы.ВтораяКоманднаяПанель.Доступность = Не Элементы.ПосмотретьПечатнуюФорму.Пометка; Элементы.ПоказыватьКолонтитулы.Доступность = Не Элементы.ПосмотретьПечатнуюФорму.Пометка; Элементы.ДействияСДокументом.Доступность = Не Элементы.ПосмотретьПечатнуюФорму.Пометка; Элементы.Язык.Доступность = Не Элементы.ПосмотретьПечатнуюФорму.Пометка; Элементы.ФорматСохраненияВыгрузки.Доступность = Не Элементы.ПосмотретьПечатнуюФорму.Пометка; КонецПроцедуры &НаСервере Процедура СформироватьПечатнуюФорму() Ссылки = ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(Образец); ОбъектыПечати = Новый СписокЗначений; Макет = ПодготовитьМакетДляЗаписи(); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); ПечатнаяФорма = МодульУправлениеПечатью.СформироватьТабличныйДокумент( Макет, Ссылки, ОбъектыПечати, ТекущийЯзык); КонецЕсли; КонецПроцедуры &НаСервере Процедура СформироватьСтруктуруВыгрузки() Если НЕ ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВыгрузкаОбъектовВФайлы") Тогда Возврат; КонецЕсли; Отказ = Ложь; Макет = ПодготовитьМакетДляЗаписи(, Отказ); Если Отказ Тогда Возврат; КонецЕсли; Ссылки = ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(Образец); Выгрузка = ""; МодульВыгрузкаОбъектовВФайлы = ОбщегоНазначения.ОбщийМодуль("ВыгрузкаОбъектовВФайлы"); Результат = МодульВыгрузкаОбъектовВФайлы.СформироватьСтруктуруДляВыгрузки( Макет, ФорматСохраненияВыгрузки, Ссылки, ТекущийЯзык); СтруктураСДанными = Результат[Образец]; ПредставлениеВыгрузки = ""; ПолноеИмяФайла = ""; Если ФорматСохраненияВыгрузки = Перечисления.ФорматыВыгрузкиОбъектов.XML Тогда МодульВыгрузкаОбъектовВФайлы.ВыполнитьВыгрузкуВXML( СтруктураСДанными, ПолноеИмяФайла, ПредставлениеВыгрузки); ИначеЕсли ФорматСохраненияВыгрузки = Перечисления.ФорматыВыгрузкиОбъектов.JSON Тогда МодульВыгрузкаОбъектовВФайлы.ВыполнитьВыгрузкуВJSON( СтруктураСДанными, ПолноеИмяФайла, ПредставлениеВыгрузки); КонецЕсли; Выгрузка = ПредставлениеВыгрузки; КонецПроцедуры &НаКлиенте Процедура УдалитьШтампЭП(Команда) Для Каждого Область Из Элементы.ТабличныйДокумент.ПолучитьВыделенныеОбласти() Цикл Если СтрНачинаетсяС(Область.Имя, "ШтампЭП") Тогда Область.Имя = ""; #Если ВебКлиент Тогда // Требуется для обновления отображения Область.Защита = Область.Защита; #КонецЕсли КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Процедура УдалитьМакетНаТекущемЯзыке() Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); МодульУправлениеПечатью.УдалитьМакет(ИдентификаторМакета, ТекущийЯзык); КонецЕсли; ЗагрузитьТабличныйДокументИзМетаданных(ТекущийЯзык); Если ЭтоПечатнаяФорма Тогда ЗаполнитьТабличныйДокумент(ТабличныйДокумент, ПрочитатьМакет()); КонецЕсли; Модифицированность = Ложь; Если Не ЗначениеЗаполнено(ТекущийЯзык) Или ТекущийЯзык = ОбщегоНазначения.КодОсновногоЯзыка() Тогда Возврат; КонецЕсли; МенюЯзык = Элементы.Язык; ДобавляемыеЯзыки = Элементы.ДобавляемыеЯзыки; ЯзыкУдаляемойФормы = ТекущийЯзык; ТекущийЯзык = ОбщегоНазначения.КодОсновногоЯзыка(); Для Каждого КнопкаЯзыка Из МенюЯзык.ПодчиненныеЭлементы Цикл Если СтрЗаканчиваетсяНа(КнопкаЯзыка.Имя, ЯзыкУдаляемойФормы) Тогда КнопкаЯзыка.Пометка = Ложь; КнопкаЯзыка.Видимость = Ложь; КонецЕсли; Если СтрЗаканчиваетсяНа(КнопкаЯзыка.Имя, ТекущийЯзык) Тогда КнопкаЯзыка.Пометка = Истина; КонецЕсли; КонецЦикла; Для Каждого КнопкаДобавляемогоЯзыка Из ДобавляемыеЯзыки.ПодчиненныеЭлементы Цикл Если СтрЗаканчиваетсяНа(КнопкаДобавляемогоЯзыка.Имя, ЯзыкУдаляемойФормы) Тогда КнопкаДобавляемогоЯзыка.Видимость = Истина; КонецЕсли; КонецЦикла; МенюЯзыкВсеДействия = Элементы.ЯзыкВсеДействия; ДобавляемыеЯзыкиВсеДействия = Элементы.ДобавляемыеЯзыкиВсеДействия; Для Каждого КнопкаЯзыка Из МенюЯзыкВсеДействия.ПодчиненныеЭлементы Цикл Если ТипЗнч(КнопкаЯзыка) = Тип("КнопкаФормы") Тогда Если СтрЗаканчиваетсяНа(КнопкаЯзыка.ИмяКоманды, ЯзыкУдаляемойФормы) Тогда КнопкаЯзыка.Пометка = Ложь; КнопкаЯзыка.Видимость = Ложь; КонецЕсли; Если СтрЗаканчиваетсяНа(КнопкаЯзыка.ИмяКоманды, ТекущийЯзык) Тогда КнопкаЯзыка.Пометка = Истина; КонецЕсли; КонецЕсли; КонецЦикла; Для Каждого КнопкаДобавляемогоЯзыка Из ДобавляемыеЯзыкиВсеДействия.ПодчиненныеЭлементы Цикл Если ТипЗнч(КнопкаДобавляемогоЯзыка) = Тип("КнопкаФормы") Тогда Если СтрЗаканчиваетсяНа(КнопкаДобавляемогоЯзыка.ИмяКоманды, ЯзыкУдаляемойФормы) Тогда КнопкаДобавляемогоЯзыка.Видимость = Истина; КонецЕсли; КонецЕсли; КонецЦикла; Элементы.Язык.Заголовок = Элементы["Язык_"+ТекущийЯзык].Заголовок; Элементы.ЯзыкВсеДействия.Заголовок = Элементы["Язык_"+ТекущийЯзык].Заголовок; КонецПроцедуры &НаКлиенте Процедура ПродолжитьСохранениеВФайл(ВыбранныеФайлы, ДополнительныеПараметры) Экспорт Если ВыбранныеФайлы = Неопределено Тогда Возврат; КонецЕсли; ПолноеИмяФайла = ВыбранныеФайлы[0]; ОчиститьПодсветку(); Макет = ПодготовитьМакетДляЗаписи(Ложь); Макет.Записать(ПолноеИмяФайла); КонецПроцедуры &НаКлиенте Процедура ПродолжитьЗагрузкуИзФайла(ВыбранныеФайлы, ДополнительныеПараметры) Экспорт Если ВыбранныеФайлы = Неопределено Тогда Возврат; КонецЕсли; ПолноеИмяФайла = ВыбранныеФайлы[0]; ОписаниеОповещения = Новый ОписаниеОповещения("ПродолжитьЗагрузкуИзФайлаПослеПолученияДанных", ЭтотОбъект); НачатьСозданиеДвоичныхДанныхИзФайла(ОписаниеОповещения, ПолноеИмяФайла); КонецПроцедуры &НаКлиенте Процедура ПродолжитьЗагрузкуИзФайлаПослеПолученияДанных(ДвоичныеДанные, ДополнительныеПараметры) Экспорт ЗакончитьЗагрузкуИзФайла(ДвоичныеДанные); Модифицированность = Истина; КонецПроцедуры &НаСервере Процедура ЗакончитьЗагрузкуИзФайла(Знач ДвоичныеДанные) КодЯзыка = ТабличныйДокумент.КодЯзыка; Макет = ПрочитатьМакет(ДвоичныеДанные); ТабличныйДокумент.КодЯзыка = КодЯзыка; ЗаполнитьТабличныйДокумент(ТабличныйДокумент, Макет); КонецПроцедуры &НаКлиенте Процедура ОбновитьТекстВОбластиЯчеек() ТекущаяОбласть = ТабличныйДокумент.ТекущаяОбласть; Если ТекущаяОбласть = Неопределено Или ТипЗнч(ТекущаяОбласть) <> Тип("ОбластьЯчеекТабличногоДокумента") Тогда Возврат; КонецЕсли; Модифицированность = Истина; Если ТекущаяОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Прямоугольник Тогда ТекущаяОбласть.Текст = ТекущееЗначение; ИначеЕсли ТекущаяОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Тогда ТекущаяОбласть.Имя = ""; Область = ТабличныйДокумент.Область(ТекущаяОбласть.Верх, 1, ТекущаяОбласть.Верх, 1); Если Область.Текст = "" Тогда Область.Текст = ""; КонецЕсли; ТекущаяОбласть.ПараметрРасшифровки = ТекущееЗначение; Если ЗначениеЗаполнено(ТекущееЗначение) Тогда ПодобратьИмяОбласти(ТабличныйДокумент, ЛокализованныйПрефиксУсловнойОбласти(), ТекущаяОбласть); КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервереБезКонтекста Функция ПрефиксУсловнойОбласти() Возврат "Условие" + "_"; КонецФункции &НаКлиентеНаСервереБезКонтекста Функция ЛокализованныйПрефиксУсловнойОбласти() Возврат НСтр("ru = 'Условие'") + "_"; КонецФункции &НаКлиенте Процедура ПриВыбореИмениМакета(НовоеИмяМакета, ДополнительныеПараметры) Экспорт Если НовоеИмяМакета = Неопределено Тогда Возврат; КонецЕсли; Если ИмяДокумента <> НовоеИмяМакета Тогда Модифицированность = Истина; КонецЕсли; ИмяДокумента = НовоеИмяМакета; УстановитьЗаголовок(); КонецПроцедуры #КонецОбласти &НаКлиенте Процедура ПриВыбореВладельцевМакета(Результат, ДополнительныеПараметры) Экспорт Если Результат = Неопределено Тогда Возврат; КонецЕсли; ИсточникиДанных.ЗагрузитьЗначения(Результат.ВыгрузитьЗначения()); Элементы.ТекстНазначение.Заголовок = ПредставлениеИсточниковДанных(ИсточникиДанных); ОбновитьСписокДоступныхПолей(); КонецПроцедуры &НаКлиентеНаСервереБезКонтекста Функция ПредставлениеИсточниковДанных(ИсточникиДанных) Значения = Новый Массив; Для Каждого Элемент Из ИсточникиДанных Цикл Значения.Добавить(Элемент.Значение); КонецЦикла; Результат = СтрСоединить(Значения, ", "); Если Не ЗначениеЗаполнено(Результат) Тогда Результат = "<" + НСтр("ru = 'не выбрано'") + ">"; КонецЕсли; Возврат Результат; КонецФункции &НаСервереБезКонтекста Функция ОбъектыСКомандамиПечати() ОбъектыСКомандамиПечати = Новый СписокЗначений; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); Для Каждого ОбъектМетаданных Из МодульУправлениеПечатью.ИсточникиКомандПечати() Цикл ОбъектыСКомандамиПечати.Добавить(ОбъектМетаданных.ПолноеИмя()); КонецЦикла; КонецЕсли; Возврат ОбъектыСКомандамиПечати; КонецФункции &НаСервере Процедура ОбновитьСписокДоступныхПолей() Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); МодульУправлениеПечатью.ОбновитьСписокДоступныхПолей(ЭтотОбъект, КоллекцииПолей(ИсточникиДанных.ВыгрузитьЗначения(), ПараметрыРедактирования()), ИмяСпискаПолей()); НастроитьПолеОбразец(); ОтметитьОбщиеПоля(); УстановитьФорматЗначенийПоУмолчанию(); Если ИсточникиДанных.Количество() > 0 Тогда ИсточникДанных = ИсточникиДанных[0].Значение; ОбъектМетаданных = ОбщегоНазначения.ОбъектМетаданныхПоИдентификатору(ИсточникДанных); ПодобратьОбразец(ОбъектМетаданных); УстановитьПримерыЗначений(); КонецЕсли; КонецЕсли; КонецПроцедуры &НаСервере Процедура НастроитьПолеОбразец() КоллекцияПолей = ЭтотОбъект[ИмяСпискаПолей()].ПолучитьЭлементы(); // ДанныеФормыКоллекцияЭлементовДерева Смещение = 0; Для Каждого ОписаниеПоля Из КоллекцияПолей Цикл Если ОписаниеПоля.ПутьКДанным = "Ссылка" Тогда ОписаниеПоля.Заголовок = НСтр("ru = 'Образец'"); Если Смещение <> 0 Тогда Индекс = КоллекцияПолей.Индекс(ОписаниеПоля); КоллекцияПолей.Сдвинуть(Индекс, Смещение); КонецЕсли; ОписаниеПоля.ПолучитьЭлементы().Очистить(); Прервать; КонецЕсли; Смещение = Смещение - 1; КонецЦикла; КонецПроцедуры &НаСервере Функция ОбщиеПоляИсточниковДанных() ОбщиеПоляИсточниковДанных = Новый Массив; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") Тогда МодульУправлениеПечатью = ОбщегоНазначения.ОбщийМодуль("УправлениеПечатью"); ОбщиеПоляИсточниковДанных = МодульУправлениеПечатью.ОбщиеПоляИсточниковДанных(ИсточникиДанных.ВыгрузитьЗначения()); КонецЕсли; Возврат ОбщиеПоляИсточниковДанных; КонецФункции &НаСервере Процедура ОтметитьОбщиеПоля(Знач КоллекцияПолей = Неопределено, Знач ОбщиеПоля = Неопределено) Если КоллекцияПолей = Неопределено Тогда КоллекцияПолей = ЭтотОбъект[ИмяСпискаПолей()]; КонецЕсли; Если ОбщиеПоля = Неопределено Тогда ОбщиеПоля = ОбщиеПоляИсточниковДанных(); КонецЕсли; Для Каждого ОписаниеПоля Из КоллекцияПолей.ПолучитьЭлементы() Цикл Если ОписаниеПоля.Папка И ОписаниеПоля.Поле = Новый ПолеКомпоновкиДанных("ОбщиеРеквизиты") Или ОписаниеПоля.ПолучитьРодителя() <> Неопределено И ОписаниеПоля.ПолучитьРодителя().Поле = Новый ПолеКомпоновкиДанных("ОбщиеРеквизиты") Тогда ОписаниеПоля.Общее = Истина; УстановитьПризнакОбщегоПоляДляПодчиненныхПолей(ОписаниеПоля); Продолжить; КонецЕсли; Если ОбщиеПоля.Найти(ОписаниеПоля.Поле) <> Неопределено Тогда ОписаниеПоля.Общее = Истина; Если Не ОписаниеПоля.Папка И Не ОписаниеПоля.Таблица Тогда УстановитьПризнакОбщегоПоляДляПодчиненныхПолей(ОписаниеПоля); КонецЕсли; КонецЕсли; Если ОписаниеПоля.Общее И (ОписаниеПоля.Папка Или ОписаниеПоля.Таблица) Тогда ОтметитьОбщиеПоля(ОписаниеПоля, ОбщиеПоля); КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Процедура УстановитьПризнакОбщегоПоляДляПодчиненныхПолей(КоллекцияПолей) Для Каждого ОписаниеПоля Из КоллекцияПолей.ПолучитьЭлементы() Цикл ОписаниеПоля.Общее = КоллекцияПолей.Общее; УстановитьПризнакОбщегоПоляДляПодчиненныхПолей(ОписаниеПоля); КонецЦикла; КонецПроцедуры &НаКлиенте Процедура УстановитьДоступностьРекурсивно(Элемент, Доступность = Неопределено) Если Доступность = Неопределено Тогда Доступность = Элемент.Доступность; КонецЕсли; Для Каждого ПодчиненныйЭлемент Из Элемент.ПодчиненныеЭлементы Цикл Если ТипЗнч(ПодчиненныйЭлемент) = Тип("КнопкаФормы") И ПодчиненныйЭлемент.ИмяКоманды <> "" Тогда ПодчиненныйЭлемент.Доступность = Доступность; КонецЕсли; Если ТипЗнч(ПодчиненныйЭлемент) = Тип("ГруппаФормы") Тогда УстановитьДоступностьРекурсивно(ПодчиненныйЭлемент, Доступность); КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Функция ПараметрыРедактирования() Результат = Новый Структура; Результат.Вставить("КлючОбъектаРедактирования", КлючОбъектаРедактирования); Результат.Вставить("УникальныйИдентификатор", УникальныйИдентификатор); Возврат Результат; КонецФункции &НаКлиенте Процедура ПриИзмененииНастроекМакета(СтруктураПараметров) Если ОбщегоНазначенияКлиент.ПодсистемаСуществует("СтандартныеПодсистемы.Печать") И НЕ МакетДляВыгрузкиОбъекта Тогда ОписаниеОповещения = Новый ОписаниеОповещения( "ЗавершениеОткрытияНастроекМакета", ЭтотОбъект, Новый Структура("Форма", ЭтотОбъект)); МодульУправлениеПечатьюКлиент = ОбщегоНазначенияКлиент.ОбщийМодуль("УправлениеПечатьюКлиент"); МодульУправлениеПечатьюКлиент.ПриИзмененииНастроекМакета(СтруктураПараметров, ОписаниеОповещения); Иначе ОписаниеОповещения = Новый ОписаниеОповещения("ПриВыбореИмениМакета", ЭтотОбъект); ПоказатьВводСтроки(ОписаниеОповещения, ИмяДокумента, НСтр("ru = 'Введите наименование макета'"), 100, Ложь); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура ЗавершениеОткрытияНастроекМакета(Результат, ДополнительныеПараметры) Экспорт Если Результат = Неопределено Тогда Возврат; КонецЕсли; Для Каждого КлючЗначение Из Результат Цикл ИмяРеквизита = КлючЗначение.Ключ; НовоеЗначение = Результат[ИмяРеквизита]; Если НовоеЗначение <> ЭтотОбъект[ИмяРеквизита] Тогда ЭтотОбъект[ИмяРеквизита] = НовоеЗначение; Модифицированность = Истина; Если ИмяРеквизита = "ИмяДокумента" Тогда УстановитьЗаголовок(); КонецЕсли; КонецЕсли; КонецЦикла; КонецПроцедуры &НаКлиентеНаСервереБезКонтекста Функция ФорматыВыгрузкиТребующиеНаличиеОбластей() МассивФорматов = Новый Массив; МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.JSON")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.XML")); Возврат МассивФорматов; КонецФункции &НаКлиентеНаСервереБезКонтекста Функция ФорматыВыгрузкиНеТребующиеРаботыСТекстом() МассивФорматов = Новый Массив; МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.JSON")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.XML")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.DBF")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.ANSITXT")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.TXT")); Возврат МассивФорматов; КонецФункции &НаКлиентеНаСервереБезКонтекста Функция ФорматыВыгрузкиРазрешеноНаличияОбластей() МассивФорматов = Новый Массив; МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.JSON")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.XML")); Возврат МассивФорматов; КонецФункции &НаКлиентеНаСервереБезКонтекста Функция ФорматыВыгрузкиРазрешеноНаличияКартинок() МассивФорматов = Новый Массив; МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.XLS")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.XLSX")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.HTML5")); МассивФорматов.Добавить(ПредопределенноеЗначение("Перечисление.ФорматыВыгрузкиОбъектов.MXL")); Возврат МассивФорматов; КонецФункции &НаКлиентеНаСервереБезКонтекста Процедура ВидимостьКнопокУправленияТекстом(Форма) ФорматСохраненияВыгрузки = Форма.ФорматСохраненияВыгрузки; МакетДляВыгрузкиОбъекта = Форма.МакетДляВыгрузкиОбъекта; Если НЕ МакетДляВыгрузкиОбъекта Тогда Возврат; КонецЕсли; Элементы = Форма.Элементы; Элементы.ПоказыватьКолонтитулы.Видимость = Ложь; Элементы.ПовторятьВНачалеСтраницы.Видимость = Ложь; Элементы.ПовторятьВКонцеСтраницы.Видимость = Ложь; ФорматыВыгрузки = ФорматыВыгрузкиНеТребующиеРаботыСТекстом(); ВидимостьЭлемента = (ФорматыВыгрузки.Найти(ФорматСохраненияВыгрузки) = Неопределено); Элементы.ФорматированиеТекста.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументШрифт.Видимость = ВидимостьЭлемента; Элементы.УменьшитьРазмерШрифта.Видимость = ВидимостьЭлемента; Элементы.УвеличитьРазмерШрифта.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЖирный.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументНаклонный.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументПодчеркивание.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьВлево.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьПоЦентру.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьВправо.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьПоШирине.Видимость = ВидимостьЭлемента; Элементы.ВыровнятьПоВерхнемуКраю.Видимость = ВидимостьЭлемента; Элементы.ВыровнятьПоСередине.Видимость = ВидимостьЭлемента; Элементы.ВыровнятьПоНижнемуКраю.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЦветФона.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЦветТекста.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЦветГраницы.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументОчиститьФормат.Видимость = ВидимостьЭлемента; Элементы.ФорматированиеТекстаВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументШрифтВсеДействия.Видимость = ВидимостьЭлемента; Элементы.УменьшитьРазмерШрифтаВсеДействия.Видимость = ВидимостьЭлемента; Элементы.УвеличитьРазмерШрифтаВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЖирныйВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументНаклонныйВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументПодчеркиваниеВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ЗачеркиваниеВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьВлевоВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьПоЦентруВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьВправоВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументВыровнятьПоШиринеВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ВыровнятьПоВерхнемуКраюВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ВыровнятьПоСерединеВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ВыровнятьПоНижнемуКраюВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЦветФонаВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЦветТекстаВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументЦветГраницыВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументОчиститьФорматВсеДействия.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументОбъединить.Видимость = ВидимостьЭлемента; Элементы.Рисунки.Видимость = ВидимостьЭлемента; Элементы.Картинка.Видимость = ВидимостьЭлемента; Элементы.Текст.Видимость = ВидимостьЭлемента; Элементы.Прямоугольник.Видимость = ВидимостьЭлемента; Элементы.Прямая.Видимость = ВидимостьЭлемента; Элементы.Эллипс.Видимость = ВидимостьЭлемента; Элементы.Сгруппировать.Видимость = ВидимостьЭлемента; Элементы.Разгруппировать.Видимость = ВидимостьЭлемента; Элементы.Границы.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументГраницаСлева.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументГраницаСверху.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументГраницаСправа.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументГраницаСнизу.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументГраницаВезде.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументГраницаВокруг.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументГраницаВнутри.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументТолстаяГраницаВокруг.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументТолстаяГраницаСверху.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументТолстаяГраницаСнизу.Видимость = ВидимостьЭлемента; Элементы.ТабличныйДокументНетГраницы.Видимость = ВидимостьЭлемента; Элементы.Таблица.Видимость = ВидимостьЭлемента; Элементы.РазмещениеАвто.Видимость = ВидимостьЭлемента; Элементы.РазмещениеПереносить.Видимость = ВидимостьЭлемента; Элементы.РазмещениеЗабивать.Видимость = ВидимостьЭлемента; Элементы.РазмещениеОбрезать.Видимость = ВидимостьЭлемента; Элементы.РазмещениеТекстаЕще.Видимость = ВидимостьЭлемента; Элементы.РазмещениеАвтоЕще.Видимость = ВидимостьЭлемента; Элементы.РазмещениеПереноситьЕще.Видимость = ВидимостьЭлемента; Элементы.РазмещениеЗабиватьЕще.Видимость = ВидимостьЭлемента; Элементы.РазмещениеОбрезатьЕще.Видимость = ВидимостьЭлемента; КонецПроцедуры &НаКлиенте Процедура ДоступностьКнопокУправленияТекстом(ТекущаяОбласть) ДоступностьЭлемента = (ТипЗнч(ТекущаяОбласть) = Тип("ОбластьЯчеекТабличногоДокумента")); Элементы.Шрифт.Доступность = ДоступностьЭлемента; Элементы.ВертикальноеВыравнивание.Доступность = ДоступностьЭлемента; Элементы.ТабличныйДокументЦветТекста.Доступность = ДоступностьЭлемента; Элементы.ТабличныйДокументЦветГраницы.Доступность = ДоступностьЭлемента; Элементы.ТабличныйДокументОчиститьФормат.Доступность = ДоступностьЭлемента; Элементы.ФорматированиеТекстаВсеДействия.Доступность = ДоступностьЭлемента; Элементы.РазмещениеТекста.Доступность = ДоступностьЭлемента; Элементы.РазмещениеТекстаЕще.Доступность = ДоступностьЭлемента; Элементы.НазначитьИмя.Доступность = ДоступностьЭлемента; Элементы.УдалитьИмя.Доступность = ДоступностьЭлемента; КонецПроцедуры #КонецОбласти
166,948
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 11512, "qsc_code_num_chars": 166948.0, "qsc_code_mean_word_length": 11.86170952, "qsc_code_frac_words_unique": 0.11153579, "qsc_code_frac_chars_top_2grams": 0.01581815, "qsc_code_frac_chars_top_3grams": 0.02413732, "qsc_code_frac_chars_top_4grams": 0.00960806, "qsc_code_frac_chars_dupe_5grams": 0.34813844, "qsc_code_frac_chars_dupe_6grams": 0.27429111, "qsc_code_frac_chars_dupe_7grams": 0.22149804, "qsc_code_frac_chars_dupe_8grams": 0.19602789, "qsc_code_frac_chars_dupe_9grams": 0.18552639, "qsc_code_frac_chars_dupe_10grams": 0.16926885, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00239766, "qsc_code_frac_chars_whitespace": 0.10813547, "qsc_code_size_file_byte": 166948.0, "qsc_code_num_lines": 4750.0, "qsc_code_num_chars_line_max": 198.0, "qsc_code_num_chars_line_mean": 35.14694737, "qsc_code_frac_chars_alphabet": 0.91469828, "qsc_code_frac_chars_comments": 0.99937106, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/json/JSONObject.java
package com.ruoyi.common.json; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern; import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.common.utils.StringUtils; /** * 通用消息对象,基于Map实现的可嵌套数据结构。 支持JSON数据结构。 * * @author ruoyi */ public class JSONObject extends LinkedHashMap<String, Object> { private static final long serialVersionUID = 1L; private static final Pattern arrayNamePattern = Pattern.compile("(\\w+)((\\[\\d+\\])+)"); private static final ObjectMapper objectMapper = new ObjectMapper(); /** * 数组结构。 */ public static class JSONArray extends ArrayList<Object> { private static final long serialVersionUID = 1L; public JSONArray() { super(); } public JSONArray(int size) { super(size); } @Override public String toString() { try { return JSON.marshal(this); } catch (Exception e) { throw new RuntimeException(e); } } @Override public Object set(int index, Object element) { return super.set(index, transfer(element)); } @Override public boolean add(Object element) { return super.add(transfer(element)); } @Override public void add(int index, Object element) { super.add(index, transfer(element)); } } public JSONObject() { super(); } public JSONObject(final JSONObject other) { super(other); } @Override public String toString() { try { return JSON.marshal(this); } catch (Exception e) { throw new RuntimeException(e); } } /** * 转换为紧凑格式的字符串。 * * @return 返回本对象紧凑格式字符串。 */ public String toCompactString() { try { return objectMapper.writeValueAsString(this); } catch (Exception e) { throw new RuntimeException(e); } } /** * 获取指定字段的整数值。如果字段不存在,或者无法转换为整数,返回null。 * * @param name 字段名,支持多级。 * @return 返回指定的整数值,或者null。 */ public Integer intValue(final String name) { return valueAsInt(value(name)); } /** * 获取指定字段的整数值。如果字段不存在,或者无法转换为整数,返回defaultValue。 * * @param name 字段名,支持多级。 * @param defaultValue 查询失败时,返回的值。 * @return 返回指定的整数值,或者defaultValue。 */ public Integer intValue(final String name, final Integer defaultValue) { return StringUtils.nvl(intValue(name), defaultValue); } /** * 获取指定字段的长整数值。如果字段不存在,或者无法转换为长整数,返回null。 * * @param name 字段名,支持多级。 * @return 返回指定的长整数值,或者null。 */ public Long longValue(final String name) { return valueAsLong(value(name)); } /** * 获取指定字段的长整数值。如果字段不存在,或者无法转换为长整数,返回defaultValue。 * * @param name 字段名,支持多级。 * @param defaultValue 查询失败时,返回的值。 * @return 返回指定的长整数值,或者defaultValue。 */ public Long longValue(final String name, final Long defaultValue) { return StringUtils.nvl(longValue(name), defaultValue); } /** * 获取指定字段的布尔值。如果字段不存在,或者无法转换为布尔型,返回null。 * * @param name 字段名,支持多级。 * @return 返回指定的布尔值,或者null。 */ public Boolean boolValue(final String name) { return valueAsBool(value(name)); } /** * 获取指定字段的布尔值。如果字段不存在,或者无法转换为布尔型,返回defaultValue。 * * @param name 字段名,支持多级。 * @param defaultValue 查询失败时,返回的值。 * @return 返回指定的布尔值,或者defaultValue。 */ public Boolean boolValue(final String name, final Boolean defaultValue) { return StringUtils.nvl(boolValue(name), defaultValue); } /** * 获取指定字段的字符串值。如果字段不存在,返回null。 * * @param name 字段名,支持多级。 * @return 返回指定的字符串值,或者null。 */ public String strValue(final String name) { return valueAsStr(value(name)); } /** * 获取指定字段的字符串值。如果字段不存在,返回defaultValue。 * * @param name 字段名,支持多级。 * @param defaultValue 查询失败时,返回的值。 * @return 返回指定的字符串值,或者defaultValue。 */ public String strValue(final String name, final String defaultValue) { return StringUtils.nvl(strValue(name), defaultValue); } /** * 获取指定字段的值。 * * @param name 字段名,支持多级,支持数组下标。 * @return 返回指定字段的值。 */ public Object value(final String name) { final int indexDot = name.indexOf('.'); if (indexDot >= 0) { return obj(name.substring(0, indexDot)).value(name.substring(indexDot + 1)); } else { final Matcher matcher = arrayNamePattern.matcher(name); if (matcher.find()) { return endArray(matcher.group(1), matcher.group(2), new EndArrayCallback<Object>() { @Override public Object callback(JSONArray arr, int index) { return elementAt(arr, index); } }); } else { return get(name); } } } /** * 设置指定字段的值。 * * @param name 字段名,支持多级,支持数组下标。 * @param value 字段值。 * @return 返回本对象。 */ public JSONObject value(final String name, final Object value) { final int indexDot = name.indexOf('.'); if (indexDot >= 0) { obj(name.substring(0, indexDot)).value(name.substring(indexDot + 1), value); } else { final Matcher matcher = arrayNamePattern.matcher(name); if (matcher.find()) { endArray(matcher.group(1), matcher.group(2), new EndArrayCallback<Void>() { @Override public Void callback(JSONArray arr, int index) { elementAt(arr, index, value); return null; } }); } else { set(name, value); } } return this; } /** * 获取对象(非标量类型)字段。返回的数据是一个结构体。当不存在指定对象时,则为指定的名字创建一个空的MessageObject对象。 * * @param name 字段名。不支持多级名字,支持数组下标。 * @return 返回指定的对象。如果对象不存在,则为指定的名字创建一个空的MessageObject对象。 */ public JSONObject obj(final String name) { final Matcher matcher = arrayNamePattern.matcher(name); if (matcher.find()) { return endArray(matcher.group(1), matcher.group(2), new EndArrayCallback<JSONObject>() { @Override public JSONObject callback(JSONArray arr, int index) { return objAt(arr, index); } }); } else { JSONObject obj = getObj(name); if (obj == null) { obj = new JSONObject(); put(name, obj); } return obj; } } /** * 获取数组字段。将名字对应的对象以数组对象返回,当指定的字段不存在时,创建一个空的数组。 * * @param name 字段名。不支持多级名字,不支持下标。 * @return 返回一个数组(List)。 */ public JSONArray arr(final String name) { JSONArray arr = getArr(name); if (arr == null) { arr = new JSONArray(); put(name, arr); } return arr; } /** * 获取对象(非标量类型)字段。返回的数据是一个结构体。 * * @param name 字段名。 * @return 返回指定的对象字段。 */ public JSONObject getObj(final String name) { return (JSONObject) get(name); } /** * 获取数组类型字段。 * * @param name 字段名。 * @return 返回数组类型字段。 */ public JSONArray getArr(final String name) { return (JSONArray) get(name); } /** * 返回字段整数值。如果不存在,返回null。 * * @param name 字段名。 * @return 返回指定字段整数值。 */ public Integer getInt(final String name) { return valueAsInt(get(name)); } /** * 返回字段整数值。如果不存在,返回defaultValue。 * * @param name 字段名。 * @param defaultValue 字段不存在时,返回的值。 * @return 返回指定字段整数值。 */ public Integer getInt(final String name, Integer defaultValue) { return StringUtils.nvl(getInt(name), defaultValue); } /** * 返回字段长整数值。如果不存在,返回null。 * * @param name 字段名。 * @return 返回指定字段长整数值。 */ public Long getLong(final String name) { return valueAsLong(get(name)); } /** * 返回字段长整数值。如果不存在,返回defaultValue。 * * @param name 字段名。 * @param defaultValue 字段不存在时,返回的值。 * @return 返回指定字段长整数值。 */ public Long getLong(final String name, Long defaultValue) { return StringUtils.nvl(getLong(name), defaultValue); } /** * 返回字段字符串值。如果不存在,返回null。 * * @param name 字段名。 * @return 返回指定字段字符串值。 */ public String getStr(final String name) { return valueAsStr(get(name)); } /** * 返回字段字符串值。如果不存在,返回defaultValue。 * * @param name 字段名。 * @param defaultValue 字段不存在时,返回的值。 * @return 返回指定字段字符串值。 */ public String getStr(final String name, final String defaultValue) { return StringUtils.nvl(getStr(name), defaultValue); } /** * 字段值按照布尔类型返回。如果不存在,返回null。 * * @param name 字段名。 * @return 字段值。 */ public Boolean getBool(final String name) { return valueAsBool(get(name)); } /** * 字段值按照布尔类型返回。如果不存在,返回defaultValue。 * * @param name 字段名。 * @param defaultValue 字段不存在时,返回的值。 * @return 字段值。 */ public Boolean getBool(final String name, final Boolean defaultValue) { return StringUtils.nvl(getBool(name), defaultValue); } /** * 设置字段值 * * @param name 字段名 * @param value 字段值(标量:数字、字符串、布尔型;结构体:MessageObject)。 如果是Map类型同时非MessageObject类型,则自动转换为MessageObject类型再存入 * (此时,再修改Map中的数据,将不会体现到本对象中)。 * @return 返回本对象 */ public JSONObject set(final String name, final Object value) { put(name, value); return this; } /** * 将本对象转换为Java Bean。 * * @param beanClass Java Bean的类对象。 * @return 返回转换后的Java Bean。 */ public <T> T asBean(Class<T> beanClass) { try { return JSON.unmarshal(JSON.marshal(this), beanClass); } catch (Exception e) { throw new RuntimeException(e); } } /** * 重载基类的方法。如果 value 是 Map 类型,但不是 MessageObject 类型,则创建一个包含内容等同于原 Map 的 MessageObject 作为 value(注意:此后再更改 Map 的内容,将不会反映到 * MessageObject 中)。 重载此方法的目的是为了使JSON能够正确地解析为MessageObject对象。不建议直接调用此方法,请使用 set(name, value)方法设置字段值。 */ @Override public Object put(String key, Object value) { return super.put(key, transfer(value)); } public static Integer valueAsInt(Object value) { if (value instanceof Integer) { return (Integer) value; } else if (value instanceof Number) { return ((Number) value).intValue(); } else if (value instanceof String) { return Integer.valueOf((String) value); } else if (value instanceof Boolean) { return ((Boolean) value) ? 1 : 0; } else { return null; } } public static Long valueAsLong(Object value) { if (value instanceof Long) { return (Long) value; } else if (value instanceof Number) { return ((Number) value).longValue(); } else if (value instanceof String) { return Long.valueOf((String) value); } else if (value instanceof Boolean) { return ((Boolean) value) ? 1L : 0L; } else { return null; } } public static String valueAsStr(Object value) { if (value instanceof String) { return (String) value; } else if (value != null) { return value.toString(); } else { return null; } } public static Boolean valueAsBool(Object value) { if (value instanceof Boolean) { return (Boolean) value; } else if (value instanceof Number) { return ((Number) value).doubleValue() != 0.0; } else if (value instanceof String) { return Boolean.valueOf((String) value); } else { return null; } } /** * 将所有层次中凡是Map类型同时又不是MessageObject的类型,转换为MessageObject类型。 * * @param value 值。 * @return 返回转换后的值。 */ @SuppressWarnings("unchecked") private static Object transfer(final Object value) { if (!(value instanceof JSONObject) && value instanceof Map) { return toObj((Map<String, Object>) value); } else if (!(value instanceof JSONArray) && value instanceof Collection) { return toArr((Collection<Object>) value); } else { return value; } } private static JSONArray toArr(final Collection<Object> list) { final JSONArray arr = new JSONArray(list.size()); for (final Object element : list) { arr.add(element); } return arr; } private static JSONObject toObj(final Map<String, Object> map) { final JSONObject obj = new JSONObject(); for (final Map.Entry<String, Object> ent : map.entrySet()) { obj.put(ent.getKey(), transfer(ent.getValue())); } return obj; } /** * 将指定下标元素作为数组返回,如果不存在,则在该位置创建一个空的数组。 * * @param arr 当前数组。 * @param index 下标。 * @return 返回当前数组指定下标的元素,该元素应该是一个数组。 */ private static JSONArray arrayAt(JSONArray arr, int index) { expand(arr, index); if (arr.get(index) == null) { arr.set(index, new JSONArray()); } return (JSONArray) arr.get(index); } /** * 将指定下标元素作为结构体返回,如果不存在,则在该位置创建一个空的结构体。 * * @param arr 当前数组。 * @param index 下标。 * @return 返回当前数组指定下标元素,该元素是一个结构体。 */ private static JSONObject objAt(final JSONArray arr, int index) { expand(arr, index); if (arr.get(index) == null) { arr.set(index, new JSONObject()); } return (JSONObject) arr.get(index); } /** * 设置数组指定下标位置的值。 * * @param arr 数组。 * @param index 下标。 * @param value 值。 */ private static void elementAt(final JSONArray arr, final int index, final Object value) { expand(arr, index).set(index, value); } /** * 获取数组指定下标元素的值。 * * @param arr 数组。 * @param index 下标。 * @return 值。 */ private static Object elementAt(final JSONArray arr, final int index) { return expand(arr, index).get(index); } /** * 扩展数组到指定下标,以防止访问时下标越界。 * * @param arr 数组 * @param index 下标 * @return 返回传入的数组 */ private static JSONArray expand(final JSONArray arr, final int index) { while (arr.size() <= index) { arr.add(null); } return arr; } /** * 最后数组回调。 * * @author Mike * * @param <T> 回调返回数据类型。 */ private interface EndArrayCallback<T> { /** * 当定位到最后一级数组,将调用本方法。 * * @param arr 最后一级数组对象。 * @param index 最后一级索引。 * @return 返回回调的返回值。 */ T callback(JSONArray arr, int index); } /** * 处理多维数组的工具函数(包括一维数组)。多维数组的名字如:arrary[1][2][3], 则name=array,indexStr=[1][2][3],在callback中,endArr将是 * array[1][2]指定的对象,indexe=3。 * * @param name 不带下标的名字,不支持多级名字。 * @param indexesStr 索引部分的字符串,如:[1][2][3] * @param callback 回调函数。 * @return 返回回调函数的返回值。 */ private <T> T endArray(final String name, final String indexesStr, final EndArrayCallback<T> callback) { JSONArray endArr = arr(name); final int[] indexes = parseIndexes(indexesStr); int i = 0; while (i < indexes.length - 1) { endArr = arrayAt(endArr, indexes[i++]); } return callback.callback(endArr, indexes[i]); } private static int[] parseIndexes(final String s) { int[] indexes = null; List<Integer> list = new ArrayList<Integer>(); final StringTokenizer st = new StringTokenizer(s, "[]"); while (st.hasMoreTokens()) { final int index = Integer.valueOf(st.nextToken()); if (index < 0) { throw new RuntimeException(String.format("Illegal index %1$d in \"%2$s\"", index, s)); } list.add(index); } indexes = new int[list.size()]; int i = 0; for (Integer tmp : list.toArray(new Integer[list.size()])) { indexes[i++] = tmp; } return indexes; } }
17,646
JSONObject
java
zh
java
code
{"qsc_code_num_words": 2219, "qsc_code_num_chars": 17646.0, "qsc_code_mean_word_length": 4.17800811, "qsc_code_frac_words_unique": 0.12933754, "qsc_code_frac_chars_top_2grams": 0.02502427, "qsc_code_frac_chars_top_3grams": 0.03883076, "qsc_code_frac_chars_top_4grams": 0.02372991, "qsc_code_frac_chars_dupe_5grams": 0.53090282, "qsc_code_frac_chars_dupe_6grams": 0.44925035, "qsc_code_frac_chars_dupe_7grams": 0.36953942, "qsc_code_frac_chars_dupe_8grams": 0.33275806, "qsc_code_frac_chars_dupe_9grams": 0.31334268, "qsc_code_frac_chars_dupe_10grams": 0.25660662, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00339801, "qsc_code_frac_chars_whitespace": 0.36625864, "qsc_code_size_file_byte": 17646.0, "qsc_code_num_lines": 749.0, "qsc_code_num_chars_line_max": 121.0, "qsc_code_num_chars_line_mean": 23.55941255, "qsc_code_frac_chars_alphabet": 0.82562819, "qsc_code_frac_chars_comments": 0.28051683, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.17105263, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00219298, "qsc_code_frac_chars_string_length": 0.0044896, "qsc_code_frac_chars_long_word_length": 0.00165406, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.14254386, "qsc_codejava_score_lines_no_logic": 0.19736842, "qsc_codejava_frac_words_no_modifier": 0.71212121, "qsc_codejava_frac_words_legal_var_name": 0.82352941, "qsc_codejava_frac_words_legal_func_name": 0.98461538, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ОтправкаSMS/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправка SMS на телефон</v8:content> </v8:item> </Title> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <AutoSaveDataInSettings>Use</AutoSaveDataInSettings> <AutoTitle>false</AutoTitle> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <Autofill>false</Autofill> </AutoCommandBar> <Events> <Event name="OnOpen">ПриОткрытии</Event> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <Pages name="Страницы" id="41"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Страницы</v8:content> </v8:item> </Title> <PagesRepresentation>None</PagesRepresentation> <ExtendedTooltip name="СтраницыРасширеннаяПодсказка" id="42"/> <ChildItems> <Page name="ПараметрыОтправки" id="15"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Параметры отправки</v8:content> </v8:item> </Title> <ExtendedTooltip name="ПараметрыОтправкиРасширеннаяПодсказка" id="24"/> <ChildItems> <UsualGroup name="ГруппаНомерПолучателя" id="128"> <Visible>false</Visible> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Номер получателя</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаНомерПолучателяРасширеннаяПодсказка" id="129"/> <ChildItems> <InputField name="НомераПолучателей" id="130"> <DataPath>НомераПолучателей</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Номера получателей</v8:content> </v8:item> </Title> <InputHint> <v8:item> <v8:lang>ru</v8:lang> <v8:content>+79001234567</v8:content> </v8:item> </InputHint> <ContextMenu name="НомераПолучателейКонтекстноеМеню" id="131"/> <ExtendedTooltip name="НомераПолучателейРасширеннаяПодсказка" id="132"/> </InputField> </ChildItems> </UsualGroup> <UsualGroup name="ГруппаТекстСообщения" id="18"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Текст сообщения</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаТекстСообщенияРасширеннаяПодсказка" id="26"/> <ChildItems> <InputField name="ТекстСообщения" id="3"> <DataPath>ТекстСообщения</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Текст сообщения</v8:content> </v8:item> </Title> <Height>5</Height> <MultiLine>true</MultiLine> <EditTextUpdate>OnValueChange</EditTextUpdate> <ContextMenu name="ТекстСообщенияКонтекстноеМеню" id="4"/> <ExtendedTooltip name="ТекстСообщенияРасширеннаяПодсказка" id="27"/> <Events> <Event name="EditTextChange">ТекстИзменениеТекстаРедактирования</Event> </Events> </InputField> <UsualGroup name="ГруппаТранслит" id="36"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Транслит</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаТранслитРасширеннаяПодсказка" id="37"/> <ChildItems> <CheckBoxField name="ОтправлятьВТранслите" id="21"> <DataPath>ОтправлятьВТранслите</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправлять в транслите</v8:content> </v8:item> </Title> <TitleLocation>Right</TitleLocation> <CheckBoxType>Auto</CheckBoxType> <ContextMenu name="ОтправлятьВТранслитеКонтекстноеМеню" id="22"/> <ExtendedTooltip name="ОтправлятьВТранслитеРасширеннаяПодсказка" id="28"/> </CheckBoxField> <LabelField name="ДлинаСообщенияСимволов" id="38"> <DataPath>ДлинаСообщенияСимволов</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Длина сообщения, символов</v8:content> </v8:item> </Title> <ContextMenu name="ДлинаСообщенияСимволовКонтекстноеМеню" id="39"/> <ExtendedTooltip name="ДлинаСообщенияСимволовРасширеннаяПодсказка" id="40"/> </LabelField> </ChildItems> </UsualGroup> <UsualGroup name="ГруппаИмяОтправителя" id="62"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Имя отправителя</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаИмяОтправителяРасширеннаяПодсказка" id="63"/> <ChildItems> <CheckBoxField name="ДобавлятьОтправителя" id="64"> <DataPath>ДобавлятьОтправителя</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Имя отправителя:</v8:content> </v8:item> </Title> <TitleLocation>Right</TitleLocation> <CheckBoxType>Auto</CheckBoxType> <ContextMenu name="ДобавлятьОтправителяКонтекстноеМеню" id="65"/> <ExtendedTooltip name="ДобавлятьОтправителяРасширеннаяПодсказка" id="66"/> <Events> <Event name="OnChange">ДобавлятьОтправителяПриИзменении</Event> </Events> </CheckBoxField> <InputField name="ИмяОтправителя" id="13"> <DataPath>ИмяОтправителя</DataPath> <Enabled>false</Enabled> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Имя отправителя</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <HorizontalStretch>false</HorizontalStretch> <ContextMenu name="ИмяОтправителяКонтекстноеМеню" id="14"/> <ExtendedTooltip name="ИмяОтправителяРасширеннаяПодсказка" id="29"/> </InputField> </ChildItems> </UsualGroup> </ChildItems> </UsualGroup> </ChildItems> </Page> <Page name="СтраницаСтатус" id="8"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Страница статус</v8:content> </v8:item> </Title> <Group>HorizontalIfPossible</Group> <ExtendedTooltip name="СтраницаСтатусРасширеннаяПодсказка" id="30"/> <ChildItems> <UsualGroup name="ГруппаПроверкаСтатуса" id="45"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проверка статуса</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаПроверкаСтатусаРасширеннаяПодсказка" id="46"/> <ChildItems> <PictureDecoration name="ДекорацияАнимация" id="51"> <GroupVerticalAlign>Center</GroupVerticalAlign> <Picture> <xr:Ref>CommonPicture.ДлительнаяОперация48</xr:Ref> <xr:LoadTransparent>false</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="ДекорацияАнимацияКонтекстноеМеню" id="52"/> <ExtendedTooltip name="ДекорацияАнимацияРасширеннаяПодсказка" id="53"/> </PictureDecoration> <LabelField name="СтатусОтправки" id="71"> <DataPath>СтатусОтправки</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Статус отправки</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <VerticalAlign>Center</VerticalAlign> <GroupVerticalAlign>Center</GroupVerticalAlign> <ContextMenu name="СтатусОтправкиКонтекстноеМеню" id="72"/> <ExtendedTooltip name="СтатусОтправкиРасширеннаяПодсказка" id="73"/> </LabelField> </ChildItems> </UsualGroup> </ChildItems> </Page> <Page name="СтраницаСообщениеОтправлено" id="91"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Страница сообщение отправлено</v8:content> </v8:item> </Title> <ExtendedTooltip name="СтраницаСообщениеОтправленоРасширеннаяПодсказка" id="92"/> <ChildItems> <UsualGroup name="ГруппаСообщениеОтправлено" id="115"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Сообщение отправлено</v8:content> </v8:item> </Title> <VerticalStretch>true</VerticalStretch> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаСообщениеОтправленоРасширеннаяПодсказка" id="116"/> <ChildItems> <PictureDecoration name="КартинкаСообщениеОтправлено" id="95"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Картинка сообщение отправлено</v8:content> </v8:item> </Title> <Picture> <xr:Ref>CommonPicture.Успешно32</xr:Ref> <xr:LoadTransparent>false</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="КартинкаСообщениеОтправленоКонтекстноеМеню" id="96"/> <ExtendedTooltip name="КартинкаСообщениеОтправленоРасширеннаяПодсказка" id="97"/> </PictureDecoration> <LabelDecoration name="ТекстСообщениеОтправлено" id="109"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправка сообщения выполнена.</v8:content> </v8:item> </Title> <GroupVerticalAlign>Center</GroupVerticalAlign> <ContextMenu name="ТекстСообщениеОтправленоКонтекстноеМеню" id="110"/> <ExtendedTooltip name="ТекстСообщениеОтправленоРасширеннаяПодсказка" id="111"/> </LabelDecoration> </ChildItems> </UsualGroup> <UsualGroup name="ГруппаПроверкаСтатусаДоставки" id="117"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проверка статуса доставки</v8:content> </v8:item> </Title> <GroupVerticalAlign>Top</GroupVerticalAlign> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаПроверкаСтатусаДоставкиРасширеннаяПодсказка" id="118"/> <ChildItems> <PictureDecoration name="КартинкаДлительнаяОперация" id="119"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Картинка длительная операция</v8:content> </v8:item> </Title> <Picture> <xr:Ref>CommonPicture.НезавершившаясяПроверка</xr:Ref> <xr:LoadTransparent>false</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="КартинкаДлительнаяОперацияКонтекстноеМеню" id="120"/> <ExtendedTooltip name="КартинкаДлительнаяОперацияРасширеннаяПодсказка" id="121"/> </PictureDecoration> <LabelDecoration name="НадписьВыполняетсяПроверкаСтатусаДоставки" id="125"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Выполняется проверка статуса доставки...</v8:content> </v8:item> </Title> <ContextMenu name="НадписьВыполняетсяПроверкаСтатусаДоставкиКонтекстноеМеню" id="126"/> <ExtendedTooltip name="НадписьВыполняетсяПроверкаСтатусаДоставкиРасширеннаяПодсказка" id="127"/> </LabelDecoration> </ChildItems> </UsualGroup> </ChildItems> </Page> <Page name="СтраницаСообщениеНеОтправлено" id="101"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Страница сообщение не отправлено</v8:content> </v8:item> </Title> <Group>HorizontalIfPossible</Group> <ExtendedTooltip name="СтраницаСообщениеНеОтправленоРасширеннаяПодсказка" id="102"/> <ChildItems> <PictureDecoration name="КартинкаСообщениеНеОтправлено" id="103"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Картинка сообщение не отправлено</v8:content> </v8:item> </Title> <Picture> <xr:Ref>StdPicture.DialogExclamation</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <FileDragMode>AsFile</FileDragMode> <ContextMenu name="КартинкаСообщениеНеОтправленоКонтекстноеМеню" id="104"/> <ExtendedTooltip name="КартинкаСообщениеНеОтправленоРасширеннаяПодсказка" id="105"/> </PictureDecoration> <LabelDecoration name="ТекстСообщениеНеОтправлено" id="112"> <Title formatted="false"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Сообщение не было отправлено (см. журнал регистрации).</v8:content> </v8:item> </Title> <GroupVerticalAlign>Center</GroupVerticalAlign> <ContextMenu name="ТекстСообщениеНеОтправленоКонтекстноеМеню" id="113"/> <ExtendedTooltip name="ТекстСообщениеНеОтправленоРасширеннаяПодсказка" id="114"/> </LabelDecoration> </ChildItems> </Page> </ChildItems> </Pages> <CommandBar name="ГруппаКоманднаяПанель" id="43"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Командная панель</v8:content> </v8:item> </Title> <HorizontalLocation>Right</HorizontalLocation> <ExtendedTooltip name="ГруппаКоманднаяПанельРасширеннаяПодсказка" id="44"/> <ChildItems> <Button name="НастройкаОтправкиSMSОткрыть" id="34"> <Type>CommandBarButton</Type> <CommandName>CommonForm.НастройкаОтправкиSMS.StandardCommand.Open</CommandName> <ExtendedTooltip name="НастройкаОтправкиSMSОткрытьРасширеннаяПодсказка" id="35"/> </Button> <Button name="Отправить" id="5"> <Type>CommandBarButton</Type> <DefaultButton>true</DefaultButton> <CommandName>Form.Command.Отправить</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправить &gt;</v8:content> </v8:item> </Title> <ExtendedTooltip name="ОтправитьРасширеннаяПодсказка" id="23"/> </Button> <Button name="Закрыть" id="79"> <Type>CommandBarButton</Type> <Visible>false</Visible> <CommandName>Form.StandardCommand.Close</CommandName> <ExtendedTooltip name="ЗакрытьРасширеннаяПодсказка" id="80"/> </Button> <Button name="Справка" id="81"> <Type>CommandBarButton</Type> <CommandName>Form.StandardCommand.Help</CommandName> <ExtendedTooltip name="СправкаРасширеннаяПодсказка" id="82"/> </Button> </ChildItems> </CommandBar> </ChildItems> <Attributes> <Attribute name="НомераПолучателей" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Номера получателей</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <FillCheck>ShowError</FillCheck> </Attribute> <Attribute name="ТекстСообщения" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Текст сообщения</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <FillCheck>ShowError</FillCheck> </Attribute> <Attribute name="ИдентификаторСообщения" id="3"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ИмяОтправителя" id="4"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Имя отправителя</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>20</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <Save> <Field>ИмяОтправителя</Field> </Save> </Attribute> <Attribute name="ОтправлятьВТранслите" id="5"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправлять в транслите</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:boolean</v8:Type> </Type> <Save> <Field>ОтправлятьВТранслите</Field> </Save> </Attribute> <Attribute name="ДлинаСообщенияСимволов" id="6"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Длина сообщения, символов</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>6</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ДобавлятьОтправителя" id="7"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Добавлять отправителя</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="СтатусОтправки" id="8"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Статус отправки</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> </Attributes> <Commands> <Command name="Отправить" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправить</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправить</v8:content> </v8:item> </ToolTip> <Action>Отправить</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> </Commands> <Parameters> <Parameter name="НомераПолучателей"> <Type/> </Parameter> <Parameter name="Текст"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> </Parameters> </Form>
19,924
Form
xml
ru
xml
data
{"qsc_code_num_words": 1874, "qsc_code_num_chars": 19924.0, "qsc_code_mean_word_length": 6.64514408, "qsc_code_frac_words_unique": 0.19210245, "qsc_code_frac_chars_top_2grams": 0.03661768, "qsc_code_frac_chars_top_3grams": 0.02441179, "qsc_code_frac_chars_top_4grams": 0.03661768, "qsc_code_frac_chars_dupe_5grams": 0.4814904, "qsc_code_frac_chars_dupe_6grams": 0.46671485, "qsc_code_frac_chars_dupe_7grams": 0.45009235, "qsc_code_frac_chars_dupe_8grams": 0.431382, "qsc_code_frac_chars_dupe_9grams": 0.40191119, "qsc_code_frac_chars_dupe_10grams": 0.37637517, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0370825, "qsc_code_frac_chars_whitespace": 0.22309777, "qsc_code_size_file_byte": 19924.0, "qsc_code_num_lines": 558.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 35.70609319, "qsc_code_frac_chars_alphabet": 0.76736223, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.6953405, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.17722345, "qsc_code_frac_chars_long_word_length": 0.11077093, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1whatleytay/saturn
src/utils/mips/mips.ts
import { ExportRegionsOptions } from '../settings' import { MidiNote } from '../midi' import { type Platform } from '../platforms' export interface ElfExecutionProfile { kind: 'elf' elf: string // not sure what to do here breakpoints: Record<number, number> } // should only be set after building export interface AssemblyExecutionProfile { kind: 'asm' } export type ExecutionProfile = ElfExecutionProfile | AssemblyExecutionProfile export interface DisassembleResult { error: string | null lines: string[] breakpoints: Record<number, number> } export interface LineMarker { line: number offset: number } export interface Breakpoint { line: number pcs: number[] } export interface AssemblerSuccess { breakpoints: Breakpoint[] } export interface AssemblerError { marker: LineMarker | null body: string | null message: string } export type AssemblerResultSuccess = AssemblerSuccess & { status: 'Success' } export type AssemblerResultError = AssemblerError & { status: 'Error' } export type AssemblerResult = AssemblerResultSuccess | AssemblerResultError export interface BinaryResult { binary: Uint8Array | null result: AssemblerResult } export interface BitmapConfig { width: number height: number address: number useDefaultRegister: boolean } export enum ExecutionModeType { Running = 'Running', Invalid = 'Invalid', Paused = 'Paused', Stopped = 'Stopped', Breakpoint = 'Breakpoint', Finished = 'Finished', } export interface ExecutionModeInvalid { type: ExecutionModeType.Invalid message: string } export interface ExecutionModeFinished { type: ExecutionModeType.Finished pc: number code: number | null } type ExecutionModeOther = | ExecutionModeType.Running | ExecutionModeType.Breakpoint | ExecutionModeType.Paused export type ExecutionMode = | ExecutionModeInvalid | ExecutionModeFinished | { type: ExecutionModeOther } export interface Registers { pc: number line: number[] lo: number hi: number } export interface ExecutionResult { mode: ExecutionMode registers: Registers } export interface LastDisplay { width: number height: number data: number[] | null } export class Breakpoints { public maxLine: number public lineToPc: Map<number, number[]> public pcToGroup: Map<number, Breakpoint> findNextPc(line: number): number[] { while (line <= this.maxLine) { const value = this.lineToPc.get(line) if (value !== undefined) { return value } line += 1 } return [] } public mapLines(lines: number[]): number[] { return lines.flatMap((line) => this.findNextPc(line)) } // pc -> line constructor(breakpoints: Breakpoint[]) { this.maxLine = Math.max(...breakpoints.map((b) => b.line)) this.lineToPc = new Map() this.pcToGroup = new Map() for (const breakpoint of breakpoints) { let lineMap = this.lineToPc.get(breakpoint.line) if (!lineMap) { lineMap = [] this.lineToPc.set(breakpoint.line, lineMap) } const anchorPc = breakpoint.pcs[0] if (anchorPc !== undefined) { lineMap.push(anchorPc) } for (const pc of breakpoint.pcs) { this.pcToGroup.set(pc, breakpoint) } } } } export interface HexRegion { name: string data: string // base64 encoded } interface AssembledRegionsBinary { type: 'binary' value: string // base64 encoded } interface AssembledRegionsSplit { type: 'split' value: HexRegion[] } export type AssembledRegions = AssembledRegionsBinary | AssembledRegionsSplit export interface HexBinaryResult { regions: AssembledRegions | null result: AssemblerResult } export interface ParameterItemRegular { type: 'Register' | 'Immediate' | 'Address' value: number } export interface ParameterItemOffset { type: 'Offset' value: { offset: number; register: number } } export type ParameterItem = ParameterItemRegular | ParameterItemOffset export interface InstructionDetails { pc: number instruction: number name: string parameters: ParameterItem[] } export interface InstructionLineInstruction { type: 'Instruction' details: InstructionDetails } export interface InstructionLineBlank { type: 'Blank' } export interface InstructionLineComment { type: 'Comment' message: string } export interface InstructionLineLabel { type: 'Label' name: string } export type InstructionLine = | InstructionLineInstruction | InstructionLineBlank | InstructionLineComment | InstructionLineLabel export interface MipsCallbacks { consoleWrite(text: string, error: boolean): void midiPlay(note: MidiNote): void } export interface MipsBackend { waitReady(): Promise<void> setCallbacks(callbacks: MipsCallbacks): Promise<void> // Insight decodeInstruction( pc: number, instruction: number, platform: Platform, ): Promise<InstructionDetails | null> disassemblyDetails(bytes: ArrayBufferLike, platform: Platform): Promise<InstructionLine[]> disassembleElf( named: string, elf: ArrayBufferLike, platform: Platform, ): Promise<DisassembleResult> assembleText(text: string, path: string | null, platform: Platform): Promise<AssemblerResult> assembleWithBinary(text: string, path: string | null, platform: Platform): Promise<BinaryResult> assembleRegions( text: string, path: string | null, options: ExportRegionsOptions, platform: Platform, ): Promise<HexBinaryResult> // Execution configureDisplay(config: BitmapConfig): Promise<void> lastDisplay(): Promise<LastDisplay> wakeSync(): Promise<void> createExecution( text: string, path: string | null, timeTravel: boolean, profile: ExecutionProfile, platform: Platform, ): Promise<MipsExecution> close(): void } export interface MipsExecution { timeTravel: boolean profile: ExecutionProfile breakpoints: Breakpoints | null lastPc(): Promise<number | null> configure(): Promise<AssemblerResult | null> rewind(count: number): Promise<ExecutionResult | null> resume( count: number | null, breakpoints: number[] | null, ): Promise<ExecutionResult | null> pause(): Promise<void> stop(): Promise<void> setBreakpoints(breakpoints: number[]): Promise<void> postKey(key: string, up: boolean): Promise<void> postInput(text: string): Promise<void> memoryAt(address: number, count: number): Promise<(number | null)[] | null> setRegister(register: number, value: number): Promise<void> setMemory(address: number, bytes: number[]): Promise<void> // Live display, should generally be more performant on tauri. readDisplay( width: number, height: number, address: number, useDefaultRegister: boolean, ): Promise<Uint8Array | null> }
6,781
mips
ts
en
typescript
code
{"qsc_code_num_words": 632, "qsc_code_num_chars": 6781.0, "qsc_code_mean_word_length": 7.66772152, "qsc_code_frac_words_unique": 0.30696203, "qsc_code_frac_chars_top_2grams": 0.08047875, "qsc_code_frac_chars_top_3grams": 0.03322328, "qsc_code_frac_chars_top_4grams": 0.01650846, "qsc_code_frac_chars_dupe_5grams": 0.07098638, "qsc_code_frac_chars_dupe_6grams": 0.04457284, "qsc_code_frac_chars_dupe_7grams": 0.04457284, "qsc_code_frac_chars_dupe_8grams": 0.04457284, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00145164, "qsc_code_frac_chars_whitespace": 0.18728801, "qsc_code_size_file_byte": 6781.0, "qsc_code_num_lines": 308.0, "qsc_code_num_chars_line_max": 99.0, "qsc_code_num_chars_line_mean": 22.01623377, "qsc_code_frac_chars_alphabet": 0.8778806, "qsc_code_frac_chars_comments": 0.02860935, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.11297071, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0245939, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1whatleytay/saturn
src/utils/mips/wasm-worker.ts
import * as backend from './wasm/saturn_wasm' import { WasmPlatform } from './wasm' import { type AssembledRegions, type AssemblerResult, type BinaryResult, type DisassembleResult, ExecutionModeType, type ExecutionResult, type HexBinaryResult, type InstructionDetails, type InstructionLine, type LastDisplay, } from './mips' import { Platform } from '../platforms' import { AssembleBinaryData, AssembleRegionsData, AssembleTextData, ConfigureAsmData, ConfigureDisplayData, ConfigureElfData, DecodeInstructionData, DetailedDisassembleData, DisassembleData, Message, MessageData, MessageEventData, MessageEventOp, MessageOp, MessageResponse, MessageResponseKind, PostInputData, PostKeyData, ReadBytesData, ReadDisplayData, ResumeData, RewindData, SetBreakpointsData, SetRegisterData, WriteBytesData, } from './wasm-worker-message' import { type MidiNote } from '../midi' function toPlatform(platform: WasmPlatform): Platform { switch (platform) { default: case WasmPlatform.Mips: return Platform.Mips case WasmPlatform.RiscV: return Platform.RiscV } } function toWasmPlatform(platform: Platform): WasmPlatform { switch (platform) { default: case Platform.Mips: return WasmPlatform.Mips case Platform.RiscV: return WasmPlatform.RiscV } } function sendConsoleWrite(text: string, error: boolean) { postEvent({ op: MessageEventOp.ConsoleWrite, text, error, }) } function sendMidiPlay(note: MidiNote) { postEvent({ op: MessageEventOp.MidiPlay, note, }) } // Runner/Execution State (Automatically Freed with the Worker Memory) const runner = new backend.Runner( new backend.EventHandler(sendConsoleWrite, sendMidiPlay), ) function assembleRegions({ text, options, platform, }: AssembleRegionsData): HexBinaryResult { const [regions, result] = backend.assemble_regions( text, toWasmPlatform(platform), options, ) as [AssembledRegions | null, AssemblerResult] return { regions, result, } } function assembleText({ text, platform }: AssembleTextData): AssemblerResult { return backend.assemble_text(text, toWasmPlatform(platform)) as AssemblerResult } function assembleBinary({ text, platform }: AssembleBinaryData): BinaryResult { return backend.assemble_binary(text, toWasmPlatform(platform)) as BinaryResult } function decodeInstruction({ pc, instruction, platform, }: DecodeInstructionData): InstructionDetails | null { return backend.decode_instruction( pc, instruction, toWasmPlatform(platform) ) as InstructionDetails | null } function disassemble({ named, bytes }: DisassembleData): DisassembleResult { return backend.disassemble(named ?? undefined, bytes) as DisassembleResult } function detailedDisassemble({ bytes, platform, }: DetailedDisassembleData): InstructionLine[] { return backend.detailed_disassemble(bytes, toWasmPlatform(platform)) as InstructionLine[] } function configureDisplay({ config }: ConfigureDisplayData) { runner.configure_display( config.useDefaultRegister, config.address, config.width, config.height, ) } function lastDisplay(): LastDisplay { return runner.last_display() } function configureElf({ bytes, timeTravel }: ConfigureElfData): Platform | null { const result = runner.configure_elf(bytes, timeTravel) if (result !== undefined) { return toPlatform(result) } else { return null } } function configureAsm({ text, timeTravel, platform, }: ConfigureAsmData): AssemblerResult { return runner.configure_asm( text, timeTravel, toWasmPlatform(platform), ) } // Thanks to Milo // https://github.com/facebook/react/blob/66cf2cfc8a8c4b09d2b783fd7302ae6b24150935/packages/scheduler/src/forks/Scheduler.js#L534-L540 const channel = new MessageChannel() const port = channel.port2 let currentResolve: (() => void) | null = null channel.port1.onmessage = () => currentResolve!() function awaitMacrotaskFast(): Promise<void> { return new Promise<void>((resolve) => { currentResolve = resolve port.postMessage(null) }) } async function resume({ count, breakpoints, }: ResumeData): Promise<ExecutionResult | null> { const batchSize = 120000 // worth adjusting this batch size let instructionsExecuted = 0 const breaks = breakpoints === null ? undefined : new Uint32Array(breakpoints) let result: ExecutionResult | null = null let firstRun = true while (count === null || instructionsExecuted < count) { const instructionsToExecute = count === null ? batchSize : Math.min(count - instructionsExecuted, batchSize) result = (await runner.resume( instructionsToExecute, firstRun ? breaks : undefined, firstRun, count !== null, )) as ExecutionResult | null firstRun = false if (result === null) { return null } if (result.mode.type !== ExecutionModeType.Running) { return result } instructionsExecuted += batchSize await awaitMacrotaskFast() } return result } function stop() { runner.stop() } function pause() { runner.pause() } function lastPc(): number | null { return runner.last_pc() ?? null } function readBytes({ address, count, }: ReadBytesData): (number | null)[] | null { return runner.read_bytes(address, count) } function writeBytes({ address, bytes }: WriteBytesData) { runner.write_bytes(address, bytes) } function setRegister({ register, value }: SetRegisterData) { runner.set_register(register, value) } function setBreakpoints({ breakpoints }: SetBreakpointsData) { runner.set_breakpoints(breakpoints) } function postInput({ text }: PostInputData) { runner.post_input(text) } function postKey({ key, up }: PostKeyData) { runner.post_key(key, up) } function wakeSync() { runner.wake_sync() } function rewind({ count }: RewindData): ExecutionResult | null { return runner.rewind(count) } function readDisplay({ width, height, address, useDefaultRegister, }: ReadDisplayData) { return runner.read_display(address, useDefaultRegister, width, height) } async function dispatchOp(data: MessageData): Promise<any> { switch (data.op) { case MessageOp.AssembleRegions: return assembleRegions(data) case MessageOp.AssembleText: return assembleText(data) case MessageOp.AssembleBinary: return assembleBinary(data) case MessageOp.DecodeInstruction: return decodeInstruction(data) case MessageOp.Disassemble: return disassemble(data) case MessageOp.DetailedDisassemble: return detailedDisassemble(data) case MessageOp.ConfigureDisplay: return configureDisplay(data) case MessageOp.LastDisplay: return lastDisplay() case MessageOp.ConfigureElf: return configureElf(data) case MessageOp.ConfigureAsm: return configureAsm(data) case MessageOp.Resume: return await resume(data) case MessageOp.Stop: return stop() case MessageOp.Pause: return pause() case MessageOp.LastPc: return lastPc() case MessageOp.ReadBytes: return readBytes(data) case MessageOp.WriteBytes: return writeBytes(data) case MessageOp.SetRegister: return setRegister(data) case MessageOp.SetBreakpoints: return setBreakpoints(data) case MessageOp.PostInput: return postInput(data) case MessageOp.PostKey: return postKey(data) case MessageOp.WakeSync: return wakeSync() case MessageOp.Rewind: return rewind(data) case MessageOp.ReadDisplay: return readDisplay(data) } } function postEvent(data: MessageEventData) { postMessage({ kind: MessageResponseKind.Event, data, } satisfies MessageResponse) } async function handleMessage(event: MessageEvent) { const { id, data } = event.data as Message try { const value = await dispatchOp(data) postMessage({ id, kind: MessageResponseKind.Success, data: value, } satisfies MessageResponse) } catch (error) { postMessage({ id, kind: MessageResponseKind.Failure, error, } satisfies MessageResponse) } } onmessage = handleMessage backend.initialize() postEvent({ op: MessageEventOp.Ready, })
8,324
wasm-worker
ts
en
typescript
code
{"qsc_code_num_words": 756, "qsc_code_num_chars": 8324.0, "qsc_code_mean_word_length": 7.83068783, "qsc_code_frac_words_unique": 0.27513228, "qsc_code_frac_chars_top_2grams": 0.05050676, "qsc_code_frac_chars_top_3grams": 0.04881757, "qsc_code_frac_chars_top_4grams": 0.00844595, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00623608, "qsc_code_frac_chars_whitespace": 0.1908938, "qsc_code_size_file_byte": 8324.0, "qsc_code_num_lines": 367.0, "qsc_code_num_chars_line_max": 135.0, "qsc_code_num_chars_line_mean": 22.68119891, "qsc_code_frac_chars_alphabet": 0.87275427, "qsc_code_frac_chars_comments": 0.03063431, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.16025641, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00867518, "qsc_code_frac_chars_long_word_length": 0.00260255, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/ОтправкаSMS/Ext/Help/ru.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta content="text/html;charset=utf-8" http-equiv="content-type"></meta><link rel="stylesheet" type="text/css" href="v8help://service_book/service_style"></link><meta name="GENERATOR" content="MSHTML 11.00.9600.16428"></meta></head><body> <p>Предназначена для набора и отправки сообщений SMS. </p> <p>Открывается из карточек объектов приложения (партнеров, организаций и т.п.) с помощью кнопки <img src="CommonPicture.ПозвонитьИлиОтправитьSMS"></img><strong> - Отправить SMS</strong>.</p> <p>Для отправки SMS необходимо заключить договор с одним из операторов сотовой связи (МТС или Билайн), указав в <a href="CommonForm.НастройкаОтправкиSMS/Help">настройках отправки SMS</a> полученные регистрационные данные.</p> <h3>Заполнение сообщения</h3> <ul><li>Напишите <strong>Текст сообщения</strong>. Максимальная длина текста одного сообщения составляет 140 символов (160 символов в латинице или 70 символов в кириллице). Провайдеры могут поддерживать отправку "длинных SMS" (несколько склеенных между собой SMS). Максимальная длина таких SMS определяется оператором, например, Билайн - 480 символов (в латинице), МТС - 1000 символов (в латинице). Необходимо учитывать, что некоторые модели телефонов не умеют склеивать длинные SMS. </li> <li><strong>Отправлять в транслите</strong> - включите флажок, для того чтобы использовать эту возможность. </li> <li>В поле <strong>Длина сообщения, символов</strong> приложение подсчитывает количество символов в набранном сообщении. </li> <li>Включите флажок, для того чтобы включать в сообщение <strong>Имя отправителя</strong> (заполните соответствующее поле, поддерживается только латиница). </li></ul><h3>Проверка настроек отправки SMS</h3> <ul><li>Нажмите <strong>Настройка отправки SMS</strong>, для того чтобы проверить правильность <a href="CommonForm.НастройкаОтправкиSMS/Help">настроек</a>. </li></ul><h3>Отправка SMS</h3> <ul><li>Если все настроено правильно, для отсылки сообщения нажмите <strong>Отправить</strong>. Приложение сообщает о состоянии отправки.</li></ul><h3>См. также:</h3> <ul><li> <div><a href="v8help://frame/form_common">Работа с формами</a>.</div></li></ul></body></html>
2,218
ru
html
ru
html
code
{"qsc_code_num_words": 308, "qsc_code_num_chars": 2218.0, "qsc_code_mean_word_length": 5.53896104, "qsc_code_frac_words_unique": 0.55844156, "qsc_code_frac_chars_top_2grams": 0.02637749, "qsc_code_frac_chars_top_3grams": 0.014068, "qsc_code_frac_chars_top_4grams": 0.04103165, "qsc_code_frac_chars_dupe_5grams": 0.07620164, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02090592, "qsc_code_frac_chars_whitespace": 0.09422904, "qsc_code_size_file_byte": 2218.0, "qsc_code_num_lines": 16.0, "qsc_code_num_chars_line_max": 485.0, "qsc_code_num_chars_line_mean": 138.625, "qsc_code_frac_chars_alphabet": 0.82777501, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.1875, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.13706041, "qsc_code_frac_chars_long_word_length": 0.08746619, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.63390442, "qsc_codehtml_num_chars_text": 1406.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 1, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/json/JSON.java
package com.ruoyi.common.json; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import com.fasterxml.jackson.core.JsonGenerationException; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; /** * JSON解析处理 * * @author ruoyi */ public class JSON { public static final String DEFAULT_FAIL = "\"Parse failed\""; private static final ObjectMapper objectMapper = new ObjectMapper(); private static final ObjectWriter objectWriter = objectMapper.writerWithDefaultPrettyPrinter(); public static void marshal(File file, Object value) throws Exception { try { objectWriter.writeValue(file, value); } catch (JsonGenerationException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } public static void marshal(OutputStream os, Object value) throws Exception { try { objectWriter.writeValue(os, value); } catch (JsonGenerationException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } public static String marshal(Object value) throws Exception { try { return objectWriter.writeValueAsString(value); } catch (JsonGenerationException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } public static byte[] marshalBytes(Object value) throws Exception { try { return objectWriter.writeValueAsBytes(value); } catch (JsonGenerationException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } public static <T> T unmarshal(File file, Class<T> valueType) throws Exception { try { return objectMapper.readValue(file, valueType); } catch (JsonParseException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } public static <T> T unmarshal(InputStream is, Class<T> valueType) throws Exception { try { return objectMapper.readValue(is, valueType); } catch (JsonParseException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } public static <T> T unmarshal(String str, Class<T> valueType) throws Exception { try { return objectMapper.readValue(str, valueType); } catch (JsonParseException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } public static <T> T unmarshal(byte[] bytes, Class<T> valueType) throws Exception { try { if (bytes == null) { bytes = new byte[0]; } return objectMapper.readValue(bytes, 0, bytes.length, valueType); } catch (JsonParseException e) { throw new Exception(e); } catch (JsonMappingException e) { throw new Exception(e); } catch (IOException e) { throw new Exception(e); } } }
4,478
JSON
java
en
java
code
{"qsc_code_num_words": 385, "qsc_code_num_chars": 4478.0, "qsc_code_mean_word_length": 6.22337662, "qsc_code_frac_words_unique": 0.16363636, "qsc_code_frac_chars_top_2grams": 0.06010017, "qsc_code_frac_chars_top_3grams": 0.09015025, "qsc_code_frac_chars_top_4grams": 0.1803005, "qsc_code_frac_chars_dupe_5grams": 0.72537563, "qsc_code_frac_chars_dupe_6grams": 0.65984975, "qsc_code_frac_chars_dupe_7grams": 0.64607679, "qsc_code_frac_chars_dupe_8grams": 0.56427379, "qsc_code_frac_chars_dupe_9grams": 0.56427379, "qsc_code_frac_chars_dupe_10grams": 0.48914858, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0007249, "qsc_code_frac_chars_whitespace": 0.38387673, "qsc_code_size_file_byte": 4478.0, "qsc_code_num_lines": 187.0, "qsc_code_num_chars_line_max": 100.0, "qsc_code_num_chars_line_mean": 23.94652406, "qsc_code_frac_chars_alphabet": 0.86770569, "qsc_code_frac_chars_comments": 0.00893256, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.3255814, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00022533, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.04069767, "qsc_codejava_score_lines_no_logic": 0.09883721, "qsc_codejava_frac_words_no_modifier": 0.875, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1whatleytay/saturn
src/utils/codemirror/riscv/autocomplete.ts
import { CompletionContext } from '@codemirror/autocomplete' import { suggestions } from '../suggestions' import { SuggestionType } from '../../languages/suggestions' export function myCompletions(context: CompletionContext) { // if we're in a string token, don't show completions if (context.tokenBefore(['String'])) { return null } // because line comments sometimes don't show up as tokens in the tree, // tokenBefore only detects Mips as the token instead of LineComment if (context.matchBefore(/#.*/)) { return null } let word = context.matchBefore(/[a-zA-Z$._]*/)! if (word.from == word.to && !context.explicit) return null let labels: { detail: string; label: string; type: string | undefined }[] = [] const suggestionsContext = context.view?.state.field(suggestions) if (suggestionsContext) { const iter = suggestionsContext.iter() while (iter.value) { const suggestion = iter.value.suggestion labels.push({ detail: suggestion.name ?? suggestion.replace, label: suggestion.replace, type: (() => { switch (suggestion.type) { case SuggestionType.Label: return 'label' // ? case SuggestionType.Function: return 'function' case SuggestionType.Variable: return 'constant' default: return undefined } })(), }) iter.next() } } return { from: word.from, options: [ ...[ { detail: 'Zero Register', label: 'x0' }, { detail: 'Zero Register', label: 'zero' }, { detail: 'Return Address', label: 'x1' }, { detail: 'Return Address', label: 'ra' }, { detail: 'Stack Pointer', label: 'x2' }, { detail: 'Stack Pointer', label: 'sp' }, { detail: 'Global Pointer', label: 'x3' }, { detail: 'Global Pointer', label: 'gp' }, { detail: 'Thread Pointer', label: 'x4' }, { detail: 'Thread Pointer', label: 'tp' }, { detail: 'Temporary Register 0', label: 'x5' }, { detail: 'Temporary Register 0', label: 't0' }, { detail: 'Temporary Register 1', label: 'x6' }, { detail: 'Temporary Register 1', label: 't1' }, { detail: 'Temporary Register 2', label: 'x7' }, { detail: 'Temporary Register 2', label: 't2' }, { detail: 'Frame Pointer / Saved Register 0', label: 'x8' }, { detail: 'Frame Pointer / Saved Register 0', label: 's0' }, { detail: 'Saved Register 1', label: 'x9' }, { detail: 'Saved Register 1', label: 's1' }, { detail: 'Function Argument 0', label: 'x10' }, { detail: 'Function Argument 0', label: 'a0' }, { detail: 'Function Argument 1', label: 'x11' }, { detail: 'Function Argument 1', label: 'a1' }, { detail: 'Function Argument 2', label: 'x12' }, { detail: 'Function Argument 2', label: 'a2' }, { detail: 'Function Argument 3', label: 'x13' }, { detail: 'Function Argument 3', label: 'a3' }, { detail: 'Function Argument 4', label: 'x14' }, { detail: 'Function Argument 4', label: 'a4' }, { detail: 'Function Argument 5', label: 'x15' }, { detail: 'Function Argument 5', label: 'a5' }, { detail: 'Function Argument 6', label: 'x16' }, { detail: 'Function Argument 6', label: 'a6' }, { detail: 'Function Argument 7', label: 'x17' }, { detail: 'Function Argument 7', label: 'a7' }, { detail: 'Saved Register 2', label: 'x18' }, { detail: 'Saved Register 2', label: 's2' }, { detail: 'Saved Register 3', label: 'x19' }, { detail: 'Saved Register 3', label: 's3' }, { detail: 'Saved Register 4', label: 'x20' }, { detail: 'Saved Register 4', label: 's4' }, { detail: 'Saved Register 5', label: 'x21' }, { detail: 'Saved Register 5', label: 's5' }, { detail: 'Saved Register 6', label: 'x22' }, { detail: 'Saved Register 6', label: 's6' }, { detail: 'Saved Register 7', label: 'x23' }, { detail: 'Saved Register 7', label: 's7' }, { detail: 'Saved Register 8', label: 'x24' }, { detail: 'Saved Register 8', label: 's8' }, { detail: 'Saved Register 9', label: 'x25' }, { detail: 'Saved Register 9', label: 's9' }, { detail: 'Saved Register 10', label: 'x26' }, { detail: 'Saved Register 10', label: 's10' }, { detail: 'Saved Register 11', label: 'x27' }, { detail: 'Saved Register 11', label: 's11' }, { detail: 'Temporary Register 3', label: 'x28' }, { detail: 'Temporary Register 3', label: 't3' }, { detail: 'Temporary Register 4', label: 'x29' }, { detail: 'Temporary Register 4', label: 't4' }, { detail: 'Temporary Register 5', label: 'x30' }, { detail: 'Temporary Register 5', label: 't5' }, { detail: 'Temporary Register 6', label: 'x31' }, { detail: 'Temporary Register 6', label: 't6' }, ].map((x) => ({ ...x, type: 'register' })), ...[ { detail: 'Ascii Text', label: '.ascii' }, { detail: 'Ascii Zero Terminated', label: '.asciiz' }, { detail: 'Align Bytes', label: '.align' }, { detail: 'Space Bytes', label: '.space' }, { detail: 'Byte Literals', label: '.byte' }, { detail: 'Half Literals', label: '.half' }, { detail: 'Word Literals', label: '.word' }, { detail: 'Float Literals', label: '.float' }, { detail: 'Double Literals', label: '.double' }, { detail: 'Entry Point', label: '.entry' }, { detail: 'Text Section', label: '.text' }, { detail: 'Data Section', label: '.data' }, { detail: 'Kernel Text Section', label: '.ktext' }, { detail: 'Kernel Data Section', label: '.kdata' }, { detail: 'Extern Symbol', label: '.extern' }, { detail: 'Define Token', label: '.eqv' }, { detail: 'Define Macro', label: '.macro' }, { detail: 'End Macro', label: '.end_macro' }, { detail: 'Include Source', label: '.include' }, ].map((x) => ({ ...x, type: 'data' as string | undefined })), ...[ { detail: 'Add', label: 'add' }, { detail: 'Add Immediate', label: 'addi' }, { detail: 'Negate', label: 'neg' }, { detail: 'Subtract', label: 'sub' }, { detail: 'Multiply', label: 'mul' }, { detail: 'Multiply High', label: 'mulh' }, { detail: 'Multiply High Unsigned', label: 'mulhu' }, { detail: 'Multiply High Signed Unsigned', label: 'mulhsu' }, { detail: 'Divide', label: 'div' }, { detail: 'Remainder', label: 'rem' }, { detail: 'And', label: 'and' }, { detail: 'And Immediate', label: 'andi' }, { detail: 'Not', label: 'not' }, { detail: 'Or', label: 'or' }, { detail: 'Or Immediate', label: 'ori' }, { detail: 'Xor', label: 'xor' }, { detail: 'Xor Immediate', label: 'xori' }, { detail: 'Shift Left Logical', label: 'sll' }, { detail: 'Shift Left Logical Immediate', label: 'slli' }, { detail: 'Shift Right Logical', label: 'srl' }, { detail: 'Shift Right Logical Immediate', label: 'srli' }, { detail: 'Shift Right Arithmetic', label: 'sra' }, { detail: 'Shift Right Arithmetic Immediate', label: 'srai' }, { detail: 'Load Immediate', label: 'li' }, { detail: 'Load Upper Immediate', label: 'lui' }, { detail: 'Add Upper Immediate to PC', label: 'auipc' }, { detail: 'Load Word', label: 'lw' }, { detail: 'Load Half', label: 'lh' }, { detail: 'Load Half Unsigned', label: 'lhu' }, { detail: 'Load Byte', label: 'lb' }, { detail: 'Load Byte Unsigned', label: 'lbu' }, { detail: 'Load Symbol Address', label: 'la' }, { detail: 'Store Word', label: 'sw' }, { detail: 'Store Half', label: 'sh' }, { detail: 'Store Byte', label: 'sb' }, { detail: 'Jump', label: 'j' }, { detail: 'Jump and Link', label: 'jal' }, { detail: 'Jump and Link Register', label: 'jalr' }, { detail: 'Call Function', label: 'call' }, { detail: 'Return from Function', label: 'ret' }, { detail: 'Branch Equal', label: 'beq' }, { detail: 'Branch Equal Zero', label: 'beqz' }, { detail: 'Branch Not Equal', label: 'bne' }, { detail: 'Branch Not Equal Zero', label: 'bnez' }, { detail: 'Branch Less Than', label: 'blt' }, { detail: 'Branch Less Than Unsigned', label: 'bltu' }, { detail: 'Branch Less Than Zero', label: 'bltz' }, { detail: 'Branch Greater Than', label: 'bgt' }, { detail: 'Branch Greater Than Unsigned', label: 'bgtu' }, { detail: 'Branch Greater Than Zero', label: 'bgtz' }, { detail: 'Branch Less or Equal', label: 'ble' }, { detail: 'Branch Less or Equal Unsigned', label: 'bleu' }, { detail: 'Branch Less or Equal Zero', label: 'blez' }, { detail: 'Branch Greater or Equal', label: 'bge' }, { detail: 'Branch Greater or Equal Unsigned', label: 'bgeu' }, { detail: 'Branch Greater or Equal Zero', label: 'bgez' }, { detail: 'Set Less Than', label: 'slt' }, { detail: 'Set Less Than Immediate', label: 'slti' }, { detail: 'Set Less Than Unsigned', label: 'sltu' }, { detail: 'Set Less Than Immediate Unsigned', label: 'sltiu' }, { detail: 'Set Equal Zero', label: 'seqz' }, { detail: 'Set Not Equal Zero', label: 'snez' }, { detail: 'Set Less Than Zero', label: 'sltz' }, { detail: 'Set Greater Than Zero', label: 'sgtz' }, ].map((x) => ({ ...x, type: 'instruction' })), ...labels, ], } }
9,843
autocomplete
ts
en
typescript
code
{"qsc_code_num_words": 1022, "qsc_code_num_chars": 9843.0, "qsc_code_mean_word_length": 5.16927593, "qsc_code_frac_words_unique": 0.27201566, "qsc_code_frac_chars_top_2grams": 0.05905735, "qsc_code_frac_chars_top_3grams": 0.07912171, "qsc_code_frac_chars_top_4grams": 0.01608934, "qsc_code_frac_chars_dupe_5grams": 0.31819042, "qsc_code_frac_chars_dupe_6grams": 0.01400719, "qsc_code_frac_chars_dupe_7grams": 0.01400719, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0200398, "qsc_code_frac_chars_whitespace": 0.28517728, "qsc_code_size_file_byte": 9843.0, "qsc_code_num_lines": 210.0, "qsc_code_num_chars_line_max": 81.0, "qsc_code_num_chars_line_mean": 46.87142857, "qsc_code_frac_chars_alphabet": 0.73081296, "qsc_code_frac_chars_comments": 0.01991263, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.02538071, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.31802633, "qsc_code_frac_chars_long_word_length": 0.00528662, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1whatleytay/saturn
src/utils/codemirror/riscv/tokenizer.ts
import { Label, Op, Register } from './syntax.grammar.terms' export const knownRegisters = new Set([ 'x0', 'x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9', 'x10', 'x11', 'x12', 'x13', 'x14', 'x15', 'x16', 'x17', 'x18', 'x19', 'x20', 'x21', 'x22', 'x23', 'x24', 'x25', 'x26', 'x27', 'x28', 'x29', 'x30', 'x31', 'zero', 'ra', 'sp', 'gp', 'tp', 't0', 't1', 't2', 's0', 's1', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 's11', 't3', 't4', 't5', 't6', ]) // following https://projectf.io/posts/riscv-cheat-sheet/ export const knownInstructions = new Set([ 'add', 'addi', 'neg', 'sub', 'mul', 'mulh', 'mulhu', 'mulhsu', 'div', 'rem', 'and', 'andi', 'not', 'or', 'ori', 'xor', 'xori', 'sll', 'slli', 'srl', 'srli', 'sra', 'srai', 'li', 'lui', 'auipc', 'lw', 'lh', 'lhu', 'lb', 'lbu', 'la', 'sw', 'sh', 'sb', 'j', 'jal', 'jalr', 'call', 'ret', 'beq', 'beqz', 'bne', 'bnez', 'blt', 'bltu', 'bltz', 'bgt', 'bgtu', 'bgtz', 'ble', 'bleu', 'blez', 'bge', 'bgeu', 'bgez', 'slt', 'slti', 'sltu', 'sltiu', 'seqz', 'snez', 'sltz', 'sgtz', 'ebreak', 'ecall', 'fence', 'mv', 'nop', ]) export let specializeIdent = (x: string) => { if (x.endsWith(':')) { return Label } if (knownRegisters.has(x)) { return Register } if (knownInstructions.has(x)) { return Op } return -1 }
1,612
tokenizer
ts
en
typescript
code
{"qsc_code_num_words": 183, "qsc_code_num_chars": 1612.0, "qsc_code_mean_word_length": 3.64480874, "qsc_code_frac_words_unique": 0.89617486, "qsc_code_frac_chars_top_2grams": 0.03298351, "qsc_code_frac_chars_top_3grams": 0.02998501, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.07433628, "qsc_code_frac_chars_whitespace": 0.29900744, "qsc_code_size_file_byte": 1612.0, "qsc_code_num_lines": 154.0, "qsc_code_num_chars_line_max": 61.0, "qsc_code_num_chars_line_mean": 10.46753247, "qsc_code_frac_chars_alphabet": 0.5159292, "qsc_code_frac_chars_comments": 0.0353598, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.01333333, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.26559486, "qsc_code_frac_chars_long_word_length": 0.01414791, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1technophile/OpenMQTTGateway
main/mqttDiscovery.cpp
/* OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Home Assistant MQTT Discovery addon. Copyright: (c) Rafal Herok / Florian Robert This file is part of OpenMQTTGateway. OpenMQTTGateway is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenMQTTGateway is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "User_config.h" #ifdef ZmqttDiscovery # include "TheengsCommon.h" # ifdef ESP8266 # include <ESP8266WiFi.h> # elif defined(ESP32) # include <WiFi.h> # include "esp_mac.h" # endif # ifdef ESP32_ETHERNET # include <ETH.h> # endif # include "config_mqttDiscovery.h" extern bool ethConnected; extern JsonArray modules; // Using Home Assistant MQTT abbreviations to shorten names as per https://github.com/home-assistant/core/blob/dev/homeassistant/components/mqtt/abbreviations.py char discovery_prefix[parameters_size + 1] = discovery_Prefix; // From https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L225 // List of classes available in Home Assistant static const char* const availableHASSClasses[] = { HASS_CLASS_BATTERY_CHARGING, HASS_CLASS_BATTERY, HASS_CLASS_CARBON_DIOXIDE, HASS_CLASS_CARBON_MONOXIDE, HASS_CLASS_CONNECTIVITY, HASS_CLASS_CURRENT, HASS_CLASS_DATA_SIZE, HASS_CLASS_DISTANCE, HASS_CLASS_DOOR, HASS_CLASS_DURATION, HASS_CLASS_ENERGY, HASS_CLASS_ENUM, HASS_CLASS_FREQUENCY, HASS_CLASS_GAS, HASS_CLASS_HUMIDITY, HASS_CLASS_ILLUMINANCE, HASS_CLASS_IRRADIANCE, HASS_CLASS_LOCK, HASS_CLASS_MOTION, HASS_CLASS_MOVING, HASS_CLASS_OCCUPANCY, HASS_CLASS_PM1, HASS_CLASS_PM10, HASS_CLASS_PM25, HASS_CLASS_POWER_FACTOR, HASS_CLASS_POWER, HASS_CLASS_PRECIPITATION_INTENSITY, HASS_CLASS_PRECIPITATION, HASS_CLASS_PRESSURE, HASS_CLASS_PROBLEM, HASS_CLASS_RESTART, HASS_CLASS_SIGNAL_STRENGTH, HASS_CLASS_SOUND_PRESSURE, HASS_CLASS_TEMPERATURE, HASS_CLASS_TIMESTAMP, HASS_CLASS_VOLTAGE, HASS_CLASS_WATER, HASS_CLASS_WEIGHT, HASS_CLASS_WIND_SPEED, HASS_CLASS_WINDOW}; // From https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L379 // List of units available in Home Assistant static const char* const availableHASSUnits[] = { HASS_UNIT_AMP, HASS_UNIT_BYTE, HASS_UNIT_UV_INDEX, HASS_UNIT_VOLT, HASS_UNIT_WATT, HASS_UNIT_BPM, HASS_UNIT_BAR, HASS_UNIT_CM, HASS_UNIT_DB, HASS_UNIT_DBM, HASS_UNIT_FT, HASS_UNIT_HOUR, HASS_UNIT_HPA, HASS_UNIT_HZ, HASS_UNIT_KG, HASS_UNIT_KW, HASS_UNIT_KWH, HASS_UNIT_KMH, HASS_UNIT_LB, HASS_UNIT_LX, HASS_UNIT_MS, HASS_UNIT_MS2, HASS_UNIT_M3, HASS_UNIT_MGM3, HASS_UNIT_MIN, HASS_UNIT_MM, HASS_UNIT_MMH, HASS_UNIT_MILLISECOND, HASS_UNIT_MV, HASS_UNIT_USCM, HASS_UNIT_UGM3, HASS_UNIT_OHM, HASS_UNIT_PERCENT, HASS_UNIT_DEGREE, HASS_UNIT_CELSIUS, HASS_UNIT_FAHRENHEIT, HASS_UNIT_SECOND, HASS_UNIT_WB2}; String getMacAddress() { uint8_t baseMac[6]; char baseMacChr[13] = {0}; # if defined(ESP8266) WiFi.macAddress(baseMac); sprintf(baseMacChr, "%02X%02X%02X%02X%02X%02X", baseMac[0], baseMac[1], baseMac[2], baseMac[3], baseMac[4], baseMac[5]); # elif defined(ESP32) esp_read_mac(baseMac, ESP_MAC_WIFI_STA); sprintf(baseMacChr, "%02X%02X%02X%02X%02X%02X", baseMac[0], baseMac[1], baseMac[2], baseMac[3], baseMac[4], baseMac[5]); # else sprintf(baseMacChr, "%02X%02X%02X%02X%02X%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); # endif return String(baseMacChr); } String getUniqueId(String name, String sufix) { String uniqueId = (String)getMacAddress() + "-" + name + sufix; return String(uniqueId); } /** * Create discover messages from a list of attributes * Full-featured version supporting all discovery parameters * * Array format: * [0] = component type * [1] = name * [2] = unique id suffix (for gateway) or name (for BLE) * [3] = device class * [4] = value template * [5] = payload on * [6] = payload off * [7] = unit of measurement * [8] = state class * [9] = state_off (for switches) * [10] = state_on (for switches) * [11] = custom state topic (overrides default) * [12] = custom command topic (overrides default) */ void createDiscoveryFromList(const char* mac, const char* sensorList[][13], int sensorCount, const char* device_name, const char* device_manufacturer, const char* device_model, bool gateway_entity, const char* state_topic, const char* availability_topic, const char* command_topic) { for (int i = 0; i < sensorCount; i++) { String unique_id; if (gateway_entity) { unique_id = getUniqueId(sensorList[i][2] ? sensorList[i][2] : sensorList[i][1], ""); } else if (mac) { unique_id = String(mac) + "-" + sensorList[i][1]; } else { unique_id = sensorList[i][1]; } // Use custom state topic if provided, otherwise use default String discovery_topic; if (sensorList[i][11] && sensorList[i][11][0]) { discovery_topic = String(sensorList[i][11]); } else if (mac && !gateway_entity) { discovery_topic = String(state_topic) + "/" + String(mac); } else { discovery_topic = String(state_topic); } // Use custom command topic if provided const char* cmd_topic = (sensorList[i][12] && sensorList[i][12][0]) ? sensorList[i][12] : command_topic; createDiscovery(sensorList[i][0], discovery_topic.c_str(), sensorList[i][1], unique_id.c_str(), availability_topic ? availability_topic : will_Topic, sensorList[i][3], sensorList[i][4], sensorList[i][5], sensorList[i][6], sensorList[i][7], 0, Gateway_AnnouncementMsg, will_Message, gateway_entity, cmd_topic ? cmd_topic : "", device_name ? device_name : "", device_manufacturer ? device_manufacturer : "", device_model ? device_model : "", mac ? mac : "", false, sensorList[i][8] ? sensorList[i][8] : stateClassNone, sensorList[i][9], sensorList[i][10], // state_off, state_on nullptr, nullptr // enum_options, command_template ); } } # if defined(ZgatewayBT) || defined(SecondaryModule) # include "config_BT.h" // Backward compatibility overload for BLE devices using 9-column format void createDiscoveryFromList(const char* mac, const char* sensorList[][9], int sensorCount, const char* device_name, const char* device_manufacturer, const char* device_model) { // Create temporary extended array const char* extendedList[sensorCount][13]; for (int i = 0; i < sensorCount; i++) { for (int j = 0; j < 9; j++) { extendedList[i][j] = sensorList[i][j]; } for (int j = 9; j < 13; j++) { extendedList[i][j] = nullptr; } } createDiscoveryFromList(mac, extendedList, sensorCount, device_name, device_manufacturer, device_model, false, subjectBTtoMQTT, will_Topic, nullptr); } # endif # ifdef ZgatewayRF /** * @brief Announce that the Gateway have the ability to raise Trigger. * This function provide the configuration of the MQTT Device trigger ( @see https://www.home-assistant.io/integrations/device_trigger.mqtt/ ). * All messages published by this function will be interpreted as configuration messages of Gateway Triggers. * Instead, all messages published on the "triggerTopic" will be interpreted as Gateway trigger. * * @param triggerTopic Mandatory - The MQTT topic subscribed to receive trigger events. * @param type The type of the trigger, e.g. button_short_press. Entries supported by the HA Frontend: button_short_press, button_short_release, button_long_press, button_long_release, button_double_press, button_triple_press, button_quadruple_press, button_quintuple_press. If set to an unsupported value, will render as subtype type, e.g. button_1 spammed with type set to spammed and subtype set to button_1 * @param subtype The subtype of the trigger, e.g. button_1. Entries supported by the HA frontend: turn_on, turn_off, button_1, button_2, button_3, button_4, button_5, button_6. If set to an unsupported value, will render as subtype type, e.g. left_button pressed with type set to button_short_press and subtype set to left_button * @param object_id The object_id of the trigger. * @param value_template The template to render the value of the trigger. The template can use the variables trigger.id, trigger.type, trigger.subtype, trigger.payload, trigger.payload_json, trigger.topic, trigger.timestamp, trigger.value, trigger.value_json. The template can be a string or a JSON object. If the template is a JSON object, it must be a valid JSON object. If the template is a string, it will be rendered as a string. If the template is a JSON object, it will be rendered as a JSON object. */ void announceGatewayTrigger(const char* triggerTopic, const char* type, const char* subtype, const char* object_id, const char* value_template) { //Create The Json StaticJsonDocument<JSON_MSG_BUFFER> jsonBuffer; JsonObject sensor = jsonBuffer.to<JsonObject>(); /** * The type of automation, must be 'trigger'. * @see https://www.home-assistant.io/integrations/device_trigger.mqtt/#automation_type */ sensor["atype"] = "trigger"; // automation_type /** * Must be device_automation. Only allowed and required in MQTT auto discovery device messages. * @see https://www.home-assistant.io/integrations/device_trigger.mqtt/#platform * @see https://www.home-assistant.io/integrations/mqtt/#device-discovery-payload */ sensor["p"] = "device_automation"; // platform // The MQTT topic subscribed to receive trigger events. if (triggerTopic && triggerTopic[0]) { char state_topic[mqtt_topic_max_size]; strcpy(state_topic, mqtt_topic); strcat(state_topic, gateway_name); strcat(state_topic, triggerTopic); /** * "info_topic" is not a standard field, for the message is required the filed "topic", but this filed is reserved and it is used to know where to publish the topic. * If we want to send on the message the topic information is usefull to use this "info_topic" that will be not delete by the send function but converted to "topic" */ sensor["info_topic"] = state_topic; } else { THEENGS_LOG_ERROR(F("[RF] Error: topic is mandatory for device trigger Discovery" CR)); return; } /** * The type of the trigger, e.g. button_short_press. * Entries supported by the HA frontend: button_short_press, button_short_release, button_long_press, button_long_release, button_double_press, button_triple_press, button_quadruple_press, button_quintuple_press. * If set to an unsupported value, will render as subtype type, e.g. button_1 spammed with type set to spammed and subtype set to button_1 */ if (type && type[0] != 0) { sensor["type"] = type; } else { sensor["type"] = "button_short_press"; } /** * The subtype of the trigger, e.g. turn_on. * Entries supported by the frontend: turn_on, turn_off, button_1, button_2, button_3, button_4, button_5, button_6. * If set to an unsupported value, will render as subtype type, e.g. left_button pressed with type set to button_short_press and subtype set to left_button */ if (subtype && subtype[0] != 0) { sensor["stype"] = subtype; // subtype } else { sensor["stype"] = "turn_on"; } // ------------------ START DEVICE DECLARATION -------------------------------------------------- // TODO: This section, like the almost identical one in createDiscovery, should be placed in a // separate function and managed specifically to avoid errors in representing the device // in the HASS world. // ------------------------------------------------------------------------------------------------- // Information about the device: this device trigger is a part of to tie it into the HA device registry. StaticJsonDocument<JSON_MSG_BUFFER> jsonDeviceBuffer; JsonObject device = jsonDeviceBuffer.to<JsonObject>(); // A link to the webpage that can manage the configuration of this device. if (ethConnected) { # ifdef ESP32_ETHERNET device["cu"] = String("http://") + String(ETH.localIP().toString()) + String("/"); // configuration_url # endif } else { device["cu"] = String("http://") + String(WiFi.localIP().toString()) + String("/"); // configuration_url } /* * A list of connections of the device to the outside world as a list of tuples [connection_type, connection_identifier]. * For example the MAC address of a network interface: "connections": [["mac", "02:5b:26:a8:dc:12"]]. */ JsonArray connections = device.createNestedArray("cns"); // connections JsonArray connection_mac = connections.createNestedArray(); connection_mac.add("mac"); connection_mac.add(getMacAddress()); // A list of IDs that uniquely identify the device. For example a serial number. String unique_id = String(getMacAddress()); JsonArray identifiers = device.createNestedArray("ids"); // identifiers identifiers.add(unique_id); // The manufacturer of the device. device["mf"] = GATEWAY_MANUFACTURER; // The model of the device. # ifndef GATEWAY_MODEL String model = ""; serializeJson(modules, model); device["mdl"] = model; # else device["mdl"] = GATEWAY_MODEL; # endif // The name of the device. device["name"] = String(gateway_name); device["sw"] = OMG_VERSION; // ------------------ END DEVICE DECLARATION ------------------ // sensor["dev"] = device; //device representing the board if (value_template && value_template[0]) { sensor["val_tpl"] = String(value_template); } /* Publish on the topic The discovery topic needs to be: <discovery_prefix>/device_automation/[<node_id>/]<object_id>/config. Note that only one trigger may be defined per unique discovery topic. Also note that the combination of type and subtype should be unique for a device. */ String topic_to_publish = String(discovery_prefix) + "/device_automation/" + String(unique_id) + "/" + object_id + "/config"; THEENGS_LOG_TRACE(F("Announce Gatewy Trigger %s" CR), topic_to_publish.c_str()); sensor["topic"] = topic_to_publish; sensor["retain"] = true; enqueueJsonObject(sensor); } # endif // ZgatewayRF /* * Remove a substring p from a given string s */ std::string remove_substring(std::string s, const std::string& p) { std::string::size_type n = p.length(); for (std::string::size_type i = s.find(p); i != std::string::npos; i = s.find(p)) s.erase(i, n); return s; } /** * @brief Generate message and publish it on an MQTT discovery explorer. For HA @see https://www.home-assistant.io/docs/mqtt/discovery/ * * @param sensor_type the Type * @param st_topic set state topic, * @param s_name set name, * @param unique_id set uniqueId * @param availability_topic set availability_topic, * @param device_class set device_class, * @param value_template set value_template, * @param payload_on set payload_on, * @param payload_off set payload_off, * @param unit_of_meas set unit_of_meas, * @param off_delay set off_delay * @param payload_available set payload_available, * @param payload_not_available set payload_not_available * @param gateway_entity set is a gateway entity, * @param cmd_topic set command topic * @param device_name set device name, * @param device_manufacturer set device manufacturer, * @param device_model set device model, * @param device_id set device(BLE)/entity(RTL_433) identification, * @param retainCmd set retain * @param state_class set state class * @param state_off state off value * @param state_on state on value * @param enum_options options * @param command_template command template * @param diagnostic_entity true if entity_category is diagnostic * * */ void createDiscovery(const char* sensor_type, const char* st_topic, const char* s_name, const char* unique_id, const char* availability_topic, const char* device_class, const char* value_template, const char* payload_on, const char* payload_off, const char* unit_of_meas, int off_delay, const char* payload_available, const char* payload_not_available, bool gateway_entity, const char* cmd_topic, const char* device_name, const char* device_manufacturer, const char* device_model, const char* device_id, bool retainCmd, const char* state_class, const char* state_off, const char* state_on, const char* enum_options, const char* command_template, bool diagnostic_entity) { StaticJsonDocument<JSON_MSG_BUFFER> jsonBuffer; JsonObject sensor = jsonBuffer.to<JsonObject>(); // If a component cannot render it's state (f.i. KAKU relays) no state topic // should be added. Without a state topic HA will use optimistic mode for the // component by default. The Home Assistant UI for optimistic switches // (separate on and off icons) allows for multiple // subsequent on commands. This is required for dimming on KAKU relays like // the ACM-300. if (st_topic && st_topic[0]) { char state_topic[mqtt_topic_max_size]; // If not an entity belonging to the gateway we put wild card for the location and gateway name // allowing to have the entity detected by several gateways and a consistent discovery topic among the gateways if (gateway_entity) { strcpy(state_topic, mqtt_topic); strcat(state_topic, gateway_name); } else { strcpy(state_topic, "+/+"); } strcat(state_topic, st_topic); if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "blind") == 0) { sensor["tilt_status_t"] = state_topic; // tilt_status_topic for blind } else if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "curtain") == 0) { sensor["pos_t"] = state_topic; // position_topic for curtain } else { sensor["stat_t"] = state_topic; } } if (availability_topic && availability_topic[0] && gateway_entity) { char avty_topic[mqtt_topic_max_size]; strcpy(avty_topic, mqtt_topic); strcat(avty_topic, gateway_name); strcat(avty_topic, availability_topic); sensor["avty_t"] = avty_topic; } if (device_class && device_class[0]) { // We check if the class belongs to HAAS classes list int num_classes = sizeof(availableHASSClasses) / sizeof(availableHASSClasses[0]); for (int i = 0; i < num_classes; i++) { // see class list and size into config_mqttDiscovery.h if (strcmp(availableHASSClasses[i], device_class) == 0) { sensor["dev_cla"] = device_class; //device_class } } } if (unit_of_meas && unit_of_meas[0]) { // We check if the class belongs to HAAS units list int num_units = sizeof(availableHASSUnits) / sizeof(availableHASSUnits[0]); for (int i = 0; i < num_units; i++) { // see units list and size into config_mqttDiscovery.h if (strcmp(availableHASSUnits[i], unit_of_meas) == 0) { sensor["unit_of_meas"] = unit_of_meas; //unit_of_measurement*/ } } } sensor["name"] = s_name; //name sensor["uniq_id"] = unique_id; //unique_id if (retainCmd) sensor["retain"] = retainCmd; // Retain command if (value_template && value_template[0]) { if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "blind") == 0) { sensor["tilt_status_tpl"] = value_template; // tilt_status_template for blind } else if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "curtain") == 0) { sensor["pos_tpl"] = value_template; // position_template for curtain } else { sensor["val_tpl"] = value_template; //HA Auto discovery } } if (payload_on && payload_on[0]) { if (strcmp(sensor_type, HASS_TYPE_BUTTON) == 0) { sensor["pl_prs"] = payload_on; // payload_press for a button press } else if (strcmp(sensor_type, HASS_TYPE_NUMBER) == 0) { sensor["cmd_tpl"] = payload_on; // payload_on for a switch } else if (strcmp(sensor_type, HASS_TYPE_UPDATE) == 0) { sensor["pl_inst"] = payload_on; // payload_install for update } else if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "blind") == 0) { int value = std::stoi(payload_on); sensor["tilt_opnd_val"] = value; // tilt_open_value for blind } else if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "curtain") == 0) { int value = std::stoi(payload_on); sensor["pos_open"] = value; // open value for curtain } else { if (strcmp(payload_on, "True") == 0 || strcmp(payload_on, "true") == 0) { sensor["pl_on"] = true; } else { sensor["pl_on"] = payload_on; // payload_on for the rest } } } if (payload_off && payload_off[0]) { if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "blind") == 0) { sensor["pl_cls"] = payload_off; // payload_close for cover } else if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "curtain") == 0) { int value = std::stoi(payload_off); sensor["pos_clsd"] = value; // closed value for curtain } else { if (strcmp(payload_off, "False") == 0 || strcmp(payload_off, "false") == 0) { sensor["pl_off"] = false; } else { sensor["pl_off"] = payload_off; //payload_off for the rest } } } if (command_template && command_template[0]) { if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "blind") == 0) { sensor["tilt_cmd_tpl"] = command_template; //command_template } else if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "curtain") == 0) { sensor["set_pos_tpl"] = command_template; //command_template } else { sensor["cmd_tpl"] = command_template; //command_template } } if (strcmp(sensor_type, "device_tracker") == 0) sensor["src_type"] = "bluetooth_le"; // source_type - payload_install for update if (off_delay != 0) sensor["off_dly"] = off_delay; // off_delay if (payload_available[0]) sensor["pl_avail"] = payload_available; // payload_on if (payload_not_available[0]) sensor["pl_not_avail"] = payload_not_available; //payload_off if (state_class && state_class[0]) sensor["stat_cla"] = state_class; //add the state class on the sensors ( https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes ) if (state_on != nullptr) if (strcmp(state_on, "true") == 0) { sensor["stat_on"] = true; } else { sensor["stat_on"] = state_on; } if (state_off != nullptr) if (strcmp(state_off, "false") == 0) { sensor["stat_off"] = false; } else { sensor["stat_off"] = state_off; } if (cmd_topic[0]) { char command_topic[mqtt_topic_max_size]; strcpy(command_topic, mqtt_topic); strcat(command_topic, gateway_name); strcat(command_topic, cmd_topic); if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "blind") == 0) { sensor["tilt_cmd_t"] = command_topic; // tilt_command_topic for cover } else if (strcmp(sensor_type, HASS_TYPE_COVER) == 0 && strcmp(state_class, "curtain") == 0) { sensor["set_pos_t"] = command_topic; // position_command_topic for curtain } else { sensor["cmd_t"] = command_topic; //command_topic } } if (diagnostic_entity) { // entity_category sensor["ent_cat"] = "diagnostic"; } if (enum_options != nullptr) { sensor["ops"] = enum_options; // options } StaticJsonDocument<JSON_MSG_BUFFER> jsonDeviceBuffer; JsonObject device = jsonDeviceBuffer.to<JsonObject>(); JsonArray identifiers = device.createNestedArray("ids"); if (gateway_entity) { //device representing the board device["name"] = String(gateway_name); # ifndef GATEWAY_MODEL String model = ""; serializeJson(modules, model); device["mdl"] = model; # else device["mdl"] = GATEWAY_MODEL; # endif device["mf"] = GATEWAY_MANUFACTURER; if (ethConnected) { # ifdef ESP32_ETHERNET device["cu"] = String("http://") + String(ETH.localIP().toString()) + String("/"); //configuration_url # endif } else { device["cu"] = String("http://") + String(WiFi.localIP().toString()) + String("/"); //configuration_url } device["sw"] = OMG_VERSION; identifiers.add(String(getMacAddress())); } else { //The Connections if (device_id[0]) { JsonArray connections = device.createNestedArray("cns"); JsonArray connection_mac = connections.createNestedArray(); connection_mac.add("mac"); connection_mac.add(device_id); //Device representing the actual sensor/switch device //The Device ID identifiers.add(device_id); } if (device_manufacturer[0]) { device["mf"] = device_manufacturer; } if (device_model[0]) { device["mdl"] = device_model; } // generate unique device name by adding the second half of the device_id only if device_name and device_id are different and we don't want to use the BLE name if (device_name[0]) { if (strcmp(device_id, device_name) != 0 && device_id[0] && !ForceDeviceName) { device["name"] = device_name + String("-") + String(device_id + 6); } else { device["name"] = device_name; } } device["via_device"] = String(getMacAddress()); //mac address of the gateway so that the devices link to the gateway } sensor["dev"] = device; // device String topic = String(discovery_prefix) + "/" + String(sensor_type) + "/" + String(unique_id) + "/config"; THEENGS_LOG_TRACE(F("Announce Device %s on %s" CR), String(sensor_type).c_str(), topic.c_str()); sensor["topic"] = topic; sensor["retain"] = true; enqueueJsonObject(sensor); } void eraseTopic(const char* sensor_type, const char* unique_id) { if (sensor_type == NULL || unique_id == NULL) { return; } String topic = String(discovery_prefix) + "/" + String(sensor_type) + "/" + String(unique_id) + "/config"; THEENGS_LOG_TRACE(F("Erase entity discovery %s on %s" CR), String(sensor_type).c_str(), topic.c_str()); pubMQTT((char*)topic.c_str(), "", true); } # if defined(ZgatewayBT) || defined(SecondaryModule) void btPresenceParametersDiscovery() { createDiscovery(HASS_TYPE_NUMBER, //set Type subjectBTtoMQTT, "BT: Presence/Tracker timeout", (char*)getUniqueId("presenceawaytimer", "").c_str(), //set state_topic,name,uniqueId will_Topic, "", "{{ value_json.presenceawaytimer/60000 }}", //set availability_topic,device_class,value_template, "{\"presenceawaytimer\":{{value*60000}},\"save\":true}", "", HASS_UNIT_MIN, //set,payload_on,payload_off,unit_of_meas, 0, //set off_delay Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic "", "", "", "", false, // device name, device manufacturer, device model, device ID, retain, stateClassNone //State Class ); } void btScanParametersDiscovery() { const char* btScanParams[][13] = { {HASS_TYPE_NUMBER, "BT: Interval between scans", "interval", "", "{{ value_json.interval/1000 }}", "{\"interval\":{{value*1000}},\"save\":true}", "", HASS_UNIT_SECOND, stateClassNone, nullptr, nullptr, nullptr, subjectMQTTtoBTset}, {HASS_TYPE_NUMBER, "BT: Interval between active scans", "intervalacts", "", "{{ value_json.intervalacts/1000 }}", "{\"intervalacts\":{{value*1000}},\"save\":true}", "", HASS_UNIT_SECOND, stateClassNone, nullptr, nullptr, nullptr, subjectMQTTtoBTset}, }; createDiscoveryFromList(nullptr, btScanParams, 2, nullptr, nullptr, nullptr, true, subjectBTtoMQTT, will_Topic, nullptr); } # endif void pubMqttDiscovery() { THEENGS_LOG_TRACE(F("omgStatusDiscovery" CR)); // System sensors and controls - using extended 13-column format with macros const char* systemEntities[][13] = { // Sensors {HASS_TYPE_BINARY_SENSOR, "SYS: Connectivity", "connectivity", HASS_CLASS_CONNECTIVITY, "", Gateway_AnnouncementMsg, will_Message, "", stateClassNone, nullptr, nullptr, will_Topic, nullptr}, {HASS_TYPE_SENSOR, "SYS: Uptime", "uptime", HASS_CLASS_DURATION, "{{ value_json.uptime }}", "", "", HASS_UNIT_SECOND, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "SYS: Free memory", "freemem", HASS_CLASS_DATA_SIZE, "{{ value_json.freemem }}", "", "", HASS_UNIT_BYTE, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "SYS: IP", "ip", "", "{{ value_json.ip }}", "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}, # ifndef ESP32_ETHERNET {HASS_TYPE_SENSOR, "SYS: RSSI", "rssi", HASS_CLASS_SIGNAL_STRENGTH, "{{ value_json.rssi }}", "", "", HASS_UNIT_DB, stateClassNone, nullptr, nullptr, nullptr, nullptr}, # endif // Switch with state_on/state_off {HASS_TYPE_SWITCH, "SYS: Auto discovery", "disc", "", "{{ value_json.disc }}", "{\"disc\":true,\"save\":true}", "{\"disc\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoSYSset}, // Buttons {HASS_TYPE_BUTTON, "SYS: Restart gateway", "restart", HASS_CLASS_RESTART, "", "{\"cmd\":\"restart\"}", "", "", stateClassNone, nullptr, nullptr, will_Topic, subjectMQTTtoSYSset}, {HASS_TYPE_BUTTON, "SYS: Erase credentials", "erase", "", "", "{\"cmd\":\"erase\"}", "", "", stateClassNone, nullptr, nullptr, will_Topic, subjectMQTTtoSYSset}, }; int entityCount = sizeof(systemEntities) / sizeof(systemEntities[0]); createDiscoveryFromList(nullptr, systemEntities, entityCount, nullptr, nullptr, nullptr, true, subjectSYStoMQTT, will_Topic, nullptr); # ifdef SecondaryModule // Secondary module system sensors - dynamic string handling required String secondaryPrefix = String(SecondaryModule); String uptimeName = "SYS: Uptime " + secondaryPrefix; String uptimeId = "uptime-" + secondaryPrefix; String freememName = "SYS: Free memory " + secondaryPrefix; String freememId = "freemem-" + secondaryPrefix; String restartName = "SYS: Restart " + secondaryPrefix; String restartId = "restart-" + secondaryPrefix; const char* secondarySensors[][13] = { {HASS_TYPE_SENSOR, uptimeName.c_str(), uptimeId.c_str(), HASS_CLASS_DURATION, "{{ value_json.uptime }}", "", "", HASS_UNIT_SECOND, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, freememName.c_str(), freememId.c_str(), HASS_CLASS_DATA_SIZE, "{{ value_json.freemem }}", "", "", HASS_UNIT_BYTE, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_BUTTON, restartName.c_str(), restartId.c_str(), HASS_CLASS_RESTART, "", "{\"cmd\":\"restart\"}", "", "", stateClassNone, nullptr, nullptr, will_Topic, subjectMQTTtoSYSsetSecondaryModule}, }; createDiscoveryFromList(nullptr, secondarySensors, 3, nullptr, nullptr, nullptr, true, subjectSYStoMQTTSecondaryModule, will_Topic, nullptr); # endif # ifdef LED_ADDRESSABLE createDiscovery(HASS_TYPE_NUMBER, //set Type subjectSYStoMQTT, "SYS: LED Brightness", (char*)getUniqueId("rgbb", "").c_str(), //set state_topic,name,uniqueId will_Topic, "", "{{ (value_json.rgbb/2.55) | round(0) }}", //set availability_topic,device_class,value_template, "{\"rgbb\":{{ (value*2.55) | round(0) }},\"save\":true}", "", "", //set,payload_on,payload_off,unit_of_meas, 0, //set off_delay Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_available,payload_not available ,is a gateway entity, command topic "", "", "", "", false, // device name, device manufacturer, device model, device ID, retain, stateClassNone //State Class ); # endif # ifdef ZdisplaySSD1306 # include "config_SSD1306.h" const char* ssd1306Entities[][13] = { {HASS_TYPE_SWITCH, "SSD1306: Control", "onstate", "", "{{ value_json.onstate }}", "{\"onstate\":true,\"save\":true}", "{\"onstate\":false,\"save\":true}", "", stateClassNone, "false", "true", subjectSSD1306toMQTT, subjectMQTTtoSSD1306set}, {HASS_TYPE_SWITCH, "SSD1306: Display metric", "displayMetric", "", "{{ value_json.displayMetric }}", "{\"displayMetric\":true,\"save\":true}", "{\"displayMetric\":false,\"save\":true}", "", stateClassNone, "false", "true", subjectWebUItoMQTT, subjectMQTTtoWebUIset}, {HASS_TYPE_NUMBER, "SSD1306: Brightness", "brightness", "", "{{ value_json.brightness }}", "{\"brightness\":{{value}},\"save\":true}", "", "", stateClassNone, nullptr, nullptr, subjectSSD1306toMQTT, subjectMQTTtoSSD1306set}, }; createDiscoveryFromList(nullptr, ssd1306Entities, 3, nullptr, nullptr, nullptr, true, subjectSSD1306toMQTT, will_Topic, nullptr); # endif # if defined(ESP32) && !defined(NO_INT_TEMP_READING) const char* esp32Sensors[][13] = { {HASS_TYPE_SENSOR, "SYS: Internal temperature", "tempc", HASS_CLASS_TEMPERATURE, "{{ value_json.tempc | round(1)}}", "", "", HASS_UNIT_CELSIUS, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, # if defined(ZboardM5STICKC) || defined(ZboardM5STICKCP) || defined(ZboardM5TOUGH) {HASS_TYPE_SENSOR, "SYS: Bat voltage", "m5batvoltage", HASS_CLASS_VOLTAGE, "{{ value_json.m5batvoltage }}", "", "", HASS_UNIT_VOLT, stateClassNone, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "SYS: Bat current", "m5batcurrent", HASS_CLASS_CURRENT, "{{ value_json.m5batcurrent }}", "", "", HASS_UNIT_AMP, stateClassNone, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "SYS: Vin voltage", "m5vinvoltage", HASS_CLASS_VOLTAGE, "{{ value_json.m5vinvoltage }}", "", "", HASS_UNIT_VOLT, stateClassNone, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "SYS: Vin current", "m5vincurrent", HASS_CLASS_CURRENT, "{{ value_json.m5vincurrent }}", "", "", HASS_UNIT_AMP, stateClassNone, nullptr, nullptr, nullptr, nullptr}, # endif # ifdef ZboardM5STACK {HASS_TYPE_SENSOR, "SYS: Batt level", "m5battlevel", HASS_CLASS_BATTERY, "{{ value_json.m5battlevel }}", "", "", HASS_UNIT_PERCENT, stateClassNone, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_BINARY_SENSOR, "SYS: Is Charging", "m5ischarging", "", "{{ value_json.m5ischarging }}", "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_BINARY_SENSOR, "SYS: Is Charge Full", "m5ischargefull", "", "{{ value_json.m5ischargefull }}", "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}, # endif }; int esp32SensorCount = sizeof(esp32Sensors) / sizeof(esp32Sensors[0]); createDiscoveryFromList(nullptr, esp32Sensors, esp32SensorCount, nullptr, nullptr, nullptr, true, subjectSYStoMQTT, will_Topic, nullptr); # endif # ifdef MQTT_HTTPS_FW_UPDATE createDiscovery(HASS_TYPE_UPDATE, //set Type subjectRLStoMQTT, "SYS: Firmware Update", (char*)getUniqueId(HASS_TYPE_UPDATE, "").c_str(), //set state_topic,name,uniqueId will_Topic, "firmware", "", //set availability_topic,device_class,value_template, LATEST_OR_DEV, "", "", //set,payload_on,payload_off,unit_of_meas, 0, //set off_delay Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSupdate, //set,payload_available,payload_not available ,is a gateway entity, command topic "", "", "", "", false, // device name, device manufacturer, device model, device ID, retain stateClassNone //State Class ); # endif # ifdef ZsensorBME280 # include "config_BME280.h" const char* BMEsensor[][13] = { {HASS_TYPE_SENSOR, "BME: Temp", "bme-temp", HASS_CLASS_TEMPERATURE, jsonTempc, "", "", HASS_UNIT_CELSIUS, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "BME: Pressure", "bme-pressure", HASS_CLASS_PRESSURE, jsonPa, "", "", HASS_UNIT_HPA, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "BME: Humidity", "bme-humidity", HASS_CLASS_HUMIDITY, jsonHum, "", "", HASS_UNIT_PERCENT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "BME: Altitude", "bme-altim", "", jsonAltim, "", "", HASS_UNIT_METER, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "BME: Altitude (ft)", "bme-altift", "", jsonAltif, "", "", HASS_UNIT_FT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("bme280Discovery" CR)); createDiscoveryFromList(nullptr, BMEsensor, 5, nullptr, nullptr, nullptr, true, BMETOPIC, will_Topic, nullptr); # endif # ifdef ZsensorHTU21 # include "config_HTU21.h" const char* HTUsensor[][13] = { {HASS_TYPE_SENSOR, "HTU: Temperature", "htu-temp", HASS_CLASS_TEMPERATURE, jsonTempc, "", "", HASS_UNIT_CELSIUS, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "HTU: Humidity", "htu-hum", HASS_CLASS_HUMIDITY, jsonHum, "", "", HASS_UNIT_PERCENT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("htu21Discovery" CR)); createDiscoveryFromList(nullptr, HTUsensor, 2, nullptr, nullptr, nullptr, true, HTUTOPIC, will_Topic, nullptr); # endif # ifdef ZsensorLM75 THEENGS_LOG_TRACE(F("LM75Discovery" CR)); const char* LM75sensor[][13] = { {HASS_TYPE_SENSOR, "LM75: Temperature", "lm75-temp", HASS_CLASS_TEMPERATURE, jsonTempc, "", "", HASS_UNIT_CELSIUS, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, LM75sensor, 1, nullptr, nullptr, nullptr, true, LM75TOPIC, will_Topic, nullptr); # endif # ifdef ZsensorAHTx0 # include "config_AHTx0.h" const char* AHTsensor[][13] = { {HASS_TYPE_SENSOR, "AHT: Temperature", "aht-temp", HASS_CLASS_TEMPERATURE, jsonTempc, "", "", HASS_UNIT_CELSIUS, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "AHT: Humidity", "aht-hum", HASS_CLASS_HUMIDITY, jsonHum, "", "", HASS_UNIT_PERCENT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("AHTx0Discovery" CR)); createDiscoveryFromList(nullptr, AHTsensor, 2, nullptr, nullptr, nullptr, true, AHTTOPIC, will_Topic, nullptr); # endif # ifdef ZsensorDHT # include "config_DHT.h" const char* DHTsensor[][13] = { {HASS_TYPE_SENSOR, "DHT: Temperature", "dht-temp", HASS_CLASS_TEMPERATURE, jsonTempc, "", "", HASS_UNIT_CELSIUS, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "DHT: Humidity", "dht-hum", HASS_CLASS_HUMIDITY, jsonHum, "", "", HASS_UNIT_PERCENT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("DHTDiscovery" CR)); createDiscoveryFromList(nullptr, DHTsensor, 2, nullptr, nullptr, nullptr, true, DHTTOPIC, will_Topic, nullptr); # endif # ifdef ZsensorADC # include "config_ADC.h" THEENGS_LOG_TRACE(F("ADCDiscovery" CR)); const char* ADCsensor[][13] = { {HASS_TYPE_SENSOR, "ADC", "adc", "", jsonAdc, "", "", "", stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, ADCsensor, 1, nullptr, nullptr, nullptr, true, ADCTOPIC, will_Topic, nullptr); # endif # ifdef ZsensorBH1750 # include "config_BH1750.h" const char* BH1750sensor[][13] = { {HASS_TYPE_SENSOR, "BH1750: Lux", "BH1750-lux", HASS_CLASS_ILLUMINANCE, jsonLux, "", "", HASS_UNIT_LX, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "BH1750: ftCd", "BH1750-ftcd", HASS_CLASS_IRRADIANCE, jsonFtcd, "", "", "", stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "BH1750: wattsm2", "BH1750-wm2", HASS_CLASS_IRRADIANCE, jsonWm2, "", "", HASS_UNIT_WM2, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("BH1750Discovery" CR)); createDiscoveryFromList(nullptr, BH1750sensor, 3, nullptr, nullptr, nullptr, true, subjectBH1750toMQTT, will_Topic, nullptr); # endif # ifdef ZsensorMQ2 # include "config_MQ2.h" const char* MQ2sensor[][13] = { {HASS_TYPE_SENSOR, "MQ2: gas", "MQ2-gas", HASS_CLASS_GAS, jsonVal, "", "", HASS_UNIT_PPM, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_BINARY_SENSOR, "MQ2", "", HASS_CLASS_GAS, jsonPresence, "true", "false", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("MQ2Discovery" CR)); createDiscoveryFromList(nullptr, MQ2sensor, 2, nullptr, nullptr, nullptr, true, subjectMQ2toMQTT, will_Topic, nullptr); # endif # ifdef ZsensorTEMT6000 # include "config_TEMT6000.h" const char* TEMT6000sensor[][13] = { {HASS_TYPE_SENSOR, "TEMT6000: Lux", "TEMT6000-lux", HASS_CLASS_ILLUMINANCE, jsonLux, "", "", HASS_UNIT_LX, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "TEMT6000: ftCd", "TEMT6000-ftcd", HASS_CLASS_IRRADIANCE, jsonFtcd, "", "", "", stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "TEMT6000: wattsm2", "TEMT6000-wm2", HASS_CLASS_IRRADIANCE, jsonWm2, "", "", HASS_UNIT_WM2, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("TEMT6000Discovery" CR)); createDiscoveryFromList(nullptr, TEMT6000sensor, 3, nullptr, nullptr, nullptr, true, subjectTEMT6000toMQTT, will_Topic, nullptr); # endif # ifdef ZsensorTSL2561 # include "config_TSL2561.h" const char* TSL2561sensor[][13] = { {HASS_TYPE_SENSOR, "TSL2561: Lux", "TSL2561-lux", HASS_CLASS_ILLUMINANCE, jsonLux, "", "", HASS_UNIT_LX, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "TSL2561: ftCd", "TSL2561-ftcd", HASS_CLASS_IRRADIANCE, jsonFtcd, "", "", "", stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "TSL2561: wattsm2", "TSL2561-wm2", HASS_CLASS_IRRADIANCE, jsonWm2, "", "", HASS_UNIT_WM2, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("TSL2561Discovery" CR)); createDiscoveryFromList(nullptr, TSL2561sensor, 3, nullptr, nullptr, nullptr, true, subjectTSL12561toMQTT, will_Topic, nullptr); # endif # ifdef ZsensorHCSR501 # include "config_HCSR501.h" THEENGS_LOG_TRACE(F("HCSR501Discovery" CR)); const char* HCSR501sensor[][13] = { {HASS_TYPE_BINARY_SENSOR, "hcsr501", "", HASS_CLASS_MOTION, jsonPresence, "true", "false", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, HCSR501sensor, 1, nullptr, nullptr, nullptr, true, subjectHCSR501toMQTT, will_Topic, nullptr); # endif # ifdef ZsensorGPIOInput # include "config_GPIOInput.h" THEENGS_LOG_TRACE(F("GPIOInputDiscovery" CR)); const char* GPIOInputsensor[][13] = { {HASS_TYPE_BINARY_SENSOR, "GPIOInput", "", "", jsonGpio, INPUT_GPIO_ON_VALUE, INPUT_GPIO_OFF_VALUE, "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, GPIOInputsensor, 1, nullptr, nullptr, nullptr, true, subjectGPIOInputtoMQTT, will_Topic, nullptr); # endif # ifdef ZsensorINA226 # include "config_INA226.h" const char* INA226sensor[][13] = { {HASS_TYPE_SENSOR, "INA226: volt", "INA226-volt", HASS_CLASS_VOLTAGE, jsonVolt, "", "", HASS_UNIT_VOLT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "INA226: current", "INA226-current", HASS_CLASS_CURRENT, jsonCurrent, "", "", HASS_UNIT_AMP, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "INA226: power", "INA226-power", HASS_CLASS_POWER, jsonPower, "", "", HASS_UNIT_WATT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("INA226Discovery" CR)); createDiscoveryFromList(nullptr, INA226sensor, 3, nullptr, nullptr, nullptr, true, subjectINA226toMQTT, will_Topic, nullptr); # endif # ifdef ZsensorDS1820 extern void pubOneWire_HADiscovery(); // Publish any DS1820 sensors found on the OneWire bus pubOneWire_HADiscovery(); # endif # ifdef ZactuatorONOFF # include "config_ONOFF.h" THEENGS_LOG_TRACE(F("actuatorONOFFDiscovery" CR)); const char* actuatorONOFF[][13] = { {HASS_TYPE_SWITCH, "actuatorONOFF", "actuatorONOFF", "", "{{ value_json.cmd }}", "{\"cmd\":1}", "{\"cmd\":0}", "", stateClassNone, "0", "1", nullptr, subjectMQTTtoONOFF}}; createDiscoveryFromList(nullptr, actuatorONOFF, 1, nullptr, nullptr, nullptr, true, subjectGTWONOFFtoMQTT, will_Topic, nullptr); # endif # ifdef ZsensorRN8209 # include "config_RN8209.h" const char* RN8209sensor[][13] = { {HASS_TYPE_SENSOR, "NRG: volt", "volt", HASS_CLASS_VOLTAGE, jsonVolt, "", "", HASS_UNIT_VOLT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "NRG: current", "current", HASS_CLASS_CURRENT, jsonCurrent, "", "", HASS_UNIT_AMP, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_SENSOR, "NRG: power", "power", HASS_CLASS_POWER, jsonPower, "", "", HASS_UNIT_WATT, stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}, {HASS_TYPE_BINARY_SENSOR, "NRG: inUse", "inUse", HASS_CLASS_POWER, jsonInuseRN8209, "on", "off", "", stateClassMeasurement, nullptr, nullptr, nullptr, nullptr}}; THEENGS_LOG_TRACE(F("RN8209Discovery" CR)); createDiscoveryFromList(nullptr, RN8209sensor, 4, nullptr, nullptr, nullptr, true, subjectRN8209toMQTT, will_Topic, nullptr); # endif // Gateway sensors for various modules # if defined(ZgatewayRF) && defined(RF_on_HAS_as_MQTTSensor) THEENGS_LOG_TRACE(F("gatewayRFDiscovery" CR)); const char* gatewayRF[][13] = { {HASS_TYPE_SENSOR, "gatewayRF", "", "", jsonVal, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gatewayRF, 1, nullptr, nullptr, nullptr, true, # if valueAsATopic subjectRFtoMQTTvalueAsATopic, # else subjectRFtoMQTT, # endif will_Topic, nullptr); # endif # ifdef ZgatewayRF2 # include "config_RF.h" THEENGS_LOG_TRACE(F("gatewayRF2Discovery" CR)); const char* gatewayRF2[][13] = { {HASS_TYPE_SENSOR, "gatewayRF2", "", "", jsonAddress, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gatewayRF2, 1, nullptr, nullptr, nullptr, true, # if valueAsATopic subjectRF2toMQTTvalueAsATopic, # else subjectRF2toMQTT, # endif will_Topic, nullptr); # endif # ifdef ZgatewayRFM69 # include "config_RFM69.h" THEENGS_LOG_TRACE(F("gatewayRFM69Discovery" CR)); const char* gatewayRFM69[][13] = { {HASS_TYPE_SENSOR, "gatewayRFM69", "", "", jsonVal, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gatewayRFM69, 1, nullptr, nullptr, nullptr, true, subjectRFM69toMQTT, will_Topic, nullptr); # endif # ifdef ZgatewayLORA # include "config_LORA.h" THEENGS_LOG_TRACE(F("gatewayLORADiscovery" CR)); const char* gatewayLORA[][13] = { {HASS_TYPE_SENSOR, "gatewayLORA", "", "", jsonMsg, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gatewayLORA, 1, nullptr, nullptr, nullptr, true, subjectLORAtoMQTT, will_Topic, nullptr); const char* LORAswitches[][13] = { {HASS_TYPE_SWITCH, "LORA: CRC", "enablecrc", "", "{{ value_json.enablecrc }}", "{\"enablecrc\":true,\"save\":true}", "{\"enablecrc\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoLORAset}, {HASS_TYPE_SWITCH, "LORA: Invert IQ", "invertiq", "", "{{ value_json.invertiq }}", "{\"invertiq\":true,\"save\":true}", "{\"invertiq\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoLORAset}, {HASS_TYPE_SWITCH, "LORA: Only Known", "onlyknown", "", "{{ value_json.onlyknown }}", "{\"onlyknown\":true,\"save\":true}", "{\"onlyknown\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoLORAset}, }; createDiscoveryFromList(nullptr, LORAswitches, 3, nullptr, nullptr, nullptr, true, subjectLORAtoMQTT, will_Topic, nullptr); # endif # ifdef ZgatewaySRFB # include "config_SRFB.h" THEENGS_LOG_TRACE(F("gatewaySRFBDiscovery" CR)); const char* gatewaySRFB[][13] = { {HASS_TYPE_SENSOR, "gatewaySRFB", "", "", jsonVal, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gatewaySRFB, 1, nullptr, nullptr, nullptr, true, subjectSRFBtoMQTT, will_Topic, nullptr); # endif # ifdef ZgatewayPilight # include "config_RF.h" THEENGS_LOG_TRACE(F("gatewayPilightDiscovery" CR)); const char* gatewayPilight[][13] = { {HASS_TYPE_SENSOR, "gatewayPilight", "", "", jsonMsg, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gatewayPilight, 1, nullptr, nullptr, nullptr, true, # if valueAsATopic subjectPilighttoMQTTvalueAsATopic, # else subjectPilighttoMQTT, # endif will_Topic, nullptr); # endif # ifdef ZgatewayIR # include "config_IR.h" THEENGS_LOG_TRACE(F("gatewayIRDiscovery" CR)); const char* gatewayIR[][13] = { {HASS_TYPE_SENSOR, "gatewayIR", "", "", jsonVal, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gatewayIR, 1, nullptr, nullptr, nullptr, true, subjectIRtoMQTT, will_Topic, nullptr); # endif # ifdef Zgateway2G # include "config_2G.h" THEENGS_LOG_TRACE(F("gateway2GDiscovery" CR)); const char* gateway2G[][13] = { {HASS_TYPE_SENSOR, "gateway2G", "", "", jsonMsg, "", "", "", stateClassNone, nullptr, nullptr, nullptr, nullptr}}; createDiscoveryFromList(nullptr, gateway2G, 1, nullptr, nullptr, nullptr, true, subject2GtoMQTT, will_Topic, nullptr); # endif # if defined(ZgatewayBT) || defined(SecondaryModule) # ifdef ESP32 // BT configuration entities - all in arrays now with macros const char* btConfigEntities[][13] = { // Numbers {HASS_TYPE_NUMBER, "BT: Connect interval", "intervalcnct", "", "{{ value_json.intervalcnct/60000 }}", "{\"intervalcnct\":{{value*60000}},\"save\":true}", "", HASS_UNIT_MIN, stateClassNone, nullptr, nullptr, nullptr, subjectMQTTtoBTset}, {HASS_TYPE_NUMBER, "BT: Scan duration", "scanduration", "", "{{ value_json.scanduration/1000 }}", "{\"scanduration\":{{value*1000}},\"save\":true}", "", HASS_UNIT_SECOND, stateClassNone, nullptr, nullptr, nullptr, subjectMQTTtoBTset}, // Buttons {HASS_TYPE_BUTTON, "BT: Force scan", "force_scan", "", "", "{\"interval\":0}", "", "", stateClassNone, nullptr, nullptr, will_Topic, subjectMQTTtoBTset}, {HASS_TYPE_BUTTON, "BT: Erase config", "erase_bt_config", "", "", "{\"erase\":true}", "", "", stateClassNone, nullptr, nullptr, will_Topic, subjectMQTTtoBTset}, // Switches with state_on/state_off {HASS_TYPE_SWITCH, "BT: Publish only sensors", "only_sensors", "", "{{ value_json.onlysensors }}", "{\"onlysensors\":true,\"save\":true}", "{\"onlysensors\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoBTset}, {HASS_TYPE_SWITCH, "BT: Adaptive scan", "adaptive_scan", "", "{{ value_json.adaptivescan }}", "{\"adaptivescan\":true,\"save\":true}", "{\"adaptivescan\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoBTset}, {HASS_TYPE_SWITCH, "BT: Enabled", "enabled", "", "{{ value_json.enabled }}", "{\"enabled\":true,\"save\":true}", "{\"enabled\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoBTset}, {HASS_TYPE_SWITCH, "BT: Publish HASS presence", "hasspresence", "", "{{ value_json.hasspresence }}", "{\"hasspresence\":true,\"save\":true}", "{\"hasspresence\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoBTset}, {HASS_TYPE_SWITCH, "BT: Publish Advertisement data", "pubadvdata", "", "{{ value_json.pubadvdata }}", "{\"pubadvdata\":true,\"save\":true}", "{\"pubadvdata\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoBTset}, {HASS_TYPE_SWITCH, "BT: Connect to devices", "bleconnect", "", "{{ value_json.bleconnect }}", "{\"bleconnect\":true,\"save\":true}", "{\"bleconnect\":false,\"save\":true}", "", stateClassNone, "false", "true", nullptr, subjectMQTTtoBTset}, }; createDiscoveryFromList(nullptr, btConfigEntities, 10, nullptr, nullptr, nullptr, true, subjectBTtoMQTT, will_Topic, nullptr); # define EntitiesCount 9 const char* obsoleteEntities[EntitiesCount][2] = { // Remove previously created entities for version < 1.4.0 {HASS_TYPE_SWITCH, "active_scan"}, // Replaced by adaptive scan // Remove previously created entities for version < 1.3.0 {HASS_TYPE_NUMBER, "scanbcnct"}, // Now a connect interval // Remove previously created entities for version < 1.2.0 {HASS_TYPE_SWITCH, "restart"}, // Now a button {HASS_TYPE_SWITCH, "erase"}, // Now a button {HASS_TYPE_SWITCH, "force_scan"}, // Now a button {HASS_TYPE_SENSOR, "interval"}, // Now a number {HASS_TYPE_SENSOR, "scanbcnct"}, // Now a number {HASS_TYPE_SWITCH, "ohdiscovery"}, // Now a new key {HASS_TYPE_SWITCH, "discovery"}}; // Now a new key for (int i = 0; i < EntitiesCount; i++) { eraseTopic(obsoleteEntities[i][0], (char*)getUniqueId(obsoleteEntities[i][1], "").c_str()); } btScanParametersDiscovery(); btPresenceParametersDiscovery(); # if DEFAULT_LOW_POWER_MODE != DEACTIVATED createDiscovery(HASS_TYPE_SWITCH, //set Type subjectSYStoMQTT, "SYS: Low Power Mode command", (char*)getUniqueId("powermode", "").c_str(), //set state_topic,name,uniqueId will_Topic, "", "{{ value_json.powermode | bool }}", //set availability_topic,device_class,value_template, "{\"powermode\":1,\"save\":true}", "{\"powermode\":0,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas, 0, //set off_delay Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_available,payload_not available,is a gateway entity, command topic "", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain stateClassNone, //State Class "false", "true" //state_off, state_on ); # else // Remove previously created switch for version < 1.4.0 eraseTopic(HASS_TYPE_SWITCH, (char*)getUniqueId("powermode", "").c_str()); # endif # endif # endif } #else void pubMqttDiscovery() {} #endif
57,350
mqttDiscovery
cpp
en
cpp
code
{"qsc_code_num_words": 6588, "qsc_code_num_chars": 57350.0, "qsc_code_mean_word_length": 5.63387978, "qsc_code_frac_words_unique": 0.13403157, "qsc_code_frac_chars_top_2grams": 0.09090419, "qsc_code_frac_chars_top_3grams": 0.0814743, "qsc_code_frac_chars_top_4grams": 0.04149154, "qsc_code_frac_chars_dupe_5grams": 0.45632611, "qsc_code_frac_chars_dupe_6grams": 0.38870029, "qsc_code_frac_chars_dupe_7grams": 0.35539929, "qsc_code_frac_chars_dupe_8grams": 0.32107447, "qsc_code_frac_chars_dupe_9grams": 0.26982972, "qsc_code_frac_chars_dupe_10grams": 0.25239789, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01921456, "qsc_code_frac_chars_whitespace": 0.19325196, "qsc_code_size_file_byte": 57350.0, "qsc_code_num_lines": 1155.0, "qsc_code_num_chars_line_max": 514.0, "qsc_code_num_chars_line_mean": 49.65367965, "qsc_code_frac_chars_alphabet": 0.78299868, "qsc_code_frac_chars_comments": 0.22385353, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.22164276, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.12288545, "qsc_code_frac_chars_long_word_length": 0.01442275, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0008658, "qsc_code_frac_lines_assert": 0.0, "qsc_codecpp_frac_lines_preprocessor_directives": 0.18122555, "qsc_codecpp_frac_lines_func_ratio": 0.03911343, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.0821382, "qsc_codecpp_frac_lines_print": 0.00391134}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1technophile/OpenMQTTGateway
main/sensorC37_YL83_HMRD.cpp
/* Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your 433mhz/infrared IR/BLE signal and a MQTT broker Send and receiving command by MQTT This file sets parameters for the integration of C-37 YL-83 HM-RD water detection sensors This file is part of OpenMQTTGateway. OpenMQTTGateway is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenMQTTGateway is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "User_config.h" #ifdef ZsensorC37_YL83_HMRD # include "TheengsCommon.h" # include "config_C37_YL83_HMRD.h" //Time used to wait for an interval before resending temp and hum unsigned long timeC37YL83HMRD = 0; unsigned int persistedanalog = 0; unsigned int persisteddigital = 0; void setupZsensorC37_YL83_HMRD() { pinMode(C37_YL83_HMRD_Digital_GPIO, INPUT); THEENGS_LOG_TRACE(F("C37_YL83_HMRD: digital configured pin: %d" CR), C37_YL83_HMRD_Digital_GPIO); pinMode(C37_YL83_HMRD_Analog_GPIO, INPUT); THEENGS_LOG_TRACE(F("C37_YL83_HMRD: Analog configured pin: %d" CR), C37_YL83_HMRD_Analog_GPIO); # ifdef C37_YL83_HMRD_Analog_RESOLUTION analogReadResolution(C37_YL83_HMRD_Analog_RESOLUTION); THEENGS_LOG_TRACE(F("C37_YL83_HMRD: resolution: %d" CR), C37_YL83_HMRD_Analog_RESOLUTION); # endif } void MeasureC37_YL83_HMRDWater() { if (millis() > (timeC37YL83HMRD + C37_YL83_HMRD_INTERVAL_SEC)) { //retrieving value of water sensor every xUL timeC37YL83HMRD = millis(); static int persistedanalog; static int persisteddigital; int sensorDigitalValue = digitalRead(C37_YL83_HMRD_Digital_GPIO); // Read the analog value from sensor int sensorAnalogValue = analogRead(C37_YL83_HMRD_Analog_GPIO); THEENGS_LOG_TRACE(F("Creating C37_YL83_HMRD buffer" CR)); StaticJsonDocument<JSON_MSG_BUFFER> C37_YL83_HMRDdataBuffer; JsonObject C37_YL83_HMRDdata = C37_YL83_HMRDdataBuffer.to<JsonObject>(); if (sensorDigitalValue != persisteddigital || C37_YL83_HMRD_ALWAYS) { C37_YL83_HMRDdata["detected"] = (sensorDigitalValue == 1 ? "false" : "true"); } else { THEENGS_LOG_TRACE(F("Same digital don't send it" CR)); } if (sensorAnalogValue != persistedanalog || C37_YL83_HMRD_ALWAYS) { C37_YL83_HMRDdata["reading"] = sensorAnalogValue; } else { THEENGS_LOG_TRACE(F("Same analog don't send it" CR)); } if (C37_YL83_HMRDdata.size() > 0) { C37_YL83_HMRDdata["origin"] = C37_YL83_HMRD_TOPIC; enqueueJsonObject(C37_YL83_HMRDdata); if (sensorDigitalValue == 1) { //No water detected, all good we can sleep if (SYSConfig.powerMode > 0) ready_to_sleep = true; } } persistedanalog = sensorAnalogValue; persisteddigital = sensorDigitalValue; } } #endif
3,316
sensorC37_YL83_HMRD
cpp
en
cpp
code
{"qsc_code_num_words": 448, "qsc_code_num_chars": 3316.0, "qsc_code_mean_word_length": 5.28571429, "qsc_code_frac_words_unique": 0.42633929, "qsc_code_frac_chars_top_2grams": 0.07685811, "qsc_code_frac_chars_top_3grams": 0.08361486, "qsc_code_frac_chars_top_4grams": 0.05025338, "qsc_code_frac_chars_dupe_5grams": 0.23564189, "qsc_code_frac_chars_dupe_6grams": 0.15836149, "qsc_code_frac_chars_dupe_7grams": 0.09163851, "qsc_code_frac_chars_dupe_8grams": 0.03040541, "qsc_code_frac_chars_dupe_9grams": 0.03040541, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.05263158, "qsc_code_frac_chars_whitespace": 0.18063932, "qsc_code_size_file_byte": 3316.0, "qsc_code_num_lines": 82.0, "qsc_code_num_chars_line_max": 112.0, "qsc_code_num_chars_line_mean": 40.43902439, "qsc_code_frac_chars_alphabet": 0.81891792, "qsc_code_frac_chars_comments": 0.36640531, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.08510638, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.12851023, "qsc_code_frac_chars_long_word_length": 0.0104712, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecpp_frac_lines_preprocessor_directives": 0.14893617, "qsc_codecpp_frac_lines_func_ratio": 0.06382979, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.12765957, "qsc_codecpp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-admin/src/main/resources/static/ajax/libs/summernote/summernote.css
@font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("./font/summernote.eot?1d9aeaaff0a8939558a45be6cd52cd4c");src:url("./font/summernote.eot?1d9aeaaff0a8939558a45be6cd52cd4c#iefix") format("embedded-opentype"),url("./font/summernote.woff?1d9aeaaff0a8939558a45be6cd52cd4c") format("woff"),url("./font/summernote.ttf?1d9aeaaff0a8939558a45be6cd52cd4c") format("truetype")}[class^="note-icon-"]:before,[class*=" note-icon-"]:before{display:inline-block;font:normal normal normal 14px summernote;font-size:inherit;-webkit-font-smoothing:antialiased;text-decoration:inherit;text-rendering:auto;text-transform:none;vertical-align:middle;speak:none;-moz-osx-font-smoothing:grayscale}.note-icon-align-center:before,.note-icon-align-indent:before,.note-icon-align-justify:before,.note-icon-align-left:before,.note-icon-align-outdent:before,.note-icon-align-right:before,.note-icon-align:before,.note-icon-arrow-circle-down:before,.note-icon-arrow-circle-left:before,.note-icon-arrow-circle-right:before,.note-icon-arrow-circle-up:before,.note-icon-arrows-alt:before,.note-icon-arrows-h:before,.note-icon-arrows-v:before,.note-icon-bold:before,.note-icon-caret:before,.note-icon-chain-broken:before,.note-icon-circle:before,.note-icon-close:before,.note-icon-code:before,.note-icon-col-after:before,.note-icon-col-before:before,.note-icon-col-remove:before,.note-icon-eraser:before,.note-icon-float-left:before,.note-icon-float-none:before,.note-icon-float-right:before,.note-icon-font:before,.note-icon-frame:before,.note-icon-italic:before,.note-icon-link:before,.note-icon-magic:before,.note-icon-menu-check:before,.note-icon-minus:before,.note-icon-orderedlist:before,.note-icon-pencil:before,.note-icon-picture:before,.note-icon-question:before,.note-icon-redo:before,.note-icon-rollback:before,.note-icon-row-above:before,.note-icon-row-below:before,.note-icon-row-remove:before,.note-icon-special-character:before,.note-icon-square:before,.note-icon-strikethrough:before,.note-icon-subscript:before,.note-icon-summernote:before,.note-icon-superscript:before,.note-icon-table:before,.note-icon-text-height:before,.note-icon-trash:before,.note-icon-underline:before,.note-icon-undo:before,.note-icon-unorderedlist:before,.note-icon-video:before{display:inline-block;font-family:"summernote";font-style:normal;font-weight:normal;text-decoration:inherit}.note-icon-align-center:before{content:"\f101"}.note-icon-align-indent:before{content:"\f102"}.note-icon-align-justify:before{content:"\f103"}.note-icon-align-left:before{content:"\f104"}.note-icon-align-outdent:before{content:"\f105"}.note-icon-align-right:before{content:"\f106"}.note-icon-align:before{content:"\f107"}.note-icon-arrow-circle-down:before{content:"\f108"}.note-icon-arrow-circle-left:before{content:"\f109"}.note-icon-arrow-circle-right:before{content:"\f10a"}.note-icon-arrow-circle-up:before{content:"\f10b"}.note-icon-arrows-alt:before{content:"\f10c"}.note-icon-arrows-h:before{content:"\f10d"}.note-icon-arrows-v:before{content:"\f10e"}.note-icon-bold:before{content:"\f10f"}.note-icon-caret:before{content:"\f110"}.note-icon-chain-broken:before{content:"\f111"}.note-icon-circle:before{content:"\f112"}.note-icon-close:before{content:"\f113"}.note-icon-code:before{content:"\f114"}.note-icon-col-after:before{content:"\f115"}.note-icon-col-before:before{content:"\f116"}.note-icon-col-remove:before{content:"\f117"}.note-icon-eraser:before{content:"\f118"}.note-icon-float-left:before{content:"\f119"}.note-icon-float-none:before{content:"\f11a"}.note-icon-float-right:before{content:"\f11b"}.note-icon-font:before{content:"\f11c"}.note-icon-frame:before{content:"\f11d"}.note-icon-italic:before{content:"\f11e"}.note-icon-link:before{content:"\f11f"}.note-icon-magic:before{content:"\f120"}.note-icon-menu-check:before{content:"\f121"}.note-icon-minus:before{content:"\f122"}.note-icon-orderedlist:before{content:"\f123"}.note-icon-pencil:before{content:"\f124"}.note-icon-picture:before{content:"\f125"}.note-icon-question:before{content:"\f126"}.note-icon-redo:before{content:"\f127"}.note-icon-rollback:before{content:"\f128"}.note-icon-row-above:before{content:"\f129"}.note-icon-row-below:before{content:"\f12a"}.note-icon-row-remove:before{content:"\f12b"}.note-icon-special-character:before{content:"\f12c"}.note-icon-square:before{content:"\f12d"}.note-icon-strikethrough:before{content:"\f12e"}.note-icon-subscript:before{content:"\f12f"}.note-icon-summernote:before{content:"\f130"}.note-icon-superscript:before{content:"\f131"}.note-icon-table:before{content:"\f132"}.note-icon-text-height:before{content:"\f133"}.note-icon-trash:before{content:"\f134"}.note-icon-underline:before{content:"\f135"}.note-icon-undo:before{content:"\f136"}.note-icon-unorderedlist:before{content:"\f137"}.note-icon-video:before{content:"\f138"}.note-editor{position:relative}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:#fff;opacity:.95}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:700;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-editing-area{position:relative}.note-editor .note-editing-area .note-editable{outline:0}.note-editor .note-editing-area .note-editable sup{vertical-align:super}.note-editor .note-editing-area .note-editable sub{vertical-align:sub}.note-editor .note-editing-area img.note-float-left{margin-right:10px}.note-editor .note-editing-area img.note-float-right{margin-left:10px}.note-editor.note-frame{border:1px solid #a9a9a9}.note-editor.note-frame.codeview .note-editing-area .note-editable{display:none}.note-editor.note-frame.codeview .note-editing-area .note-codable{display:block}.note-editor.note-frame .note-editing-area{overflow:hidden}.note-editor.note-frame .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;word-wrap:break-word;background-color:#fff}.note-editor.note-frame .note-editing-area .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor.note-frame .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;outline:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor.note-frame.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important}.note-editor.note-frame.fullscreen .note-editable{background-color:#fff}.note-editor.note-frame.fullscreen .note-resizebar{display:none}.note-editor.note-frame .note-status-output{display:block;width:100%;height:20px;margin-bottom:0;font-size:14px;line-height:1.42857143;color:#000;border:0;border-top:1px solid #e2e2e2}.note-editor.note-frame .note-status-output:empty{height:0;border-top:0 solid transparent}.note-editor.note-frame .note-status-output .pull-right{float:right!important}.note-editor.note-frame .note-status-output .text-muted{color:#777}.note-editor.note-frame .note-status-output .text-primary{color:#286090}.note-editor.note-frame .note-status-output .text-success{color:#3c763d}.note-editor.note-frame .note-status-output .text-info{color:#31708f}.note-editor.note-frame .note-status-output .text-warning{color:#8a6d3b}.note-editor.note-frame .note-status-output .text-danger{color:#a94442}.note-editor.note-frame .note-status-output .alert{padding:7px 10px 2px 10px;margin:-7px 0 0 0;color:#000;background-color:#f5f5f5;border-radius:0}.note-editor.note-frame .note-status-output .alert .note-icon{margin-right:5px}.note-editor.note-frame .note-status-output .alert-success{color:#3c763d!important;background-color:#dff0d8!important}.note-editor.note-frame .note-status-output .alert-info{color:#31708f!important;background-color:#d9edf7!important}.note-editor.note-frame .note-status-output .alert-warning{color:#8a6d3b!important;background-color:#fcf8e3!important}.note-editor.note-frame .note-status-output .alert-danger{color:#a94442!important;background-color:#f2dede!important}.note-editor.note-frame .note-statusbar{background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.note-editor.note-frame .note-statusbar .note-resizebar{width:100%;height:9px;padding-top:1px;cursor:ns-resize}.note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor.note-frame .note-statusbar.locked .note-resizebar{cursor:default}.note-editor.note-frame .note-statusbar.locked .note-resizebar .note-icon-bar{display:none}.note-editor.note-frame .note-placeholder{padding:10px}.note-popover.popover{max-width:none}.note-popover.popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover.popover .arrow{left:20px!important}.note-toolbar{position:relative;z-index:500}.note-popover .popover-content,.panel-heading.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover-content>.btn-group,.panel-heading.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover-content .btn-group .note-table,.panel-heading.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .note-style .dropdown-style blockquote,.panel-heading.note-toolbar .note-style .dropdown-style blockquote,.note-popover .popover-content .note-style .dropdown-style pre,.panel-heading.note-toolbar .note-style .dropdown-style pre{padding:5px 10px;margin:0}.note-popover .popover-content .note-style .dropdown-style h1,.panel-heading.note-toolbar .note-style .dropdown-style h1,.note-popover .popover-content .note-style .dropdown-style h2,.panel-heading.note-toolbar .note-style .dropdown-style h2,.note-popover .popover-content .note-style .dropdown-style h3,.panel-heading.note-toolbar .note-style .dropdown-style h3,.note-popover .popover-content .note-style .dropdown-style h4,.panel-heading.note-toolbar .note-style .dropdown-style h4,.note-popover .popover-content .note-style .dropdown-style h5,.panel-heading.note-toolbar .note-style .dropdown-style h5,.note-popover .popover-content .note-style .dropdown-style h6,.panel-heading.note-toolbar .note-style .dropdown-style h6,.note-popover .popover-content .note-style .dropdown-style p,.panel-heading.note-toolbar .note-style .dropdown-style p{padding:0;margin:0}.note-popover .popover-content .note-color-all .dropdown-menu,.panel-heading.note-toolbar .note-color-all .dropdown-menu{min-width:337px}.note-popover .popover-content .note-color .dropdown-toggle,.panel-heading.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette{display:inline-block;width:160px;margin:0}.note-popover .popover-content .note-color .dropdown-menu .note-palette:first-child,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette:first-child{margin:0 5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-palette-title,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset,.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-select,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-select{width:100%;padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-row,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-row{height:20px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset:hover,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset:hover{background:#eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-select-btn,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-select-btn{display:none}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-holder-custom .note-color-btn,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-holder-custom .note-color-btn{border:1px solid #eee}.note-popover .popover-content .note-para .dropdown-menu,.panel-heading.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover-content .note-para .dropdown-menu>div:first-child,.panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover-content .dropdown-menu,.panel-heading.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover-content .dropdown-menu.right,.panel-heading.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover-content .dropdown-menu.right::before,.panel-heading.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover-content .dropdown-menu.right::after,.panel-heading.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover-content .dropdown-menu.note-check li a i,.panel-heading.note-toolbar .dropdown-menu.note-check li a i{color:deepskyblue;visibility:hidden}.note-popover .popover-content .dropdown-menu.note-check li a.checked i,.panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i{visibility:visible}.note-popover .popover-content .note-fontsize-10,.panel-heading.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover-content .note-color-palette,.panel-heading.note-toolbar .note-color-palette{line-height:1}.note-popover .popover-content .note-color-palette div .note-color-btn,.panel-heading.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover-content .note-color-palette div .note-color-btn:hover,.panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}@-moz-document url-prefix(){.note-image-input{height:auto}}.note-placeholder{position:absolute;display:none;color:gray}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid #000}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:#000;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:#fff;border:1px solid #000}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{max-height:150px;padding:3px;overflow:auto}.note-hint-popover .popover-content .note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-popover .popover-content .note-hint-group .note-hint-item.active,.note-hint-popover .popover-content .note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:#fff;text-decoration:none;white-space:nowrap;cursor:pointer;background-color:#428bca;outline:0}
18,699
summernote
css
en
css
data
{"qsc_code_num_words": 2795, "qsc_code_num_chars": 18699.0, "qsc_code_mean_word_length": 5.36350626, "qsc_code_frac_words_unique": 0.13381038, "qsc_code_frac_chars_top_2grams": 0.06243746, "qsc_code_frac_chars_top_3grams": 0.05136415, "qsc_code_frac_chars_top_4grams": 0.06503902, "qsc_code_frac_chars_dupe_5grams": 0.57974785, "qsc_code_frac_chars_dupe_6grams": 0.47875392, "qsc_code_frac_chars_dupe_7grams": 0.42932426, "qsc_code_frac_chars_dupe_8grams": 0.36942165, "qsc_code_frac_chars_dupe_9grams": 0.2392769, "qsc_code_frac_chars_dupe_10grams": 0.19371623, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03424133, "qsc_code_frac_chars_whitespace": 0.02230066, "qsc_code_size_file_byte": 18699.0, "qsc_code_num_lines": 1.0, "qsc_code_num_chars_line_max": 18699.0, "qsc_code_num_chars_line_mean": 18699.0, "qsc_code_frac_chars_alphabet": 0.78574554, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.05764706, "qsc_code_frac_chars_long_word_length": 0.0386631, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 1, "qsc_code_num_chars_line_max": 1, "qsc_code_num_chars_line_mean": 1, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1technophile/OpenMQTTGateway
main/config_TSL2561.h
/* Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files exposes light level measured by a TSL2651 module Heavily inspired by the driver for the BH1750 light sensor Copyright: (c) Chris Broekema This file is part of OpenMQTTGateway. OpenMQTTGateway is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenMQTTGateway is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Connection Schemata: -------------------- TSL2561 ------> ESP8266 =================================== Vcc ---------> Vu (3.3V) GND ---------> GND SCL ---------> D1 SDA ---------> D2 ADD ---------> N/C (Not Connected) */ #ifndef config_TSL2561_h #define config_TSL2561_h extern void setupZsensorTSL2561(); extern void MeasureLightIntensityTSL2561(); #define tsl2561_always true // if false only send current value if it has changed #define TimeBetweenReadingtsl2561 30000 /*----------------------------USER PARAMETERS-----------------------------*/ /*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/ #define subjectTSL12561toMQTT "/LIGHTtoMQTT" #endif
1,807
config_TSL2561
h
en
c
code
{"qsc_code_num_words": 228, "qsc_code_num_chars": 1807.0, "qsc_code_mean_word_length": 5.20175439, "qsc_code_frac_words_unique": 0.64473684, "qsc_code_frac_chars_top_2grams": 0.01264755, "qsc_code_frac_chars_top_3grams": 0.03288364, "qsc_code_frac_chars_top_4grams": 0.04806071, "qsc_code_frac_chars_dupe_5grams": 0.06913997, "qsc_code_frac_chars_dupe_6grams": 0.04721754, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03980782, "qsc_code_frac_chars_whitespace": 0.1936912, "qsc_code_size_file_byte": 1807.0, "qsc_code_num_lines": 51.0, "qsc_code_num_chars_line_max": 111.0, "qsc_code_num_chars_line_mean": 35.43137255, "qsc_code_frac_chars_alphabet": 0.77419355, "qsc_code_frac_chars_comments": 0.85334809, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.04511278, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.28571429, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 1.0, "qsc_codec_score_lines_no_logic": 0.28571429, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 1, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1technophile/OpenMQTTGateway
main/config_Touch.h
/* Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the esp32's touch buttons Copyright: (c) Florian Xhumari Uses work by Florian ROBERT This file is part of OpenMQTTGateway. OpenMQTTGateway is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenMQTTGateway is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef config_Touch_h #define config_Touch_h extern void setupTouch(); extern void touchtoX(); /*----------------------------USER PARAMETERS-----------------------------*/ /*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/ #define subjectTouchtoMQTT "/touchToMQTT" // Time between readings of the touch sensor. Don't make it too short, as // reading one touch sensor takes 0.5 ms. #if !defined(TOUCH_TIME_BETWEEN_READINGS) || (TOUCH_TIME_BETWEEN_READINGS) < 10 # define TOUCH_TIME_BETWEEN_READINGS 30 #endif // We take the average reading of the sensor, and consider as "touched" state // any reading less than average * TOUCH_THRESHOLD / 100. #if !defined(TOUCH_THRESHOLD) # define TOUCH_THRESHOLD 75 #endif // Minimum duration of "touched" state to generate a touch event. By default, // we'll wait 3 readings indicating "touched" in order to generate a touch event. #if !defined(TOUCH_MIN_DURATION) || (TOUCH_MIN_DURATION < 10) # define TOUCH_MIN_DURATION 90 #endif // After a touch was sensed, don't consider changes to "touched" status // for this duration. #if !defined(TOUCH_DEBOUNCE_TIME) || (TOUCH_DEBOUNCE_TIME < 100) # define TOUCH_DEBOUNCE_TIME 200 #endif /**************************************** * * One can define TOUCH_GPIO, or TOUCH_GPIO_0 through TOUCH_GPIO_9 to * include up to 10 sensors. * * By default there's only one sensor at TOUCH_GPIO, default to * pin 4 (T0). * ****************************************/ #if defined(TOUCH_GPIO) && !defined(TOUCH_GPIO_0) # define TOUCH_GPIO_0 (TOUCH_GPIO) #endif #if !defined(TOUCH_GPIO_0) // T0 == GPIO 4 # define TOUCH_GPIO_0 T0 #endif #if defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) && defined(TOUCH_GPIO_3) && defined(TOUCH_GPIO_4) && defined(TOUCH_GPIO_5) && defined(TOUCH_GPIO_6) && defined(TOUCH_GPIO_7) && defined(TOUCH_GPIO_8) && defined(TOUCH_GPIO_9) # define TOUCH_SENSORS 10 #elif defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) && defined(TOUCH_GPIO_3) && defined(TOUCH_GPIO_4) && defined(TOUCH_GPIO_5) && defined(TOUCH_GPIO_6) && defined(TOUCH_GPIO_7) && defined(TOUCH_GPIO_8) # define TOUCH_SENSORS 9 #elif defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) && defined(TOUCH_GPIO_3) && defined(TOUCH_GPIO_4) && defined(TOUCH_GPIO_5) && defined(TOUCH_GPIO_6) && defined(TOUCH_GPIO_7) # define TOUCH_SENSORS 8 #elif defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) && defined(TOUCH_GPIO_3) && defined(TOUCH_GPIO_4) && defined(TOUCH_GPIO_5) && defined(TOUCH_GPIO_6) # define TOUCH_SENSORS 7 #elif defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) && defined(TOUCH_GPIO_3) && defined(TOUCH_GPIO_4) && defined(TOUCH_GPIO_5) # define TOUCH_SENSORS 6 #elif defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) && defined(TOUCH_GPIO_3) && defined(TOUCH_GPIO_4) # define TOUCH_SENSORS 5 #elif defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) && defined(TOUCH_GPIO_3) # define TOUCH_SENSORS 4 #elif defined(TOUCH_GPIO_1) && defined(TOUCH_GPIO_2) # define TOUCH_SENSORS 3 #elif defined(TOUCH_GPIO_1) # define TOUCH_SENSORS 2 #else # define TOUCH_SENSORS 1 #endif #endif
4,158
config_Touch
h
en
c
code
{"qsc_code_num_words": 625, "qsc_code_num_chars": 4158.0, "qsc_code_mean_word_length": 4.592, "qsc_code_frac_words_unique": 0.2928, "qsc_code_frac_chars_top_2grams": 0.17247387, "qsc_code_frac_chars_top_3grams": 0.26759582, "qsc_code_frac_chars_top_4grams": 0.0533101, "qsc_code_frac_chars_dupe_5grams": 0.32543554, "qsc_code_frac_chars_dupe_6grams": 0.28397213, "qsc_code_frac_chars_dupe_7grams": 0.26445993, "qsc_code_frac_chars_dupe_8grams": 0.26445993, "qsc_code_frac_chars_dupe_9grams": 0.26445993, "qsc_code_frac_chars_dupe_10grams": 0.25121951, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02741662, "qsc_code_frac_chars_whitespace": 0.14911015, "qsc_code_size_file_byte": 4158.0, "qsc_code_num_lines": 101.0, "qsc_code_num_chars_line_max": 226.0, "qsc_code_num_chars_line_mean": 41.16831683, "qsc_code_frac_chars_alphabet": 0.78377614, "qsc_code_frac_chars_comments": 0.48605099, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.17777778, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00561535, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.26666667, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 1.0, "qsc_codec_score_lines_no_logic": 0.26666667, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 1, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 1, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1technophile/OpenMQTTGateway
main/config_mqttDiscovery.h
/* OpenMQTTGateway - ESP8266 or Arduino program for home automation Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the Home assistant mqtt Discovery Copyright: (c) Rafal Herok This file is part of OpenMQTTGateway. OpenMQTTGateway is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenMQTTGateway is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef config_mqttDiscovery_h #define config_mqttDiscovery_h extern String getUniqueId(String name, String sufix); extern void pubMqttDiscovery(); /** * Create a discover messages form a list of attribute * * @param mac the MAC address * @param sensorList[][0] = component type * @param sensorList[][1] = name * @param sensorList[][2] = availability topic * @param sensorList[][3] = device class * @param sensorList[][4] = value template * @param sensorList[][5] = payload on * @param sensorList[][6] = payload off * @param sensorList[][7] = unit of measurement * @param sensorList[][8] = unit of measurement * @param sensorCount number of sensor * @param device_name name of sensors * @param device_manufacturer name of manufacturer * @param device_model the model * */ extern void createDiscoveryFromList(const char* mac, const char* sensorList[][9], int sensorCount, const char* device_name, const char* device_manufacturer, const char* device_model); /** * @brief Generate message and publish it on an MQTT discovery exploiter. For HA @see https://www.home-assistant.io/docs/mqtt/discovery/ * * @param sensor_type the Type * @param st_topic set state topic, * @param s_name set name, * @param unique_id set uniqueId * @param availability_topic set availability_topic, * @param device_class set device_class, * @param value_template set value_template, * @param payload_on set payload_on, * @param payload_off set payload_off, * @param unit_of_meas set unit_of_meas, * @param off_delay set off_delay * @param payload_available set payload_available, * @param payload_not_available set payload_not_available * @param gateway_entity set is a gateway entity, * @param cmd_topic set command topic * @param device_name set device name, * @param device_manufacturer set device manufacturer, * @param device_model set device model, * @param device_mac set device MAC, * @param retainCmd set retain * @param state_class set state class * @param state_off state off value * @param state_on state on value * @param enum_options options * @param command_template command template * @param diagnostic_entity true if entity_category is diagnostic * * */ extern void createDiscovery(const char* sensor_type, const char* state_topic, const char* s_name, const char* unique_id, const char* availability_topic, const char* device_class, const char* value_template, const char* payload_on, const char* payload_off, const char* unit_of_meas, int off_delay, const char* payload_available, const char* payload_not_available, bool gateway_entity, const char* command_topic, const char* device_name, const char* device_manufacturer, const char* device_model, const char* device_mac, bool retainCmd, const char* state_class, const char* state_off = nullptr, const char* state_on = nullptr, const char* enum_options = nullptr, const char* command_template = nullptr, bool diagnostic_entity = false); #ifdef ZgatewayRF /** * @brief Create a message for Discovery Device Trigger. For HA @see https://www.home-assistant.io/integrations/device_trigger.mqtt/ * @param topic Mandatory - The MQTT topic subscribed to receive trigger events. * @param type The type of the trigger, e.g. button_short_press. Entries supported by the HA Frontend: button_short_press, button_short_release, button_long_press, button_long_release, button_double_press, button_triple_press, button_quadruple_press, button_quintuple_press. If set to an unsupported value, will render as subtype type, e.g. button_1 spammed with type set to spammed and subtype set to button_1 * @param subtype The subtype of the trigger, e.g. button_1. Entries supported by the HA frontend: turn_on, turn_off, button_1, button_2, button_3, button_4, button_5, button_6. If set to an unsupported value, will render as subtype type, e.g. left_button pressed with type set to button_short_press and subtype set to left_button * @param object_id The object_id of the trigger. * @param value_template The template to render the value of the trigger. The template can use the variables trigger.id, trigger.type, trigger.subtype, trigger.payload, trigger.payload_json, trigger.topic, trigger.timestamp, trigger.value, trigger.value_json. The template can be a string or a JSON object. If the template is a JSON object, it must be a valid JSON object. If the template is a string, it will be rendered as a string. If the template is a JSON object, it will be rendered as a JSON object. */ void announceGatewayTrigger(const char* topic, const char* type, const char* subtype, const char* object_id, const char* value_template); #endif // ZgatewayRF #ifdef discovery_Topic //Deprecated - use discovery_Prefix instead # pragma message("compiler directive discovery_Topic is deprecated, use discovery_Prefix instead") # define discovery_Prefix discovery_Topic #endif #ifndef discovery_Prefix # define discovery_Prefix "homeassistant" #endif extern char discovery_prefix[]; // discovery_republish_on_reconnect false to publish discovery topics over MQTT only with first connect // discovery_republish_on_reconnect true to always republish discovery topics over MQTT when connection is re-established #ifndef discovery_republish_on_reconnect # define discovery_republish_on_reconnect false #endif #ifndef DiscoveryAutoOffTimer # define DiscoveryAutoOffTimer 1800000 // Timer (ms) that trigger auto discovery to off after activation, the goal is to avoid the discovery of entities that are not expected #endif #ifndef GATEWAY_MANUFACTURER # define GATEWAY_MANUFACTURER "OMG_community" #endif #ifndef ForceDeviceName # define ForceDeviceName false // Set to true to force the device name to be from the name of the device and not the model #endif /*-------------- Auto discovery macros-----------------*/ // Home assistant autodiscovery value key definition #define jsonBatt "{{ value_json.batt | is_defined }}" #define jsonLux "{{ value_json.lux | is_defined }}" #define jsonPres "{{ value_json.pres | is_defined }}" #define jsonFer "{{ value_json.fer | is_defined }}" #define jsonFor "{{ value_json.for | is_defined }}" #define jsonMoi "{{ value_json.moi | is_defined }}" #define jsonHum "{{ value_json.hum | is_defined }}" #define jsonStep "{{ value_json.steps | is_defined }}" #define jsonWeight "{{ value_json.weight | is_defined }}" #define jsonPresence "{{ value_json.presence | is_defined }}" #define jsonAltim "{{ value_json.altim | is_defined }}" #define jsonAltif "{{ value_json.altift | is_defined }}" #define jsonTempc "{{ value_json.tempc | is_defined }}" #define jsonTempc2 "{{ value_json.tempc2 | is_defined }}" #define jsonTempc3 "{{ value_json.tempc3 | is_defined }}" #define jsonTempc4 "{{ value_json.tempc4 | is_defined }}" #define jsonTempf "{{ value_json.tempf | is_defined }}" #define jsonMsg "{{ value_json.message | is_defined }}" #define jsonVal "{{ value_json.value | is_defined }}" #define jsonVolt "{{ value_json.volt | is_defined }}" #define jsonCurrent "{{ value_json.current | is_defined }}" #define jsonPower "{{ value_json.power | is_defined }}" #define jsonEnergy "{{ value_json.energy | is_defined }}" #define jsonGpio "{{ value_json.gpio | is_defined }}" #define jsonFtcd "{{ value_json.ftcd | is_defined }}" #define jsonWm2 "{{ value_json.wattsm2 | is_defined }}" #define jsonAdc "{{ value_json.adc | is_defined }}" #define jsonPa "{{ float(value_json.pa) * 0.01 | is_defined }}" #define jsonId "{{ value_json.id | is_defined }}" #define jsonAddress "{{ value_json.address | is_defined }}" #define jsonOpen "{{ value_json.open | is_defined }}" #define jsonTime "{{ value_json.time | is_defined }}" #define jsonCount "{{ value_json.count | is_defined }}" #define jsonAlarm "{{ value_json.alarm | is_defined }}" #define jsonInuse "{{ value_json.power | is_defined | float > 0 }}" #define jsonInuseRN8209 "{% if value_json.power > 0.02 -%} on {% else %} off {%- endif %}" #define jsonVoltBM2 "{% if value_json.uuid is not defined and value_json.volt is defined -%} {{value_json.volt}} {%- endif %}" #define jsonRSSI "{{ value_json.rssi | is_defined }}" #define stateClassNone "" #define stateClassMeasurement "measurement" #define stateClassTotal "total" #define stateClassTotalIncreasing "total_increasing" // Define all HASS device classes as macros for reuse and consistency #define HASS_CLASS_BATTERY_CHARGING "battery_charging" #define HASS_CLASS_BATTERY "battery" #define HASS_CLASS_CARBON_DIOXIDE "carbon_dioxide" #define HASS_CLASS_CARBON_MONOXIDE "carbon_monoxide" #define HASS_CLASS_CONNECTIVITY "connectivity" #define HASS_CLASS_CURRENT "current" #define HASS_CLASS_DATA_SIZE "data_size" #define HASS_CLASS_DISTANCE "distance" #define HASS_CLASS_DOOR "door" #define HASS_CLASS_DURATION "duration" #define HASS_CLASS_ENERGY "energy" #define HASS_CLASS_ENUM "enum" #define HASS_CLASS_FREQUENCY "frequency" #define HASS_CLASS_GAS "gas" #define HASS_CLASS_HUMIDITY "humidity" #define HASS_CLASS_ILLUMINANCE "illuminance" #define HASS_CLASS_IRRADIANCE "irradiance" #define HASS_CLASS_LOCK "lock" #define HASS_CLASS_MOTION "motion" #define HASS_CLASS_MOVING "moving" #define HASS_CLASS_OCCUPANCY "occupancy" #define HASS_CLASS_PM1 "pm1" #define HASS_CLASS_PM10 "pm10" #define HASS_CLASS_PM25 "pm25" #define HASS_CLASS_POWER_FACTOR "power_factor" #define HASS_CLASS_POWER "power" #define HASS_CLASS_PRECIPITATION_INTENSITY "precipitation_intensity" #define HASS_CLASS_PRECIPITATION "precipitation" #define HASS_CLASS_PRESSURE "pressure" #define HASS_CLASS_PROBLEM "problem" #define HASS_CLASS_RESTART "restart" #define HASS_CLASS_SIGNAL_STRENGTH "signal_strength" #define HASS_CLASS_SOUND_PRESSURE "sound_pressure" #define HASS_CLASS_TEMPERATURE "temperature" #define HASS_CLASS_TIMESTAMP "timestamp" #define HASS_CLASS_VOLTAGE "voltage" #define HASS_CLASS_WATER "water" #define HASS_CLASS_WEIGHT "weight" #define HASS_CLASS_WIND_SPEED "wind_speed" #define HASS_CLASS_WINDOW "window" // Define all HASS units as macros for reuse and consistency #define HASS_UNIT_AMP "A" #define HASS_UNIT_BYTE "B" #define HASS_UNIT_UV_INDEX "UV index" #define HASS_UNIT_VOLT "V" #define HASS_UNIT_WATT "W" #define HASS_UNIT_BPM "bpm" #define HASS_UNIT_BAR "bar" #define HASS_UNIT_CM "cm" #define HASS_UNIT_DB "dB" #define HASS_UNIT_DBM "dBm" #define HASS_UNIT_FT "ft" #define HASS_UNIT_HOUR "h" #define HASS_UNIT_HPA "hPa" #define HASS_UNIT_HZ "Hz" #define HASS_UNIT_KG "kg" #define HASS_UNIT_KW "kW" #define HASS_UNIT_KWH "kWh" #define HASS_UNIT_KMH "km/h" #define HASS_UNIT_LB "lb" #define HASS_UNIT_LITER "L" #define HASS_UNIT_LX "lx" #define HASS_UNIT_MS "m/s" #define HASS_UNIT_MS2 "m/s²" #define HASS_UNIT_M3 "m³" #define HASS_UNIT_MGM3 "mg/m³" #define HASS_UNIT_MIN "min" #define HASS_UNIT_MM "mm" #define HASS_UNIT_MMH "mm/h" #define HASS_UNIT_MILLISECOND "ms" #define HASS_UNIT_MV "mV" #define HASS_UNIT_USCM "µS/cm" #define HASS_UNIT_UGM3 "μg/m³" #define HASS_UNIT_OHM "Ω" #define HASS_UNIT_PERCENT "%" #define HASS_UNIT_DEGREE "°" #define HASS_UNIT_CELSIUS "°C" #define HASS_UNIT_FAHRENHEIT "°F" #define HASS_UNIT_SECOND "s" #define HASS_UNIT_WB2 "wb²" // Additional commonly used units not in the standard list #define HASS_UNIT_METER "m" #define HASS_UNIT_PPM "ppm" #define HASS_UNIT_WM2 "wm²" #define HASS_TYPE_SENSOR "sensor" #define HASS_TYPE_BINARY_SENSOR "binary_sensor" #define HASS_TYPE_SWITCH "switch" #define HASS_TYPE_BUTTON "button" #define HASS_TYPE_NUMBER "number" #define HASS_TYPE_UPDATE "update" #define HASS_TYPE_COVER "cover" #define HASS_TYPE_DEVICE_TRACKER "device_tracker" // Define the command used to update through OTA depending if we want to update from dev nightly or latest release #if DEVELOPMENTOTA # define LATEST_OR_DEV "{\"version\":\"dev\"}" #else # define LATEST_OR_DEV "{\"version\":\"latest\"}" #endif #endif
14,572
config_mqttDiscovery
h
en
c
code
{"qsc_code_num_words": 1858, "qsc_code_num_chars": 14572.0, "qsc_code_mean_word_length": 5.1189451, "qsc_code_frac_words_unique": 0.24757804, "qsc_code_frac_chars_top_2grams": 0.09462727, "qsc_code_frac_chars_top_3grams": 0.06182315, "qsc_code_frac_chars_top_4grams": 0.0121964, "qsc_code_frac_chars_dupe_5grams": 0.10114604, "qsc_code_frac_chars_dupe_6grams": 0.06939333, "qsc_code_frac_chars_dupe_7grams": 0.0489959, "qsc_code_frac_chars_dupe_8grams": 0.04521081, "qsc_code_frac_chars_dupe_9grams": 0.02439281, "qsc_code_frac_chars_dupe_10grams": 0.02439281, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00683945, "qsc_code_frac_chars_whitespace": 0.23744167, "qsc_code_size_file_byte": 14572.0, "qsc_code_num_lines": 290.0, "qsc_code_num_chars_line_max": 514.0, "qsc_code_num_chars_line_mean": 50.24827586, "qsc_code_frac_chars_alphabet": 0.8488121, "qsc_code_frac_chars_comments": 0.37132858, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.03867403, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00552486, "qsc_code_frac_chars_string_length": 0.22945093, "qsc_code_frac_chars_long_word_length": 0.00251064, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.03314917, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.03314917, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1ultimat3/BadIntent
README.md
# BadIntent ## Introduction BadIntent is the missing link between the Burp Suite and the core Android's IPC/Messaging-system. BadIntent consists of two parts, an Xposed-based module running on Android and a Burp-plugin. Based on this interplay, it is possible to use the Burp's common workflow and all involved tools and extensions, since the intercept and repeater functionality is provided. BadIntent hooks deeply into the Android system, performs various method redirections in Parcels and adds additional services to provide the described features. Most notably, BadIntent works system-wide (**experimental**) and is not restricted to individual user apps. BadIntent can used to perform various pentesting activities such as the following [examples](https://github.com/mateuszk87/BadIntent/wiki/Showcases): * identifying [insecure logging](https://github.com/mateuszk87/BadIntent/wiki/Showcases#insecure-logging), [access control issues](https://github.com/mateuszk87/BadIntent/wiki/Showcases#access-control-issues), [pasteboard vulnerabilities](https://github.com/mateuszk87/BadIntent/wiki/Showcases#pasteboard-vulnerability), * conduct and configure [intent sniffing](https://github.com/mateuszk87/BadIntent/wiki/Showcases#intent-sniffing), [brute force attacks](https://github.com/mateuszk87/BadIntent/wiki/Showcases#brute-force), * [AIDL testing](https://github.com/mateuszk87/BadIntent/wiki/Showcases#aidl-testing), [GCM attacks](https://github.com/mateuszk87/BadIntent/wiki/Showcases#cloud-messaging), and searching for [WebView vulnerabilities](https://github.com/mateuszk87/BadIntent/wiki/Showcases#mobile-xss-web-view) * and finally how BadIntent can be (mis-)used as a [keylogger](https://github.com/mateuszk87/BadIntent/wiki/Showcases#keylogger) <img src="https://github.com/mateuszk87/BadIntent/blob/master/doc/img/main.png" width="700" /> ## Installation The most handy approach is to install BadIntent Android from the Xposed Module Repository and BadIntent Burp from the Burp’s BApp Store. Both are made available/submitted before the Arsenal presentation of BadIntent in Black Hat Las Vegas 2017. * [Xposed Repo Module](http://repo.xposed.info/module/de.mat3.badintent) * [BApp Store Ref](https://portswigger.net/bappstore/bapps/) ## Environment BadIntent has been tested on Genymotion with Xposed v87 on Android Marshmallow (6.0) and Burp Suite 1.7.23 (Free and Pro). There are known limitations in hooking all system apps and all interfaces. During the boot proccess the Android system will remain in a boot loop and you will not be able to uninstall BadIntent from your Android device. Therefore, it is strongly recommended to use the mentioned setup in case all system apps are hooked. ## Configuration & Usage Please refer to the [wiki](https://github.com/mateuszk87/BadIntent/wiki) for more details. ## License BadIntent is released under a 3-clause BSD License. See LICENSE for full details.
2,949
README
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.20541401, "qsc_doc_num_sentences": 35.0, "qsc_doc_num_words": 424, "qsc_doc_num_chars": 2949.0, "qsc_doc_num_lines": 34.0, "qsc_doc_mean_word_length": 5.53773585, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.49292453, "qsc_doc_entropy_unigram": 4.82971413, "qsc_doc_frac_words_all_caps": 0.00796178, "qsc_doc_frac_lines_dupe_lines": 0.0, "qsc_doc_frac_chars_dupe_lines": 0.0, "qsc_doc_frac_chars_top_2grams": 0.05621806, "qsc_doc_frac_chars_top_3grams": 0.07155026, "qsc_doc_frac_chars_top_4grams": 0.12265758, "qsc_doc_frac_chars_dupe_5grams": 0.24446337, "qsc_doc_frac_chars_dupe_6grams": 0.23040886, "qsc_doc_frac_chars_dupe_7grams": 0.21465077, "qsc_doc_frac_chars_dupe_8grams": 0.09710392, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 1.0, "qsc_doc_num_chars_sentence_length_mean": 41.14285714, "qsc_doc_frac_chars_hyperlink_html_tag": 0.31976941, "qsc_doc_frac_chars_alphabet": 0.88188073, "qsc_doc_frac_chars_digital": 0.01567278, "qsc_doc_frac_chars_whitespace": 0.11291963, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-admin/src/main/resources/static/ajax/libs/summernote/summernote.js
/** * Super simple wysiwyg editor v0.8.12 * https://summernote.org * * Copyright 2013- Alan Hong. and other contributors * summernote may be freely distributed under the MIT license. * * Date: 2019-05-16T08:16Z */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global = global || self, factory(global.jQuery)); }(this, function ($$1) { 'use strict'; $$1 = $$1 && $$1.hasOwnProperty('default') ? $$1['default'] : $$1; var Renderer = /** @class */ (function () { function Renderer(markup, children, options, callback) { this.markup = markup; this.children = children; this.options = options; this.callback = callback; } Renderer.prototype.render = function ($parent) { var $node = $$1(this.markup); if (this.options && this.options.contents) { $node.html(this.options.contents); } if (this.options && this.options.className) { $node.addClass(this.options.className); } if (this.options && this.options.data) { $$1.each(this.options.data, function (k, v) { $node.attr('data-' + k, v); }); } if (this.options && this.options.click) { $node.on('click', this.options.click); } if (this.children) { var $container_1 = $node.find('.note-children-container'); this.children.forEach(function (child) { child.render($container_1.length ? $container_1 : $node); }); } if (this.callback) { this.callback($node, this.options); } if (this.options && this.options.callback) { this.options.callback($node); } if ($parent) { $parent.append($node); } return $node; }; return Renderer; }()); var renderer = { create: function (markup, callback) { return function () { var options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0]; var children = Array.isArray(arguments[0]) ? arguments[0] : []; if (options && options.children) { children = options.children; } return new Renderer(markup, children, options, callback); }; } }; var editor = renderer.create('<div class="note-editor note-frame panel panel-default"/>'); var toolbar = renderer.create('<div class="note-toolbar panel-heading" role="toolbar"></div></div>'); var editingArea = renderer.create('<div class="note-editing-area"/>'); var codable = renderer.create('<textarea class="note-codable" role="textbox" aria-multiline="true"/>'); var editable = renderer.create('<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>'); var statusbar = renderer.create([ '<output class="note-status-output" aria-live="polite"/>', '<div class="note-statusbar" role="status">', ' <div class="note-resizebar" role="seperator" aria-orientation="horizontal" aria-label="Resize">', ' <div class="note-icon-bar"/>', ' <div class="note-icon-bar"/>', ' <div class="note-icon-bar"/>', ' </div>', '</div>', ].join('')); var airEditor = renderer.create('<div class="note-editor"/>'); var airEditable = renderer.create([ '<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>', '<output class="note-status-output" aria-live="polite"/>', ].join('')); var buttonGroup = renderer.create('<div class="note-btn-group btn-group">'); var dropdown = renderer.create('<ul class="dropdown-menu" role="list">', function ($node, options) { var markup = Array.isArray(options.items) ? options.items.map(function (item) { var value = (typeof item === 'string') ? item : (item.value || ''); var content = options.template ? options.template(item) : item; var option = (typeof item === 'object') ? item.option : undefined; var dataValue = 'data-value="' + value + '"'; var dataOption = (option !== undefined) ? ' data-option="' + option + '"' : ''; return '<li role="listitem" aria-label="' + value + '"><a href="#" ' + (dataValue + dataOption) + '>' + content + '</a></li>'; }).join('') : options.items; $node.html(markup).attr({ 'aria-label': options.title }); }); var dropdownButtonContents = function (contents, options) { return contents + ' ' + icon(options.icons.caret, 'span'); }; var dropdownCheck = renderer.create('<ul class="dropdown-menu note-check" role="list">', function ($node, options) { var markup = Array.isArray(options.items) ? options.items.map(function (item) { var value = (typeof item === 'string') ? item : (item.value || ''); var content = options.template ? options.template(item) : item; return '<li role="listitem" aria-label="' + item + '"><a href="#" data-value="' + value + '">' + icon(options.checkClassName) + ' ' + content + '</a></li>'; }).join('') : options.items; $node.html(markup).attr({ 'aria-label': options.title }); }); var palette = renderer.create('<div class="note-color-palette"/>', function ($node, options) { var contents = []; for (var row = 0, rowSize = options.colors.length; row < rowSize; row++) { var eventName = options.eventName; var colors = options.colors[row]; var colorsName = options.colorsName[row]; var buttons = []; for (var col = 0, colSize = colors.length; col < colSize; col++) { var color = colors[col]; var colorName = colorsName[col]; buttons.push([ '<button type="button" class="note-color-btn"', 'style="background-color:', color, '" ', 'data-event="', eventName, '" ', 'data-value="', color, '" ', 'title="', colorName, '" ', 'aria-label="', colorName, '" ', 'data-toggle="button" tabindex="-1"></button>', ].join('')); } contents.push('<div class="note-color-row">' + buttons.join('') + '</div>'); } $node.html(contents.join('')); if (options.tooltip) { $node.find('.note-color-btn').tooltip({ container: options.container, trigger: 'hover', placement: 'bottom' }); } }); var dialog = renderer.create('<div class="modal" aria-hidden="false" tabindex="-1" role="dialog"/>', function ($node, options) { if (options.fade) { $node.addClass('fade'); } $node.attr({ 'aria-label': options.title }); $node.html([ '<div class="modal-dialog">', ' <div class="modal-content">', (options.title ? ' <div class="modal-header">' + ' <button type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true">&times;</button>' + ' <h4 class="modal-title">' + options.title + '</h4>' + ' </div>' : ''), ' <div class="modal-body">' + options.body + '</div>', (options.footer ? ' <div class="modal-footer">' + options.footer + '</div>' : ''), ' </div>', '</div>', ].join('')); }); var popover = renderer.create([ '<div class="note-popover popover in">', ' <div class="arrow"/>', ' <div class="popover-content note-children-container"/>', '</div>', ].join(''), function ($node, options) { var direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom'; $node.addClass(direction); if (options.hideArrow) { $node.find('.arrow').hide(); } }); var checkbox = renderer.create('<div class="checkbox"></div>', function ($node, options) { $node.html([ '<label' + (options.id ? ' for="' + options.id + '"' : '') + '>', ' <input role="checkbox" type="checkbox"' + (options.id ? ' id="' + options.id + '"' : ''), (options.checked ? ' checked' : ''), ' aria-checked="' + (options.checked ? 'true' : 'false') + '"/>', (options.text ? options.text : ''), '</label>', ].join('')); }); var icon = function (iconClassName, tagName) { tagName = tagName || 'i'; return '<' + tagName + ' class="' + iconClassName + '"/>'; }; var ui = { editor: editor, toolbar: toolbar, editingArea: editingArea, codable: codable, editable: editable, statusbar: statusbar, airEditor: airEditor, airEditable: airEditable, buttonGroup: buttonGroup, dropdown: dropdown, dropdownButtonContents: dropdownButtonContents, dropdownCheck: dropdownCheck, palette: palette, dialog: dialog, popover: popover, checkbox: checkbox, icon: icon, options: {}, button: function ($node, options) { return renderer.create('<button type="button" class="note-btn btn btn-default btn-sm" role="button" tabindex="-1">', function ($node, options) { if (options && options.tooltip) { $node.attr({ title: options.tooltip, 'aria-label': options.tooltip }).tooltip({ container: (options.container !== undefined) ? options.container : 'body', trigger: 'hover', placement: 'bottom' }).on('click', function (e) { $$1(e.currentTarget).tooltip('hide'); }); } })($node, options); }, toggleBtn: function ($btn, isEnable) { $btn.toggleClass('disabled', !isEnable); $btn.attr('disabled', !isEnable); }, toggleBtnActive: function ($btn, isActive) { $btn.toggleClass('active', isActive); }, onDialogShown: function ($dialog, handler) { $dialog.one('shown.bs.modal', handler); }, onDialogHidden: function ($dialog, handler) { $dialog.one('hidden.bs.modal', handler); }, showDialog: function ($dialog) { $dialog.modal('show'); }, hideDialog: function ($dialog) { $dialog.modal('hide'); }, createLayout: function ($note, options) { var $editor = (options.airMode ? ui.airEditor([ ui.editingArea([ ui.airEditable(), ]), ]) : ui.editor([ ui.toolbar(), ui.editingArea([ ui.codable(), ui.editable(), ]), ui.statusbar(), ])).render(); $editor.insertAfter($note); return { note: $note, editor: $editor, toolbar: $editor.find('.note-toolbar'), editingArea: $editor.find('.note-editing-area'), editable: $editor.find('.note-editable'), codable: $editor.find('.note-codable'), statusbar: $editor.find('.note-statusbar') }; }, removeLayout: function ($note, layoutInfo) { $note.html(layoutInfo.editable.html()); layoutInfo.editor.remove(); $note.show(); } }; $$1.summernote = $$1.summernote || { lang: {} }; $$1.extend($$1.summernote.lang, { 'en-US': { font: { bold: 'Bold', italic: 'Italic', underline: 'Underline', clear: 'Remove Font Style', height: 'Line Height', name: 'Font Family', strikethrough: 'Strikethrough', subscript: 'Subscript', superscript: 'Superscript', size: 'Font Size' }, image: { image: 'Picture', insert: 'Insert Image', resizeFull: 'Resize full', resizeHalf: 'Resize half', resizeQuarter: 'Resize quarter', resizeNone: 'Original size', floatLeft: 'Float Left', floatRight: 'Float Right', floatNone: 'Remove float', shapeRounded: 'Shape: Rounded', shapeCircle: 'Shape: Circle', shapeThumbnail: 'Shape: Thumbnail', shapeNone: 'Shape: None', dragImageHere: 'Drag image or text here', dropImage: 'Drop image or Text', selectFromFiles: 'Select from files', maximumFileSize: 'Maximum file size', maximumFileSizeError: 'Maximum file size exceeded.', url: 'Image URL', remove: 'Remove Image', original: 'Original' }, video: { video: 'Video', videoLink: 'Video Link', insert: 'Insert Video', url: 'Video URL', providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)' }, link: { link: 'Link', insert: 'Insert Link', unlink: 'Unlink', edit: 'Edit', textToDisplay: 'Text to display', url: 'To what URL should this link go?', openInNewWindow: 'Open in new window' }, table: { table: 'Table', addRowAbove: 'Add row above', addRowBelow: 'Add row below', addColLeft: 'Add column left', addColRight: 'Add column right', delRow: 'Delete row', delCol: 'Delete column', delTable: 'Delete table' }, hr: { insert: 'Insert Horizontal Rule' }, style: { style: 'Style', p: 'Normal', blockquote: 'Quote', pre: 'Code', h1: 'Header 1', h2: 'Header 2', h3: 'Header 3', h4: 'Header 4', h5: 'Header 5', h6: 'Header 6' }, lists: { unordered: 'Unordered list', ordered: 'Ordered list' }, options: { help: 'Help', fullscreen: 'Full Screen', codeview: 'Code View' }, paragraph: { paragraph: 'Paragraph', outdent: 'Outdent', indent: 'Indent', left: 'Align left', center: 'Align center', right: 'Align right', justify: 'Justify full' }, color: { recent: 'Recent Color', more: 'More Color', background: 'Background Color', foreground: 'Foreground Color', transparent: 'Transparent', setTransparent: 'Set transparent', reset: 'Reset', resetToDefault: 'Reset to default', cpSelect: 'Select' }, shortcut: { shortcuts: 'Keyboard shortcuts', close: 'Close', textFormatting: 'Text formatting', action: 'Action', paragraphFormatting: 'Paragraph formatting', documentStyle: 'Document Style', extraKeys: 'Extra keys' }, help: { 'insertParagraph': 'Insert Paragraph', 'undo': 'Undoes the last command', 'redo': 'Redoes the last command', 'tab': 'Tab', 'untab': 'Untab', 'bold': 'Set a bold style', 'italic': 'Set a italic style', 'underline': 'Set a underline style', 'strikethrough': 'Set a strikethrough style', 'removeFormat': 'Clean a style', 'justifyLeft': 'Set left align', 'justifyCenter': 'Set center align', 'justifyRight': 'Set right align', 'justifyFull': 'Set full align', 'insertUnorderedList': 'Toggle unordered list', 'insertOrderedList': 'Toggle ordered list', 'outdent': 'Outdent on current paragraph', 'indent': 'Indent on current paragraph', 'formatPara': 'Change current block\'s format as a paragraph(P tag)', 'formatH1': 'Change current block\'s format as H1', 'formatH2': 'Change current block\'s format as H2', 'formatH3': 'Change current block\'s format as H3', 'formatH4': 'Change current block\'s format as H4', 'formatH5': 'Change current block\'s format as H5', 'formatH6': 'Change current block\'s format as H6', 'insertHorizontalRule': 'Insert horizontal rule', 'linkDialog.show': 'Show Link Dialog' }, history: { undo: 'Undo', redo: 'Redo' }, specialChar: { specialChar: 'SPECIAL CHARACTERS', select: 'Select Special characters' } } }); var isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line /** * returns whether font is installed or not. * * @param {String} fontName * @return {Boolean} */ function isFontInstalled(fontName) { var testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS'; var testText = 'mmmmmmmmmmwwwww'; var testSize = '200px'; var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); context.font = testSize + " '" + testFontName + "'"; var originalWidth = context.measureText(testText).width; context.font = testSize + " '" + fontName + "', '" + testFontName + "'"; var width = context.measureText(testText).width; return originalWidth !== width; } var userAgent = navigator.userAgent; var isMSIE = /MSIE|Trident/i.test(userAgent); var browserVersion; if (isMSIE) { var matches = /MSIE (\d+[.]\d+)/.exec(userAgent); if (matches) { browserVersion = parseFloat(matches[1]); } matches = /Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent); if (matches) { browserVersion = parseFloat(matches[1]); } } var isEdge = /Edge\/\d+/.test(userAgent); var hasCodeMirror = !!window.CodeMirror; var isSupportTouch = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); // [workaround] IE doesn't have input events for contentEditable // - see: https://goo.gl/4bfIvA var inputEventName = (isMSIE || isEdge) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input'; /** * @class core.env * * Object which check platform and agent * * @singleton * @alternateClassName env */ var env = { isMac: navigator.appVersion.indexOf('Mac') > -1, isMSIE: isMSIE, isEdge: isEdge, isFF: !isEdge && /firefox/i.test(userAgent), isPhantom: /PhantomJS/i.test(userAgent), isWebkit: !isEdge && /webkit/i.test(userAgent), isChrome: !isEdge && /chrome/i.test(userAgent), isSafari: !isEdge && /safari/i.test(userAgent), browserVersion: browserVersion, jqueryVersion: parseFloat($$1.fn.jquery), isSupportAmd: isSupportAmd, isSupportTouch: isSupportTouch, hasCodeMirror: hasCodeMirror, isFontInstalled: isFontInstalled, isW3CRangeSupport: !!document.createRange, inputEventName: inputEventName }; /** * @class core.func * * func utils (for high-order func's arg) * * @singleton * @alternateClassName func */ function eq(itemA) { return function (itemB) { return itemA === itemB; }; } function eq2(itemA, itemB) { return itemA === itemB; } function peq2(propName) { return function (itemA, itemB) { return itemA[propName] === itemB[propName]; }; } function ok() { return true; } function fail() { return false; } function not(f) { return function () { return !f.apply(f, arguments); }; } function and(fA, fB) { return function (item) { return fA(item) && fB(item); }; } function self(a) { return a; } function invoke(obj, method) { return function () { return obj[method].apply(obj, arguments); }; } var idCounter = 0; /** * generate a globally-unique id * * @param {String} [prefix] */ function uniqueId(prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; } /** * returns bnd (bounds) from rect * * - IE Compatibility Issue: http://goo.gl/sRLOAo * - Scroll Issue: http://goo.gl/sNjUc * * @param {Rect} rect * @return {Object} bounds * @return {Number} bounds.top * @return {Number} bounds.left * @return {Number} bounds.width * @return {Number} bounds.height */ function rect2bnd(rect) { var $document = $(document); return { top: rect.top + $document.scrollTop(), left: rect.left + $document.scrollLeft(), width: rect.right - rect.left, height: rect.bottom - rect.top }; } /** * returns a copy of the object where the keys have become the values and the values the keys. * @param {Object} obj * @return {Object} */ function invertObject(obj) { var inverted = {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { inverted[obj[key]] = key; } } return inverted; } /** * @param {String} namespace * @param {String} [prefix] * @return {String} */ function namespaceToCamel(namespace, prefix) { prefix = prefix || ''; return prefix + namespace.split('.').map(function (name) { return name.substring(0, 1).toUpperCase() + name.substring(1); }).join(''); } /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The function will be called after it stops being called for * N milliseconds. If `immediate` is passed, trigger the function on the * leading edge, instead of the trailing. * @param {Function} func * @param {Number} wait * @param {Boolean} immediate * @return {Function} */ function debounce(func, wait, immediate) { var timeout; return function () { var context = this; var args = arguments; var later = function () { timeout = null; if (!immediate) { func.apply(context, args); } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) { func.apply(context, args); } }; } /** * * @param {String} url * @return {Boolean} */ function isValidUrl(url) { var expression = /[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi; return expression.test(url); } var func = { eq: eq, eq2: eq2, peq2: peq2, ok: ok, fail: fail, self: self, not: not, and: and, invoke: invoke, uniqueId: uniqueId, rect2bnd: rect2bnd, invertObject: invertObject, namespaceToCamel: namespaceToCamel, debounce: debounce, isValidUrl: isValidUrl }; /** * returns the first item of an array. * * @param {Array} array */ function head(array) { return array[0]; } /** * returns the last item of an array. * * @param {Array} array */ function last(array) { return array[array.length - 1]; } /** * returns everything but the last entry of the array. * * @param {Array} array */ function initial(array) { return array.slice(0, array.length - 1); } /** * returns the rest of the items in an array. * * @param {Array} array */ function tail(array) { return array.slice(1); } /** * returns item of array */ function find(array, pred) { for (var idx = 0, len = array.length; idx < len; idx++) { var item = array[idx]; if (pred(item)) { return item; } } } /** * returns true if all of the values in the array pass the predicate truth test. */ function all(array, pred) { for (var idx = 0, len = array.length; idx < len; idx++) { if (!pred(array[idx])) { return false; } } return true; } /** * returns true if the value is present in the list. */ function contains(array, item) { if (array && array.length && item) { return array.indexOf(item) !== -1; } return false; } /** * get sum from a list * * @param {Array} array - array * @param {Function} fn - iterator */ function sum(array, fn) { fn = fn || func.self; return array.reduce(function (memo, v) { return memo + fn(v); }, 0); } /** * returns a copy of the collection with array type. * @param {Collection} collection - collection eg) node.childNodes, ... */ function from(collection) { var result = []; var length = collection.length; var idx = -1; while (++idx < length) { result[idx] = collection[idx]; } return result; } /** * returns whether list is empty or not */ function isEmpty(array) { return !array || !array.length; } /** * cluster elements by predicate function. * * @param {Array} array - array * @param {Function} fn - predicate function for cluster rule * @param {Array[]} */ function clusterBy(array, fn) { if (!array.length) { return []; } var aTail = tail(array); return aTail.reduce(function (memo, v) { var aLast = last(memo); if (fn(last(aLast), v)) { aLast[aLast.length] = v; } else { memo[memo.length] = [v]; } return memo; }, [[head(array)]]); } /** * returns a copy of the array with all false values removed * * @param {Array} array - array * @param {Function} fn - predicate function for cluster rule */ function compact(array) { var aResult = []; for (var idx = 0, len = array.length; idx < len; idx++) { if (array[idx]) { aResult.push(array[idx]); } } return aResult; } /** * produces a duplicate-free version of the array * * @param {Array} array */ function unique(array) { var results = []; for (var idx = 0, len = array.length; idx < len; idx++) { if (!contains(results, array[idx])) { results.push(array[idx]); } } return results; } /** * returns next item. * @param {Array} array */ function next(array, item) { if (array && array.length && item) { var idx = array.indexOf(item); return idx === -1 ? null : array[idx + 1]; } return null; } /** * returns prev item. * @param {Array} array */ function prev(array, item) { if (array && array.length && item) { var idx = array.indexOf(item); return idx === -1 ? null : array[idx - 1]; } return null; } /** * @class core.list * * list utils * * @singleton * @alternateClassName list */ var lists = { head: head, last: last, initial: initial, tail: tail, prev: prev, next: next, find: find, contains: contains, all: all, sum: sum, from: from, isEmpty: isEmpty, clusterBy: clusterBy, compact: compact, unique: unique }; var NBSP_CHAR = String.fromCharCode(160); var ZERO_WIDTH_NBSP_CHAR = '\ufeff'; /** * @method isEditable * * returns whether node is `note-editable` or not. * * @param {Node} node * @return {Boolean} */ function isEditable(node) { return node && $$1(node).hasClass('note-editable'); } /** * @method isControlSizing * * returns whether node is `note-control-sizing` or not. * * @param {Node} node * @return {Boolean} */ function isControlSizing(node) { return node && $$1(node).hasClass('note-control-sizing'); } /** * @method makePredByNodeName * * returns predicate which judge whether nodeName is same * * @param {String} nodeName * @return {Function} */ function makePredByNodeName(nodeName) { nodeName = nodeName.toUpperCase(); return function (node) { return node && node.nodeName.toUpperCase() === nodeName; }; } /** * @method isText * * * * @param {Node} node * @return {Boolean} true if node's type is text(3) */ function isText(node) { return node && node.nodeType === 3; } /** * @method isElement * * * * @param {Node} node * @return {Boolean} true if node's type is element(1) */ function isElement(node) { return node && node.nodeType === 1; } /** * ex) br, col, embed, hr, img, input, ... * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements */ function isVoid(node) { return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase()); } function isPara(node) { if (isEditable(node)) { return false; } // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase()); } function isHeading(node) { return node && /^H[1-7]/.test(node.nodeName.toUpperCase()); } var isPre = makePredByNodeName('PRE'); var isLi = makePredByNodeName('LI'); function isPurePara(node) { return isPara(node) && !isLi(node); } var isTable = makePredByNodeName('TABLE'); var isData = makePredByNodeName('DATA'); function isInline(node) { return !isBodyContainer(node) && !isList(node) && !isHr(node) && !isPara(node) && !isTable(node) && !isBlockquote(node) && !isData(node); } function isList(node) { return node && /^UL|^OL/.test(node.nodeName.toUpperCase()); } var isHr = makePredByNodeName('HR'); function isCell(node) { return node && /^TD|^TH/.test(node.nodeName.toUpperCase()); } var isBlockquote = makePredByNodeName('BLOCKQUOTE'); function isBodyContainer(node) { return isCell(node) || isBlockquote(node) || isEditable(node); } var isAnchor = makePredByNodeName('A'); function isParaInline(node) { return isInline(node) && !!ancestor(node, isPara); } function isBodyInline(node) { return isInline(node) && !ancestor(node, isPara); } var isBody = makePredByNodeName('BODY'); /** * returns whether nodeB is closest sibling of nodeA * * @param {Node} nodeA * @param {Node} nodeB * @return {Boolean} */ function isClosestSibling(nodeA, nodeB) { return nodeA.nextSibling === nodeB || nodeA.previousSibling === nodeB; } /** * returns array of closest siblings with node * * @param {Node} node * @param {function} [pred] - predicate function * @return {Node[]} */ function withClosestSiblings(node, pred) { pred = pred || func.ok; var siblings = []; if (node.previousSibling && pred(node.previousSibling)) { siblings.push(node.previousSibling); } siblings.push(node); if (node.nextSibling && pred(node.nextSibling)) { siblings.push(node.nextSibling); } return siblings; } /** * blank HTML for cursor position * - [workaround] old IE only works with &nbsp; * - [workaround] IE11 and other browser works with bogus br */ var blankHTML = env.isMSIE && env.browserVersion < 11 ? '&nbsp;' : '<br>'; /** * @method nodeLength * * returns #text's text size or element's childNodes size * * @param {Node} node */ function nodeLength(node) { if (isText(node)) { return node.nodeValue.length; } if (node) { return node.childNodes.length; } return 0; } /** * returns whether node is empty or not. * * @param {Node} node * @return {Boolean} */ function isEmpty$1(node) { var len = nodeLength(node); if (len === 0) { return true; } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) { // ex) <p><br></p>, <span><br></span> return true; } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') { // ex) <p></p>, <span></span> return true; } return false; } /** * padding blankHTML if node is empty (for cursor position) */ function paddingBlankHTML(node) { if (!isVoid(node) && !nodeLength(node)) { node.innerHTML = blankHTML; } } /** * find nearest ancestor predicate hit * * @param {Node} node * @param {Function} pred - predicate function */ function ancestor(node, pred) { while (node) { if (pred(node)) { return node; } if (isEditable(node)) { break; } node = node.parentNode; } return null; } /** * find nearest ancestor only single child blood line and predicate hit * * @param {Node} node * @param {Function} pred - predicate function */ function singleChildAncestor(node, pred) { node = node.parentNode; while (node) { if (nodeLength(node) !== 1) { break; } if (pred(node)) { return node; } if (isEditable(node)) { break; } node = node.parentNode; } return null; } /** * returns new array of ancestor nodes (until predicate hit). * * @param {Node} node * @param {Function} [optional] pred - predicate function */ function listAncestor(node, pred) { pred = pred || func.fail; var ancestors = []; ancestor(node, function (el) { if (!isEditable(el)) { ancestors.push(el); } return pred(el); }); return ancestors; } /** * find farthest ancestor predicate hit */ function lastAncestor(node, pred) { var ancestors = listAncestor(node); return lists.last(ancestors.filter(pred)); } /** * returns common ancestor node between two nodes. * * @param {Node} nodeA * @param {Node} nodeB */ function commonAncestor(nodeA, nodeB) { var ancestors = listAncestor(nodeA); for (var n = nodeB; n; n = n.parentNode) { if (ancestors.indexOf(n) > -1) return n; } return null; // difference document area } /** * listing all previous siblings (until predicate hit). * * @param {Node} node * @param {Function} [optional] pred - predicate function */ function listPrev(node, pred) { pred = pred || func.fail; var nodes = []; while (node) { if (pred(node)) { break; } nodes.push(node); node = node.previousSibling; } return nodes; } /** * listing next siblings (until predicate hit). * * @param {Node} node * @param {Function} [pred] - predicate function */ function listNext(node, pred) { pred = pred || func.fail; var nodes = []; while (node) { if (pred(node)) { break; } nodes.push(node); node = node.nextSibling; } return nodes; } /** * listing descendant nodes * * @param {Node} node * @param {Function} [pred] - predicate function */ function listDescendant(node, pred) { var descendants = []; pred = pred || func.ok; // start DFS(depth first search) with node (function fnWalk(current) { if (node !== current && pred(current)) { descendants.push(current); } for (var idx = 0, len = current.childNodes.length; idx < len; idx++) { fnWalk(current.childNodes[idx]); } })(node); return descendants; } /** * wrap node with new tag. * * @param {Node} node * @param {Node} tagName of wrapper * @return {Node} - wrapper */ function wrap(node, wrapperName) { var parent = node.parentNode; var wrapper = $$1('<' + wrapperName + '>')[0]; parent.insertBefore(wrapper, node); wrapper.appendChild(node); return wrapper; } /** * insert node after preceding * * @param {Node} node * @param {Node} preceding - predicate function */ function insertAfter(node, preceding) { var next = preceding.nextSibling; var parent = preceding.parentNode; if (next) { parent.insertBefore(node, next); } else { parent.appendChild(node); } return node; } /** * append elements. * * @param {Node} node * @param {Collection} aChild */ function appendChildNodes(node, aChild) { $$1.each(aChild, function (idx, child) { node.appendChild(child); }); return node; } /** * returns whether boundaryPoint is left edge or not. * * @param {BoundaryPoint} point * @return {Boolean} */ function isLeftEdgePoint(point) { return point.offset === 0; } /** * returns whether boundaryPoint is right edge or not. * * @param {BoundaryPoint} point * @return {Boolean} */ function isRightEdgePoint(point) { return point.offset === nodeLength(point.node); } /** * returns whether boundaryPoint is edge or not. * * @param {BoundaryPoint} point * @return {Boolean} */ function isEdgePoint(point) { return isLeftEdgePoint(point) || isRightEdgePoint(point); } /** * returns whether node is left edge of ancestor or not. * * @param {Node} node * @param {Node} ancestor * @return {Boolean} */ function isLeftEdgeOf(node, ancestor) { while (node && node !== ancestor) { if (position(node) !== 0) { return false; } node = node.parentNode; } return true; } /** * returns whether node is right edge of ancestor or not. * * @param {Node} node * @param {Node} ancestor * @return {Boolean} */ function isRightEdgeOf(node, ancestor) { if (!ancestor) { return false; } while (node && node !== ancestor) { if (position(node) !== nodeLength(node.parentNode) - 1) { return false; } node = node.parentNode; } return true; } /** * returns whether point is left edge of ancestor or not. * @param {BoundaryPoint} point * @param {Node} ancestor * @return {Boolean} */ function isLeftEdgePointOf(point, ancestor) { return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor); } /** * returns whether point is right edge of ancestor or not. * @param {BoundaryPoint} point * @param {Node} ancestor * @return {Boolean} */ function isRightEdgePointOf(point, ancestor) { return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor); } /** * returns offset from parent. * * @param {Node} node */ function position(node) { var offset = 0; while ((node = node.previousSibling)) { offset += 1; } return offset; } function hasChildren(node) { return !!(node && node.childNodes && node.childNodes.length); } /** * returns previous boundaryPoint * * @param {BoundaryPoint} point * @param {Boolean} isSkipInnerOffset * @return {BoundaryPoint} */ function prevPoint(point, isSkipInnerOffset) { var node; var offset; if (point.offset === 0) { if (isEditable(point.node)) { return null; } node = point.node.parentNode; offset = position(point.node); } else if (hasChildren(point.node)) { node = point.node.childNodes[point.offset - 1]; offset = nodeLength(node); } else { node = point.node; offset = isSkipInnerOffset ? 0 : point.offset - 1; } return { node: node, offset: offset }; } /** * returns next boundaryPoint * * @param {BoundaryPoint} point * @param {Boolean} isSkipInnerOffset * @return {BoundaryPoint} */ function nextPoint(point, isSkipInnerOffset) { var node, offset; if (nodeLength(point.node) === point.offset) { if (isEditable(point.node)) { return null; } node = point.node.parentNode; offset = position(point.node) + 1; } else if (hasChildren(point.node)) { node = point.node.childNodes[point.offset]; offset = 0; } else { node = point.node; offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1; } return { node: node, offset: offset }; } /** * returns whether pointA and pointB is same or not. * * @param {BoundaryPoint} pointA * @param {BoundaryPoint} pointB * @return {Boolean} */ function isSamePoint(pointA, pointB) { return pointA.node === pointB.node && pointA.offset === pointB.offset; } /** * returns whether point is visible (can set cursor) or not. * * @param {BoundaryPoint} point * @return {Boolean} */ function isVisiblePoint(point) { if (isText(point.node) || !hasChildren(point.node) || isEmpty$1(point.node)) { return true; } var leftNode = point.node.childNodes[point.offset - 1]; var rightNode = point.node.childNodes[point.offset]; if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) { return true; } return false; } /** * @method prevPointUtil * * @param {BoundaryPoint} point * @param {Function} pred * @return {BoundaryPoint} */ function prevPointUntil(point, pred) { while (point) { if (pred(point)) { return point; } point = prevPoint(point); } return null; } /** * @method nextPointUntil * * @param {BoundaryPoint} point * @param {Function} pred * @return {BoundaryPoint} */ function nextPointUntil(point, pred) { while (point) { if (pred(point)) { return point; } point = nextPoint(point); } return null; } /** * returns whether point has character or not. * * @param {Point} point * @return {Boolean} */ function isCharPoint(point) { if (!isText(point.node)) { return false; } var ch = point.node.nodeValue.charAt(point.offset - 1); return ch && (ch !== ' ' && ch !== NBSP_CHAR); } /** * @method walkPoint * * @param {BoundaryPoint} startPoint * @param {BoundaryPoint} endPoint * @param {Function} handler * @param {Boolean} isSkipInnerOffset */ function walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) { var point = startPoint; while (point) { handler(point); if (isSamePoint(point, endPoint)) { break; } var isSkipOffset = isSkipInnerOffset && startPoint.node !== point.node && endPoint.node !== point.node; point = nextPoint(point, isSkipOffset); } } /** * @method makeOffsetPath * * return offsetPath(array of offset) from ancestor * * @param {Node} ancestor - ancestor node * @param {Node} node */ function makeOffsetPath(ancestor, node) { var ancestors = listAncestor(node, func.eq(ancestor)); return ancestors.map(position).reverse(); } /** * @method fromOffsetPath * * return element from offsetPath(array of offset) * * @param {Node} ancestor - ancestor node * @param {array} offsets - offsetPath */ function fromOffsetPath(ancestor, offsets) { var current = ancestor; for (var i = 0, len = offsets.length; i < len; i++) { if (current.childNodes.length <= offsets[i]) { current = current.childNodes[current.childNodes.length - 1]; } else { current = current.childNodes[offsets[i]]; } } return current; } /** * @method splitNode * * split element or #text * * @param {BoundaryPoint} point * @param {Object} [options] * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false * @param {Boolean} [options.isNotSplitEdgePoint] - default: false * @param {Boolean} [options.isDiscardEmptySplits] - default: false * @return {Node} right node of boundaryPoint */ function splitNode(point, options) { var isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML; var isNotSplitEdgePoint = options && options.isNotSplitEdgePoint; var isDiscardEmptySplits = options && options.isDiscardEmptySplits; if (isDiscardEmptySplits) { isSkipPaddingBlankHTML = true; } // edge case if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) { if (isLeftEdgePoint(point)) { return point.node; } else if (isRightEdgePoint(point)) { return point.node.nextSibling; } } // split #text if (isText(point.node)) { return point.node.splitText(point.offset); } else { var childNode = point.node.childNodes[point.offset]; var clone = insertAfter(point.node.cloneNode(false), point.node); appendChildNodes(clone, listNext(childNode)); if (!isSkipPaddingBlankHTML) { paddingBlankHTML(point.node); paddingBlankHTML(clone); } if (isDiscardEmptySplits) { if (isEmpty$1(point.node)) { remove(point.node); } if (isEmpty$1(clone)) { remove(clone); return point.node.nextSibling; } } return clone; } } /** * @method splitTree * * split tree by point * * @param {Node} root - split root * @param {BoundaryPoint} point * @param {Object} [options] * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false * @param {Boolean} [options.isNotSplitEdgePoint] - default: false * @return {Node} right node of boundaryPoint */ function splitTree(root, point, options) { // ex) [#text, <span>, <p>] var ancestors = listAncestor(point.node, func.eq(root)); if (!ancestors.length) { return null; } else if (ancestors.length === 1) { return splitNode(point, options); } return ancestors.reduce(function (node, parent) { if (node === point.node) { node = splitNode(point, options); } return splitNode({ node: parent, offset: node ? position(node) : nodeLength(parent) }, options); }); } /** * split point * * @param {Point} point * @param {Boolean} isInline * @return {Object} */ function splitPoint(point, isInline) { // find splitRoot, container // - inline: splitRoot is a child of paragraph // - block: splitRoot is a child of bodyContainer var pred = isInline ? isPara : isBodyContainer; var ancestors = listAncestor(point.node, pred); var topAncestor = lists.last(ancestors) || point.node; var splitRoot, container; if (pred(topAncestor)) { splitRoot = ancestors[ancestors.length - 2]; container = topAncestor; } else { splitRoot = topAncestor; container = splitRoot.parentNode; } // if splitRoot is exists, split with splitTree var pivot = splitRoot && splitTree(splitRoot, point, { isSkipPaddingBlankHTML: isInline, isNotSplitEdgePoint: isInline }); // if container is point.node, find pivot with point.offset if (!pivot && container === point.node) { pivot = point.node.childNodes[point.offset]; } return { rightNode: pivot, container: container }; } function create(nodeName) { return document.createElement(nodeName); } function createText(text) { return document.createTextNode(text); } /** * @method remove * * remove node, (isRemoveChild: remove child or not) * * @param {Node} node * @param {Boolean} isRemoveChild */ function remove(node, isRemoveChild) { if (!node || !node.parentNode) { return; } if (node.removeNode) { return node.removeNode(isRemoveChild); } var parent = node.parentNode; if (!isRemoveChild) { var nodes = []; for (var i = 0, len = node.childNodes.length; i < len; i++) { nodes.push(node.childNodes[i]); } for (var i = 0, len = nodes.length; i < len; i++) { parent.insertBefore(nodes[i], node); } } parent.removeChild(node); } /** * @method removeWhile * * @param {Node} node * @param {Function} pred */ function removeWhile(node, pred) { while (node) { if (isEditable(node) || !pred(node)) { break; } var parent = node.parentNode; remove(node); node = parent; } } /** * @method replace * * replace node with provided nodeName * * @param {Node} node * @param {String} nodeName * @return {Node} - new node */ function replace(node, nodeName) { if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) { return node; } var newNode = create(nodeName); if (node.style.cssText) { newNode.style.cssText = node.style.cssText; } appendChildNodes(newNode, lists.from(node.childNodes)); insertAfter(newNode, node); remove(node); return newNode; } var isTextarea = makePredByNodeName('TEXTAREA'); /** * @param {jQuery} $node * @param {Boolean} [stripLinebreaks] - default: false */ function value($node, stripLinebreaks) { var val = isTextarea($node[0]) ? $node.val() : $node.html(); if (stripLinebreaks) { return val.replace(/[\n\r]/g, ''); } return val; } /** * @method html * * get the HTML contents of node * * @param {jQuery} $node * @param {Boolean} [isNewlineOnBlock] */ function html($node, isNewlineOnBlock) { var markup = value($node); if (isNewlineOnBlock) { var regexTag = /<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g; markup = markup.replace(regexTag, function (match, endSlash, name) { name = name.toUpperCase(); var isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) && !!endSlash; var isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name); return match + ((isEndOfInlineContainer || isBlockNode) ? '\n' : ''); }); markup = markup.trim(); } return markup; } function posFromPlaceholder(placeholder) { var $placeholder = $$1(placeholder); var pos = $placeholder.offset(); var height = $placeholder.outerHeight(true); // include margin return { left: pos.left, top: pos.top + height }; } function attachEvents($node, events) { Object.keys(events).forEach(function (key) { $node.on(key, events[key]); }); } function detachEvents($node, events) { Object.keys(events).forEach(function (key) { $node.off(key, events[key]); }); } /** * @method isCustomStyleTag * * assert if a node contains a "note-styletag" class, * which implies that's a custom-made style tag node * * @param {Node} an HTML DOM node */ function isCustomStyleTag(node) { return node && !isText(node) && lists.contains(node.classList, 'note-styletag'); } var dom = { /** @property {String} NBSP_CHAR */ NBSP_CHAR: NBSP_CHAR, /** @property {String} ZERO_WIDTH_NBSP_CHAR */ ZERO_WIDTH_NBSP_CHAR: ZERO_WIDTH_NBSP_CHAR, /** @property {String} blank */ blank: blankHTML, /** @property {String} emptyPara */ emptyPara: "<p>" + blankHTML + "</p>", makePredByNodeName: makePredByNodeName, isEditable: isEditable, isControlSizing: isControlSizing, isText: isText, isElement: isElement, isVoid: isVoid, isPara: isPara, isPurePara: isPurePara, isHeading: isHeading, isInline: isInline, isBlock: func.not(isInline), isBodyInline: isBodyInline, isBody: isBody, isParaInline: isParaInline, isPre: isPre, isList: isList, isTable: isTable, isData: isData, isCell: isCell, isBlockquote: isBlockquote, isBodyContainer: isBodyContainer, isAnchor: isAnchor, isDiv: makePredByNodeName('DIV'), isLi: isLi, isBR: makePredByNodeName('BR'), isSpan: makePredByNodeName('SPAN'), isB: makePredByNodeName('B'), isU: makePredByNodeName('U'), isS: makePredByNodeName('S'), isI: makePredByNodeName('I'), isImg: makePredByNodeName('IMG'), isTextarea: isTextarea, isEmpty: isEmpty$1, isEmptyAnchor: func.and(isAnchor, isEmpty$1), isClosestSibling: isClosestSibling, withClosestSiblings: withClosestSiblings, nodeLength: nodeLength, isLeftEdgePoint: isLeftEdgePoint, isRightEdgePoint: isRightEdgePoint, isEdgePoint: isEdgePoint, isLeftEdgeOf: isLeftEdgeOf, isRightEdgeOf: isRightEdgeOf, isLeftEdgePointOf: isLeftEdgePointOf, isRightEdgePointOf: isRightEdgePointOf, prevPoint: prevPoint, nextPoint: nextPoint, isSamePoint: isSamePoint, isVisiblePoint: isVisiblePoint, prevPointUntil: prevPointUntil, nextPointUntil: nextPointUntil, isCharPoint: isCharPoint, walkPoint: walkPoint, ancestor: ancestor, singleChildAncestor: singleChildAncestor, listAncestor: listAncestor, lastAncestor: lastAncestor, listNext: listNext, listPrev: listPrev, listDescendant: listDescendant, commonAncestor: commonAncestor, wrap: wrap, insertAfter: insertAfter, appendChildNodes: appendChildNodes, position: position, hasChildren: hasChildren, makeOffsetPath: makeOffsetPath, fromOffsetPath: fromOffsetPath, splitTree: splitTree, splitPoint: splitPoint, create: create, createText: createText, remove: remove, removeWhile: removeWhile, replace: replace, html: html, value: value, posFromPlaceholder: posFromPlaceholder, attachEvents: attachEvents, detachEvents: detachEvents, isCustomStyleTag: isCustomStyleTag }; var Context = /** @class */ (function () { /** * @param {jQuery} $note * @param {Object} options */ function Context($note, options) { this.ui = $$1.summernote.ui; this.$note = $note; this.memos = {}; this.modules = {}; this.layoutInfo = {}; this.options = options; this.initialize(); } /** * create layout and initialize modules and other resources */ Context.prototype.initialize = function () { this.layoutInfo = this.ui.createLayout(this.$note, this.options); this._initialize(); this.$note.hide(); return this; }; /** * destroy modules and other resources and remove layout */ Context.prototype.destroy = function () { this._destroy(); this.$note.removeData('summernote'); this.ui.removeLayout(this.$note, this.layoutInfo); }; /** * destory modules and other resources and initialize it again */ Context.prototype.reset = function () { var disabled = this.isDisabled(); this.code(dom.emptyPara); this._destroy(); this._initialize(); if (disabled) { this.disable(); } }; Context.prototype._initialize = function () { var _this = this; // add optional buttons var buttons = $$1.extend({}, this.options.buttons); Object.keys(buttons).forEach(function (key) { _this.memo('button.' + key, buttons[key]); }); var modules = $$1.extend({}, this.options.modules, $$1.summernote.plugins || {}); // add and initialize modules Object.keys(modules).forEach(function (key) { _this.module(key, modules[key], true); }); Object.keys(this.modules).forEach(function (key) { _this.initializeModule(key); }); }; Context.prototype._destroy = function () { var _this = this; // destroy modules with reversed order Object.keys(this.modules).reverse().forEach(function (key) { _this.removeModule(key); }); Object.keys(this.memos).forEach(function (key) { _this.removeMemo(key); }); // trigger custom onDestroy callback this.triggerEvent('destroy', this); }; Context.prototype.code = function (html) { var isActivated = this.invoke('codeview.isActivated'); if (html === undefined) { this.invoke('codeview.sync'); return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html(); } else { if (isActivated) { this.layoutInfo.codable.val(html); } else { this.layoutInfo.editable.html(html); } this.$note.val(html); this.triggerEvent('change', html, this.layoutInfo.editable); } }; Context.prototype.isDisabled = function () { return this.layoutInfo.editable.attr('contenteditable') === 'false'; }; Context.prototype.enable = function () { this.layoutInfo.editable.attr('contenteditable', true); this.invoke('toolbar.activate', true); this.triggerEvent('disable', false); }; Context.prototype.disable = function () { // close codeview if codeview is opend if (this.invoke('codeview.isActivated')) { this.invoke('codeview.deactivate'); } this.layoutInfo.editable.attr('contenteditable', false); this.invoke('toolbar.deactivate', true); this.triggerEvent('disable', true); }; Context.prototype.triggerEvent = function () { var namespace = lists.head(arguments); var args = lists.tail(lists.from(arguments)); var callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')]; if (callback) { callback.apply(this.$note[0], args); } this.$note.trigger('summernote.' + namespace, args); }; Context.prototype.initializeModule = function (key) { var module = this.modules[key]; module.shouldInitialize = module.shouldInitialize || func.ok; if (!module.shouldInitialize()) { return; } // initialize module if (module.initialize) { module.initialize(); } // attach events if (module.events) { dom.attachEvents(this.$note, module.events); } }; Context.prototype.module = function (key, ModuleClass, withoutIntialize) { if (arguments.length === 1) { return this.modules[key]; } this.modules[key] = new ModuleClass(this); if (!withoutIntialize) { this.initializeModule(key); } }; Context.prototype.removeModule = function (key) { var module = this.modules[key]; if (module.shouldInitialize()) { if (module.events) { dom.detachEvents(this.$note, module.events); } if (module.destroy) { module.destroy(); } } delete this.modules[key]; }; Context.prototype.memo = function (key, obj) { if (arguments.length === 1) { return this.memos[key]; } this.memos[key] = obj; }; Context.prototype.removeMemo = function (key) { if (this.memos[key] && this.memos[key].destroy) { this.memos[key].destroy(); } delete this.memos[key]; }; /** * Some buttons need to change their visual style immediately once they get pressed */ Context.prototype.createInvokeHandlerAndUpdateState = function (namespace, value) { var _this = this; return function (event) { _this.createInvokeHandler(namespace, value)(event); _this.invoke('buttons.updateCurrentStyle'); }; }; Context.prototype.createInvokeHandler = function (namespace, value) { var _this = this; return function (event) { event.preventDefault(); var $target = $$1(event.target); _this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target); }; }; Context.prototype.invoke = function () { var namespace = lists.head(arguments); var args = lists.tail(lists.from(arguments)); var splits = namespace.split('.'); var hasSeparator = splits.length > 1; var moduleName = hasSeparator && lists.head(splits); var methodName = hasSeparator ? lists.last(splits) : lists.head(splits); var module = this.modules[moduleName || 'editor']; if (!moduleName && this[methodName]) { return this[methodName].apply(this, args); } else if (module && module[methodName] && module.shouldInitialize()) { return module[methodName].apply(module, args); } }; return Context; }()); $$1.fn.extend({ /** * Summernote API * * @param {Object|String} * @return {this} */ summernote: function () { var type = $$1.type(lists.head(arguments)); var isExternalAPICalled = type === 'string'; var hasInitOptions = type === 'object'; var options = $$1.extend({}, $$1.summernote.options, hasInitOptions ? lists.head(arguments) : {}); // Update options options.langInfo = $$1.extend(true, {}, $$1.summernote.lang['en-US'], $$1.summernote.lang[options.lang]); options.icons = $$1.extend(true, {}, $$1.summernote.options.icons, options.icons); options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip; this.each(function (idx, note) { var $note = $$1(note); if (!$note.data('summernote')) { var context = new Context($note, options); $note.data('summernote', context); $note.data('summernote').triggerEvent('init', context.layoutInfo); } }); var $note = this.first(); if ($note.length) { var context = $note.data('summernote'); if (isExternalAPICalled) { return context.invoke.apply(context, lists.from(arguments)); } else if (options.focus) { context.invoke('editor.focus'); } } return this; } }); /** * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js * * @param {TextRange} textRange * @param {Boolean} isStart * @return {BoundaryPoint} * * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx */ function textRangeToPoint(textRange, isStart) { var container = textRange.parentElement(); var offset; var tester = document.body.createTextRange(); var prevContainer; var childNodes = lists.from(container.childNodes); for (offset = 0; offset < childNodes.length; offset++) { if (dom.isText(childNodes[offset])) { continue; } tester.moveToElementText(childNodes[offset]); if (tester.compareEndPoints('StartToStart', textRange) >= 0) { break; } prevContainer = childNodes[offset]; } if (offset !== 0 && dom.isText(childNodes[offset - 1])) { var textRangeStart = document.body.createTextRange(); var curTextNode = null; textRangeStart.moveToElementText(prevContainer || container); textRangeStart.collapse(!prevContainer); curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild; var pointTester = textRange.duplicate(); pointTester.setEndPoint('StartToStart', textRangeStart); var textCount = pointTester.text.replace(/[\r\n]/g, '').length; while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) { textCount -= curTextNode.nodeValue.length; curTextNode = curTextNode.nextSibling; } // [workaround] enforce IE to re-reference curTextNode, hack var dummy = curTextNode.nodeValue; // eslint-disable-line if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) && textCount === curTextNode.nodeValue.length) { textCount -= curTextNode.nodeValue.length; curTextNode = curTextNode.nextSibling; } container = curTextNode; offset = textCount; } return { cont: container, offset: offset }; } /** * return TextRange from boundary point (inspired by google closure-library) * @param {BoundaryPoint} point * @return {TextRange} */ function pointToTextRange(point) { var textRangeInfo = function (container, offset) { var node, isCollapseToStart; if (dom.isText(container)) { var prevTextNodes = dom.listPrev(container, func.not(dom.isText)); var prevContainer = lists.last(prevTextNodes).previousSibling; node = prevContainer || container.parentNode; offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength); isCollapseToStart = !prevContainer; } else { node = container.childNodes[offset] || container; if (dom.isText(node)) { return textRangeInfo(node, 0); } offset = 0; isCollapseToStart = false; } return { node: node, collapseToStart: isCollapseToStart, offset: offset }; }; var textRange = document.body.createTextRange(); var info = textRangeInfo(point.node, point.offset); textRange.moveToElementText(info.node); textRange.collapse(info.collapseToStart); textRange.moveStart('character', info.offset); return textRange; } /** * Wrapped Range * * @constructor * @param {Node} sc - start container * @param {Number} so - start offset * @param {Node} ec - end container * @param {Number} eo - end offset */ var WrappedRange = /** @class */ (function () { function WrappedRange(sc, so, ec, eo) { this.sc = sc; this.so = so; this.ec = ec; this.eo = eo; // isOnEditable: judge whether range is on editable or not this.isOnEditable = this.makeIsOn(dom.isEditable); // isOnList: judge whether range is on list node or not this.isOnList = this.makeIsOn(dom.isList); // isOnAnchor: judge whether range is on anchor node or not this.isOnAnchor = this.makeIsOn(dom.isAnchor); // isOnCell: judge whether range is on cell node or not this.isOnCell = this.makeIsOn(dom.isCell); // isOnData: judge whether range is on data node or not this.isOnData = this.makeIsOn(dom.isData); } // nativeRange: get nativeRange from sc, so, ec, eo WrappedRange.prototype.nativeRange = function () { if (env.isW3CRangeSupport) { var w3cRange = document.createRange(); w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so); w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo); return w3cRange; } else { var textRange = pointToTextRange({ node: this.sc, offset: this.so }); textRange.setEndPoint('EndToEnd', pointToTextRange({ node: this.ec, offset: this.eo })); return textRange; } }; WrappedRange.prototype.getPoints = function () { return { sc: this.sc, so: this.so, ec: this.ec, eo: this.eo }; }; WrappedRange.prototype.getStartPoint = function () { return { node: this.sc, offset: this.so }; }; WrappedRange.prototype.getEndPoint = function () { return { node: this.ec, offset: this.eo }; }; /** * select update visible range */ WrappedRange.prototype.select = function () { var nativeRng = this.nativeRange(); if (env.isW3CRangeSupport) { var selection = document.getSelection(); if (selection.rangeCount > 0) { selection.removeAllRanges(); } selection.addRange(nativeRng); } else { nativeRng.select(); } return this; }; /** * Moves the scrollbar to start container(sc) of current range * * @return {WrappedRange} */ WrappedRange.prototype.scrollIntoView = function (container) { var height = $$1(container).height(); if (container.scrollTop + height < this.sc.offsetTop) { container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop); } return this; }; /** * @return {WrappedRange} */ WrappedRange.prototype.normalize = function () { /** * @param {BoundaryPoint} point * @param {Boolean} isLeftToRight - true: prefer to choose right node * - false: prefer to choose left node * @return {BoundaryPoint} */ var getVisiblePoint = function (point, isLeftToRight) { // Just use the given point [XXX:Adhoc] // - case 01. if the point is on the middle of the node // - case 02. if the point is on the right edge and prefer to choose left node // - case 03. if the point is on the left edge and prefer to choose right node // - case 04. if the point is on the right edge and prefer to choose right node but the node is void // - case 05. if the point is on the left edge and prefer to choose left node but the node is void // - case 06. if the point is on the block node and there is no children if (dom.isVisiblePoint(point)) { if (!dom.isEdgePoint(point) || (dom.isRightEdgePoint(point) && !isLeftToRight) || (dom.isLeftEdgePoint(point) && isLeftToRight) || (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) || (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) || (dom.isBlock(point.node) && dom.isEmpty(point.node))) { return point; } } // point on block's edge var block = dom.ancestor(point.node, dom.isBlock); if (((dom.isLeftEdgePointOf(point, block) || dom.isVoid(dom.prevPoint(point).node)) && !isLeftToRight) || ((dom.isRightEdgePointOf(point, block) || dom.isVoid(dom.nextPoint(point).node)) && isLeftToRight)) { // returns point already on visible point if (dom.isVisiblePoint(point)) { return point; } // reverse direction isLeftToRight = !isLeftToRight; } var nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint) : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint); return nextPoint || point; }; var endPoint = getVisiblePoint(this.getEndPoint(), false); var startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true); return new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset); }; /** * returns matched nodes on range * * @param {Function} [pred] - predicate function * @param {Object} [options] * @param {Boolean} [options.includeAncestor] * @param {Boolean} [options.fullyContains] * @return {Node[]} */ WrappedRange.prototype.nodes = function (pred, options) { pred = pred || func.ok; var includeAncestor = options && options.includeAncestor; var fullyContains = options && options.fullyContains; // TODO compare points and sort var startPoint = this.getStartPoint(); var endPoint = this.getEndPoint(); var nodes = []; var leftEdgeNodes = []; dom.walkPoint(startPoint, endPoint, function (point) { if (dom.isEditable(point.node)) { return; } var node; if (fullyContains) { if (dom.isLeftEdgePoint(point)) { leftEdgeNodes.push(point.node); } if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) { node = point.node; } } else if (includeAncestor) { node = dom.ancestor(point.node, pred); } else { node = point.node; } if (node && pred(node)) { nodes.push(node); } }, true); return lists.unique(nodes); }; /** * returns commonAncestor of range * @return {Element} - commonAncestor */ WrappedRange.prototype.commonAncestor = function () { return dom.commonAncestor(this.sc, this.ec); }; /** * returns expanded range by pred * * @param {Function} pred - predicate function * @return {WrappedRange} */ WrappedRange.prototype.expand = function (pred) { var startAncestor = dom.ancestor(this.sc, pred); var endAncestor = dom.ancestor(this.ec, pred); if (!startAncestor && !endAncestor) { return new WrappedRange(this.sc, this.so, this.ec, this.eo); } var boundaryPoints = this.getPoints(); if (startAncestor) { boundaryPoints.sc = startAncestor; boundaryPoints.so = 0; } if (endAncestor) { boundaryPoints.ec = endAncestor; boundaryPoints.eo = dom.nodeLength(endAncestor); } return new WrappedRange(boundaryPoints.sc, boundaryPoints.so, boundaryPoints.ec, boundaryPoints.eo); }; /** * @param {Boolean} isCollapseToStart * @return {WrappedRange} */ WrappedRange.prototype.collapse = function (isCollapseToStart) { if (isCollapseToStart) { return new WrappedRange(this.sc, this.so, this.sc, this.so); } else { return new WrappedRange(this.ec, this.eo, this.ec, this.eo); } }; /** * splitText on range */ WrappedRange.prototype.splitText = function () { var isSameContainer = this.sc === this.ec; var boundaryPoints = this.getPoints(); if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) { this.ec.splitText(this.eo); } if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) { boundaryPoints.sc = this.sc.splitText(this.so); boundaryPoints.so = 0; if (isSameContainer) { boundaryPoints.ec = boundaryPoints.sc; boundaryPoints.eo = this.eo - this.so; } } return new WrappedRange(boundaryPoints.sc, boundaryPoints.so, boundaryPoints.ec, boundaryPoints.eo); }; /** * delete contents on range * @return {WrappedRange} */ WrappedRange.prototype.deleteContents = function () { if (this.isCollapsed()) { return this; } var rng = this.splitText(); var nodes = rng.nodes(null, { fullyContains: true }); // find new cursor point var point = dom.prevPointUntil(rng.getStartPoint(), function (point) { return !lists.contains(nodes, point.node); }); var emptyParents = []; $$1.each(nodes, function (idx, node) { // find empty parents var parent = node.parentNode; if (point.node !== parent && dom.nodeLength(parent) === 1) { emptyParents.push(parent); } dom.remove(node, false); }); // remove empty parents $$1.each(emptyParents, function (idx, node) { dom.remove(node, false); }); return new WrappedRange(point.node, point.offset, point.node, point.offset).normalize(); }; /** * makeIsOn: return isOn(pred) function */ WrappedRange.prototype.makeIsOn = function (pred) { return function () { var ancestor = dom.ancestor(this.sc, pred); return !!ancestor && (ancestor === dom.ancestor(this.ec, pred)); }; }; /** * @param {Function} pred * @return {Boolean} */ WrappedRange.prototype.isLeftEdgeOf = function (pred) { if (!dom.isLeftEdgePoint(this.getStartPoint())) { return false; } var node = dom.ancestor(this.sc, pred); return node && dom.isLeftEdgeOf(this.sc, node); }; /** * returns whether range was collapsed or not */ WrappedRange.prototype.isCollapsed = function () { return this.sc === this.ec && this.so === this.eo; }; /** * wrap inline nodes which children of body with paragraph * * @return {WrappedRange} */ WrappedRange.prototype.wrapBodyInlineWithPara = function () { if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) { this.sc.innerHTML = dom.emptyPara; return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0); } /** * [workaround] firefox often create range on not visible point. so normalize here. * - firefox: |<p>text</p>| * - chrome: <p>|text|</p> */ var rng = this.normalize(); if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) { return rng; } // find inline top ancestor var topAncestor; if (dom.isInline(rng.sc)) { var ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline)); topAncestor = lists.last(ancestors); if (!dom.isInline(topAncestor)) { topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so]; } } else { topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0]; } // siblings not in paragraph var inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse(); inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline)); // wrap with paragraph if (inlineSiblings.length) { var para = dom.wrap(lists.head(inlineSiblings), 'p'); dom.appendChildNodes(para, lists.tail(inlineSiblings)); } return this.normalize(); }; /** * insert node at current cursor * * @param {Node} node * @return {Node} */ WrappedRange.prototype.insertNode = function (node) { var rng = this.wrapBodyInlineWithPara().deleteContents(); var info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node)); if (info.rightNode) { info.rightNode.parentNode.insertBefore(node, info.rightNode); } else { info.container.appendChild(node); } return node; }; /** * insert html at current cursor */ WrappedRange.prototype.pasteHTML = function (markup) { var contentsContainer = $$1('<div></div>').html(markup)[0]; var childNodes = lists.from(contentsContainer.childNodes); var rng = this.wrapBodyInlineWithPara().deleteContents(); if (rng.so > 0) { childNodes = childNodes.reverse(); } childNodes = childNodes.map(function (childNode) { return rng.insertNode(childNode); }); if (rng.so > 0) { childNodes = childNodes.reverse(); } return childNodes; }; /** * returns text in range * * @return {String} */ WrappedRange.prototype.toString = function () { var nativeRng = this.nativeRange(); return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text; }; /** * returns range for word before cursor * * @param {Boolean} [findAfter] - find after cursor, default: false * @return {WrappedRange} */ WrappedRange.prototype.getWordRange = function (findAfter) { var endPoint = this.getEndPoint(); if (!dom.isCharPoint(endPoint)) { return this; } var startPoint = dom.prevPointUntil(endPoint, function (point) { return !dom.isCharPoint(point); }); if (findAfter) { endPoint = dom.nextPointUntil(endPoint, function (point) { return !dom.isCharPoint(point); }); } return new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset); }; /** * create offsetPath bookmark * * @param {Node} editable */ WrappedRange.prototype.bookmark = function (editable) { return { s: { path: dom.makeOffsetPath(editable, this.sc), offset: this.so }, e: { path: dom.makeOffsetPath(editable, this.ec), offset: this.eo } }; }; /** * create offsetPath bookmark base on paragraph * * @param {Node[]} paras */ WrappedRange.prototype.paraBookmark = function (paras) { return { s: { path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)), offset: this.so }, e: { path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)), offset: this.eo } }; }; /** * getClientRects * @return {Rect[]} */ WrappedRange.prototype.getClientRects = function () { var nativeRng = this.nativeRange(); return nativeRng.getClientRects(); }; return WrappedRange; }()); /** * Data structure * * BoundaryPoint: a point of dom tree * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range * * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position */ var range = { /** * create Range Object From arguments or Browser Selection * * @param {Node} sc - start container * @param {Number} so - start offset * @param {Node} ec - end container * @param {Number} eo - end offset * @return {WrappedRange} */ create: function (sc, so, ec, eo) { if (arguments.length === 4) { return new WrappedRange(sc, so, ec, eo); } else if (arguments.length === 2) { // collapsed ec = sc; eo = so; return new WrappedRange(sc, so, ec, eo); } else { var wrappedRange = this.createFromSelection(); if (!wrappedRange && arguments.length === 1) { wrappedRange = this.createFromNode(arguments[0]); return wrappedRange.collapse(dom.emptyPara === arguments[0].innerHTML); } return wrappedRange; } }, createFromSelection: function () { var sc, so, ec, eo; if (env.isW3CRangeSupport) { var selection = document.getSelection(); if (!selection || selection.rangeCount === 0) { return null; } else if (dom.isBody(selection.anchorNode)) { // Firefox: returns entire body as range on initialization. // We won't never need it. return null; } var nativeRng = selection.getRangeAt(0); sc = nativeRng.startContainer; so = nativeRng.startOffset; ec = nativeRng.endContainer; eo = nativeRng.endOffset; } else { // IE8: TextRange var textRange = document.selection.createRange(); var textRangeEnd = textRange.duplicate(); textRangeEnd.collapse(false); var textRangeStart = textRange; textRangeStart.collapse(true); var startPoint = textRangeToPoint(textRangeStart, true); var endPoint = textRangeToPoint(textRangeEnd, false); // same visible point case: range was collapsed. if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) && dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) && endPoint.node.nextSibling === startPoint.node) { startPoint = endPoint; } sc = startPoint.cont; so = startPoint.offset; ec = endPoint.cont; eo = endPoint.offset; } return new WrappedRange(sc, so, ec, eo); }, /** * @method * * create WrappedRange from node * * @param {Node} node * @return {WrappedRange} */ createFromNode: function (node) { var sc = node; var so = 0; var ec = node; var eo = dom.nodeLength(ec); // browsers can't target a picture or void node if (dom.isVoid(sc)) { so = dom.listPrev(sc).length - 1; sc = sc.parentNode; } if (dom.isBR(ec)) { eo = dom.listPrev(ec).length - 1; ec = ec.parentNode; } else if (dom.isVoid(ec)) { eo = dom.listPrev(ec).length; ec = ec.parentNode; } return this.create(sc, so, ec, eo); }, /** * create WrappedRange from node after position * * @param {Node} node * @return {WrappedRange} */ createFromNodeBefore: function (node) { return this.createFromNode(node).collapse(true); }, /** * create WrappedRange from node after position * * @param {Node} node * @return {WrappedRange} */ createFromNodeAfter: function (node) { return this.createFromNode(node).collapse(); }, /** * @method * * create WrappedRange from bookmark * * @param {Node} editable * @param {Object} bookmark * @return {WrappedRange} */ createFromBookmark: function (editable, bookmark) { var sc = dom.fromOffsetPath(editable, bookmark.s.path); var so = bookmark.s.offset; var ec = dom.fromOffsetPath(editable, bookmark.e.path); var eo = bookmark.e.offset; return new WrappedRange(sc, so, ec, eo); }, /** * @method * * create WrappedRange from paraBookmark * * @param {Object} bookmark * @param {Node[]} paras * @return {WrappedRange} */ createFromParaBookmark: function (bookmark, paras) { var so = bookmark.s.offset; var eo = bookmark.e.offset; var sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path); var ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path); return new WrappedRange(sc, so, ec, eo); } }; var KEY_MAP = { 'BACKSPACE': 8, 'TAB': 9, 'ENTER': 13, 'SPACE': 32, 'DELETE': 46, // Arrow 'LEFT': 37, 'UP': 38, 'RIGHT': 39, 'DOWN': 40, // Number: 0-9 'NUM0': 48, 'NUM1': 49, 'NUM2': 50, 'NUM3': 51, 'NUM4': 52, 'NUM5': 53, 'NUM6': 54, 'NUM7': 55, 'NUM8': 56, // Alphabet: a-z 'B': 66, 'E': 69, 'I': 73, 'J': 74, 'K': 75, 'L': 76, 'R': 82, 'S': 83, 'U': 85, 'V': 86, 'Y': 89, 'Z': 90, 'SLASH': 191, 'LEFTBRACKET': 219, 'BACKSLASH': 220, 'RIGHTBRACKET': 221 }; /** * @class core.key * * Object for keycodes. * * @singleton * @alternateClassName key */ var key = { /** * @method isEdit * * @param {Number} keyCode * @return {Boolean} */ isEdit: function (keyCode) { return lists.contains([ KEY_MAP.BACKSPACE, KEY_MAP.TAB, KEY_MAP.ENTER, KEY_MAP.SPACE, KEY_MAP.DELETE, ], keyCode); }, /** * @method isMove * * @param {Number} keyCode * @return {Boolean} */ isMove: function (keyCode) { return lists.contains([ KEY_MAP.LEFT, KEY_MAP.UP, KEY_MAP.RIGHT, KEY_MAP.DOWN, ], keyCode); }, /** * @property {Object} nameFromCode * @property {String} nameFromCode.8 "BACKSPACE" */ nameFromCode: func.invertObject(KEY_MAP), code: KEY_MAP }; /** * @method readFileAsDataURL * * read contents of file as representing URL * * @param {File} file * @return {Promise} - then: dataUrl */ function readFileAsDataURL(file) { return $$1.Deferred(function (deferred) { $$1.extend(new FileReader(), { onload: function (e) { var dataURL = e.target.result; deferred.resolve(dataURL); }, onerror: function (err) { deferred.reject(err); } }).readAsDataURL(file); }).promise(); } /** * @method createImage * * create `<image>` from url string * * @param {String} url * @return {Promise} - then: $image */ function createImage(url) { return $$1.Deferred(function (deferred) { var $img = $$1('<img>'); $img.one('load', function () { $img.off('error abort'); deferred.resolve($img); }).one('error abort', function () { $img.off('load').detach(); deferred.reject($img); }).css({ display: 'none' }).appendTo(document.body).attr('src', url); }).promise(); } var History = /** @class */ (function () { function History($editable) { this.stack = []; this.stackOffset = -1; this.$editable = $editable; this.editable = $editable[0]; } History.prototype.makeSnapshot = function () { var rng = range.create(this.editable); var emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } }; return { contents: this.$editable.html(), bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark) }; }; History.prototype.applySnapshot = function (snapshot) { if (snapshot.contents !== null) { this.$editable.html(snapshot.contents); } if (snapshot.bookmark !== null) { range.createFromBookmark(this.editable, snapshot.bookmark).select(); } }; /** * @method rewind * Rewinds the history stack back to the first snapshot taken. * Leaves the stack intact, so that "Redo" can still be used. */ History.prototype.rewind = function () { // Create snap shot if not yet recorded if (this.$editable.html() !== this.stack[this.stackOffset].contents) { this.recordUndo(); } // Return to the first available snapshot. this.stackOffset = 0; // Apply that snapshot. this.applySnapshot(this.stack[this.stackOffset]); }; /** * @method commit * Resets history stack, but keeps current editor's content. */ History.prototype.commit = function () { // Clear the stack. this.stack = []; // Restore stackOffset to its original value. this.stackOffset = -1; // Record our first snapshot (of nothing). this.recordUndo(); }; /** * @method reset * Resets the history stack completely; reverting to an empty editor. */ History.prototype.reset = function () { // Clear the stack. this.stack = []; // Restore stackOffset to its original value. this.stackOffset = -1; // Clear the editable area. this.$editable.html(''); // Record our first snapshot (of nothing). this.recordUndo(); }; /** * undo */ History.prototype.undo = function () { // Create snap shot if not yet recorded if (this.$editable.html() !== this.stack[this.stackOffset].contents) { this.recordUndo(); } if (this.stackOffset > 0) { this.stackOffset--; this.applySnapshot(this.stack[this.stackOffset]); } }; /** * redo */ History.prototype.redo = function () { if (this.stack.length - 1 > this.stackOffset) { this.stackOffset++; this.applySnapshot(this.stack[this.stackOffset]); } }; /** * recorded undo */ History.prototype.recordUndo = function () { this.stackOffset++; // Wash out stack after stackOffset if (this.stack.length > this.stackOffset) { this.stack = this.stack.slice(0, this.stackOffset); } // Create new snapshot and push it to the end this.stack.push(this.makeSnapshot()); }; return History; }()); var Style = /** @class */ (function () { function Style() { } /** * @method jQueryCSS * * [workaround] for old jQuery * passing an array of style properties to .css() * will result in an object of property-value pairs. * (compability with version < 1.9) * * @private * @param {jQuery} $obj * @param {Array} propertyNames - An array of one or more CSS properties. * @return {Object} */ Style.prototype.jQueryCSS = function ($obj, propertyNames) { if (env.jqueryVersion < 1.9) { var result_1 = {}; $$1.each(propertyNames, function (idx, propertyName) { result_1[propertyName] = $obj.css(propertyName); }); return result_1; } return $obj.css(propertyNames); }; /** * returns style object from node * * @param {jQuery} $node * @return {Object} */ Style.prototype.fromNode = function ($node) { var properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height']; var styleInfo = this.jQueryCSS($node, properties) || {}; styleInfo['font-size'] = parseInt(styleInfo['font-size'], 10); return styleInfo; }; /** * paragraph level style * * @param {WrappedRange} rng * @param {Object} styleInfo */ Style.prototype.stylePara = function (rng, styleInfo) { $$1.each(rng.nodes(dom.isPara, { includeAncestor: true }), function (idx, para) { $$1(para).css(styleInfo); }); }; /** * insert and returns styleNodes on range. * * @param {WrappedRange} rng * @param {Object} [options] - options for styleNodes * @param {String} [options.nodeName] - default: `SPAN` * @param {Boolean} [options.expandClosestSibling] - default: `false` * @param {Boolean} [options.onlyPartialContains] - default: `false` * @return {Node[]} */ Style.prototype.styleNodes = function (rng, options) { rng = rng.splitText(); var nodeName = (options && options.nodeName) || 'SPAN'; var expandClosestSibling = !!(options && options.expandClosestSibling); var onlyPartialContains = !!(options && options.onlyPartialContains); if (rng.isCollapsed()) { return [rng.insertNode(dom.create(nodeName))]; } var pred = dom.makePredByNodeName(nodeName); var nodes = rng.nodes(dom.isText, { fullyContains: true }).map(function (text) { return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName); }); if (expandClosestSibling) { if (onlyPartialContains) { var nodesInRange_1 = rng.nodes(); // compose with partial contains predication pred = func.and(pred, function (node) { return lists.contains(nodesInRange_1, node); }); } return nodes.map(function (node) { var siblings = dom.withClosestSiblings(node, pred); var head = lists.head(siblings); var tails = lists.tail(siblings); $$1.each(tails, function (idx, elem) { dom.appendChildNodes(head, elem.childNodes); dom.remove(elem); }); return lists.head(siblings); }); } else { return nodes; } }; /** * get current style on cursor * * @param {WrappedRange} rng * @return {Object} - object contains style properties. */ Style.prototype.current = function (rng) { var $cont = $$1(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc); var styleInfo = this.fromNode($cont); // document.queryCommandState for toggle state // [workaround] prevent Firefox nsresult: "0x80004005 (NS_ERROR_FAILURE)" try { styleInfo = $$1.extend(styleInfo, { 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal', 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal', 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal', 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal', 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal', 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal', 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family'] }); } catch (e) { } // list-style-type to list-style(unordered, ordered) if (!rng.isOnList()) { styleInfo['list-style'] = 'none'; } else { var orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square']; var isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1; styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered'; } var para = dom.ancestor(rng.sc, dom.isPara); if (para && para.style['line-height']) { styleInfo['line-height'] = para.style.lineHeight; } else { var lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10); styleInfo['line-height'] = lineHeight.toFixed(1); } styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor); styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable); styleInfo.range = rng; return styleInfo; }; return Style; }()); var Bullet = /** @class */ (function () { function Bullet() { } /** * toggle ordered list */ Bullet.prototype.insertOrderedList = function (editable) { this.toggleList('OL', editable); }; /** * toggle unordered list */ Bullet.prototype.insertUnorderedList = function (editable) { this.toggleList('UL', editable); }; /** * indent */ Bullet.prototype.indent = function (editable) { var _this = this; var rng = range.create(editable).wrapBodyInlineWithPara(); var paras = rng.nodes(dom.isPara, { includeAncestor: true }); var clustereds = lists.clusterBy(paras, func.peq2('parentNode')); $$1.each(clustereds, function (idx, paras) { var head = lists.head(paras); if (dom.isLi(head)) { var previousList_1 = _this.findList(head.previousSibling); if (previousList_1) { paras .map(function (para) { return previousList_1.appendChild(para); }); } else { _this.wrapList(paras, head.parentNode.nodeName); paras .map(function (para) { return para.parentNode; }) .map(function (para) { return _this.appendToPrevious(para); }); } } else { $$1.each(paras, function (idx, para) { $$1(para).css('marginLeft', function (idx, val) { return (parseInt(val, 10) || 0) + 25; }); }); } }); rng.select(); }; /** * outdent */ Bullet.prototype.outdent = function (editable) { var _this = this; var rng = range.create(editable).wrapBodyInlineWithPara(); var paras = rng.nodes(dom.isPara, { includeAncestor: true }); var clustereds = lists.clusterBy(paras, func.peq2('parentNode')); $$1.each(clustereds, function (idx, paras) { var head = lists.head(paras); if (dom.isLi(head)) { _this.releaseList([paras]); } else { $$1.each(paras, function (idx, para) { $$1(para).css('marginLeft', function (idx, val) { val = (parseInt(val, 10) || 0); return val > 25 ? val - 25 : ''; }); }); } }); rng.select(); }; /** * toggle list * * @param {String} listName - OL or UL */ Bullet.prototype.toggleList = function (listName, editable) { var _this = this; var rng = range.create(editable).wrapBodyInlineWithPara(); var paras = rng.nodes(dom.isPara, { includeAncestor: true }); var bookmark = rng.paraBookmark(paras); var clustereds = lists.clusterBy(paras, func.peq2('parentNode')); // paragraph to list if (lists.find(paras, dom.isPurePara)) { var wrappedParas_1 = []; $$1.each(clustereds, function (idx, paras) { wrappedParas_1 = wrappedParas_1.concat(_this.wrapList(paras, listName)); }); paras = wrappedParas_1; // list to paragraph or change list style } else { var diffLists = rng.nodes(dom.isList, { includeAncestor: true }).filter(function (listNode) { return !$$1.nodeName(listNode, listName); }); if (diffLists.length) { $$1.each(diffLists, function (idx, listNode) { dom.replace(listNode, listName); }); } else { paras = this.releaseList(clustereds, true); } } range.createFromParaBookmark(bookmark, paras).select(); }; /** * @param {Node[]} paras * @param {String} listName * @return {Node[]} */ Bullet.prototype.wrapList = function (paras, listName) { var head = lists.head(paras); var last = lists.last(paras); var prevList = dom.isList(head.previousSibling) && head.previousSibling; var nextList = dom.isList(last.nextSibling) && last.nextSibling; var listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last); // P to LI paras = paras.map(function (para) { return dom.isPurePara(para) ? dom.replace(para, 'LI') : para; }); // append to list(<ul>, <ol>) dom.appendChildNodes(listNode, paras); if (nextList) { dom.appendChildNodes(listNode, lists.from(nextList.childNodes)); dom.remove(nextList); } return paras; }; /** * @method releaseList * * @param {Array[]} clustereds * @param {Boolean} isEscapseToBody * @return {Node[]} */ Bullet.prototype.releaseList = function (clustereds, isEscapseToBody) { var _this = this; var releasedParas = []; $$1.each(clustereds, function (idx, paras) { var head = lists.head(paras); var last = lists.last(paras); var headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode; var parentItem = headList.parentNode; if (headList.parentNode.nodeName === 'LI') { paras.map(function (para) { var newList = _this.findNextSiblings(para); if (parentItem.nextSibling) { parentItem.parentNode.insertBefore(para, parentItem.nextSibling); } else { parentItem.parentNode.appendChild(para); } if (newList.length) { _this.wrapList(newList, headList.nodeName); para.appendChild(newList[0].parentNode); } }); if (headList.children.length === 0) { parentItem.removeChild(headList); } if (parentItem.childNodes.length === 0) { parentItem.parentNode.removeChild(parentItem); } } else { var lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, { node: last.parentNode, offset: dom.position(last) + 1 }, { isSkipPaddingBlankHTML: true }) : null; var middleList = dom.splitTree(headList, { node: head.parentNode, offset: dom.position(head) }, { isSkipPaddingBlankHTML: true }); paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi) : lists.from(middleList.childNodes).filter(dom.isLi); // LI to P if (isEscapseToBody || !dom.isList(headList.parentNode)) { paras = paras.map(function (para) { return dom.replace(para, 'P'); }); } $$1.each(lists.from(paras).reverse(), function (idx, para) { dom.insertAfter(para, headList); }); // remove empty lists var rootLists = lists.compact([headList, middleList, lastList]); $$1.each(rootLists, function (idx, rootList) { var listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList)); $$1.each(listNodes.reverse(), function (idx, listNode) { if (!dom.nodeLength(listNode)) { dom.remove(listNode, true); } }); }); } releasedParas = releasedParas.concat(paras); }); return releasedParas; }; /** * @method appendToPrevious * * Appends list to previous list item, if * none exist it wraps the list in a new list item. * * @param {HTMLNode} ListItem * @return {HTMLNode} */ Bullet.prototype.appendToPrevious = function (node) { return node.previousSibling ? dom.appendChildNodes(node.previousSibling, [node]) : this.wrapList([node], 'LI'); }; /** * @method findList * * Finds an existing list in list item * * @param {HTMLNode} ListItem * @return {Array[]} */ Bullet.prototype.findList = function (node) { return node ? lists.find(node.children, function (child) { return ['OL', 'UL'].indexOf(child.nodeName) > -1; }) : null; }; /** * @method findNextSiblings * * Finds all list item siblings that follow it * * @param {HTMLNode} ListItem * @return {HTMLNode} */ Bullet.prototype.findNextSiblings = function (node) { var siblings = []; while (node.nextSibling) { siblings.push(node.nextSibling); node = node.nextSibling; } return siblings; }; return Bullet; }()); /** * @class editing.Typing * * Typing * */ var Typing = /** @class */ (function () { function Typing(context) { // a Bullet instance to toggle lists off this.bullet = new Bullet(); this.options = context.options; } /** * insert tab * * @param {WrappedRange} rng * @param {Number} tabsize */ Typing.prototype.insertTab = function (rng, tabsize) { var tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR)); rng = rng.deleteContents(); rng.insertNode(tab, true); rng = range.create(tab, tabsize); rng.select(); }; /** * insert paragraph * * @param {jQuery} $editable * @param {WrappedRange} rng Can be used in unit tests to "mock" the range * * blockquoteBreakingLevel * 0 - No break, the new paragraph remains inside the quote * 1 - Break the first blockquote in the ancestors list * 2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default) */ Typing.prototype.insertParagraph = function (editable, rng) { rng = rng || range.create(editable); // deleteContents on range. rng = rng.deleteContents(); // Wrap range if it needs to be wrapped by paragraph rng = rng.wrapBodyInlineWithPara(); // finding paragraph var splitRoot = dom.ancestor(rng.sc, dom.isPara); var nextPara; // on paragraph: split paragraph if (splitRoot) { // if it is an empty line with li if (dom.isEmpty(splitRoot) && dom.isLi(splitRoot)) { // toogle UL/OL and escape this.bullet.toggleList(splitRoot.parentNode.nodeName); return; } else { var blockquote = null; if (this.options.blockquoteBreakingLevel === 1) { blockquote = dom.ancestor(splitRoot, dom.isBlockquote); } else if (this.options.blockquoteBreakingLevel === 2) { blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote); } if (blockquote) { // We're inside a blockquote and options ask us to break it nextPara = $$1(dom.emptyPara)[0]; // If the split is right before a <br>, remove it so that there's no "empty line" // after the split in the new blockquote created if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) { $$1(rng.sc.nextSibling).remove(); } var split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true }); if (split) { split.parentNode.insertBefore(nextPara, split); } else { dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote } } else { nextPara = dom.splitTree(splitRoot, rng.getStartPoint()); // not a blockquote, just insert the paragraph var emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor); emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor)); $$1.each(emptyAnchors, function (idx, anchor) { dom.remove(anchor); }); // replace empty heading, pre or custom-made styleTag with P tag if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) { nextPara = dom.replace(nextPara, 'p'); } } } // no paragraph: insert empty paragraph } else { var next = rng.sc.childNodes[rng.so]; nextPara = $$1(dom.emptyPara)[0]; if (next) { rng.sc.insertBefore(nextPara, next); } else { rng.sc.appendChild(nextPara); } } range.create(nextPara, 0).normalize().select().scrollIntoView(editable); }; return Typing; }()); /** * @class Create a virtual table to create what actions to do in change. * @param {object} startPoint Cell selected to apply change. * @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction * @param {object} domTable Dom element of table to make changes. */ var TableResultAction = function (startPoint, where, action, domTable) { var _startPoint = { 'colPos': 0, 'rowPos': 0 }; var _virtualTable = []; var _actionCellList = []; /// /////////////////////////////////////////// // Private functions /// /////////////////////////////////////////// /** * Set the startPoint of action. */ function setStartPoint() { if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) { console.error('Impossible to identify start Cell point.', startPoint); return; } _startPoint.colPos = startPoint.cellIndex; if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') { console.error('Impossible to identify start Row point.', startPoint); return; } _startPoint.rowPos = startPoint.parentElement.rowIndex; } /** * Define virtual table position info object. * * @param {int} rowIndex Index position in line of virtual table. * @param {int} cellIndex Index position in column of virtual table. * @param {object} baseRow Row affected by this position. * @param {object} baseCell Cell affected by this position. * @param {bool} isSpan Inform if it is an span cell/row. */ function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) { var objPosition = { 'baseRow': baseRow, 'baseCell': baseCell, 'isRowSpan': isRowSpan, 'isColSpan': isColSpan, 'isVirtual': isVirtualCell }; if (!_virtualTable[rowIndex]) { _virtualTable[rowIndex] = []; } _virtualTable[rowIndex][cellIndex] = objPosition; } /** * Create action cell object. * * @param {object} virtualTableCellObj Object of specific position on virtual table. * @param {enum} resultAction Action to be applied in that item. */ function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) { return { 'baseCell': virtualTableCellObj.baseCell, 'action': resultAction, 'virtualTable': { 'rowIndex': virtualRowPosition, 'cellIndex': virtualColPosition } }; } /** * Recover free index of row to append Cell. * * @param {int} rowIndex Index of row to find free space. * @param {int} cellIndex Index of cell to find free space in table. */ function recoverCellIndex(rowIndex, cellIndex) { if (!_virtualTable[rowIndex]) { return cellIndex; } if (!_virtualTable[rowIndex][cellIndex]) { return cellIndex; } var newCellIndex = cellIndex; while (_virtualTable[rowIndex][newCellIndex]) { newCellIndex++; if (!_virtualTable[rowIndex][newCellIndex]) { return newCellIndex; } } } /** * Recover info about row and cell and add information to virtual table. * * @param {object} row Row to recover information. * @param {object} cell Cell to recover information. */ function addCellInfoToVirtual(row, cell) { var cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex); var cellHasColspan = (cell.colSpan > 1); var cellHasRowspan = (cell.rowSpan > 1); var isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos); setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false); // Add span rows to virtual Table. var rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0; if (rowspanNumber > 1) { for (var rp = 1; rp < rowspanNumber; rp++) { var rowspanIndex = row.rowIndex + rp; adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell); setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true); } } // Add span cols to virtual table. var colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0; if (colspanNumber > 1) { for (var cp = 1; cp < colspanNumber; cp++) { var cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp)); adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell); setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true); } } } /** * Process validation and adjust of start point if needed * * @param {int} rowIndex * @param {int} cellIndex * @param {object} cell * @param {bool} isSelectedCell */ function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) { if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) { _startPoint.colPos++; } } /** * Create virtual table of cells with all cells, including span cells. */ function createVirtualTable() { var rows = domTable.rows; for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) { var cells = rows[rowIndex].cells; for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) { addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]); } } } /** * Get action to be applied on the cell. * * @param {object} cell virtual table cell to apply action */ function getDeleteResultActionToCell(cell) { switch (where) { case TableResultAction.where.Column: if (cell.isColSpan) { return TableResultAction.resultAction.SubtractSpanCount; } break; case TableResultAction.where.Row: if (!cell.isVirtual && cell.isRowSpan) { return TableResultAction.resultAction.AddCell; } else if (cell.isRowSpan) { return TableResultAction.resultAction.SubtractSpanCount; } break; } return TableResultAction.resultAction.RemoveCell; } /** * Get action to be applied on the cell. * * @param {object} cell virtual table cell to apply action */ function getAddResultActionToCell(cell) { switch (where) { case TableResultAction.where.Column: if (cell.isColSpan) { return TableResultAction.resultAction.SumSpanCount; } else if (cell.isRowSpan && cell.isVirtual) { return TableResultAction.resultAction.Ignore; } break; case TableResultAction.where.Row: if (cell.isRowSpan) { return TableResultAction.resultAction.SumSpanCount; } else if (cell.isColSpan && cell.isVirtual) { return TableResultAction.resultAction.Ignore; } break; } return TableResultAction.resultAction.AddCell; } function init() { setStartPoint(); createVirtualTable(); } /// /////////////////////////////////////////// // Public functions /// /////////////////////////////////////////// /** * Recover array os what to do in table. */ this.getActionList = function () { var fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1; var fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1; var actualPosition = 0; var canContinue = true; while (canContinue) { var rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition; var colPosition = (fixedCol >= 0) ? fixedCol : actualPosition; var row = _virtualTable[rowPosition]; if (!row) { canContinue = false; return _actionCellList; } var cell = row[colPosition]; if (!cell) { canContinue = false; return _actionCellList; } // Define action to be applied in this cell var resultAction = TableResultAction.resultAction.Ignore; switch (action) { case TableResultAction.requestAction.Add: resultAction = getAddResultActionToCell(cell); break; case TableResultAction.requestAction.Delete: resultAction = getDeleteResultActionToCell(cell); break; } _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition)); actualPosition++; } return _actionCellList; }; init(); }; /** * * Where action occours enum. */ TableResultAction.where = { 'Row': 0, 'Column': 1 }; /** * * Requested action to apply enum. */ TableResultAction.requestAction = { 'Add': 0, 'Delete': 1 }; /** * * Result action to be executed enum. */ TableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 }; /** * * @class editing.Table * * Table * */ var Table = /** @class */ (function () { function Table() { } /** * handle tab key * * @param {WrappedRange} rng * @param {Boolean} isShift */ Table.prototype.tab = function (rng, isShift) { var cell = dom.ancestor(rng.commonAncestor(), dom.isCell); var table = dom.ancestor(cell, dom.isTable); var cells = dom.listDescendant(table, dom.isCell); var nextCell = lists[isShift ? 'prev' : 'next'](cells, cell); if (nextCell) { range.create(nextCell, 0).select(); } }; /** * Add a new row * * @param {WrappedRange} rng * @param {String} position (top/bottom) * @return {Node} */ Table.prototype.addRow = function (rng, position) { var cell = dom.ancestor(rng.commonAncestor(), dom.isCell); var currentTr = $$1(cell).closest('tr'); var trAttributes = this.recoverAttributes(currentTr); var html = $$1('<tr' + trAttributes + '></tr>'); var vTable = new TableResultAction(cell, TableResultAction.where.Row, TableResultAction.requestAction.Add, $$1(currentTr).closest('table')[0]); var actions = vTable.getActionList(); for (var idCell = 0; idCell < actions.length; idCell++) { var currentCell = actions[idCell]; var tdAttributes = this.recoverAttributes(currentCell.baseCell); switch (currentCell.action) { case TableResultAction.resultAction.AddCell: html.append('<td' + tdAttributes + '>' + dom.blank + '</td>'); break; case TableResultAction.resultAction.SumSpanCount: if (position === 'top') { var baseCellTr = currentCell.baseCell.parent; var isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex; if (isTopFromRowSpan) { var newTd = $$1('<div></div>').append($$1('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html(); html.append(newTd); break; } } var rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10); rowspanNumber++; currentCell.baseCell.setAttribute('rowSpan', rowspanNumber); break; } } if (position === 'top') { currentTr.before(html); } else { var cellHasRowspan = (cell.rowSpan > 1); if (cellHasRowspan) { var lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2); $$1($$1(currentTr).parent().find('tr')[lastTrIndex]).after($$1(html)); return; } currentTr.after(html); } }; /** * Add a new col * * @param {WrappedRange} rng * @param {String} position (left/right) * @return {Node} */ Table.prototype.addCol = function (rng, position) { var cell = dom.ancestor(rng.commonAncestor(), dom.isCell); var row = $$1(cell).closest('tr'); var rowsGroup = $$1(row).siblings(); rowsGroup.push(row); var vTable = new TableResultAction(cell, TableResultAction.where.Column, TableResultAction.requestAction.Add, $$1(row).closest('table')[0]); var actions = vTable.getActionList(); for (var actionIndex = 0; actionIndex < actions.length; actionIndex++) { var currentCell = actions[actionIndex]; var tdAttributes = this.recoverAttributes(currentCell.baseCell); switch (currentCell.action) { case TableResultAction.resultAction.AddCell: if (position === 'right') { $$1(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>'); } else { $$1(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>'); } break; case TableResultAction.resultAction.SumSpanCount: if (position === 'right') { var colspanNumber = parseInt(currentCell.baseCell.colSpan, 10); colspanNumber++; currentCell.baseCell.setAttribute('colSpan', colspanNumber); } else { $$1(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>'); } break; } } }; /* * Copy attributes from element. * * @param {object} Element to recover attributes. * @return {string} Copied string elements. */ Table.prototype.recoverAttributes = function (el) { var resultStr = ''; if (!el) { return resultStr; } var attrList = el.attributes || []; for (var i = 0; i < attrList.length; i++) { if (attrList[i].name.toLowerCase() === 'id') { continue; } if (attrList[i].specified) { resultStr += ' ' + attrList[i].name + '=\'' + attrList[i].value + '\''; } } return resultStr; }; /** * Delete current row * * @param {WrappedRange} rng * @return {Node} */ Table.prototype.deleteRow = function (rng) { var cell = dom.ancestor(rng.commonAncestor(), dom.isCell); var row = $$1(cell).closest('tr'); var cellPos = row.children('td, th').index($$1(cell)); var rowPos = row[0].rowIndex; var vTable = new TableResultAction(cell, TableResultAction.where.Row, TableResultAction.requestAction.Delete, $$1(row).closest('table')[0]); var actions = vTable.getActionList(); for (var actionIndex = 0; actionIndex < actions.length; actionIndex++) { if (!actions[actionIndex]) { continue; } var baseCell = actions[actionIndex].baseCell; var virtualPosition = actions[actionIndex].virtualTable; var hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1); var rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0; switch (actions[actionIndex].action) { case TableResultAction.resultAction.Ignore: continue; case TableResultAction.resultAction.AddCell: var nextRow = row.next('tr')[0]; if (!nextRow) { continue; } var cloneRow = row[0].cells[cellPos]; if (hasRowspan) { if (rowspanNumber > 2) { rowspanNumber--; nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]); nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber); nextRow.cells[cellPos].innerHTML = ''; } else if (rowspanNumber === 2) { nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]); nextRow.cells[cellPos].removeAttribute('rowSpan'); nextRow.cells[cellPos].innerHTML = ''; } } continue; case TableResultAction.resultAction.SubtractSpanCount: if (hasRowspan) { if (rowspanNumber > 2) { rowspanNumber--; baseCell.setAttribute('rowSpan', rowspanNumber); if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; } } else if (rowspanNumber === 2) { baseCell.removeAttribute('rowSpan'); if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; } } } continue; case TableResultAction.resultAction.RemoveCell: // Do not need remove cell because row will be deleted. continue; } } row.remove(); }; /** * Delete current col * * @param {WrappedRange} rng * @return {Node} */ Table.prototype.deleteCol = function (rng) { var cell = dom.ancestor(rng.commonAncestor(), dom.isCell); var row = $$1(cell).closest('tr'); var cellPos = row.children('td, th').index($$1(cell)); var vTable = new TableResultAction(cell, TableResultAction.where.Column, TableResultAction.requestAction.Delete, $$1(row).closest('table')[0]); var actions = vTable.getActionList(); for (var actionIndex = 0; actionIndex < actions.length; actionIndex++) { if (!actions[actionIndex]) { continue; } switch (actions[actionIndex].action) { case TableResultAction.resultAction.Ignore: continue; case TableResultAction.resultAction.SubtractSpanCount: var baseCell = actions[actionIndex].baseCell; var hasColspan = (baseCell.colSpan && baseCell.colSpan > 1); if (hasColspan) { var colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0; if (colspanNumber > 2) { colspanNumber--; baseCell.setAttribute('colSpan', colspanNumber); if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; } } else if (colspanNumber === 2) { baseCell.removeAttribute('colSpan'); if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; } } } continue; case TableResultAction.resultAction.RemoveCell: dom.remove(actions[actionIndex].baseCell, true); continue; } } }; /** * create empty table element * * @param {Number} rowCount * @param {Number} colCount * @return {Node} */ Table.prototype.createTable = function (colCount, rowCount, options) { var tds = []; var tdHTML; for (var idxCol = 0; idxCol < colCount; idxCol++) { tds.push('<td>' + dom.blank + '</td>'); } tdHTML = tds.join(''); var trs = []; var trHTML; for (var idxRow = 0; idxRow < rowCount; idxRow++) { trs.push('<tr>' + tdHTML + '</tr>'); } trHTML = trs.join(''); var $table = $$1('<table>' + trHTML + '</table>'); if (options && options.tableClassName) { $table.addClass(options.tableClassName); } return $table[0]; }; /** * Delete current table * * @param {WrappedRange} rng * @return {Node} */ Table.prototype.deleteTable = function (rng) { var cell = dom.ancestor(rng.commonAncestor(), dom.isCell); $$1(cell).closest('table').remove(); }; return Table; }()); var KEY_BOGUS = 'bogus'; /** * @class Editor */ var Editor = /** @class */ (function () { function Editor(context) { var _this = this; this.context = context; this.$note = context.layoutInfo.note; this.$editor = context.layoutInfo.editor; this.$editable = context.layoutInfo.editable; this.options = context.options; this.lang = this.options.langInfo; this.editable = this.$editable[0]; this.lastRange = null; this.style = new Style(); this.table = new Table(); this.typing = new Typing(context); this.bullet = new Bullet(); this.history = new History(this.$editable); this.context.memo('help.undo', this.lang.help.undo); this.context.memo('help.redo', this.lang.help.redo); this.context.memo('help.tab', this.lang.help.tab); this.context.memo('help.untab', this.lang.help.untab); this.context.memo('help.insertParagraph', this.lang.help.insertParagraph); this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList); this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList); this.context.memo('help.indent', this.lang.help.indent); this.context.memo('help.outdent', this.lang.help.outdent); this.context.memo('help.formatPara', this.lang.help.formatPara); this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule); this.context.memo('help.fontName', this.lang.help.fontName); // native commands(with execCommand), generate function for execCommand var commands = [ 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull', 'formatBlock', 'removeFormat', 'backColor', ]; for (var idx = 0, len = commands.length; idx < len; idx++) { this[commands[idx]] = (function (sCmd) { return function (value) { _this.beforeCommand(); document.execCommand(sCmd, false, value); _this.afterCommand(true); }; })(commands[idx]); this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]); } this.fontName = this.wrapCommand(function (value) { return _this.fontStyling('font-family', "\'" + value + "\'"); }); this.fontSize = this.wrapCommand(function (value) { return _this.fontStyling('font-size', value + 'px'); }); for (var idx = 1; idx <= 6; idx++) { this['formatH' + idx] = (function (idx) { return function () { _this.formatBlock('H' + idx); }; })(idx); this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]); } this.insertParagraph = this.wrapCommand(function () { _this.typing.insertParagraph(_this.editable); }); this.insertOrderedList = this.wrapCommand(function () { _this.bullet.insertOrderedList(_this.editable); }); this.insertUnorderedList = this.wrapCommand(function () { _this.bullet.insertUnorderedList(_this.editable); }); this.indent = this.wrapCommand(function () { _this.bullet.indent(_this.editable); }); this.outdent = this.wrapCommand(function () { _this.bullet.outdent(_this.editable); }); /** * insertNode * insert node * @param {Node} node */ this.insertNode = this.wrapCommand(function (node) { if (_this.isLimited($$1(node).text().length)) { return; } var rng = _this.getLastRange(); rng.insertNode(node); range.createFromNodeAfter(node).select(); _this.setLastRange(); }); /** * insert text * @param {String} text */ this.insertText = this.wrapCommand(function (text) { if (_this.isLimited(text.length)) { return; } var rng = _this.getLastRange(); var textNode = rng.insertNode(dom.createText(text)); range.create(textNode, dom.nodeLength(textNode)).select(); _this.setLastRange(); }); /** * paste HTML * @param {String} markup */ this.pasteHTML = this.wrapCommand(function (markup) { if (_this.isLimited(markup.length)) { return; } markup = _this.context.invoke('codeview.purify', markup); var contents = _this.getLastRange().pasteHTML(markup); range.createFromNodeAfter(lists.last(contents)).select(); _this.setLastRange(); }); /** * formatBlock * * @param {String} tagName */ this.formatBlock = this.wrapCommand(function (tagName, $target) { var onApplyCustomStyle = _this.options.callbacks.onApplyCustomStyle; if (onApplyCustomStyle) { onApplyCustomStyle.call(_this, $target, _this.context, _this.onFormatBlock); } else { _this.onFormatBlock(tagName, $target); } }); /** * insert horizontal rule */ this.insertHorizontalRule = this.wrapCommand(function () { var hrNode = _this.getLastRange().insertNode(dom.create('HR')); if (hrNode.nextSibling) { range.create(hrNode.nextSibling, 0).normalize().select(); _this.setLastRange(); } }); /** * lineHeight * @param {String} value */ this.lineHeight = this.wrapCommand(function (value) { _this.style.stylePara(_this.getLastRange(), { lineHeight: value }); }); /** * create link (command) * * @param {Object} linkInfo */ this.createLink = this.wrapCommand(function (linkInfo) { var linkUrl = linkInfo.url; var linkText = linkInfo.text; var isNewWindow = linkInfo.isNewWindow; var rng = linkInfo.range || _this.getLastRange(); var additionalTextLength = linkText.length - rng.toString().length; if (additionalTextLength > 0 && _this.isLimited(additionalTextLength)) { return; } var isTextChanged = rng.toString() !== linkText; // handle spaced urls from input if (typeof linkUrl === 'string') { linkUrl = linkUrl.trim(); } if (_this.options.onCreateLink) { linkUrl = _this.options.onCreateLink(linkUrl); } else { // if url doesn't have any protocol and not even a relative or a label, use http:// as default linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(linkUrl) ? linkUrl : 'http://' + linkUrl; } var anchors = []; if (isTextChanged) { rng = rng.deleteContents(); var anchor = rng.insertNode($$1('<A>' + linkText + '</A>')[0]); anchors.push(anchor); } else { anchors = _this.style.styleNodes(rng, { nodeName: 'A', expandClosestSibling: true, onlyPartialContains: true }); } $$1.each(anchors, function (idx, anchor) { $$1(anchor).attr('href', linkUrl); if (isNewWindow) { $$1(anchor).attr('target', '_blank'); } else { $$1(anchor).removeAttr('target'); } }); var startRange = range.createFromNodeBefore(lists.head(anchors)); var startPoint = startRange.getStartPoint(); var endRange = range.createFromNodeAfter(lists.last(anchors)); var endPoint = endRange.getEndPoint(); range.create(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset).select(); _this.setLastRange(); }); /** * setting color * * @param {Object} sObjColor color code * @param {String} sObjColor.foreColor foreground color * @param {String} sObjColor.backColor background color */ this.color = this.wrapCommand(function (colorInfo) { var foreColor = colorInfo.foreColor; var backColor = colorInfo.backColor; if (foreColor) { document.execCommand('foreColor', false, foreColor); } if (backColor) { document.execCommand('backColor', false, backColor); } }); /** * Set foreground color * * @param {String} colorCode foreground color code */ this.foreColor = this.wrapCommand(function (colorInfo) { document.execCommand('styleWithCSS', false, true); document.execCommand('foreColor', false, colorInfo); }); /** * insert Table * * @param {String} dimension of table (ex : "5x5") */ this.insertTable = this.wrapCommand(function (dim) { var dimension = dim.split('x'); var rng = _this.getLastRange().deleteContents(); rng.insertNode(_this.table.createTable(dimension[0], dimension[1], _this.options)); }); /** * remove media object and Figure Elements if media object is img with Figure. */ this.removeMedia = this.wrapCommand(function () { var $target = $$1(_this.restoreTarget()).parent(); if ($target.parent('figure').length) { $target.parent('figure').remove(); } else { $target = $$1(_this.restoreTarget()).detach(); } _this.context.triggerEvent('media.delete', $target, _this.$editable); }); /** * float me * * @param {String} value */ this.floatMe = this.wrapCommand(function (value) { var $target = $$1(_this.restoreTarget()); $target.toggleClass('note-float-left', value === 'left'); $target.toggleClass('note-float-right', value === 'right'); $target.css('float', (value === 'none' ? '' : value)); }); /** * resize overlay element * @param {String} value */ this.resize = this.wrapCommand(function (value) { var $target = $$1(_this.restoreTarget()); value = parseFloat(value); if (value === 0) { $target.css('width', ''); } else { $target.css({ width: value * 100 + '%', height: '' }); } }); } Editor.prototype.initialize = function () { var _this = this; // bind custom events this.$editable.on('keydown', function (event) { if (event.keyCode === key.code.ENTER) { _this.context.triggerEvent('enter', event); } _this.context.triggerEvent('keydown', event); if (!event.isDefaultPrevented()) { if (_this.options.shortcuts) { _this.handleKeyMap(event); } else { _this.preventDefaultEditableShortCuts(event); } } if (_this.isLimited(1, event)) { return false; } }).on('keyup', function (event) { _this.setLastRange(); _this.context.triggerEvent('keyup', event); }).on('focus', function (event) { _this.setLastRange(); _this.context.triggerEvent('focus', event); }).on('blur', function (event) { _this.context.triggerEvent('blur', event); }).on('mousedown', function (event) { _this.context.triggerEvent('mousedown', event); }).on('mouseup', function (event) { _this.setLastRange(); _this.context.triggerEvent('mouseup', event); }).on('scroll', function (event) { _this.context.triggerEvent('scroll', event); }).on('paste', function (event) { _this.setLastRange(); _this.context.triggerEvent('paste', event); }); this.$editable.attr('spellcheck', this.options.spellCheck); // init content before set event this.$editable.html(dom.html(this.$note) || dom.emptyPara); this.$editable.on(env.inputEventName, func.debounce(function () { _this.context.triggerEvent('change', _this.$editable.html(), _this.$editable); }, 10)); this.$editor.on('focusin', function (event) { _this.context.triggerEvent('focusin', event); }).on('focusout', function (event) { _this.context.triggerEvent('focusout', event); }); if (!this.options.airMode) { if (this.options.width) { this.$editor.outerWidth(this.options.width); } if (this.options.height) { this.$editable.outerHeight(this.options.height); } if (this.options.maxHeight) { this.$editable.css('max-height', this.options.maxHeight); } if (this.options.minHeight) { this.$editable.css('min-height', this.options.minHeight); } } this.history.recordUndo(); this.setLastRange(); }; Editor.prototype.destroy = function () { this.$editable.off(); }; Editor.prototype.handleKeyMap = function (event) { var keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc']; var keys = []; if (event.metaKey) { keys.push('CMD'); } if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); } if (event.shiftKey) { keys.push('SHIFT'); } var keyName = key.nameFromCode[event.keyCode]; if (keyName) { keys.push(keyName); } var eventName = keyMap[keys.join('+')]; if (eventName) { if (this.context.invoke(eventName) !== false) { event.preventDefault(); } } else if (key.isEdit(event.keyCode)) { this.afterCommand(); } }; Editor.prototype.preventDefaultEditableShortCuts = function (event) { // B(Bold, 66) / I(Italic, 73) / U(Underline, 85) if ((event.ctrlKey || event.metaKey) && lists.contains([66, 73, 85], event.keyCode)) { event.preventDefault(); } }; Editor.prototype.isLimited = function (pad, event) { pad = pad || 0; if (typeof event !== 'undefined') { if (key.isMove(event.keyCode) || (event.ctrlKey || event.metaKey) || lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) { return false; } } if (this.options.maxTextLength > 0) { if ((this.$editable.text().length + pad) >= this.options.maxTextLength) { return true; } } return false; }; /** * create range * @return {WrappedRange} */ Editor.prototype.createRange = function () { this.focus(); this.setLastRange(); return this.getLastRange(); }; Editor.prototype.setLastRange = function () { this.lastRange = range.create(this.editable); }; Editor.prototype.getLastRange = function () { if (!this.lastRange) { this.setLastRange(); } return this.lastRange; }; /** * saveRange * * save current range * * @param {Boolean} [thenCollapse=false] */ Editor.prototype.saveRange = function (thenCollapse) { if (thenCollapse) { this.getLastRange().collapse().select(); } }; /** * restoreRange * * restore lately range */ Editor.prototype.restoreRange = function () { if (this.lastRange) { this.lastRange.select(); this.focus(); } }; Editor.prototype.saveTarget = function (node) { this.$editable.data('target', node); }; Editor.prototype.clearTarget = function () { this.$editable.removeData('target'); }; Editor.prototype.restoreTarget = function () { return this.$editable.data('target'); }; /** * currentStyle * * current style * @return {Object|Boolean} unfocus */ Editor.prototype.currentStyle = function () { var rng = range.create(); if (rng) { rng = rng.normalize(); } return rng ? this.style.current(rng) : this.style.fromNode(this.$editable); }; /** * style from node * * @param {jQuery} $node * @return {Object} */ Editor.prototype.styleFromNode = function ($node) { return this.style.fromNode($node); }; /** * undo */ Editor.prototype.undo = function () { this.context.triggerEvent('before.command', this.$editable.html()); this.history.undo(); this.context.triggerEvent('change', this.$editable.html(), this.$editable); }; /* * commit */ Editor.prototype.commit = function () { this.context.triggerEvent('before.command', this.$editable.html()); this.history.commit(); this.context.triggerEvent('change', this.$editable.html(), this.$editable); }; /** * redo */ Editor.prototype.redo = function () { this.context.triggerEvent('before.command', this.$editable.html()); this.history.redo(); this.context.triggerEvent('change', this.$editable.html(), this.$editable); }; /** * before command */ Editor.prototype.beforeCommand = function () { this.context.triggerEvent('before.command', this.$editable.html()); // keep focus on editable before command execution this.focus(); }; /** * after command * @param {Boolean} isPreventTrigger */ Editor.prototype.afterCommand = function (isPreventTrigger) { this.normalizeContent(); this.history.recordUndo(); if (!isPreventTrigger) { this.context.triggerEvent('change', this.$editable.html(), this.$editable); } }; /** * handle tab key */ Editor.prototype.tab = function () { var rng = this.getLastRange(); if (rng.isCollapsed() && rng.isOnCell()) { this.table.tab(rng); } else { if (this.options.tabSize === 0) { return false; } if (!this.isLimited(this.options.tabSize)) { this.beforeCommand(); this.typing.insertTab(rng, this.options.tabSize); this.afterCommand(); } } }; /** * handle shift+tab key */ Editor.prototype.untab = function () { var rng = this.getLastRange(); if (rng.isCollapsed() && rng.isOnCell()) { this.table.tab(rng, true); } else { if (this.options.tabSize === 0) { return false; } } }; /** * run given function between beforeCommand and afterCommand */ Editor.prototype.wrapCommand = function (fn) { return function () { this.beforeCommand(); fn.apply(this, arguments); this.afterCommand(); }; }; /** * insert image * * @param {String} src * @param {String|Function} param * @return {Promise} */ Editor.prototype.insertImage = function (src, param) { var _this = this; return createImage(src, param).then(function ($image) { _this.beforeCommand(); if (typeof param === 'function') { param($image); } else { if (typeof param === 'string') { $image.attr('data-filename', param); } $image.css('width', Math.min(_this.$editable.width(), $image.width())); } $image.show(); range.create(_this.editable).insertNode($image[0]); range.createFromNodeAfter($image[0]).select(); _this.setLastRange(); _this.afterCommand(); }).fail(function (e) { _this.context.triggerEvent('image.upload.error', e); }); }; /** * insertImages * @param {File[]} files */ Editor.prototype.insertImagesAsDataURL = function (files) { var _this = this; $$1.each(files, function (idx, file) { var filename = file.name; if (_this.options.maximumImageFileSize && _this.options.maximumImageFileSize < file.size) { _this.context.triggerEvent('image.upload.error', _this.lang.image.maximumFileSizeError); } else { readFileAsDataURL(file).then(function (dataURL) { return _this.insertImage(dataURL, filename); }).fail(function () { _this.context.triggerEvent('image.upload.error'); }); } }); }; /** * insertImagesOrCallback * @param {File[]} files */ Editor.prototype.insertImagesOrCallback = function (files) { var callbacks = this.options.callbacks; // If onImageUpload set, if (callbacks.onImageUpload) { this.context.triggerEvent('image.upload', files); // else insert Image as dataURL } else { this.insertImagesAsDataURL(files); } }; /** * return selected plain text * @return {String} text */ Editor.prototype.getSelectedText = function () { var rng = this.getLastRange(); // if range on anchor, expand range with anchor if (rng.isOnAnchor()) { rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor)); } return rng.toString(); }; Editor.prototype.onFormatBlock = function (tagName, $target) { // [workaround] for MSIE, IE need `<` document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName); // support custom class if ($target && $target.length) { // find the exact element has given tagName if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) { $target = $target.find(tagName); } if ($target && $target.length) { var className = $target[0].className || ''; if (className) { var currentRange = this.createRange(); var $parent = $$1([currentRange.sc, currentRange.ec]).closest(tagName); $parent.addClass(className); } } } }; Editor.prototype.formatPara = function () { this.formatBlock('P'); }; Editor.prototype.fontStyling = function (target, value) { var rng = this.getLastRange(); if (rng) { var spans = this.style.styleNodes(rng); $$1(spans).css(target, value); // [workaround] added styled bogus span for style // - also bogus character needed for cursor position if (rng.isCollapsed()) { var firstSpan = lists.head(spans); if (firstSpan && !dom.nodeLength(firstSpan)) { firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR; range.createFromNodeAfter(firstSpan.firstChild).select(); this.setLastRange(); this.$editable.data(KEY_BOGUS, firstSpan); } } } }; /** * unlink * * @type command */ Editor.prototype.unlink = function () { var rng = this.getLastRange(); if (rng.isOnAnchor()) { var anchor = dom.ancestor(rng.sc, dom.isAnchor); rng = range.createFromNode(anchor); rng.select(); this.setLastRange(); this.beforeCommand(); document.execCommand('unlink'); this.afterCommand(); } }; /** * returns link info * * @return {Object} * @return {WrappedRange} return.range * @return {String} return.text * @return {Boolean} [return.isNewWindow=true] * @return {String} [return.url=""] */ Editor.prototype.getLinkInfo = function () { var rng = this.getLastRange().expand(dom.isAnchor); // Get the first anchor on range(for edit). var $anchor = $$1(lists.head(rng.nodes(dom.isAnchor))); var linkInfo = { range: rng, text: rng.toString(), url: $anchor.length ? $anchor.attr('href') : '' }; // When anchor exists, if ($anchor.length) { // Set isNewWindow by checking its target. linkInfo.isNewWindow = $anchor.attr('target') === '_blank'; } return linkInfo; }; Editor.prototype.addRow = function (position) { var rng = this.getLastRange(this.$editable); if (rng.isCollapsed() && rng.isOnCell()) { this.beforeCommand(); this.table.addRow(rng, position); this.afterCommand(); } }; Editor.prototype.addCol = function (position) { var rng = this.getLastRange(this.$editable); if (rng.isCollapsed() && rng.isOnCell()) { this.beforeCommand(); this.table.addCol(rng, position); this.afterCommand(); } }; Editor.prototype.deleteRow = function () { var rng = this.getLastRange(this.$editable); if (rng.isCollapsed() && rng.isOnCell()) { this.beforeCommand(); this.table.deleteRow(rng); this.afterCommand(); } }; Editor.prototype.deleteCol = function () { var rng = this.getLastRange(this.$editable); if (rng.isCollapsed() && rng.isOnCell()) { this.beforeCommand(); this.table.deleteCol(rng); this.afterCommand(); } }; Editor.prototype.deleteTable = function () { var rng = this.getLastRange(this.$editable); if (rng.isCollapsed() && rng.isOnCell()) { this.beforeCommand(); this.table.deleteTable(rng); this.afterCommand(); } }; /** * @param {Position} pos * @param {jQuery} $target - target element * @param {Boolean} [bKeepRatio] - keep ratio */ Editor.prototype.resizeTo = function (pos, $target, bKeepRatio) { var imageSize; if (bKeepRatio) { var newRatio = pos.y / pos.x; var ratio = $target.data('ratio'); imageSize = { width: ratio > newRatio ? pos.x : pos.y / ratio, height: ratio > newRatio ? pos.x * ratio : pos.y }; } else { imageSize = { width: pos.x, height: pos.y }; } $target.css(imageSize); }; /** * returns whether editable area has focus or not. */ Editor.prototype.hasFocus = function () { return this.$editable.is(':focus'); }; /** * set focus */ Editor.prototype.focus = function () { // [workaround] Screen will move when page is scolled in IE. // - do focus when not focused if (!this.hasFocus()) { this.$editable.focus(); } }; /** * returns whether contents is empty or not. * @return {Boolean} */ Editor.prototype.isEmpty = function () { return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html(); }; /** * Removes all contents and restores the editable instance to an _emptyPara_. */ Editor.prototype.empty = function () { this.context.invoke('code', dom.emptyPara); }; /** * normalize content */ Editor.prototype.normalizeContent = function () { this.$editable[0].normalize(); }; return Editor; }()); var Clipboard = /** @class */ (function () { function Clipboard(context) { this.context = context; this.$editable = context.layoutInfo.editable; } Clipboard.prototype.initialize = function () { this.$editable.on('paste', this.pasteByEvent.bind(this)); }; /** * paste by clipboard event * * @param {Event} event */ Clipboard.prototype.pasteByEvent = function (event) { var clipboardData = event.originalEvent.clipboardData; if (clipboardData && clipboardData.items && clipboardData.items.length) { // paste img file var item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items); if (item.kind === 'file' && item.type.indexOf('image/') !== -1) { this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]); } this.context.invoke('editor.afterCommand'); } }; return Clipboard; }()); var Dropzone = /** @class */ (function () { function Dropzone(context) { this.context = context; this.$eventListener = $$1(document); this.$editor = context.layoutInfo.editor; this.$editable = context.layoutInfo.editable; this.options = context.options; this.lang = this.options.langInfo; this.documentEventHandlers = {}; this.$dropzone = $$1([ '<div class="note-dropzone">', ' <div class="note-dropzone-message"/>', '</div>', ].join('')).prependTo(this.$editor); } /** * attach Drag and Drop Events */ Dropzone.prototype.initialize = function () { if (this.options.disableDragAndDrop) { // prevent default drop event this.documentEventHandlers.onDrop = function (e) { e.preventDefault(); }; // do not consider outside of dropzone this.$eventListener = this.$dropzone; this.$eventListener.on('drop', this.documentEventHandlers.onDrop); } else { this.attachDragAndDropEvent(); } }; /** * attach Drag and Drop Events */ Dropzone.prototype.attachDragAndDropEvent = function () { var _this = this; var collection = $$1(); var $dropzoneMessage = this.$dropzone.find('.note-dropzone-message'); this.documentEventHandlers.onDragenter = function (e) { var isCodeview = _this.context.invoke('codeview.isActivated'); var hasEditorSize = _this.$editor.width() > 0 && _this.$editor.height() > 0; if (!isCodeview && !collection.length && hasEditorSize) { _this.$editor.addClass('dragover'); _this.$dropzone.width(_this.$editor.width()); _this.$dropzone.height(_this.$editor.height()); $dropzoneMessage.text(_this.lang.image.dragImageHere); } collection = collection.add(e.target); }; this.documentEventHandlers.onDragleave = function (e) { collection = collection.not(e.target); if (!collection.length) { _this.$editor.removeClass('dragover'); } }; this.documentEventHandlers.onDrop = function () { collection = $$1(); _this.$editor.removeClass('dragover'); }; // show dropzone on dragenter when dragging a object to document // -but only if the editor is visible, i.e. has a positive width and height this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter) .on('dragleave', this.documentEventHandlers.onDragleave) .on('drop', this.documentEventHandlers.onDrop); // change dropzone's message on hover. this.$dropzone.on('dragenter', function () { _this.$dropzone.addClass('hover'); $dropzoneMessage.text(_this.lang.image.dropImage); }).on('dragleave', function () { _this.$dropzone.removeClass('hover'); $dropzoneMessage.text(_this.lang.image.dragImageHere); }); // attach dropImage this.$dropzone.on('drop', function (event) { var dataTransfer = event.originalEvent.dataTransfer; // stop the browser from opening the dropped content event.preventDefault(); if (dataTransfer && dataTransfer.files && dataTransfer.files.length) { _this.$editable.focus(); _this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files); } else { $$1.each(dataTransfer.types, function (idx, type) { var content = dataTransfer.getData(type); if (type.toLowerCase().indexOf('text') > -1) { _this.context.invoke('editor.pasteHTML', content); } else { $$1(content).each(function (idx, item) { _this.context.invoke('editor.insertNode', item); }); } }); } }).on('dragover', false); // prevent default dragover event }; Dropzone.prototype.destroy = function () { var _this = this; Object.keys(this.documentEventHandlers).forEach(function (key) { _this.$eventListener.off(key.substr(2).toLowerCase(), _this.documentEventHandlers[key]); }); this.documentEventHandlers = {}; }; return Dropzone; }()); var CodeMirror; if (env.hasCodeMirror) { CodeMirror = window.CodeMirror; } /** * @class Codeview */ var CodeView = /** @class */ (function () { function CodeView(context) { this.context = context; this.$editor = context.layoutInfo.editor; this.$editable = context.layoutInfo.editable; this.$codable = context.layoutInfo.codable; this.options = context.options; } CodeView.prototype.sync = function () { var isCodeview = this.isActivated(); if (isCodeview && env.hasCodeMirror) { this.$codable.data('cmEditor').save(); } }; /** * @return {Boolean} */ CodeView.prototype.isActivated = function () { return this.$editor.hasClass('codeview'); }; /** * toggle codeview */ CodeView.prototype.toggle = function () { if (this.isActivated()) { this.deactivate(); } else { this.activate(); } this.context.triggerEvent('codeview.toggled'); }; /** * purify input value * @param value * @returns {*} */ CodeView.prototype.purify = function (value) { if (this.options.codeviewFilter) { // filter code view regex value = value.replace(this.options.codeviewFilterRegex, ''); // allow specific iframe tag if (this.options.codeviewIframeFilter) { var whitelist_1 = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase); value = value.replace(/(<iframe.*?>.*?(?:<\/iframe>)?)/gi, function (tag) { // remove if src attribute is duplicated if (/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(tag)) { return ''; } for (var _i = 0, whitelist_2 = whitelist_1; _i < whitelist_2.length; _i++) { var src = whitelist_2[_i]; // pass if src is trusted if ((new RegExp('src="(https?:)?\/\/' + src.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') + '\/(.+)"')).test(tag)) { return tag; } } return ''; }); } } return value; }; /** * activate code view */ CodeView.prototype.activate = function () { var _this = this; this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml)); this.$codable.height(this.$editable.height()); this.context.invoke('toolbar.updateCodeview', true); this.$editor.addClass('codeview'); this.$codable.focus(); // activate CodeMirror as codable if (env.hasCodeMirror) { var cmEditor_1 = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror); // CodeMirror TernServer if (this.options.codemirror.tern) { var server_1 = new CodeMirror.TernServer(this.options.codemirror.tern); cmEditor_1.ternServer = server_1; cmEditor_1.on('cursorActivity', function (cm) { server_1.updateArgHints(cm); }); } cmEditor_1.on('blur', function (event) { _this.context.triggerEvent('blur.codeview', cmEditor_1.getValue(), event); }); cmEditor_1.on('change', function (event) { _this.context.triggerEvent('change.codeview', cmEditor_1.getValue(), cmEditor_1); }); // CodeMirror hasn't Padding. cmEditor_1.setSize(null, this.$editable.outerHeight()); this.$codable.data('cmEditor', cmEditor_1); } else { this.$codable.on('blur', function (event) { _this.context.triggerEvent('blur.codeview', _this.$codable.val(), event); }); this.$codable.on('input', function (event) { _this.context.triggerEvent('change.codeview', _this.$codable.val(), _this.$codable); }); } }; /** * deactivate code view */ CodeView.prototype.deactivate = function () { // deactivate CodeMirror as codable if (env.hasCodeMirror) { var cmEditor = this.$codable.data('cmEditor'); this.$codable.val(cmEditor.getValue()); cmEditor.toTextArea(); } var value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara); var isChange = this.$editable.html() !== value; this.$editable.html(value); this.$editable.height(this.options.height ? this.$codable.height() : 'auto'); this.$editor.removeClass('codeview'); if (isChange) { this.context.triggerEvent('change', this.$editable.html(), this.$editable); } this.$editable.focus(); this.context.invoke('toolbar.updateCodeview', false); }; CodeView.prototype.destroy = function () { if (this.isActivated()) { this.deactivate(); } }; return CodeView; }()); var EDITABLE_PADDING = 24; var Statusbar = /** @class */ (function () { function Statusbar(context) { this.$document = $$1(document); this.$statusbar = context.layoutInfo.statusbar; this.$editable = context.layoutInfo.editable; this.options = context.options; } Statusbar.prototype.initialize = function () { var _this = this; if (this.options.airMode || this.options.disableResizeEditor) { this.destroy(); return; } this.$statusbar.on('mousedown', function (event) { event.preventDefault(); event.stopPropagation(); var editableTop = _this.$editable.offset().top - _this.$document.scrollTop(); var onMouseMove = function (event) { var height = event.clientY - (editableTop + EDITABLE_PADDING); height = (_this.options.minheight > 0) ? Math.max(height, _this.options.minheight) : height; height = (_this.options.maxHeight > 0) ? Math.min(height, _this.options.maxHeight) : height; _this.$editable.height(height); }; _this.$document.on('mousemove', onMouseMove).one('mouseup', function () { _this.$document.off('mousemove', onMouseMove); }); }); }; Statusbar.prototype.destroy = function () { this.$statusbar.off(); this.$statusbar.addClass('locked'); }; return Statusbar; }()); var Fullscreen = /** @class */ (function () { function Fullscreen(context) { var _this = this; this.context = context; this.$editor = context.layoutInfo.editor; this.$toolbar = context.layoutInfo.toolbar; this.$editable = context.layoutInfo.editable; this.$codable = context.layoutInfo.codable; this.$window = $$1(window); this.$scrollbar = $$1('html, body'); this.onResize = function () { _this.resizeTo({ h: _this.$window.height() - _this.$toolbar.outerHeight() }); }; } Fullscreen.prototype.resizeTo = function (size) { this.$editable.css('height', size.h); this.$codable.css('height', size.h); if (this.$codable.data('cmeditor')) { this.$codable.data('cmeditor').setsize(null, size.h); } }; /** * toggle fullscreen */ Fullscreen.prototype.toggle = function () { this.$editor.toggleClass('fullscreen'); if (this.isFullscreen()) { this.$editable.data('orgHeight', this.$editable.css('height')); this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight')); this.$editable.css('maxHeight', ''); this.$window.on('resize', this.onResize).trigger('resize'); this.$scrollbar.css('overflow', 'hidden'); } else { this.$window.off('resize', this.onResize); this.resizeTo({ h: this.$editable.data('orgHeight') }); this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight')); this.$scrollbar.css('overflow', 'visible'); } this.context.invoke('toolbar.updateFullscreen', this.isFullscreen()); }; Fullscreen.prototype.isFullscreen = function () { return this.$editor.hasClass('fullscreen'); }; return Fullscreen; }()); var Handle = /** @class */ (function () { function Handle(context) { var _this = this; this.context = context; this.$document = $$1(document); this.$editingArea = context.layoutInfo.editingArea; this.options = context.options; this.lang = this.options.langInfo; this.events = { 'summernote.mousedown': function (we, e) { if (_this.update(e.target, e)) { e.preventDefault(); } }, 'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': function () { _this.update(); }, 'summernote.disable': function () { _this.hide(); }, 'summernote.codeview.toggled': function () { _this.update(); } }; } Handle.prototype.initialize = function () { var _this = this; this.$handle = $$1([ '<div class="note-handle">', '<div class="note-control-selection">', '<div class="note-control-selection-bg"></div>', '<div class="note-control-holder note-control-nw"></div>', '<div class="note-control-holder note-control-ne"></div>', '<div class="note-control-holder note-control-sw"></div>', '<div class="', (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'), ' note-control-se"></div>', (this.options.disableResizeImage ? '' : '<div class="note-control-selection-info"></div>'), '</div>', '</div>', ].join('')).prependTo(this.$editingArea); this.$handle.on('mousedown', function (event) { if (dom.isControlSizing(event.target)) { event.preventDefault(); event.stopPropagation(); var $target_1 = _this.$handle.find('.note-control-selection').data('target'); var posStart_1 = $target_1.offset(); var scrollTop_1 = _this.$document.scrollTop(); var onMouseMove_1 = function (event) { _this.context.invoke('editor.resizeTo', { x: event.clientX - posStart_1.left, y: event.clientY - (posStart_1.top - scrollTop_1) }, $target_1, !event.shiftKey); _this.update($target_1[0]); }; _this.$document .on('mousemove', onMouseMove_1) .one('mouseup', function (e) { e.preventDefault(); _this.$document.off('mousemove', onMouseMove_1); _this.context.invoke('editor.afterCommand'); }); if (!$target_1.data('ratio')) { // original ratio. $target_1.data('ratio', $target_1.height() / $target_1.width()); } } }); // Listen for scrolling on the handle overlay. this.$handle.on('wheel', function (e) { e.preventDefault(); _this.update(); }); }; Handle.prototype.destroy = function () { this.$handle.remove(); }; Handle.prototype.update = function (target, event) { if (this.context.isDisabled()) { return false; } var isImage = dom.isImg(target); var $selection = this.$handle.find('.note-control-selection'); this.context.invoke('imagePopover.update', target, event); if (isImage) { var $image = $$1(target); var position = $image.position(); var pos = { left: position.left + parseInt($image.css('marginLeft'), 10), top: position.top + parseInt($image.css('marginTop'), 10) }; // exclude margin var imageSize = { w: $image.outerWidth(false), h: $image.outerHeight(false) }; $selection.css({ display: 'block', left: pos.left, top: pos.top, width: imageSize.w, height: imageSize.h }).data('target', $image); // save current image element. var origImageObj = new Image(); origImageObj.src = $image.attr('src'); var sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')'; $selection.find('.note-control-selection-info').text(sizingText); this.context.invoke('editor.saveTarget', target); } else { this.hide(); } return isImage; }; /** * hide * * @param {jQuery} $handle */ Handle.prototype.hide = function () { this.context.invoke('editor.clearTarget'); this.$handle.children().hide(); }; return Handle; }()); var defaultScheme = 'http://'; var linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i; var AutoLink = /** @class */ (function () { function AutoLink(context) { var _this = this; this.context = context; this.events = { 'summernote.keyup': function (we, e) { if (!e.isDefaultPrevented()) { _this.handleKeyup(e); } }, 'summernote.keydown': function (we, e) { _this.handleKeydown(e); } }; } AutoLink.prototype.initialize = function () { this.lastWordRange = null; }; AutoLink.prototype.destroy = function () { this.lastWordRange = null; }; AutoLink.prototype.replace = function () { if (!this.lastWordRange) { return; } var keyword = this.lastWordRange.toString(); var match = keyword.match(linkPattern); if (match && (match[1] || match[2])) { var link = match[1] ? keyword : defaultScheme + keyword; var node = $$1('<a />').html(keyword).attr('href', link)[0]; if (this.context.options.linkTargetBlank) { $$1(node).attr('target', '_blank'); } this.lastWordRange.insertNode(node); this.lastWordRange = null; this.context.invoke('editor.focus'); } }; AutoLink.prototype.handleKeydown = function (e) { if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) { var wordRange = this.context.invoke('editor.createRange').getWordRange(); this.lastWordRange = wordRange; } }; AutoLink.prototype.handleKeyup = function (e) { if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) { this.replace(); } }; return AutoLink; }()); /** * textarea auto sync. */ var AutoSync = /** @class */ (function () { function AutoSync(context) { var _this = this; this.$note = context.layoutInfo.note; this.events = { 'summernote.change': function () { _this.$note.val(context.invoke('code')); } }; } AutoSync.prototype.shouldInitialize = function () { return dom.isTextarea(this.$note[0]); }; return AutoSync; }()); var AutoReplace = /** @class */ (function () { function AutoReplace(context) { var _this = this; this.context = context; this.options = context.options.replace || {}; this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH]; this.previousKeydownCode = null; this.events = { 'summernote.keyup': function (we, e) { if (!e.isDefaultPrevented()) { _this.handleKeyup(e); } }, 'summernote.keydown': function (we, e) { _this.handleKeydown(e); } }; } AutoReplace.prototype.shouldInitialize = function () { return !!this.options.match; }; AutoReplace.prototype.initialize = function () { this.lastWord = null; }; AutoReplace.prototype.destroy = function () { this.lastWord = null; }; AutoReplace.prototype.replace = function () { if (!this.lastWord) { return; } var self = this; var keyword = this.lastWord.toString(); this.options.match(keyword, function (match) { if (match) { var node = ''; if (typeof match === 'string') { node = dom.createText(match); } else if (match instanceof jQuery) { node = match[0]; } else if (match instanceof Node) { node = match; } if (!node) return; self.lastWord.insertNode(node); self.lastWord = null; self.context.invoke('editor.focus'); } }); }; AutoReplace.prototype.handleKeydown = function (e) { // this forces it to remember the last whole word, even if multiple termination keys are pressed // before the previous key is let go. if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) { this.previousKeydownCode = e.keyCode; return; } if (lists.contains(this.keys, e.keyCode)) { var wordRange = this.context.invoke('editor.createRange').getWordRange(); this.lastWord = wordRange; } this.previousKeydownCode = e.keyCode; }; AutoReplace.prototype.handleKeyup = function (e) { if (lists.contains(this.keys, e.keyCode)) { this.replace(); } }; return AutoReplace; }()); var Placeholder = /** @class */ (function () { function Placeholder(context) { var _this = this; this.context = context; this.$editingArea = context.layoutInfo.editingArea; this.options = context.options; this.events = { 'summernote.init summernote.change': function () { _this.update(); }, 'summernote.codeview.toggled': function () { _this.update(); } }; } Placeholder.prototype.shouldInitialize = function () { return !!this.options.placeholder; }; Placeholder.prototype.initialize = function () { var _this = this; this.$placeholder = $$1('<div class="note-placeholder">'); this.$placeholder.on('click', function () { _this.context.invoke('focus'); }).html(this.options.placeholder).prependTo(this.$editingArea); this.update(); }; Placeholder.prototype.destroy = function () { this.$placeholder.remove(); }; Placeholder.prototype.update = function () { var isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty'); this.$placeholder.toggle(isShow); }; return Placeholder; }()); var Buttons = /** @class */ (function () { function Buttons(context) { this.ui = $$1.summernote.ui; this.context = context; this.$toolbar = context.layoutInfo.toolbar; this.options = context.options; this.lang = this.options.langInfo; this.invertedKeyMap = func.invertObject(this.options.keyMap[env.isMac ? 'mac' : 'pc']); } Buttons.prototype.representShortcut = function (editorMethod) { var shortcut = this.invertedKeyMap[editorMethod]; if (!this.options.shortcuts || !shortcut) { return ''; } if (env.isMac) { shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧'); } shortcut = shortcut.replace('BACKSLASH', '\\') .replace('SLASH', '/') .replace('LEFTBRACKET', '[') .replace('RIGHTBRACKET', ']'); return ' (' + shortcut + ')'; }; Buttons.prototype.button = function (o) { if (!this.options.tooltip && o.tooltip) { delete o.tooltip; } o.container = this.options.container; return this.ui.button(o); }; Buttons.prototype.initialize = function () { this.addToolbarButtons(); this.addImagePopoverButtons(); this.addLinkPopoverButtons(); this.addTablePopoverButtons(); this.fontInstalledMap = {}; }; Buttons.prototype.destroy = function () { delete this.fontInstalledMap; }; Buttons.prototype.isFontInstalled = function (name) { if (!this.fontInstalledMap.hasOwnProperty(name)) { this.fontInstalledMap[name] = env.isFontInstalled(name) || lists.contains(this.options.fontNamesIgnoreCheck, name); } return this.fontInstalledMap[name]; }; Buttons.prototype.isFontDeservedToAdd = function (name) { var genericFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy']; name = name.toLowerCase(); return (name !== '' && this.isFontInstalled(name) && genericFamilies.indexOf(name) === -1); }; Buttons.prototype.colorPalette = function (className, tooltip, backColor, foreColor) { var _this = this; return this.ui.buttonGroup({ className: 'note-color ' + className, children: [ this.button({ className: 'note-current-color-button', contents: this.ui.icon(this.options.icons.font + ' note-recent-color'), tooltip: tooltip, click: function (e) { var $button = $$1(e.currentTarget); if (backColor && foreColor) { _this.context.invoke('editor.color', { backColor: $button.attr('data-backColor'), foreColor: $button.attr('data-foreColor') }); } else if (backColor) { _this.context.invoke('editor.color', { backColor: $button.attr('data-backColor') }); } else if (foreColor) { _this.context.invoke('editor.color', { foreColor: $button.attr('data-foreColor') }); } }, callback: function ($button) { var $recentColor = $button.find('.note-recent-color'); if (backColor) { $recentColor.css('background-color', _this.options.colorButton.backColor); $button.attr('data-backColor', _this.options.colorButton.backColor); } if (foreColor) { $recentColor.css('color', _this.options.colorButton.foreColor); $button.attr('data-foreColor', _this.options.colorButton.foreColor); } else { $recentColor.css('color', 'transparent'); } } }), this.button({ className: 'dropdown-toggle', contents: this.ui.dropdownButtonContents('', this.options), tooltip: this.lang.color.more, data: { toggle: 'dropdown' } }), this.ui.dropdown({ items: (backColor ? [ '<div class="note-palette">', ' <div class="note-palette-title">' + this.lang.color.background + '</div>', ' <div>', ' <button type="button" class="note-color-reset btn btn-light" data-event="backColor" data-value="inherit">', this.lang.color.transparent, ' </button>', ' </div>', ' <div class="note-holder" data-event="backColor"/>', ' <div>', ' <button type="button" class="note-color-select btn" data-event="openPalette" data-value="backColorPicker">', this.lang.color.cpSelect, ' </button>', ' <input type="color" id="backColorPicker" class="note-btn note-color-select-btn" value="' + this.options.colorButton.backColor + '" data-event="backColorPalette">', ' </div>', ' <div class="note-holder-custom" id="backColorPalette" data-event="backColor"/>', '</div>', ].join('') : '') + (foreColor ? [ '<div class="note-palette">', ' <div class="note-palette-title">' + this.lang.color.foreground + '</div>', ' <div>', ' <button type="button" class="note-color-reset btn btn-light" data-event="removeFormat" data-value="foreColor">', this.lang.color.resetToDefault, ' </button>', ' </div>', ' <div class="note-holder" data-event="foreColor"/>', ' <div>', ' <button type="button" class="note-color-select btn" data-event="openPalette" data-value="foreColorPicker">', this.lang.color.cpSelect, ' </button>', ' <input type="color" id="foreColorPicker" class="note-btn note-color-select-btn" value="' + this.options.colorButton.foreColor + '" data-event="foreColorPalette">', ' <div class="note-holder-custom" id="foreColorPalette" data-event="foreColor"/>', '</div>', ].join('') : ''), callback: function ($dropdown) { $dropdown.find('.note-holder').each(function (idx, item) { var $holder = $$1(item); $holder.append(_this.ui.palette({ colors: _this.options.colors, colorsName: _this.options.colorsName, eventName: $holder.data('event'), container: _this.options.container, tooltip: _this.options.tooltip }).render()); }); /* TODO: do we have to record recent custom colors within cookies? */ var customColors = [ ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'], ]; $dropdown.find('.note-holder-custom').each(function (idx, item) { var $holder = $$1(item); $holder.append(_this.ui.palette({ colors: customColors, colorsName: customColors, eventName: $holder.data('event'), container: _this.options.container, tooltip: _this.options.tooltip }).render()); }); $dropdown.find('input[type=color]').each(function (idx, item) { $$1(item).change(function () { var $chip = $dropdown.find('#' + $$1(this).data('event')).find('.note-color-btn').first(); var color = this.value.toUpperCase(); $chip.css('background-color', color) .attr('aria-label', color) .attr('data-value', color) .attr('data-original-title', color); $chip.click(); }); }); }, click: function (event) { event.stopPropagation(); var $parent = $$1('.' + className); var $button = $$1(event.target); var eventName = $button.data('event'); var value = $button.attr('data-value'); if (eventName === 'openPalette') { var $picker = $parent.find('#' + value); var $palette = $$1($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]); // Shift palette chips var $chip = $palette.find('.note-color-btn').last().detach(); // Set chip attributes var color = $picker.val(); $chip.css('background-color', color) .attr('aria-label', color) .attr('data-value', color) .attr('data-original-title', color); $palette.prepend($chip); $picker.click(); } else if (lists.contains(['backColor', 'foreColor'], eventName)) { var key = eventName === 'backColor' ? 'background-color' : 'color'; var $color = $button.closest('.note-color').find('.note-recent-color'); var $currentButton = $button.closest('.note-color').find('.note-current-color-button'); $color.css(key, value); $currentButton.attr('data-' + eventName, value); _this.context.invoke('editor.' + eventName, value); } } }), ] }).render(); }; Buttons.prototype.addToolbarButtons = function () { var _this = this; this.context.memo('button.style', function () { return _this.ui.buttonGroup([ _this.button({ className: 'dropdown-toggle', contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.magic), _this.options), tooltip: _this.lang.style.style, data: { toggle: 'dropdown' } }), _this.ui.dropdown({ className: 'dropdown-style', items: _this.options.styleTags, title: _this.lang.style.style, template: function (item) { if (typeof item === 'string') { item = { tag: item, title: (_this.lang.style.hasOwnProperty(item) ? _this.lang.style[item] : item) }; } var tag = item.tag; var title = item.title; var style = item.style ? ' style="' + item.style + '" ' : ''; var className = item.className ? ' class="' + item.className + '"' : ''; return '<' + tag + style + className + '>' + title + '</' + tag + '>'; }, click: _this.context.createInvokeHandler('editor.formatBlock') }), ]).render(); }); var _loop_1 = function (styleIdx, styleLen) { var item = this_1.options.styleTags[styleIdx]; this_1.context.memo('button.style.' + item, function () { return _this.button({ className: 'note-btn-style-' + item, contents: '<div data-value="' + item + '">' + item.toUpperCase() + '</div>', tooltip: _this.lang.style[item], click: _this.context.createInvokeHandler('editor.formatBlock') }).render(); }); }; var this_1 = this; for (var styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) { _loop_1(styleIdx, styleLen); } this.context.memo('button.bold', function () { return _this.button({ className: 'note-btn-bold', contents: _this.ui.icon(_this.options.icons.bold), tooltip: _this.lang.font.bold + _this.representShortcut('bold'), click: _this.context.createInvokeHandlerAndUpdateState('editor.bold') }).render(); }); this.context.memo('button.italic', function () { return _this.button({ className: 'note-btn-italic', contents: _this.ui.icon(_this.options.icons.italic), tooltip: _this.lang.font.italic + _this.representShortcut('italic'), click: _this.context.createInvokeHandlerAndUpdateState('editor.italic') }).render(); }); this.context.memo('button.underline', function () { return _this.button({ className: 'note-btn-underline', contents: _this.ui.icon(_this.options.icons.underline), tooltip: _this.lang.font.underline + _this.representShortcut('underline'), click: _this.context.createInvokeHandlerAndUpdateState('editor.underline') }).render(); }); this.context.memo('button.clear', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.eraser), tooltip: _this.lang.font.clear + _this.representShortcut('removeFormat'), click: _this.context.createInvokeHandler('editor.removeFormat') }).render(); }); this.context.memo('button.strikethrough', function () { return _this.button({ className: 'note-btn-strikethrough', contents: _this.ui.icon(_this.options.icons.strikethrough), tooltip: _this.lang.font.strikethrough + _this.representShortcut('strikethrough'), click: _this.context.createInvokeHandlerAndUpdateState('editor.strikethrough') }).render(); }); this.context.memo('button.superscript', function () { return _this.button({ className: 'note-btn-superscript', contents: _this.ui.icon(_this.options.icons.superscript), tooltip: _this.lang.font.superscript, click: _this.context.createInvokeHandlerAndUpdateState('editor.superscript') }).render(); }); this.context.memo('button.subscript', function () { return _this.button({ className: 'note-btn-subscript', contents: _this.ui.icon(_this.options.icons.subscript), tooltip: _this.lang.font.subscript, click: _this.context.createInvokeHandlerAndUpdateState('editor.subscript') }).render(); }); this.context.memo('button.fontname', function () { var styleInfo = _this.context.invoke('editor.currentStyle'); // Add 'default' fonts into the fontnames array if not exist $$1.each(styleInfo['font-family'].split(','), function (idx, fontname) { fontname = fontname.trim().replace(/['"]+/g, ''); if (_this.isFontDeservedToAdd(fontname)) { if (_this.options.fontNames.indexOf(fontname) === -1) { _this.options.fontNames.push(fontname); } } }); return _this.ui.buttonGroup([ _this.button({ className: 'dropdown-toggle', contents: _this.ui.dropdownButtonContents('<span class="note-current-fontname"/>', _this.options), tooltip: _this.lang.font.name, data: { toggle: 'dropdown' } }), _this.ui.dropdownCheck({ className: 'dropdown-fontname', checkClassName: _this.options.icons.menuCheck, items: _this.options.fontNames.filter(_this.isFontInstalled.bind(_this)), title: _this.lang.font.name, template: function (item) { return '<span style="font-family: \'' + item + '\'">' + item + '</span>'; }, click: _this.context.createInvokeHandlerAndUpdateState('editor.fontName') }), ]).render(); }); this.context.memo('button.fontsize', function () { return _this.ui.buttonGroup([ _this.button({ className: 'dropdown-toggle', contents: _this.ui.dropdownButtonContents('<span class="note-current-fontsize"/>', _this.options), tooltip: _this.lang.font.size, data: { toggle: 'dropdown' } }), _this.ui.dropdownCheck({ className: 'dropdown-fontsize', checkClassName: _this.options.icons.menuCheck, items: _this.options.fontSizes, title: _this.lang.font.size, click: _this.context.createInvokeHandlerAndUpdateState('editor.fontSize') }), ]).render(); }); this.context.memo('button.color', function () { return _this.colorPalette('note-color-all', _this.lang.color.recent, true, true); }); this.context.memo('button.forecolor', function () { return _this.colorPalette('note-color-fore', _this.lang.color.foreground, false, true); }); this.context.memo('button.backcolor', function () { return _this.colorPalette('note-color-back', _this.lang.color.background, true, false); }); this.context.memo('button.ul', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.unorderedlist), tooltip: _this.lang.lists.unordered + _this.representShortcut('insertUnorderedList'), click: _this.context.createInvokeHandler('editor.insertUnorderedList') }).render(); }); this.context.memo('button.ol', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.orderedlist), tooltip: _this.lang.lists.ordered + _this.representShortcut('insertOrderedList'), click: _this.context.createInvokeHandler('editor.insertOrderedList') }).render(); }); var justifyLeft = this.button({ contents: this.ui.icon(this.options.icons.alignLeft), tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'), click: this.context.createInvokeHandler('editor.justifyLeft') }); var justifyCenter = this.button({ contents: this.ui.icon(this.options.icons.alignCenter), tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'), click: this.context.createInvokeHandler('editor.justifyCenter') }); var justifyRight = this.button({ contents: this.ui.icon(this.options.icons.alignRight), tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'), click: this.context.createInvokeHandler('editor.justifyRight') }); var justifyFull = this.button({ contents: this.ui.icon(this.options.icons.alignJustify), tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'), click: this.context.createInvokeHandler('editor.justifyFull') }); var outdent = this.button({ contents: this.ui.icon(this.options.icons.outdent), tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'), click: this.context.createInvokeHandler('editor.outdent') }); var indent = this.button({ contents: this.ui.icon(this.options.icons.indent), tooltip: this.lang.paragraph.indent + this.representShortcut('indent'), click: this.context.createInvokeHandler('editor.indent') }); this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render')); this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render')); this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render')); this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render')); this.context.memo('button.outdent', func.invoke(outdent, 'render')); this.context.memo('button.indent', func.invoke(indent, 'render')); this.context.memo('button.paragraph', function () { return _this.ui.buttonGroup([ _this.button({ className: 'dropdown-toggle', contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.alignLeft), _this.options), tooltip: _this.lang.paragraph.paragraph, data: { toggle: 'dropdown' } }), _this.ui.dropdown([ _this.ui.buttonGroup({ className: 'note-align', children: [justifyLeft, justifyCenter, justifyRight, justifyFull] }), _this.ui.buttonGroup({ className: 'note-list', children: [outdent, indent] }), ]), ]).render(); }); this.context.memo('button.height', function () { return _this.ui.buttonGroup([ _this.button({ className: 'dropdown-toggle', contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.textHeight), _this.options), tooltip: _this.lang.font.height, data: { toggle: 'dropdown' } }), _this.ui.dropdownCheck({ items: _this.options.lineHeights, checkClassName: _this.options.icons.menuCheck, className: 'dropdown-line-height', title: _this.lang.font.height, click: _this.context.createInvokeHandler('editor.lineHeight') }), ]).render(); }); this.context.memo('button.table', function () { return _this.ui.buttonGroup([ _this.button({ className: 'dropdown-toggle', contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.table), _this.options), tooltip: _this.lang.table.table, data: { toggle: 'dropdown' } }), _this.ui.dropdown({ title: _this.lang.table.table, className: 'note-table', items: [ '<div class="note-dimension-picker">', ' <div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>', ' <div class="note-dimension-picker-highlighted"/>', ' <div class="note-dimension-picker-unhighlighted"/>', '</div>', '<div class="note-dimension-display">1 x 1</div>', ].join('') }), ], { callback: function ($node) { var $catcher = $node.find('.note-dimension-picker-mousecatcher'); $catcher.css({ width: _this.options.insertTableMaxSize.col + 'em', height: _this.options.insertTableMaxSize.row + 'em' }).mousedown(_this.context.createInvokeHandler('editor.insertTable')) .on('mousemove', _this.tableMoveHandler.bind(_this)); } }).render(); }); this.context.memo('button.link', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.link), tooltip: _this.lang.link.link + _this.representShortcut('linkDialog.show'), click: _this.context.createInvokeHandler('linkDialog.show') }).render(); }); this.context.memo('button.picture', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.picture), tooltip: _this.lang.image.image, click: _this.context.createInvokeHandler('imageDialog.show') }).render(); }); this.context.memo('button.video', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.video), tooltip: _this.lang.video.video, click: _this.context.createInvokeHandler('videoDialog.show') }).render(); }); this.context.memo('button.hr', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.minus), tooltip: _this.lang.hr.insert + _this.representShortcut('insertHorizontalRule'), click: _this.context.createInvokeHandler('editor.insertHorizontalRule') }).render(); }); this.context.memo('button.fullscreen', function () { return _this.button({ className: 'btn-fullscreen', contents: _this.ui.icon(_this.options.icons.arrowsAlt), tooltip: _this.lang.options.fullscreen, click: _this.context.createInvokeHandler('fullscreen.toggle') }).render(); }); this.context.memo('button.codeview', function () { return _this.button({ className: 'btn-codeview', contents: _this.ui.icon(_this.options.icons.code), tooltip: _this.lang.options.codeview, click: _this.context.createInvokeHandler('codeview.toggle') }).render(); }); this.context.memo('button.redo', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.redo), tooltip: _this.lang.history.redo + _this.representShortcut('redo'), click: _this.context.createInvokeHandler('editor.redo') }).render(); }); this.context.memo('button.undo', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.undo), tooltip: _this.lang.history.undo + _this.representShortcut('undo'), click: _this.context.createInvokeHandler('editor.undo') }).render(); }); this.context.memo('button.help', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.question), tooltip: _this.lang.options.help, click: _this.context.createInvokeHandler('helpDialog.show') }).render(); }); }; /** * image: [ * ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']], * ['float', ['floatLeft', 'floatRight', 'floatNone']], * ['remove', ['removeMedia']], * ], */ Buttons.prototype.addImagePopoverButtons = function () { var _this = this; // Image Size Buttons this.context.memo('button.resizeFull', function () { return _this.button({ contents: '<span class="note-fontsize-10">100%</span>', tooltip: _this.lang.image.resizeFull, click: _this.context.createInvokeHandler('editor.resize', '1') }).render(); }); this.context.memo('button.resizeHalf', function () { return _this.button({ contents: '<span class="note-fontsize-10">50%</span>', tooltip: _this.lang.image.resizeHalf, click: _this.context.createInvokeHandler('editor.resize', '0.5') }).render(); }); this.context.memo('button.resizeQuarter', function () { return _this.button({ contents: '<span class="note-fontsize-10">25%</span>', tooltip: _this.lang.image.resizeQuarter, click: _this.context.createInvokeHandler('editor.resize', '0.25') }).render(); }); this.context.memo('button.resizeNone', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.rollback), tooltip: _this.lang.image.resizeNone, click: _this.context.createInvokeHandler('editor.resize', '0') }).render(); }); // Float Buttons this.context.memo('button.floatLeft', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.floatLeft), tooltip: _this.lang.image.floatLeft, click: _this.context.createInvokeHandler('editor.floatMe', 'left') }).render(); }); this.context.memo('button.floatRight', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.floatRight), tooltip: _this.lang.image.floatRight, click: _this.context.createInvokeHandler('editor.floatMe', 'right') }).render(); }); this.context.memo('button.floatNone', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.rollback), tooltip: _this.lang.image.floatNone, click: _this.context.createInvokeHandler('editor.floatMe', 'none') }).render(); }); // Remove Buttons this.context.memo('button.removeMedia', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.trash), tooltip: _this.lang.image.remove, click: _this.context.createInvokeHandler('editor.removeMedia') }).render(); }); }; Buttons.prototype.addLinkPopoverButtons = function () { var _this = this; this.context.memo('button.linkDialogShow', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.link), tooltip: _this.lang.link.edit, click: _this.context.createInvokeHandler('linkDialog.show') }).render(); }); this.context.memo('button.unlink', function () { return _this.button({ contents: _this.ui.icon(_this.options.icons.unlink), tooltip: _this.lang.link.unlink, click: _this.context.createInvokeHandler('editor.unlink') }).render(); }); }; /** * table : [ * ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']], * ['delete', ['deleteRow', 'deleteCol', 'deleteTable']] * ], */ Buttons.prototype.addTablePopoverButtons = function () { var _this = this; this.context.memo('button.addRowUp', function () { return _this.button({ className: 'btn-md', contents: _this.ui.icon(_this.options.icons.rowAbove), tooltip: _this.lang.table.addRowAbove, click: _this.context.createInvokeHandler('editor.addRow', 'top') }).render(); }); this.context.memo('button.addRowDown', function () { return _this.button({ className: 'btn-md', contents: _this.ui.icon(_this.options.icons.rowBelow), tooltip: _this.lang.table.addRowBelow, click: _this.context.createInvokeHandler('editor.addRow', 'bottom') }).render(); }); this.context.memo('button.addColLeft', function () { return _this.button({ className: 'btn-md', contents: _this.ui.icon(_this.options.icons.colBefore), tooltip: _this.lang.table.addColLeft, click: _this.context.createInvokeHandler('editor.addCol', 'left') }).render(); }); this.context.memo('button.addColRight', function () { return _this.button({ className: 'btn-md', contents: _this.ui.icon(_this.options.icons.colAfter), tooltip: _this.lang.table.addColRight, click: _this.context.createInvokeHandler('editor.addCol', 'right') }).render(); }); this.context.memo('button.deleteRow', function () { return _this.button({ className: 'btn-md', contents: _this.ui.icon(_this.options.icons.rowRemove), tooltip: _this.lang.table.delRow, click: _this.context.createInvokeHandler('editor.deleteRow') }).render(); }); this.context.memo('button.deleteCol', function () { return _this.button({ className: 'btn-md', contents: _this.ui.icon(_this.options.icons.colRemove), tooltip: _this.lang.table.delCol, click: _this.context.createInvokeHandler('editor.deleteCol') }).render(); }); this.context.memo('button.deleteTable', function () { return _this.button({ className: 'btn-md', contents: _this.ui.icon(_this.options.icons.trash), tooltip: _this.lang.table.delTable, click: _this.context.createInvokeHandler('editor.deleteTable') }).render(); }); }; Buttons.prototype.build = function ($container, groups) { for (var groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) { var group = groups[groupIdx]; var groupName = Array.isArray(group) ? group[0] : group; var buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group]; var $group = this.ui.buttonGroup({ className: 'note-' + groupName }).render(); for (var idx = 0, len = buttons.length; idx < len; idx++) { var btn = this.context.memo('button.' + buttons[idx]); if (btn) { $group.append(typeof btn === 'function' ? btn() : btn); } } $group.appendTo($container); } }; /** * @param {jQuery} [$container] */ Buttons.prototype.updateCurrentStyle = function ($container) { var _this = this; var $cont = $container || this.$toolbar; var styleInfo = this.context.invoke('editor.currentStyle'); this.updateBtnStates($cont, { '.note-btn-bold': function () { return styleInfo['font-bold'] === 'bold'; }, '.note-btn-italic': function () { return styleInfo['font-italic'] === 'italic'; }, '.note-btn-underline': function () { return styleInfo['font-underline'] === 'underline'; }, '.note-btn-subscript': function () { return styleInfo['font-subscript'] === 'subscript'; }, '.note-btn-superscript': function () { return styleInfo['font-superscript'] === 'superscript'; }, '.note-btn-strikethrough': function () { return styleInfo['font-strikethrough'] === 'strikethrough'; } }); if (styleInfo['font-family']) { var fontNames = styleInfo['font-family'].split(',').map(function (name) { return name.replace(/[\'\"]/g, '') .replace(/\s+$/, '') .replace(/^\s+/, ''); }); var fontName_1 = lists.find(fontNames, this.isFontInstalled.bind(this)); $cont.find('.dropdown-fontname a').each(function (idx, item) { var $item = $$1(item); // always compare string to avoid creating another func. var isChecked = ($item.data('value') + '') === (fontName_1 + ''); $item.toggleClass('checked', isChecked); }); $cont.find('.note-current-fontname').text(fontName_1).css('font-family', fontName_1); } if (styleInfo['font-size']) { var fontSize_1 = styleInfo['font-size']; $cont.find('.dropdown-fontsize a').each(function (idx, item) { var $item = $$1(item); // always compare with string to avoid creating another func. var isChecked = ($item.data('value') + '') === (fontSize_1 + ''); $item.toggleClass('checked', isChecked); }); $cont.find('.note-current-fontsize').text(fontSize_1); } if (styleInfo['line-height']) { var lineHeight_1 = styleInfo['line-height']; $cont.find('.dropdown-line-height li a').each(function (idx, item) { // always compare with string to avoid creating another func. var isChecked = ($$1(item).data('value') + '') === (lineHeight_1 + ''); _this.className = isChecked ? 'checked' : ''; }); } }; Buttons.prototype.updateBtnStates = function ($container, infos) { var _this = this; $$1.each(infos, function (selector, pred) { _this.ui.toggleBtnActive($container.find(selector), pred()); }); }; Buttons.prototype.tableMoveHandler = function (event) { var PX_PER_EM = 18; var $picker = $$1(event.target.parentNode); // target is mousecatcher var $dimensionDisplay = $picker.next(); var $catcher = $picker.find('.note-dimension-picker-mousecatcher'); var $highlighted = $picker.find('.note-dimension-picker-highlighted'); var $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted'); var posOffset; // HTML5 with jQuery - e.offsetX is undefined in Firefox if (event.offsetX === undefined) { var posCatcher = $$1(event.target).offset(); posOffset = { x: event.pageX - posCatcher.left, y: event.pageY - posCatcher.top }; } else { posOffset = { x: event.offsetX, y: event.offsetY }; } var dim = { c: Math.ceil(posOffset.x / PX_PER_EM) || 1, r: Math.ceil(posOffset.y / PX_PER_EM) || 1 }; $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' }); $catcher.data('value', dim.c + 'x' + dim.r); if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) { $unhighlighted.css({ width: dim.c + 1 + 'em' }); } if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) { $unhighlighted.css({ height: dim.r + 1 + 'em' }); } $dimensionDisplay.html(dim.c + ' x ' + dim.r); }; return Buttons; }()); var Toolbar = /** @class */ (function () { function Toolbar(context) { this.context = context; this.$window = $$1(window); this.$document = $$1(document); this.ui = $$1.summernote.ui; this.$note = context.layoutInfo.note; this.$editor = context.layoutInfo.editor; this.$toolbar = context.layoutInfo.toolbar; this.$editable = context.layoutInfo.editable; this.$statusbar = context.layoutInfo.statusbar; this.options = context.options; this.isFollowing = false; this.followScroll = this.followScroll.bind(this); } Toolbar.prototype.shouldInitialize = function () { return !this.options.airMode; }; Toolbar.prototype.initialize = function () { var _this = this; this.options.toolbar = this.options.toolbar || []; if (!this.options.toolbar.length) { this.$toolbar.hide(); } else { this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar); } if (this.options.toolbarContainer) { this.$toolbar.appendTo(this.options.toolbarContainer); } this.changeContainer(false); this.$note.on('summernote.keyup summernote.mouseup summernote.change', function () { _this.context.invoke('buttons.updateCurrentStyle'); }); this.context.invoke('buttons.updateCurrentStyle'); if (this.options.followingToolbar) { this.$window.on('scroll resize', this.followScroll); } }; Toolbar.prototype.destroy = function () { this.$toolbar.children().remove(); if (this.options.followingToolbar) { this.$window.off('scroll resize', this.followScroll); } }; Toolbar.prototype.followScroll = function () { if (this.$editor.hasClass('fullscreen')) { return false; } var editorHeight = this.$editor.outerHeight(); var editorWidth = this.$editor.width(); var toolbarHeight = this.$toolbar.height(); var statusbarHeight = this.$statusbar.height(); // check if the web app is currently using another static bar var otherBarHeight = 0; if (this.options.otherStaticBar) { otherBarHeight = $$1(this.options.otherStaticBar).outerHeight(); } var currentOffset = this.$document.scrollTop(); var editorOffsetTop = this.$editor.offset().top; var editorOffsetBottom = editorOffsetTop + editorHeight; var activateOffset = editorOffsetTop - otherBarHeight; var deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight; if (!this.isFollowing && (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) { this.isFollowing = true; this.$toolbar.css({ position: 'fixed', top: otherBarHeight, width: editorWidth }); this.$editable.css({ marginTop: this.$toolbar.height() + 5 }); } else if (this.isFollowing && ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) { this.isFollowing = false; this.$toolbar.css({ position: 'relative', top: 0, width: '100%' }); this.$editable.css({ marginTop: '' }); } }; Toolbar.prototype.changeContainer = function (isFullscreen) { if (isFullscreen) { this.$toolbar.prependTo(this.$editor); } else { if (this.options.toolbarContainer) { this.$toolbar.appendTo(this.options.toolbarContainer); } } this.followScroll(); }; Toolbar.prototype.updateFullscreen = function (isFullscreen) { this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen); this.changeContainer(isFullscreen); }; Toolbar.prototype.updateCodeview = function (isCodeview) { this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview); if (isCodeview) { this.deactivate(); } else { this.activate(); } }; Toolbar.prototype.activate = function (isIncludeCodeview) { var $btn = this.$toolbar.find('button'); if (!isIncludeCodeview) { $btn = $btn.not('.btn-codeview'); } this.ui.toggleBtn($btn, true); }; Toolbar.prototype.deactivate = function (isIncludeCodeview) { var $btn = this.$toolbar.find('button'); if (!isIncludeCodeview) { $btn = $btn.not('.btn-codeview'); } this.ui.toggleBtn($btn, false); }; return Toolbar; }()); var LinkDialog = /** @class */ (function () { function LinkDialog(context) { this.context = context; this.ui = $$1.summernote.ui; this.$body = $$1(document.body); this.$editor = context.layoutInfo.editor; this.options = context.options; this.lang = this.options.langInfo; context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']); } LinkDialog.prototype.initialize = function () { var $container = this.options.dialogsInBody ? this.$body : this.$editor; var body = [ '<div class="form-group note-form-group">', "<label class=\"note-form-label\">" + this.lang.link.textToDisplay + "</label>", '<input class="note-link-text form-control note-form-control note-input" type="text" />', '</div>', '<div class="form-group note-form-group">', "<label class=\"note-form-label\">" + this.lang.link.url + "</label>", '<input class="note-link-url form-control note-form-control note-input" type="text" value="http://" />', '</div>', !this.options.disableLinkTarget ? $$1('<div/>').append(this.ui.checkbox({ className: 'sn-checkbox-open-in-new-window', text: this.lang.link.openInNewWindow, checked: true }).render()).html() : '', ].join(''); var buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn'; var footer = "<input type=\"button\" href=\"#\" class=\"" + buttonClass + "\" value=\"" + this.lang.link.insert + "\" disabled>"; this.$dialog = this.ui.dialog({ className: 'link-dialog', title: this.lang.link.insert, fade: this.options.dialogsFade, body: body, footer: footer }).render().appendTo($container); }; LinkDialog.prototype.destroy = function () { this.ui.hideDialog(this.$dialog); this.$dialog.remove(); }; LinkDialog.prototype.bindEnterKey = function ($input, $btn) { $input.on('keypress', function (event) { if (event.keyCode === key.code.ENTER) { event.preventDefault(); $btn.trigger('click'); } }); }; /** * toggle update button */ LinkDialog.prototype.toggleLinkBtn = function ($linkBtn, $linkText, $linkUrl) { this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val()); }; /** * Show link dialog and set event handlers on dialog controls. * * @param {Object} linkInfo * @return {Promise} */ LinkDialog.prototype.showLinkDialog = function (linkInfo) { var _this = this; return $$1.Deferred(function (deferred) { var $linkText = _this.$dialog.find('.note-link-text'); var $linkUrl = _this.$dialog.find('.note-link-url'); var $linkBtn = _this.$dialog.find('.note-link-btn'); var $openInNewWindow = _this.$dialog .find('.sn-checkbox-open-in-new-window input[type=checkbox]'); _this.ui.onDialogShown(_this.$dialog, function () { _this.context.triggerEvent('dialog.shown'); // If no url was given and given text is valid URL then copy that into URL Field if (!linkInfo.url && func.isValidUrl(linkInfo.text)) { linkInfo.url = linkInfo.text; } $linkText.on('input paste propertychange', function () { // If linktext was modified by input events, // cloning text from linkUrl will be stopped. linkInfo.text = $linkText.val(); _this.toggleLinkBtn($linkBtn, $linkText, $linkUrl); }).val(linkInfo.text); $linkUrl.on('input paste propertychange', function () { // Display same text on `Text to display` as default // when linktext has no text if (!linkInfo.text) { $linkText.val($linkUrl.val()); } _this.toggleLinkBtn($linkBtn, $linkText, $linkUrl); }).val(linkInfo.url); if (!env.isSupportTouch) { $linkUrl.trigger('focus'); } _this.toggleLinkBtn($linkBtn, $linkText, $linkUrl); _this.bindEnterKey($linkUrl, $linkBtn); _this.bindEnterKey($linkText, $linkBtn); var isNewWindowChecked = linkInfo.isNewWindow !== undefined ? linkInfo.isNewWindow : _this.context.options.linkTargetBlank; $openInNewWindow.prop('checked', isNewWindowChecked); $linkBtn.one('click', function (event) { event.preventDefault(); deferred.resolve({ range: linkInfo.range, url: $linkUrl.val(), text: $linkText.val(), isNewWindow: $openInNewWindow.is(':checked') }); _this.ui.hideDialog(_this.$dialog); }); }); _this.ui.onDialogHidden(_this.$dialog, function () { // detach events $linkText.off(); $linkUrl.off(); $linkBtn.off(); if (deferred.state() === 'pending') { deferred.reject(); } }); _this.ui.showDialog(_this.$dialog); }).promise(); }; /** * @param {Object} layoutInfo */ LinkDialog.prototype.show = function () { var _this = this; var linkInfo = this.context.invoke('editor.getLinkInfo'); this.context.invoke('editor.saveRange'); this.showLinkDialog(linkInfo).then(function (linkInfo) { _this.context.invoke('editor.restoreRange'); _this.context.invoke('editor.createLink', linkInfo); }).fail(function () { _this.context.invoke('editor.restoreRange'); }); }; return LinkDialog; }()); var LinkPopover = /** @class */ (function () { function LinkPopover(context) { var _this = this; this.context = context; this.ui = $$1.summernote.ui; this.options = context.options; this.events = { 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': function () { _this.update(); }, 'summernote.disable summernote.dialog.shown': function () { _this.hide(); } }; } LinkPopover.prototype.shouldInitialize = function () { return !lists.isEmpty(this.options.popover.link); }; LinkPopover.prototype.initialize = function () { this.$popover = this.ui.popover({ className: 'note-link-popover', callback: function ($node) { var $content = $node.find('.popover-content,.note-popover-content'); $content.prepend('<span><a target="_blank"></a>&nbsp;</span>'); } }).render().appendTo(this.options.container); var $content = this.$popover.find('.popover-content,.note-popover-content'); this.context.invoke('buttons.build', $content, this.options.popover.link); }; LinkPopover.prototype.destroy = function () { this.$popover.remove(); }; LinkPopover.prototype.update = function () { // Prevent focusing on editable when invoke('code') is executed if (!this.context.invoke('editor.hasFocus')) { this.hide(); return; } var rng = this.context.invoke('editor.getLastRange'); if (rng.isCollapsed() && rng.isOnAnchor()) { var anchor = dom.ancestor(rng.sc, dom.isAnchor); var href = $$1(anchor).attr('href'); this.$popover.find('a').attr('href', href).html(href); var pos = dom.posFromPlaceholder(anchor); this.$popover.css({ display: 'block', left: pos.left, top: pos.top }); } else { this.hide(); } }; LinkPopover.prototype.hide = function () { this.$popover.hide(); }; return LinkPopover; }()); var ImageDialog = /** @class */ (function () { function ImageDialog(context) { this.context = context; this.ui = $$1.summernote.ui; this.$body = $$1(document.body); this.$editor = context.layoutInfo.editor; this.options = context.options; this.lang = this.options.langInfo; } ImageDialog.prototype.initialize = function () { var $container = this.options.dialogsInBody ? this.$body : this.$editor; var imageLimitation = ''; if (this.options.maximumImageFileSize) { var unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024)); var readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 + ' ' + ' KMGTP'[unit] + 'B'; imageLimitation = "<small>" + (this.lang.image.maximumFileSize + ' : ' + readableSize) + "</small>"; } var body = [ '<div class="form-group note-form-group note-group-select-from-files">', '<label class="note-form-label">' + this.lang.image.selectFromFiles + '</label>', '<input class="note-image-input form-control-file note-form-control note-input" ', ' type="file" name="files" accept="image/*" multiple="multiple" />', imageLimitation, '</div>', '<div class="form-group note-group-image-url" style="overflow:auto;">', '<label class="note-form-label">' + this.lang.image.url + '</label>', '<input class="note-image-url form-control note-form-control note-input ', ' col-md-12" type="text" />', '</div>', ].join(''); var buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn'; var footer = "<input type=\"button\" href=\"#\" class=\"" + buttonClass + "\" value=\"" + this.lang.image.insert + "\" disabled>"; this.$dialog = this.ui.dialog({ title: this.lang.image.insert, fade: this.options.dialogsFade, body: body, footer: footer }).render().appendTo($container); }; ImageDialog.prototype.destroy = function () { this.ui.hideDialog(this.$dialog); this.$dialog.remove(); }; ImageDialog.prototype.bindEnterKey = function ($input, $btn) { $input.on('keypress', function (event) { if (event.keyCode === key.code.ENTER) { event.preventDefault(); $btn.trigger('click'); } }); }; ImageDialog.prototype.show = function () { var _this = this; this.context.invoke('editor.saveRange'); this.showImageDialog().then(function (data) { // [workaround] hide dialog before restore range for IE range focus _this.ui.hideDialog(_this.$dialog); _this.context.invoke('editor.restoreRange'); if (typeof data === 'string') { // image url // If onImageLinkInsert set, if (_this.options.callbacks.onImageLinkInsert) { _this.context.triggerEvent('image.link.insert', data); } else { _this.context.invoke('editor.insertImage', data); } } else { // array of files _this.context.invoke('editor.insertImagesOrCallback', data); } }).fail(function () { _this.context.invoke('editor.restoreRange'); }); }; /** * show image dialog * * @param {jQuery} $dialog * @return {Promise} */ ImageDialog.prototype.showImageDialog = function () { var _this = this; return $$1.Deferred(function (deferred) { var $imageInput = _this.$dialog.find('.note-image-input'); var $imageUrl = _this.$dialog.find('.note-image-url'); var $imageBtn = _this.$dialog.find('.note-image-btn'); _this.ui.onDialogShown(_this.$dialog, function () { _this.context.triggerEvent('dialog.shown'); // Cloning imageInput to clear element. $imageInput.replaceWith($imageInput.clone().on('change', function (event) { deferred.resolve(event.target.files || event.target.value); }).val('')); $imageUrl.on('input paste propertychange', function () { _this.ui.toggleBtn($imageBtn, $imageUrl.val()); }).val(''); if (!env.isSupportTouch) { $imageUrl.trigger('focus'); } $imageBtn.click(function (event) { event.preventDefault(); deferred.resolve($imageUrl.val()); }); _this.bindEnterKey($imageUrl, $imageBtn); }); _this.ui.onDialogHidden(_this.$dialog, function () { $imageInput.off(); $imageUrl.off(); $imageBtn.off(); if (deferred.state() === 'pending') { deferred.reject(); } }); _this.ui.showDialog(_this.$dialog); }); }; return ImageDialog; }()); /** * Image popover module * mouse events that show/hide popover will be handled by Handle.js. * Handle.js will receive the events and invoke 'imagePopover.update'. */ var ImagePopover = /** @class */ (function () { function ImagePopover(context) { var _this = this; this.context = context; this.ui = $$1.summernote.ui; this.editable = context.layoutInfo.editable[0]; this.options = context.options; this.events = { 'summernote.disable': function () { _this.hide(); } }; } ImagePopover.prototype.shouldInitialize = function () { return !lists.isEmpty(this.options.popover.image); }; ImagePopover.prototype.initialize = function () { this.$popover = this.ui.popover({ className: 'note-image-popover' }).render().appendTo(this.options.container); var $content = this.$popover.find('.popover-content,.note-popover-content'); this.context.invoke('buttons.build', $content, this.options.popover.image); }; ImagePopover.prototype.destroy = function () { this.$popover.remove(); }; ImagePopover.prototype.update = function (target, event) { if (dom.isImg(target)) { var pos = dom.posFromPlaceholder(target); var posEditor = dom.posFromPlaceholder(this.editable); this.$popover.css({ display: 'block', left: this.options.popatmouse ? event.pageX - 20 : pos.left, top: this.options.popatmouse ? event.pageY : Math.min(pos.top, posEditor.top) }); } else { this.hide(); } }; ImagePopover.prototype.hide = function () { this.$popover.hide(); }; return ImagePopover; }()); var TablePopover = /** @class */ (function () { function TablePopover(context) { var _this = this; this.context = context; this.ui = $$1.summernote.ui; this.options = context.options; this.events = { 'summernote.mousedown': function (we, e) { _this.update(e.target); }, 'summernote.keyup summernote.scroll summernote.change': function () { _this.update(); }, 'summernote.disable': function () { _this.hide(); } }; } TablePopover.prototype.shouldInitialize = function () { return !lists.isEmpty(this.options.popover.table); }; TablePopover.prototype.initialize = function () { this.$popover = this.ui.popover({ className: 'note-table-popover' }).render().appendTo(this.options.container); var $content = this.$popover.find('.popover-content,.note-popover-content'); this.context.invoke('buttons.build', $content, this.options.popover.table); // [workaround] Disable Firefox's default table editor if (env.isFF) { document.execCommand('enableInlineTableEditing', false, false); } }; TablePopover.prototype.destroy = function () { this.$popover.remove(); }; TablePopover.prototype.update = function (target) { if (this.context.isDisabled()) { return false; } var isCell = dom.isCell(target); if (isCell) { var pos = dom.posFromPlaceholder(target); this.$popover.css({ display: 'block', left: pos.left, top: pos.top }); } else { this.hide(); } return isCell; }; TablePopover.prototype.hide = function () { this.$popover.hide(); }; return TablePopover; }()); var VideoDialog = /** @class */ (function () { function VideoDialog(context) { this.context = context; this.ui = $$1.summernote.ui; this.$body = $$1(document.body); this.$editor = context.layoutInfo.editor; this.options = context.options; this.lang = this.options.langInfo; } VideoDialog.prototype.initialize = function () { var $container = this.options.dialogsInBody ? this.$body : this.$editor; var body = [ '<div class="form-group note-form-group row-fluid">', "<label class=\"note-form-label\">" + this.lang.video.url + " <small class=\"text-muted\">" + this.lang.video.providers + "</small></label>", '<input class="note-video-url form-control note-form-control note-input" type="text" />', '</div>', ].join(''); var buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn'; var footer = "<input type=\"button\" href=\"#\" class=\"" + buttonClass + "\" value=\"" + this.lang.video.insert + "\" disabled>"; this.$dialog = this.ui.dialog({ title: this.lang.video.insert, fade: this.options.dialogsFade, body: body, footer: footer }).render().appendTo($container); }; VideoDialog.prototype.destroy = function () { this.ui.hideDialog(this.$dialog); this.$dialog.remove(); }; VideoDialog.prototype.bindEnterKey = function ($input, $btn) { $input.on('keypress', function (event) { if (event.keyCode === key.code.ENTER) { event.preventDefault(); $btn.trigger('click'); } }); }; VideoDialog.prototype.createVideoNode = function (url) { // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm) var ytRegExp = /\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/; var ytRegExpForStart = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/; var ytMatch = url.match(ytRegExp); var igRegExp = /(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/; var igMatch = url.match(igRegExp); var vRegExp = /\/\/vine\.co\/v\/([a-zA-Z0-9]+)/; var vMatch = url.match(vRegExp); var vimRegExp = /\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/; var vimMatch = url.match(vimRegExp); var dmRegExp = /.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/; var dmMatch = url.match(dmRegExp); var youkuRegExp = /\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/; var youkuMatch = url.match(youkuRegExp); var qqRegExp = /\/\/v\.qq\.com.*?vid=(.+)/; var qqMatch = url.match(qqRegExp); var qqRegExp2 = /\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/; var qqMatch2 = url.match(qqRegExp2); var mp4RegExp = /^.+.(mp4|m4v)$/; var mp4Match = url.match(mp4RegExp); var oggRegExp = /^.+.(ogg|ogv)$/; var oggMatch = url.match(oggRegExp); var webmRegExp = /^.+.(webm)$/; var webmMatch = url.match(webmRegExp); var fbRegExp = /(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/; var fbMatch = url.match(fbRegExp); var $video; if (ytMatch && ytMatch[1].length === 11) { var youtubeId = ytMatch[1]; var start = 0; if (typeof ytMatch[2] !== 'undefined') { var ytMatchForStart = ytMatch[2].match(ytRegExpForStart); if (ytMatchForStart) { for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) { start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0); } } } $video = $$1('<iframe>') .attr('frameborder', 0) .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : '')) .attr('width', '640').attr('height', '360'); } else if (igMatch && igMatch[0].length) { $video = $$1('<iframe>') .attr('frameborder', 0) .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/') .attr('width', '612').attr('height', '710') .attr('scrolling', 'no') .attr('allowtransparency', 'true'); } else if (vMatch && vMatch[0].length) { $video = $$1('<iframe>') .attr('frameborder', 0) .attr('src', vMatch[0] + '/embed/simple') .attr('width', '600').attr('height', '600') .attr('class', 'vine-embed'); } else if (vimMatch && vimMatch[3].length) { $video = $$1('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>') .attr('frameborder', 0) .attr('src', '//player.vimeo.com/video/' + vimMatch[3]) .attr('width', '640').attr('height', '360'); } else if (dmMatch && dmMatch[2].length) { $video = $$1('<iframe>') .attr('frameborder', 0) .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2]) .attr('width', '640').attr('height', '360'); } else if (youkuMatch && youkuMatch[1].length) { $video = $$1('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>') .attr('frameborder', 0) .attr('height', '498') .attr('width', '510') .attr('src', '//player.youku.com/embed/' + youkuMatch[1]); } else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) { var vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]); $video = $$1('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>') .attr('frameborder', 0) .attr('height', '310') .attr('width', '500') .attr('src', 'http://v.qq.com/iframe/player.html?vid=' + vid + '&amp;auto=0'); } else if (mp4Match || oggMatch || webmMatch) { $video = $$1('<video controls>') .attr('src', url) .attr('width', '640').attr('height', '360'); } else if (fbMatch && fbMatch[0].length) { $video = $$1('<iframe>') .attr('frameborder', 0) .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560') .attr('width', '560').attr('height', '301') .attr('scrolling', 'no') .attr('allowtransparency', 'true'); } else { // this is not a known video link. Now what, Cat? Now what? return false; } $video.addClass('note-video-clip'); return $video[0]; }; VideoDialog.prototype.show = function () { var _this = this; var text = this.context.invoke('editor.getSelectedText'); this.context.invoke('editor.saveRange'); this.showVideoDialog(text).then(function (url) { // [workaround] hide dialog before restore range for IE range focus _this.ui.hideDialog(_this.$dialog); _this.context.invoke('editor.restoreRange'); // build node var $node = _this.createVideoNode(url); if ($node) { // insert video node _this.context.invoke('editor.insertNode', $node); } }).fail(function () { _this.context.invoke('editor.restoreRange'); }); }; /** * show image dialog * * @param {jQuery} $dialog * @return {Promise} */ VideoDialog.prototype.showVideoDialog = function (text) { var _this = this; return $$1.Deferred(function (deferred) { var $videoUrl = _this.$dialog.find('.note-video-url'); var $videoBtn = _this.$dialog.find('.note-video-btn'); _this.ui.onDialogShown(_this.$dialog, function () { _this.context.triggerEvent('dialog.shown'); $videoUrl.on('input paste propertychange', function () { _this.ui.toggleBtn($videoBtn, $videoUrl.val()); }); if (!env.isSupportTouch) { $videoUrl.trigger('focus'); } $videoBtn.click(function (event) { event.preventDefault(); deferred.resolve($videoUrl.val()); }); _this.bindEnterKey($videoUrl, $videoBtn); }); _this.ui.onDialogHidden(_this.$dialog, function () { $videoUrl.off(); $videoBtn.off(); if (deferred.state() === 'pending') { deferred.reject(); } }); _this.ui.showDialog(_this.$dialog); }); }; return VideoDialog; }()); var HelpDialog = /** @class */ (function () { function HelpDialog(context) { this.context = context; this.ui = $$1.summernote.ui; this.$body = $$1(document.body); this.$editor = context.layoutInfo.editor; this.options = context.options; this.lang = this.options.langInfo; } HelpDialog.prototype.initialize = function () { var $container = this.options.dialogsInBody ? this.$body : this.$editor; var body = [ '<p class="text-center">', '<a href="http://summernote.org/" target="_blank">Summernote 0.8.12</a> · ', '<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ', '<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>', '</p>', ].join(''); this.$dialog = this.ui.dialog({ title: this.lang.options.help, fade: this.options.dialogsFade, body: this.createShortcutList(), footer: body, callback: function ($node) { $node.find('.modal-body,.note-modal-body').css({ 'max-height': 300, 'overflow': 'scroll' }); } }).render().appendTo($container); }; HelpDialog.prototype.destroy = function () { this.ui.hideDialog(this.$dialog); this.$dialog.remove(); }; HelpDialog.prototype.createShortcutList = function () { var _this = this; var keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc']; return Object.keys(keyMap).map(function (key) { var command = keyMap[key]; var $row = $$1('<div><div class="help-list-item"/></div>'); $row.append($$1('<label><kbd>' + key + '</kdb></label>').css({ 'width': 180, 'margin-right': 10 })).append($$1('<span/>').html(_this.context.memo('help.' + command) || command)); return $row.html(); }).join(''); }; /** * show help dialog * * @return {Promise} */ HelpDialog.prototype.showHelpDialog = function () { var _this = this; return $$1.Deferred(function (deferred) { _this.ui.onDialogShown(_this.$dialog, function () { _this.context.triggerEvent('dialog.shown'); deferred.resolve(); }); _this.ui.showDialog(_this.$dialog); }).promise(); }; HelpDialog.prototype.show = function () { var _this = this; this.context.invoke('editor.saveRange'); this.showHelpDialog().then(function () { _this.context.invoke('editor.restoreRange'); }); }; return HelpDialog; }()); var AIR_MODE_POPOVER_X_OFFSET = 20; var AirPopover = /** @class */ (function () { function AirPopover(context) { var _this = this; this.context = context; this.ui = $$1.summernote.ui; this.options = context.options; this.events = { 'summernote.keyup summernote.mouseup summernote.scroll': function () { _this.update(); }, 'summernote.disable summernote.change summernote.dialog.shown': function () { _this.hide(); }, 'summernote.focusout': function (we, e) { // [workaround] Firefox doesn't support relatedTarget on focusout // - Ignore hide action on focus out in FF. if (env.isFF) { return; } if (!e.relatedTarget || !dom.ancestor(e.relatedTarget, func.eq(_this.$popover[0]))) { _this.hide(); } } }; } AirPopover.prototype.shouldInitialize = function () { return this.options.airMode && !lists.isEmpty(this.options.popover.air); }; AirPopover.prototype.initialize = function () { this.$popover = this.ui.popover({ className: 'note-air-popover' }).render().appendTo(this.options.container); var $content = this.$popover.find('.popover-content'); this.context.invoke('buttons.build', $content, this.options.popover.air); }; AirPopover.prototype.destroy = function () { this.$popover.remove(); }; AirPopover.prototype.update = function () { var styleInfo = this.context.invoke('editor.currentStyle'); if (styleInfo.range && !styleInfo.range.isCollapsed()) { var rect = lists.last(styleInfo.range.getClientRects()); if (rect) { var bnd = func.rect2bnd(rect); this.$popover.css({ display: 'block', left: Math.max(bnd.left + bnd.width / 2, 0) - AIR_MODE_POPOVER_X_OFFSET, top: bnd.top + bnd.height }); this.context.invoke('buttons.updateCurrentStyle', this.$popover); } } else { this.hide(); } }; AirPopover.prototype.hide = function () { this.$popover.hide(); }; return AirPopover; }()); var POPOVER_DIST = 5; var HintPopover = /** @class */ (function () { function HintPopover(context) { var _this = this; this.context = context; this.ui = $$1.summernote.ui; this.$editable = context.layoutInfo.editable; this.options = context.options; this.hint = this.options.hint || []; this.direction = this.options.hintDirection || 'bottom'; this.hints = Array.isArray(this.hint) ? this.hint : [this.hint]; this.events = { 'summernote.keyup': function (we, e) { if (!e.isDefaultPrevented()) { _this.handleKeyup(e); } }, 'summernote.keydown': function (we, e) { _this.handleKeydown(e); }, 'summernote.disable summernote.dialog.shown': function () { _this.hide(); } }; } HintPopover.prototype.shouldInitialize = function () { return this.hints.length > 0; }; HintPopover.prototype.initialize = function () { var _this = this; this.lastWordRange = null; this.$popover = this.ui.popover({ className: 'note-hint-popover', hideArrow: true, direction: '' }).render().appendTo(this.options.container); this.$popover.hide(); this.$content = this.$popover.find('.popover-content,.note-popover-content'); this.$content.on('click', '.note-hint-item', function (e) { _this.$content.find('.active').removeClass('active'); $$1(e.currentTarget).addClass('active'); _this.replace(); }); }; HintPopover.prototype.destroy = function () { this.$popover.remove(); }; HintPopover.prototype.selectItem = function ($item) { this.$content.find('.active').removeClass('active'); $item.addClass('active'); this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2); }; HintPopover.prototype.moveDown = function () { var $current = this.$content.find('.note-hint-item.active'); var $next = $current.next(); if ($next.length) { this.selectItem($next); } else { var $nextGroup = $current.parent().next(); if (!$nextGroup.length) { $nextGroup = this.$content.find('.note-hint-group').first(); } this.selectItem($nextGroup.find('.note-hint-item').first()); } }; HintPopover.prototype.moveUp = function () { var $current = this.$content.find('.note-hint-item.active'); var $prev = $current.prev(); if ($prev.length) { this.selectItem($prev); } else { var $prevGroup = $current.parent().prev(); if (!$prevGroup.length) { $prevGroup = this.$content.find('.note-hint-group').last(); } this.selectItem($prevGroup.find('.note-hint-item').last()); } }; HintPopover.prototype.replace = function () { var $item = this.$content.find('.note-hint-item.active'); if ($item.length) { var node = this.nodeFromItem($item); // XXX: consider to move codes to editor for recording redo/undo. this.lastWordRange.insertNode(node); range.createFromNode(node).collapse().select(); this.lastWordRange = null; this.hide(); this.context.triggerEvent('change', this.$editable.html(), this.$editable[0]); this.context.invoke('editor.focus'); } }; HintPopover.prototype.nodeFromItem = function ($item) { var hint = this.hints[$item.data('index')]; var item = $item.data('item'); var node = hint.content ? hint.content(item) : item; if (typeof node === 'string') { node = dom.createText(node); } return node; }; HintPopover.prototype.createItemTemplates = function (hintIdx, items) { var hint = this.hints[hintIdx]; return items.map(function (item, idx) { var $item = $$1('<div class="note-hint-item"/>'); $item.append(hint.template ? hint.template(item) : item + ''); $item.data({ 'index': hintIdx, 'item': item }); return $item; }); }; HintPopover.prototype.handleKeydown = function (e) { if (!this.$popover.is(':visible')) { return; } if (e.keyCode === key.code.ENTER) { e.preventDefault(); this.replace(); } else if (e.keyCode === key.code.UP) { e.preventDefault(); this.moveUp(); } else if (e.keyCode === key.code.DOWN) { e.preventDefault(); this.moveDown(); } }; HintPopover.prototype.searchKeyword = function (index, keyword, callback) { var hint = this.hints[index]; if (hint && hint.match.test(keyword) && hint.search) { var matches = hint.match.exec(keyword); hint.search(matches[1], callback); } else { callback(); } }; HintPopover.prototype.createGroup = function (idx, keyword) { var _this = this; var $group = $$1('<div class="note-hint-group note-hint-group-' + idx + '"/>'); this.searchKeyword(idx, keyword, function (items) { items = items || []; if (items.length) { $group.html(_this.createItemTemplates(idx, items)); _this.show(); } }); return $group; }; HintPopover.prototype.handleKeyup = function (e) { var _this = this; if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) { var wordRange = this.context.invoke('editor.getLastRange').getWordRange(); var keyword_1 = wordRange.toString(); if (this.hints.length && keyword_1) { this.$content.empty(); var bnd = func.rect2bnd(lists.last(wordRange.getClientRects())); if (bnd) { this.$popover.hide(); this.lastWordRange = wordRange; this.hints.forEach(function (hint, idx) { if (hint.match.test(keyword_1)) { _this.createGroup(idx, keyword_1).appendTo(_this.$content); } }); // select first .note-hint-item this.$content.find('.note-hint-item:first').addClass('active'); // set position for popover after group is created if (this.direction === 'top') { this.$popover.css({ left: bnd.left, top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST }); } else { this.$popover.css({ left: bnd.left, top: bnd.top + bnd.height + POPOVER_DIST }); } } } else { this.hide(); } } }; HintPopover.prototype.show = function () { this.$popover.show(); }; HintPopover.prototype.hide = function () { this.$popover.hide(); }; return HintPopover; }()); $$1.summernote = $$1.extend($$1.summernote, { version: '0.8.12', plugins: {}, dom: dom, range: range, options: { langInfo: $$1.summernote.lang['en-US'], modules: { 'editor': Editor, 'clipboard': Clipboard, 'dropzone': Dropzone, 'codeview': CodeView, 'statusbar': Statusbar, 'fullscreen': Fullscreen, 'handle': Handle, // FIXME: HintPopover must be front of autolink // - Script error about range when Enter key is pressed on hint popover 'hintPopover': HintPopover, 'autoLink': AutoLink, 'autoSync': AutoSync, 'autoReplace': AutoReplace, 'placeholder': Placeholder, 'buttons': Buttons, 'toolbar': Toolbar, 'linkDialog': LinkDialog, 'linkPopover': LinkPopover, 'imageDialog': ImageDialog, 'imagePopover': ImagePopover, 'tablePopover': TablePopover, 'videoDialog': VideoDialog, 'helpDialog': HelpDialog, 'airPopover': AirPopover }, buttons: {}, lang: 'en-US', followingToolbar: false, otherStaticBar: '', // toolbar toolbar: [ ['style', ['style']], ['font', ['bold', 'underline', 'clear']], ['fontsize',['fontsize']], ['fontname', ['fontname']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture', 'video']], ['view', ['fullscreen', 'codeview', 'help']], ], // popover popatmouse: true, popover: { image: [ ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']], ['float', ['floatLeft', 'floatRight', 'floatNone']], ['remove', ['removeMedia']], ], link: [ ['link', ['linkDialogShow', 'unlink']], ], table: [ ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']], ['delete', ['deleteRow', 'deleteCol', 'deleteTable']], ], air: [ ['color', ['color']], ['font', ['bold', 'underline', 'clear']], ['para', ['ul', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture']], ] }, // air mode: inline editor airMode: false, width: null, height: null, linkTargetBlank: true, focus: false, tabSize: 4, styleWithSpan: true, shortcuts: true, textareaAutoSync: true, hintDirection: 'bottom', tooltip: 'auto', container: 'body', maxTextLength: 0, blockquoteBreakingLevel: 2, spellCheck: true, styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], fontNames: [ 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande', 'Tahoma', 'Times New Roman', 'Verdana', ], fontNamesIgnoreCheck: [], fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'], // pallete colors(n x n) colors: [ ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'], ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'], ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'], ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'], ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'], ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'], ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'], ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'], ], // http://chir.ag/projects/name-that-color/ colorsName: [ ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'], ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'], ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'], ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'], ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'], ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'], ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'], ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'], ], colorButton: { foreColor: '#000000', backColor: '#FFFF00' }, lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'], tableClassName: 'table table-bordered', insertTableMaxSize: { col: 10, row: 10 }, dialogsInBody: false, dialogsFade: false, maximumImageFileSize: null, callbacks: { onBeforeCommand: null, onBlur: null, onBlurCodeview: null, onChange: null, onChangeCodeview: null, onDialogShown: null, onEnter: null, onFocus: null, onImageLinkInsert: null, onImageUpload: null, onImageUploadError: null, onInit: null, onKeydown: null, onKeyup: null, onMousedown: null, onMouseup: null, onPaste: null, onScroll: null }, codemirror: { mode: 'text/html', htmlMode: true, lineNumbers: true }, codeviewFilter: false, codeviewFilterRegex: /<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi, codeviewIframeFilter: true, codeviewIframeWhitelistSrc: [], codeviewIframeWhitelistSrcBase: [ 'www.youtube.com', 'www.youtube-nocookie.com', 'www.facebook.com', 'vine.co', 'instagram.com', 'player.vimeo.com', 'www.dailymotion.com', 'player.youku.com', 'v.qq.com', ], keyMap: { pc: { 'ENTER': 'insertParagraph', 'CTRL+Z': 'undo', 'CTRL+Y': 'redo', 'TAB': 'tab', 'SHIFT+TAB': 'untab', 'CTRL+B': 'bold', 'CTRL+I': 'italic', 'CTRL+U': 'underline', 'CTRL+SHIFT+S': 'strikethrough', 'CTRL+BACKSLASH': 'removeFormat', 'CTRL+SHIFT+L': 'justifyLeft', 'CTRL+SHIFT+E': 'justifyCenter', 'CTRL+SHIFT+R': 'justifyRight', 'CTRL+SHIFT+J': 'justifyFull', 'CTRL+SHIFT+NUM7': 'insertUnorderedList', 'CTRL+SHIFT+NUM8': 'insertOrderedList', 'CTRL+LEFTBRACKET': 'outdent', 'CTRL+RIGHTBRACKET': 'indent', 'CTRL+NUM0': 'formatPara', 'CTRL+NUM1': 'formatH1', 'CTRL+NUM2': 'formatH2', 'CTRL+NUM3': 'formatH3', 'CTRL+NUM4': 'formatH4', 'CTRL+NUM5': 'formatH5', 'CTRL+NUM6': 'formatH6', 'CTRL+ENTER': 'insertHorizontalRule', 'CTRL+K': 'linkDialog.show' }, mac: { 'ENTER': 'insertParagraph', 'CMD+Z': 'undo', 'CMD+SHIFT+Z': 'redo', 'TAB': 'tab', 'SHIFT+TAB': 'untab', 'CMD+B': 'bold', 'CMD+I': 'italic', 'CMD+U': 'underline', 'CMD+SHIFT+S': 'strikethrough', 'CMD+BACKSLASH': 'removeFormat', 'CMD+SHIFT+L': 'justifyLeft', 'CMD+SHIFT+E': 'justifyCenter', 'CMD+SHIFT+R': 'justifyRight', 'CMD+SHIFT+J': 'justifyFull', 'CMD+SHIFT+NUM7': 'insertUnorderedList', 'CMD+SHIFT+NUM8': 'insertOrderedList', 'CMD+LEFTBRACKET': 'outdent', 'CMD+RIGHTBRACKET': 'indent', 'CMD+NUM0': 'formatPara', 'CMD+NUM1': 'formatH1', 'CMD+NUM2': 'formatH2', 'CMD+NUM3': 'formatH3', 'CMD+NUM4': 'formatH4', 'CMD+NUM5': 'formatH5', 'CMD+NUM6': 'formatH6', 'CMD+ENTER': 'insertHorizontalRule', 'CMD+K': 'linkDialog.show' } }, icons: { 'align': 'note-icon-align', 'alignCenter': 'note-icon-align-center', 'alignJustify': 'note-icon-align-justify', 'alignLeft': 'note-icon-align-left', 'alignRight': 'note-icon-align-right', 'rowBelow': 'note-icon-row-below', 'colBefore': 'note-icon-col-before', 'colAfter': 'note-icon-col-after', 'rowAbove': 'note-icon-row-above', 'rowRemove': 'note-icon-row-remove', 'colRemove': 'note-icon-col-remove', 'indent': 'note-icon-align-indent', 'outdent': 'note-icon-align-outdent', 'arrowsAlt': 'note-icon-arrows-alt', 'bold': 'note-icon-bold', 'caret': 'note-icon-caret', 'circle': 'note-icon-circle', 'close': 'note-icon-close', 'code': 'note-icon-code', 'eraser': 'note-icon-eraser', 'floatLeft': 'note-icon-float-left', 'floatRight': 'note-icon-float-right', 'font': 'note-icon-font', 'frame': 'note-icon-frame', 'italic': 'note-icon-italic', 'link': 'note-icon-link', 'unlink': 'note-icon-chain-broken', 'magic': 'note-icon-magic', 'menuCheck': 'note-icon-menu-check', 'minus': 'note-icon-minus', 'orderedlist': 'note-icon-orderedlist', 'pencil': 'note-icon-pencil', 'picture': 'note-icon-picture', 'question': 'note-icon-question', 'redo': 'note-icon-redo', 'rollback': 'note-icon-rollback', 'square': 'note-icon-square', 'strikethrough': 'note-icon-strikethrough', 'subscript': 'note-icon-subscript', 'superscript': 'note-icon-superscript', 'table': 'note-icon-table', 'textHeight': 'note-icon-text-height', 'trash': 'note-icon-trash', 'underline': 'note-icon-underline', 'undo': 'note-icon-undo', 'unorderedlist': 'note-icon-unorderedlist', 'video': 'note-icon-video' } } }); $$1.summernote = $$1.extend($$1.summernote, { ui: ui }); })); //# sourceMappingURL=summernote.js.map
301,188
summernote
js
en
javascript
code
{"qsc_code_num_words": 25572, "qsc_code_num_chars": 301188.0, "qsc_code_mean_word_length": 5.95745346, "qsc_code_frac_words_unique": 0.0852886, "qsc_code_frac_chars_top_2grams": 0.01696818, "qsc_code_frac_chars_top_3grams": 0.00649845, "qsc_code_frac_chars_top_4grams": 0.00703014, "qsc_code_frac_chars_dupe_5grams": 0.32607782, "qsc_code_frac_chars_dupe_6grams": 0.25928819, "qsc_code_frac_chars_dupe_7grams": 0.21286037, "qsc_code_frac_chars_dupe_8grams": 0.17912094, "qsc_code_frac_chars_dupe_9grams": 0.15805677, "qsc_code_frac_chars_dupe_10grams": 0.13621147, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00666784, "qsc_code_frac_chars_whitespace": 0.35765701, "qsc_code_size_file_byte": 301188.0, "qsc_code_num_lines": 7763.0, "qsc_code_num_chars_line_max": 199.0, "qsc_code_num_chars_line_mean": 38.79788741, "qsc_code_frac_chars_alphabet": 0.78075734, "qsc_code_frac_chars_comments": 0.1203202, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.31049865, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01513462, "qsc_code_frac_chars_string_length": 0.09093826, "qsc_code_frac_chars_long_word_length": 0.01742977, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.00038645, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 1.0, "qsc_codejavascript_cate_var_zero": 0.0, "qsc_codejavascript_frac_lines_func_ratio": 0.02357814, "qsc_codejavascript_num_statement_line": 0.00015931, "qsc_codejavascript_score_lines_no_logic": 0.06722957, "qsc_codejavascript_frac_words_legal_var_name": 0.86061381, "qsc_codejavascript_frac_words_legal_func_name": 0.97972973, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 0, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1wilkens/rdm
README.md
# rdm [![Build Status](https://travis-ci.org/1wilkens/rdm.svg)](https://travis-ci.org/1wilkens/rdm) A display manager written in Rust. Inspired by Slim it aims to provide a simple and elegant login screen. THIS IS A WIP AND HAS MAJOR ISSUES RELATED TO SECURITY!! USE AT YOUR OWN RISK! ## Current Problems/Questions - X authorization - xauth cookie is generated but - not copied to `~/.Xauthority` - `XAUTHORITY` environment variable is not set - -> Investigate "best practices" and fix! - Session setup / PAM usage - Session setup works(tm) but I am still not sure whether all "best practices" are followed - -> Review and validate `pam-sys`/`pam-auth` crates - `reboot`/`poweroff` etc. fail with `Failed to power off system via logind: Interactive authentication required.` - -> Investigate whether this has something to do with systemd - `systemd-logind` support - Investigate what this actually means - Do we need to link against `libsystemd.so` and call APIs from there? - Implement or mark it as done - `dbus` support - Is this required (maybe for systemd integration)? - If so what methods do we need to support? - (multi-)`seat`-API - Architecture - Stay with simple client or use server-client to encapsulate login process - Likely related to multiseat support - Split into more crates (likely not justified) ## Goals - [ ] Support common standards - [x] Linux PAM (in review) - [ ] `systemd-logind` (?) - [ ] `dbus` (?) - [ ] Basic theming support
1,570
README
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.21818182, "qsc_doc_num_sentences": 19.0, "qsc_doc_num_words": 216, "qsc_doc_num_chars": 1570.0, "qsc_doc_num_lines": 36.0, "qsc_doc_mean_word_length": 4.98611111, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.65277778, "qsc_doc_entropy_unigram": 4.77783025, "qsc_doc_frac_words_all_caps": 0.06969697, "qsc_doc_frac_lines_dupe_lines": 0.0, "qsc_doc_frac_chars_dupe_lines": 0.0, "qsc_doc_frac_chars_top_2grams": 0.02042711, "qsc_doc_frac_chars_top_3grams": 0.02414113, "qsc_doc_frac_chars_top_4grams": 0.02971216, "qsc_doc_frac_chars_dupe_5grams": 0.05013928, "qsc_doc_frac_chars_dupe_6grams": 0.05013928, "qsc_doc_frac_chars_dupe_7grams": 0.0, "qsc_doc_frac_chars_dupe_8grams": 0.0, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 1.0, "qsc_doc_num_chars_sentence_length_mean": 27.05357143, "qsc_doc_frac_chars_hyperlink_html_tag": 0.04904459, "qsc_doc_frac_chars_alphabet": 0.8797054, "qsc_doc_frac_chars_digital": 0.00163666, "qsc_doc_frac_chars_whitespace": 0.22165605, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSession.java
package com.ruoyi.framework.shiro.session; import org.apache.shiro.session.mgt.SimpleSession; import com.ruoyi.common.enums.OnlineStatus; /** * 在线用户会话属性 * * @author ruoyi */ public class OnlineSession extends SimpleSession { private static final long serialVersionUID = 1L; /** 用户ID */ private Long userId; /** 用户名称 */ private String loginName; /** 部门名称 */ private String deptName; /** 用户头像 */ private String avatar; /** 登录IP地址 */ private String host; /** 浏览器类型 */ private String browser; /** 操作系统 */ private String os; /** 在线状态 */ private OnlineStatus status = OnlineStatus.on_line; /** 属性是否改变 优化session数据同步 */ private transient boolean attributeChanged = false; @Override public String getHost() { return host; } @Override public void setHost(String host) { this.host = host; } public String getBrowser() { return browser; } public void setBrowser(String browser) { this.browser = browser; } public String getOs() { return os; } public void setOs(String os) { this.os = os; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public String getLoginName() { return loginName; } public void setLoginName(String loginName) { this.loginName = loginName; } public String getDeptName() { return deptName; } public void setDeptName(String deptName) { this.deptName = deptName; } public OnlineStatus getStatus() { return status; } public void setStatus(OnlineStatus status) { this.status = status; } public void markAttributeChanged() { this.attributeChanged = true; } public void resetAttributeChanged() { this.attributeChanged = false; } public boolean isAttributeChanged() { return attributeChanged; } public String getAvatar() { return avatar; } public void setAvatar(String avatar) { this.avatar = avatar; } @Override public void setAttribute(Object key, Object value) { super.setAttribute(key, value); } @Override public Object removeAttribute(Object key) { return super.removeAttribute(key); } }
2,464
OnlineSession
java
zh
java
code
{"qsc_code_num_words": 236, "qsc_code_num_chars": 2464.0, "qsc_code_mean_word_length": 6.21186441, "qsc_code_frac_words_unique": 0.38135593, "qsc_code_frac_chars_top_2grams": 0.07503411, "qsc_code_frac_chars_top_3grams": 0.02046385, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00059172, "qsc_code_frac_chars_whitespace": 0.31412338, "qsc_code_size_file_byte": 2464.0, "qsc_code_num_lines": 148.0, "qsc_code_num_chars_line_max": 56.0, "qsc_code_num_chars_line_mean": 16.64864865, "qsc_code_frac_chars_alphabet": 0.86686391, "qsc_code_frac_chars_comments": 0.06412338, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.03921569, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.20588235, "qsc_codejava_score_lines_no_logic": 0.39215686, "qsc_codejava_frac_words_no_modifier": 0.95454545, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 1, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/СравнениеТабличныхДокументов/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <CommandBarLocation>None</CommandBarLocation> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"/> <Events> <Event name="OnOpen">ПриОткрытии</Event> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <UsualGroup name="ГруппаТабличныеДокументы" id="132"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Табличные документы</v8:content> </v8:item> </Title> <Behavior>Usual</Behavior> <Representation>None</Representation> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаТабличныеДокументыРасширеннаяПодсказка" id="133"/> <ChildItems> <UsualGroup name="ГруппаЛевыйТабличныйДокумент" id="134"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Версия №</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Usual</Behavior> <ExtendedTooltip name="ГруппаЛевыйТабличныйДокументРасширеннаяПодсказка" id="135"/> <ChildItems> <CommandBar name="ГруппаКоманднаяПанельЛевогоТабличногоДокумента" id="112"> <EnableContentChange>true</EnableContentChange> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Командная панель левого табличного документа</v8:content> </v8:item> </Title> <ExtendedTooltip name="ГруппаКоманднаяПанельЛевогоТабличногоДокументаРасширеннаяПодсказка" id="113"/> <ChildItems> <Button name="ПредыдущееИзменениеЛевый" id="114"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ПредыдущееИзменениеЛевый</CommandName> <Picture> <xr:Ref>StdPicture.MoveUp</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предыдущее изменение</v8:content> </v8:item> </Title> <ExtendedTooltip name="ПредыдущееИзменениеЛевыйРасширеннаяПодсказка" id="115"/> </Button> <Button name="СледующееИзменениеЛевый" id="116"> <Type>CommandBarButton</Type> <CommandName>Form.Command.СледующееИзменениеЛевый</CommandName> <Picture> <xr:Ref>StdPicture.MoveDown</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Следующее изменение</v8:content> </v8:item> </Title> <ExtendedTooltip name="СледующееИзменениеЛевыйРасширеннаяПодсказка" id="117"/> </Button> </ChildItems> </CommandBar> <SpreadSheetDocumentField name="ТабличныйДокументЛевый" id="77"> <DataPath>ТабличныйДокументЛевый</DataPath> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Табличный документ левый</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <VerticalScrollBar>true</VerticalScrollBar> <HorizontalScrollBar>true</HorizontalScrollBar> <Output>Enable</Output> <ContextMenu name="ТабличныйДокументЛевыйКонтекстноеМеню" id="78"/> <ExtendedTooltip name="ТабличныйДокументЛевыйРасширеннаяПодсказка" id="79"/> <Events> <Event name="OnActivate">ТабличныйДокументЛевыйПриАктивизации</Event> </Events> </SpreadSheetDocumentField> </ChildItems> </UsualGroup> <UsualGroup name="ГруппаПравыйТабличныйДокумент" id="136"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Версия №</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Usual</Behavior> <ExtendedTooltip name="ГруппаПравыйТабличныйДокументРасширеннаяПодсказка" id="137"/> <ChildItems> <CommandBar name="ГруппаКоманднаяПанельПравогоТабличногоДокумента" id="118"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Командная панель правого табличного документа</v8:content> </v8:item> </Title> <ExtendedTooltip name="ГруппаКоманднаяПанельПравогоТабличногоДокументаРасширеннаяПодсказка" id="119"/> <ChildItems> <Button name="ПредыдущееИзменениеПравый" id="128"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ПредыдущееИзменениеПравый</CommandName> <Picture> <xr:Ref>StdPicture.MoveUp</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предыдущее изменение</v8:content> </v8:item> </Title> <ExtendedTooltip name="ПредыдущееИзменениеПравыйРасширеннаяПодсказка" id="129"/> </Button> <Button name="СледующееИзменениеПравый" id="130"> <Type>CommandBarButton</Type> <CommandName>Form.Command.СледующееИзменениеПравый</CommandName> <Picture> <xr:Ref>StdPicture.MoveDown</xr:Ref> <xr:LoadTransparent>true</xr:LoadTransparent> </Picture> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Следующее изменение</v8:content> </v8:item> </Title> <ExtendedTooltip name="СледующееИзменениеПравыйРасширеннаяПодсказка" id="131"/> </Button> </ChildItems> </CommandBar> <SpreadSheetDocumentField name="ТабличныйДокументПравый" id="80"> <DataPath>ТабличныйДокументПравый</DataPath> <ReadOnly>true</ReadOnly> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Табличный документ правый</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <VerticalScrollBar>true</VerticalScrollBar> <HorizontalScrollBar>true</HorizontalScrollBar> <Output>Enable</Output> <ContextMenu name="ТабличныйДокументПравыйКонтекстноеМеню" id="81"/> <ExtendedTooltip name="ТабличныйДокументПравыйРасширеннаяПодсказка" id="82"/> <Events> <Event name="OnActivate">ТабличныйДокументПравыйПриАктивизации</Event> </Events> </SpreadSheetDocumentField> </ChildItems> </UsualGroup> </ChildItems> </UsualGroup> </ChildItems> <Attributes> <Attribute name="Объект" id="1"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <MainAttribute>true</MainAttribute> </Attribute> <Attribute name="ТабличныйДокументЛевый" id="5"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Табличный документ левый</v8:content> </v8:item> </Title> <Type> <v8:Type xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet">mxl:SpreadsheetDocument</v8:Type> </Type> <Settings xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet" xsi:type="mxl:SpreadsheetDocument"> <mxl:columns> <mxl:size>0</mxl:size> </mxl:columns> <mxl:rowsItem> <mxl:index>0</mxl:index> <mxl:row> <mxl:empty>true</mxl:empty> </mxl:row> </mxl:rowsItem> <mxl:vgRows>0</mxl:vgRows> </Settings> </Attribute> <Attribute name="ТабличныйДокументПравый" id="6"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Табличный документ правый</v8:content> </v8:item> </Title> <Type> <v8:Type xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet">mxl:SpreadsheetDocument</v8:Type> </Type> <Settings xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet" xsi:type="mxl:SpreadsheetDocument"> <mxl:columns> <mxl:size>0</mxl:size> </mxl:columns> <mxl:rowsItem> <mxl:index>0</mxl:index> <mxl:row> <mxl:empty>true</mxl:empty> </mxl:row> </mxl:rowsItem> <mxl:vgRows>0</mxl:vgRows> </Settings> </Attribute> <Attribute name="БлокировкаОбработкиАктивизации" id="9"> <Type> <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> <Attribute name="СоответствиеСтрокЛевый" id="11"> <Type/> </Attribute> <Attribute name="СоответствиеСтрокПравый" id="12"> <Type/> </Attribute> <Attribute name="СоответствиеСтолбцовЛевый" id="13"> <Type/> </Attribute> <Attribute name="СоответствиеСтолбцовПравый" id="14"> <Type/> </Attribute> <Attribute name="РазличияЯчеекЛевый" id="15"> <Type> <v8:Type>v8:ValueTable</v8:Type> </Type> <Columns> <Column name="НомерСтроки" id="1"> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>10</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Column> <Column name="НомерСтолбца" id="2"> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>10</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Column> </Columns> </Attribute> <Attribute name="РазличияЯчеекПравый" id="16"> <Type> <v8:Type>v8:ValueTable</v8:Type> </Type> <Columns> <Column name="НомерСтроки" id="1"> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>10</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Column> <Column name="НомерСтолбца" id="2"> <Type> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>10</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </Type> </Column> </Columns> </Attribute> </Attributes> <Commands> <Command name="ПредыдущееИзменениеЛевый" id="6"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предыдущее изменение</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предыдущее изменение</v8:content> </v8:item> </ToolTip> <Action>КомандаПредыдущееИзменениеЛевый</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="СледующееИзменениеЛевый" id="7"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Следующее изменение</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Следующее изменение</v8:content> </v8:item> </ToolTip> <Action>КомандаСледующееИзменениеЛевый</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="ПредыдущееИзменениеПравый" id="10"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предыдущее изменение</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Предыдущее изменение</v8:content> </v8:item> </ToolTip> <Action>КомандаПредыдущееИзменениеПравый</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="СледующееИзменениеПравый" id="11"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Следующее изменение</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Следующее изменение</v8:content> </v8:item> </ToolTip> <Action>КомандаСледующееИзменениеПравый</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> </Commands> <Parameters> <Parameter name="АдресТабличныхДокументов"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> <Parameter name="ЗаголовокЛевый"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <KeyParameter>true</KeyParameter> </Parameter> <Parameter name="ЗаголовокПравый"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> <KeyParameter>true</KeyParameter> </Parameter> <Parameter name="Заголовок"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> </Parameters> </Form>
13,630
Form
xml
ru
xml
data
{"qsc_code_num_words": 1429, "qsc_code_num_chars": 13630.0, "qsc_code_mean_word_length": 6.1056683, "qsc_code_frac_words_unique": 0.16585024, "qsc_code_frac_chars_top_2grams": 0.02888252, "qsc_code_frac_chars_top_3grams": 0.01925501, "qsc_code_frac_chars_top_4grams": 0.02888252, "qsc_code_frac_chars_dupe_5grams": 0.65008596, "qsc_code_frac_chars_dupe_6grams": 0.61753582, "qsc_code_frac_chars_dupe_7grams": 0.59037249, "qsc_code_frac_chars_dupe_8grams": 0.56550143, "qsc_code_frac_chars_dupe_9grams": 0.54647564, "qsc_code_frac_chars_dupe_10grams": 0.51633238, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03900483, "qsc_code_frac_chars_whitespace": 0.19493764, "qsc_code_size_file_byte": 13630.0, "qsc_code_num_lines": 407.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 33.48894349, "qsc_code_frac_chars_alphabet": 0.75567302, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.81572482, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.17402788, "qsc_code_frac_chars_long_word_length": 0.09258988, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1wilkens/rdm
theme/rdm.theme
<?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.12"/> <object class="GtkWindow" id="window"> <property name="name">00</property> <property name="can_focus">False</property> <property name="window_position">center</property> <property name="default_width">800</property> <property name="default_height">600</property> <property name="type_hint">desktop</property> <property name="decorated">False</property> <child> <object class="GtkOverlay" id="overlay"> <property name="visible">True</property> <property name="can_focus">False</property> <child> <object class="GtkImage" id="background"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="yalign">0.49000000953674316</property> </object> </child> <child type="overlay"> <object class="GtkBox" id="credentialsBox"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="opacity">0.93000000000000005</property> <property name="halign">center</property> <property name="valign">center</property> <property name="orientation">vertical</property> <child> <object class="GtkEntry" id="user"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="halign">center</property> <property name="valign">center</property> <property name="xalign">0.5</property> <property name="placeholder_text" translatable="yes">Username</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkEntry" id="secret"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="halign">center</property> <property name="valign">center</property> <property name="visibility">False</property> <property name="invisible_char">*</property> <property name="xalign">0.5</property> <property name="placeholder_text" translatable="yes">Password</property> <property name="input_purpose">password</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> </child> </object> </child> </object> </interface>
3,077
rdm
theme
en
unknown
unknown
{}
0
{}
1wilkens/rdm
docs/architecture.md
# **[rdm]** -- architecture.md ## General - Libraries/Technologies - `systemd`/`logind` - `DBUS` - Communication with `logind` - Multiprocess (Daemon <=> Greeter) - Communication via unix socket in `/var/run/rdm/ipc.socket` - Library for greeter - Rust - C (wrapping Rust) - React to session close => show new greeter (DBUS?) - OOP (SDDM) vs flat architecture (lightdm, gdm) - Which one is more "rusty"? - OOP - Main executable (`rdm`) launches sub 'Managers' - SeatManager - DisplayManager - PowerManager? - [+] Clear-cut separation of concerns (easier to reason about?) - [--] More complexity (`Traits` vs `structs`) - Questions - How to link managers? (Callbacks?, Fn(Once) & friends) / How does this work with struct methods? - flat - `main` sets up different features sequentially - Logging - IPC - (Dbus) - [+] All objects in scope - [+] Less complexity? (especially in regards to lifetimes) - [--] Long `main` function - `Tokio` for IPC and event loop? - Does the daemon need a real event loop? (e.g. multiplex DBUS, greeter IPC and systemd) - probably - One Greeter implementation initially (`GTK` based) ## Daemon - Responsibilities - Manage event loop with the following components - IPC socket - DBUS: Monitor logind - DBUS: Own API (maybe v2 and behind feature flag?) - Signals? - Spawn session helpers for successful logins - Monitor sessions and spawn new greeter after session ends ## Greeter - Responsibilities - Obtain credentials from user - Feed credentials to daemon - Just exit or interact with session helper? - GTK based - Theme is GTK-.xml - Mandatory input fields identified via names - Single background image (initially) named `background.png` - Connects to socket - For more customization move credential closures into theme (taking `void*` as interface pointer?) ## Authentication/Session management - Use new process for each pam authentication process as `systemd` maps pid to sessions/users - daemon: get credentials from greeter => spawn session-helper - session-helper: get credentials from daemon - authenticate against pam - spawn user session (if successful) - wait for user session to exit - cleanup and exit - Credential flow: Greeter => Daemon => Session-helper (transient) => Session - Which process uses which pam file? - Additional policy file required to start logind session? (`/etc/dbus-1/systemd./rdm.conf` ??)
2,534
architecture
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.14512922, "qsc_doc_num_sentences": 25.0, "qsc_doc_num_words": 313, "qsc_doc_num_chars": 2534.0, "qsc_doc_num_lines": 73.0, "qsc_doc_mean_word_length": 5.58146965, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.58785942, "qsc_doc_entropy_unigram": 4.95357109, "qsc_doc_frac_words_all_caps": 0.03379722, "qsc_doc_frac_lines_dupe_lines": 0.03076923, "qsc_doc_frac_chars_dupe_lines": 0.01569996, "qsc_doc_frac_chars_top_2grams": 0.02976531, "qsc_doc_frac_chars_top_3grams": 0.02060675, "qsc_doc_frac_chars_top_4grams": 0.0, "qsc_doc_frac_chars_dupe_5grams": 0.0, "qsc_doc_frac_chars_dupe_6grams": 0.0, "qsc_doc_frac_chars_dupe_7grams": 0.0, "qsc_doc_frac_chars_dupe_8grams": 0.0, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 24.35, "qsc_doc_frac_chars_hyperlink_html_tag": 0.0011839, "qsc_doc_frac_chars_alphabet": 0.87865055, "qsc_doc_frac_chars_digital": 0.00100705, "qsc_doc_frac_chars_whitespace": 0.21625888, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1wilkens/rdm
docs/questions.md
# **[rdm]** -- questions.md ## .Xauthority - Generated by dm (either by `xauth` or directly) - Don't rely on `xauth` as it may not be installed - For format of the file see: https://github.com/aosm/X11/blob/f2829c6974ac3aacdf0c5e3f1d1c2818301cec0d/xc/lib/Xau/AuWrite.c#L55 - Passed to Xorg call - Persisted in `%HOME/.Xauthority` (usually) to allow access for apps + location saved in "XAUTHORITY" env var - Where to do this? - Generate pre X spawn -> pass to X - But no user yet -> share with user session which then writes to home (probably in memory) ## Dbus - Required? - Probably not strictly, but figure out which best practices exist (e.g. comply with Gnome interface) ## PAM - rdm - `system-login`? - rdm-greeter - Opens sessions -> "`-session optional pam_systemd.so`" - sddm: Cannot change password? ## Systemd - What are the requirements? - `pam_systemd.so` does not seem to be enough - How to properly validate? - Existence of user run directory not sufficient ## Other - Signalhandling? - Is the raw C API safe enough? - Are there new wrappers? - yes! tokio_signal -> investigate - Non-root Xorg - How to decide which user to run the server as? - What are the actual requirements for this? - C Callback interaction (?? migrated from `architecture.md`)
1,334
questions
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.2414966, "qsc_doc_num_sentences": 24.0, "qsc_doc_num_words": 193, "qsc_doc_num_chars": 1334.0, "qsc_doc_num_lines": 38.0, "qsc_doc_mean_word_length": 4.79274611, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.70984456, "qsc_doc_entropy_unigram": 4.76372136, "qsc_doc_frac_words_all_caps": 0.03401361, "qsc_doc_frac_lines_dupe_lines": 0.0, "qsc_doc_frac_chars_dupe_lines": 0.0, "qsc_doc_frac_chars_top_2grams": 0.02162162, "qsc_doc_frac_chars_top_3grams": 0.02594595, "qsc_doc_frac_chars_top_4grams": 0.0, "qsc_doc_frac_chars_dupe_5grams": 0.0, "qsc_doc_frac_chars_dupe_6grams": 0.0, "qsc_doc_frac_chars_dupe_7grams": 0.0, "qsc_doc_frac_chars_dupe_8grams": 0.0, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 20.53225806, "qsc_doc_frac_chars_hyperlink_html_tag": 0.0, "qsc_doc_frac_chars_alphabet": 0.85052034, "qsc_doc_frac_chars_digital": 0.02459792, "qsc_doc_frac_chars_whitespace": 0.20764618, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionDAO.java
package com.ruoyi.framework.shiro.session; import java.io.Serializable; import java.util.Date; import org.apache.shiro.session.Session; import org.apache.shiro.session.UnknownSessionException; import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import com.ruoyi.common.enums.OnlineStatus; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; import com.ruoyi.framework.shiro.service.SysShiroService; /** * 针对自定义的ShiroSession的db操作 * * @author ruoyi */ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO { /** * 同步session到数据库的周期 单位为毫秒(默认1分钟) */ @Value("${shiro.session.dbSyncPeriod}") private int dbSyncPeriod; /** * 上次同步数据库的时间戳 */ private static final String LAST_SYNC_DB_TIMESTAMP = OnlineSessionDAO.class.getName() + "LAST_SYNC_DB_TIMESTAMP"; @Autowired private SysShiroService sysShiroService; public OnlineSessionDAO() { super(); } public OnlineSessionDAO(long expireTime) { super(); } /** * 根据会话ID获取会话 * * @param sessionId 会话ID * @return ShiroSession */ @Override protected Session doReadSession(Serializable sessionId) { return sysShiroService.getSession(sessionId); } @Override public void update(Session session) throws UnknownSessionException { super.update(session); } /** * 更新会话;如更新会话最后访问时间/停止会话/设置超时时间/设置移除属性等会调用 */ public void syncToDb(OnlineSession onlineSession) { Date lastSyncTimestamp = (Date) onlineSession.getAttribute(LAST_SYNC_DB_TIMESTAMP); if (lastSyncTimestamp != null) { boolean needSync = true; long deltaTime = onlineSession.getLastAccessTime().getTime() - lastSyncTimestamp.getTime(); if (deltaTime < dbSyncPeriod * 60 * 1000) { // 时间差不足 无需同步 needSync = false; } // isGuest = true 访客 boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L; // session 数据变更了 同步 if (!isGuest == false && onlineSession.isAttributeChanged()) { needSync = true; } if (!needSync) { return; } } // 更新上次同步数据库时间 onlineSession.setAttribute(LAST_SYNC_DB_TIMESTAMP, onlineSession.getLastAccessTime()); // 更新完后 重置标识 if (onlineSession.isAttributeChanged()) { onlineSession.resetAttributeChanged(); } AsyncManager.me().execute(AsyncFactory.syncSessionToDb(onlineSession)); } /** * 当会话过期/停止(如用户退出时)属性等会调用 */ @Override protected void doDelete(Session session) { OnlineSession onlineSession = (OnlineSession) session; if (null == onlineSession) { return; } onlineSession.setStatus(OnlineStatus.off_line); sysShiroService.deleteSession(onlineSession); } }
3,213
OnlineSessionDAO
java
ja
java
code
{"qsc_code_num_words": 342, "qsc_code_num_chars": 3213.0, "qsc_code_mean_word_length": 5.94444444, "qsc_code_frac_words_unique": 0.4502924, "qsc_code_frac_chars_top_2grams": 0.01967536, "qsc_code_frac_chars_top_3grams": 0.03344811, "qsc_code_frac_chars_top_4grams": 0.03738318, "qsc_code_frac_chars_dupe_5grams": 0.12051156, "qsc_code_frac_chars_dupe_6grams": 0.04525332, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00339559, "qsc_code_frac_chars_whitespace": 0.26672891, "qsc_code_size_file_byte": 3213.0, "qsc_code_num_lines": 117.0, "qsc_code_num_chars_line_max": 118.0, "qsc_code_num_chars_line_mean": 27.46153846, "qsc_code_frac_chars_alphabet": 0.85950764, "qsc_code_frac_chars_comments": 0.12542795, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.09090909, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.01814947, "qsc_code_frac_chars_long_word_length": 0.01814947, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.05194805, "qsc_codejava_score_lines_no_logic": 0.25974026, "qsc_codejava_frac_words_no_modifier": 0.8, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/СравнениеТабличныхДокументов/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) Если ОбщегоНазначения.ЭтоМобильныйКлиент() Тогда Отказ = Истина; ВызватьИсключение НСтр("ru = 'Операция не доступна в мобильном клиенте, используйте тонкий клиент.'"); КонецЕсли; ТабличныеДокументыДляСравнения = ПолучитьИзВременногоХранилища(Параметры.АдресТабличныхДокументов); УдалитьИзВременногоХранилища(Параметры.АдресТабличныхДокументов); ТабличныйДокументЛевый = ПодготовитьТабличныйДокумент(ТабличныеДокументыДляСравнения.Левый); ТабличныйДокументПравый = ПодготовитьТабличныйДокумент(ТабличныеДокументыДляСравнения.Правый); Элементы.ГруппаЛевыйТабличныйДокумент.Заголовок = Параметры.ЗаголовокЛевый; Элементы.ГруппаПравыйТабличныйДокумент.Заголовок = Параметры.ЗаголовокПравый; Если Не ПустаяСтрока(Параметры.Заголовок) Тогда Заголовок = Параметры.Заголовок; КонецЕсли; БлокировкаОбработкиАктивизации = Истина; КонецПроцедуры &НаКлиенте Процедура ПриОткрытии(Отказ) ПодключитьОбработчикОжидания("НачатьСравнениеНаКлиенте", 0.1, Истина); КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовТаблицыФормыТабличныйДокументЛевый &НаКлиенте Процедура ТабличныйДокументЛевыйПриАктивизации(Элемент) Если БлокировкаОбработкиАктивизации = Истина Тогда Возврат; КонецЕсли; Источник = Новый Структура("Объект, Элемент", ТабличныйДокументЛевый, Элементы.ТабличныйДокументЛевый); Приемник = Новый Структура("Объект, Элемент", ТабличныйДокументПравый, Элементы.ТабличныйДокументПравый); СоответствияИсточник = Новый Структура("Строки, Столбцы", СоответствиеСтрокЛевый, СоответствиеСтолбцовЛевый); СоответствияПриемник = Новый Структура("Строки, Столбцы", СоответствиеСтрокПравый, СоответствиеСтолбцовПравый); ОбработатьАктивизациюОбласти(Источник, Приемник, СоответствияИсточник, СоответствияПриемник); КонецПроцедуры #КонецОбласти #Область ОбработчикиСобытийЭлементовТаблицыФормыТабличныйДокументПравый &НаКлиенте Процедура ТабличныйДокументПравыйПриАктивизации(Элемент) Если БлокировкаОбработкиАктивизации = Истина Тогда Возврат; КонецЕсли; Источник = Новый Структура("Объект, Элемент", ТабличныйДокументПравый, Элементы.ТабличныйДокументПравый); Приемник = Новый Структура("Объект, Элемент", ТабличныйДокументЛевый, Элементы.ТабличныйДокументЛевый); СоответствияИсточник = Новый Структура("Строки, Столбцы", СоответствиеСтрокПравый, СоответствиеСтолбцовПравый); СоответствияПриемник = Новый Структура("Строки, Столбцы", СоответствиеСтрокЛевый, СоответствиеСтолбцовЛевый); ОбработатьАктивизациюОбласти(Источник, Приемник, СоответствияИсточник, СоответствияПриемник); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура КомандаПредыдущееИзменениеЛевый(Команда) ПредыдущееИзменение(Элементы.ТабличныйДокументЛевый, ТабличныйДокументЛевый, РазличияЯчеекЛевый); КонецПроцедуры &НаКлиенте Процедура КомандаПредыдущееИзменениеПравый(Команда) ПредыдущееИзменение(Элементы.ТабличныйДокументПравый, ТабличныйДокументПравый, РазличияЯчеекПравый); КонецПроцедуры &НаКлиенте Процедура КомандаСледующееИзменениеЛевый(Команда) СледующееИзменение(Элементы.ТабличныйДокументЛевый, ТабличныйДокументЛевый, РазличияЯчеекЛевый); КонецПроцедуры &НаКлиенте Процедура КомандаСледующееИзменениеПравый(Команда) СледующееИзменение(Элементы.ТабличныйДокументПравый, ТабличныйДокументПравый, РазличияЯчеекПравый); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаКлиенте Процедура НачатьСравнениеНаКлиенте() БлокировкаОбработкиАктивизации = Истина; СоответствиеСтрокЛевый = Новый СписокЗначений; СоответствиеСтрокПравый = Новый СписокЗначений; СоответствиеСтолбцовЛевый = Новый СписокЗначений; СоответствиеСтолбцовПравый = Новый СписокЗначений; РазличияЯчеекЛевый.Очистить(); РазличияЯчеекПравый.Очистить(); ДлительнаяОперация = НачатьСравнениеНаСервере(); ОповещениеОЗавершении = Новый ОписаниеОповещения("ВывестиРезультатНаКлиенте", ЭтотОбъект); ПараметрыОжидания = ДлительныеОперацииКлиент.ПараметрыОжидания(ЭтотОбъект); ПараметрыОжидания.ТекстСообщения = НСтр("ru = 'Выполняется сравнение документов.'"); ДлительныеОперацииКлиент.ОжидатьЗавершение(ДлительнаяОперация, ОповещениеОЗавершении, ПараметрыОжидания); КонецПроцедуры &НаСервере Функция НачатьСравнениеНаСервере() ТаблицаЛевогоДокумента = ПрочитатьТабличныйДокумент(ТабличныйДокументЛевый); ТаблицаПравогоДокумента = ПрочитатьТабличныйДокумент(ТабличныйДокументПравый); ПараметрыВыполнения = ДлительныеОперации.ПараметрыВыполненияФункции(УникальныйИдентификатор); Возврат ДлительныеОперации.ВыполнитьФункцию(ПараметрыВыполнения, "СтандартныеПодсистемыСервер.СравнитьТаблицы", ТаблицаЛевогоДокумента, ТаблицаПравогоДокумента); КонецФункции &НаКлиенте Процедура ВывестиРезультатНаКлиенте(Результат, ДополнительныеПараметры) Экспорт БлокировкаОбработкиАктивизации = Ложь; Если Результат = Неопределено Тогда Возврат; КонецЕсли; Если Результат.Статус = "Ошибка" Тогда СтандартныеПодсистемыКлиент.ВывестиИнформациюОбОшибке(Результат.ИнформацияОбОшибке); Возврат; КонецЕсли; ВывестиРезультатНаСервере(Результат.АдресРезультата); СледующееИзменение(Элементы.ТабличныйДокументЛевый, ТабличныйДокументЛевый, РазличияЯчеекЛевый); КонецПроцедуры &НаСервере Процедура ВывестиРезультатНаСервере(АдресРезультата) #Область Сравнение РезультатСравнения = ПолучитьИзВременногоХранилища(АдресРезультата); // Сравниваются табличные документы по строкам и подбираются соответствия строк. Соответствия = РезультатСравнения.СоответствияСтрок; СоответствиеСтрокЛевый = Соответствия[0]; СоответствиеСтрокПравый = Соответствия[1]; // Сравниваются табличные документы по столбцам и подбираются соответствия столбцов. Соответствия = РезультатСравнения.СоответствияСтолбцов; СоответствиеСтолбцовЛевый = Соответствия[0]; СоответствиеСтолбцовПравый = Соответствия[1]; ТаблицаЛевогоДокумента = Неопределено; ТаблицаПравогоДокумента = Неопределено; #КонецОбласти #Область ГрафическоеОтображениеРазличий ЦветОбластиУдаленнойФон = ЦветаСтиля.УдаленныйРеквизитФон; ЦветОбластиДобавленнойФон = ЦветаСтиля.ДобавленныйРеквизитФон; ЦветОбластиИзмененнойФон = ЦветаСтиля.ИзмененноеЗначениеРеквизитаФон; ЦветОбластиИзмененнойТекст = ЦветаСтиля.ИзмененноеЗначениеРеквизитаЦвет; ВысотаЛевойТаблицы = ТабличныйДокументЛевый.ВысотаТаблицы; ШиринаЛевойТаблицы = ТабличныйДокументЛевый.ШиринаТаблицы; ВысотаПравойТаблицы = ТабличныйДокументПравый.ВысотаТаблицы; ШиринаПравойТаблицы = ТабличныйДокументПравый.ШиринаТаблицы; // Строки которые были удалены из левого табличного документа. Для НомерСтроки = 1 По СоответствиеСтрокЛевый.Количество()-1 Цикл Если СоответствиеСтрокЛевый[НомерСтроки].Значение = Неопределено Тогда Область = ТабличныйДокументЛевый.Область(НомерСтроки, 1, НомерСтроки, ШиринаЛевойТаблицы); Область.ЦветФона = ЦветОбластиУдаленнойФон; НоваяСтрокаРазличий = РазличияЯчеекЛевый.Добавить(); НоваяСтрокаРазличий.НомерСтроки = НомерСтроки; НоваяСтрокаРазличий.НомерСтолбца = 0; КонецЕсли; КонецЦикла; // Столбцы которые были удалены из левого табличного документа. Для НомерСтолбца = 1 По СоответствиеСтолбцовЛевый.Количество()-1 Цикл Если СоответствиеСтолбцовЛевый[НомерСтолбца].Значение = Неопределено Тогда Область = ТабличныйДокументЛевый.Область(1, НомерСтолбца, ВысотаЛевойТаблицы, НомерСтолбца); Область.ЦветФона = ЦветОбластиУдаленнойФон; НоваяСтрокаРазличий = РазличияЯчеекЛевый.Добавить(); НоваяСтрокаРазличий.НомерСтроки = 0; НоваяСтрокаРазличий.НомерСтолбца = НомерСтолбца; КонецЕсли; КонецЦикла; // Строки которые были добавлены в правый табличный документ. Для НомерСтроки = 1 По СоответствиеСтрокПравый.Количество()-1 Цикл Если СоответствиеСтрокПравый[НомерСтроки].Значение = Неопределено Тогда Область = ТабличныйДокументПравый.Область(НомерСтроки, 1, НомерСтроки, ШиринаПравойТаблицы); Область.ЦветФона = ЦветОбластиДобавленнойФон; НоваяСтрокаРазличий = РазличияЯчеекПравый.Добавить(); НоваяСтрокаРазличий.НомерСтроки = НомерСтроки; НоваяСтрокаРазличий.НомерСтолбца = 0; КонецЕсли; КонецЦикла; // Столбцы которые были добавлены в правый табличный документ. Для НомерСтолбца = 1 По СоответствиеСтолбцовПравый.Количество()-1 Цикл Если СоответствиеСтолбцовПравый[НомерСтолбца].Значение = Неопределено Тогда Область = ТабличныйДокументПравый.Область(1, НомерСтолбца, ВысотаПравойТаблицы, НомерСтолбца); Область.ЦветФона = ЦветОбластиДобавленнойФон; НоваяСтрокаРазличий = РазличияЯчеекПравый.Добавить(); НоваяСтрокаРазличий.НомерСтроки = 0; НоваяСтрокаРазличий.НомерСтолбца = НомерСтолбца; КонецЕсли; КонецЦикла; // Ячейки которые были изменены. Для НомерСтроки1 = 1 По СоответствиеСтрокЛевый.Количество()-1 Цикл НомерСтроки2 = СоответствиеСтрокЛевый[НомерСтроки1].Значение; Если НомерСтроки2 = Неопределено Тогда Продолжить; КонецЕсли; Для НомерСтолбца1 = 1 По СоответствиеСтолбцовЛевый.Количество()-1 Цикл НомерСтолбца2 = СоответствиеСтолбцовЛевый[НомерСтолбца1].Значение; Если НомерСтолбца2 = Неопределено Тогда Продолжить; КонецЕсли; Область1 = ТабличныйДокументЛевый.Область(НомерСтроки1, НомерСтолбца1, НомерСтроки1, НомерСтолбца1); Область2 = ТабличныйДокументПравый.Область(НомерСтроки2, НомерСтолбца2, НомерСтроки2, НомерСтолбца2); Если НЕ СравнитьОбласти(Область1, Область2) Тогда Область1 = ТабличныйДокументЛевый.Область(НомерСтроки1, НомерСтолбца1); Область2 = ТабличныйДокументПравый.Область(НомерСтроки2, НомерСтолбца2); Область1.ЦветТекста = ЦветОбластиИзмененнойТекст; Область2.ЦветТекста = ЦветОбластиИзмененнойТекст; Область1.ЦветФона = ЦветОбластиИзмененнойФон; Область2.ЦветФона = ЦветОбластиИзмененнойФон; НоваяСтрокаРазличий = РазличияЯчеекЛевый.Добавить(); НоваяСтрокаРазличий.НомерСтроки = НомерСтроки1; НоваяСтрокаРазличий.НомерСтолбца = НомерСтолбца1; НоваяСтрокаРазличий = РазличияЯчеекПравый.Добавить(); НоваяСтрокаРазличий.НомерСтроки = НомерСтроки2; НоваяСтрокаРазличий.НомерСтолбца = НомерСтолбца2; КонецЕсли; КонецЦикла; КонецЦикла; РазличияЯчеекЛевый.Сортировать("НомерСтроки, НомерСтолбца"); РазличияЯчеекПравый.Сортировать("НомерСтроки, НомерСтолбца"); #КонецОбласти КонецПроцедуры &НаСервере Функция СравнитьОбласти(Область1, Область2) Если Область1.Текст <> Область2.Текст Тогда Возврат Ложь; КонецЕсли; Если Область1.Примечание.Текст <> Область2.Примечание.Текст Тогда Возврат Ложь; КонецЕсли; Возврат Истина; КонецФункции &НаСервере Функция ПрочитатьТабличныйДокумент(ТабличныйДокументИсточник) КоличествоСтолбцов = ТабличныйДокументИсточник.ШиринаТаблицы; Если КоличествоСтолбцов = 0 Тогда Возврат Новый ТаблицаЗначений; КонецЕсли; ТабличныйДокумент = Новый ТабличныйДокумент; Для НомерСтолбца = 1 По КоличествоСтолбцов Цикл ТабличныйДокумент.Область(1, НомерСтолбца, 1, НомерСтолбца).Текст = "Номер_" + Формат(НомерСтолбца,"ЧГ=0"); КонецЦикла; ТабличныйДокумент.Вывести(ТабличныйДокументИсточник); Построитель = Новый ПостроительЗапроса; Построитель.ИсточникДанных = Новый ОписаниеИсточникаДанных(ТабличныйДокумент.Область()); Построитель.Выполнить(); ТаблицаЗначенийРезультат = Построитель.Результат.Выгрузить(); Возврат ТаблицаЗначенийРезультат; КонецФункции &НаКлиенте Процедура ОбработатьАктивизациюОбласти(ТабДокИсточник, ТабДокПриемник, СоответствияИсточник, СоответствияПриемник) БлокировкаОбработкиАктивизации = Истина; ТекОбласть = ТабДокИсточник.Элемент.ТекущаяОбласть; Если ТекОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Таблица Тогда ВыбраннаяОбласть = ТабДокПриемник.Область(); Иначе Если ТекОбласть.Низ < СоответствияИсточник.Строки.Количество() Тогда НомерСтроки = СоответствияИсточник.Строки[ТекОбласть.Низ].Значение; Иначе НомерСтроки = ТекОбласть.Низ - СоответствияИсточник.Строки.Количество() + СоответствияПриемник.Строки.Количество(); КонецЕсли; Если ТекОбласть.Лево < СоответствияИсточник.Столбцы.Количество() Тогда НомерСтолбца = СоответствияИсточник.Столбцы[ТекОбласть.Лево].Значение; Иначе НомерСтолбца = ТекОбласть.Лево - СоответствияИсточник.Столбцы.Количество() + СоответствияПриемник.Столбцы.Количество(); КонецЕсли; ВыбраннаяОбласть = Неопределено; Если ТекОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Прямоугольник Тогда Если НомерСтроки <> Неопределено И НомерСтолбца <> Неопределено Тогда ВыбраннаяОбласть = ТабДокПриемник.Объект.Область(НомерСтроки, НомерСтолбца); КонецЕсли; ИначеЕсли ТекОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Строки Тогда Если НомерСтроки <> Неопределено Тогда ВыбраннаяОбласть = ТабДокПриемник.Объект.Область(НомерСтроки, 0, НомерСтроки, 0); КонецЕсли; ИначеЕсли ТекОбласть.ТипОбласти = ТипОбластиЯчеекТабличногоДокумента.Колонки Тогда Если НомерСтолбца <> Неопределено Тогда ВыбраннаяОбласть = ТабДокПриемник.Объект.Область(0, НомерСтолбца, 0, НомерСтолбца); КонецЕсли; Иначе Возврат; КонецЕсли; КонецЕсли; ТабДокПриемник.Элемент.ТекущаяОбласть = ВыбраннаяОбласть; БлокировкаОбработкиАктивизации = Ложь; КонецПроцедуры &НаКлиенте Процедура ПредыдущееИзменение(ЭлементФормы, РеквизитФормы, ТаблицаРазличий) Перем Индекс; ТекЯчейка = ЭлементФормы.ТекущаяОбласть; НомерСтроки = ТекЯчейка.Верх; НомерСтолбца = ТекЯчейка.Лево; Для Каждого ТекСтрока Из ТаблицаРазличий Цикл Если ТекСтрока.НомерСтроки < НомерСтроки ИЛИ ТекСтрока.НомерСтроки = НомерСтроки И ТекСтрока.НомерСтолбца < НомерСтолбца Тогда Индекс = ТаблицаРазличий.Индекс(ТекСтрока); ИначеЕсли ТекСтрока.НомерСтроки >= НомерСтроки И ТекСтрока.НомерСтолбца > НомерСтолбца Тогда Прервать; КонецЕсли; КонецЦикла; Если Индекс <> Неопределено Тогда СтрокаРазличий = ТаблицаРазличий[Индекс]; НомерСтроки = СтрокаРазличий.НомерСтроки; НомерСтолбца = СтрокаРазличий.НомерСтолбца; ЭлементФормы.ТекущаяОбласть = РеквизитФормы.Область(НомерСтроки, НомерСтолбца, НомерСтроки, НомерСтолбца); КонецЕсли; КонецПроцедуры &НаКлиенте Процедура СледующееИзменение(ЭлементФормы, РеквизитФормы, ТаблицаРазличий) Перем Индекс; ТекЯчейка = ЭлементФормы.ТекущаяОбласть; НомерСтроки = ТекЯчейка.Верх; НомерСтолбца = ТекЯчейка.Лево; Для Каждого ТекСтрока Из ТаблицаРазличий Цикл Если ТекСтрока.НомерСтроки = НомерСтроки И ТекСтрока.НомерСтолбца > НомерСтолбца ИЛИ ТекСтрока.НомерСтроки > НомерСтроки Тогда Индекс = ТаблицаРазличий.Индекс(ТекСтрока); Прервать; КонецЕсли; КонецЦикла; Если Индекс <> Неопределено Тогда СтрокаРазличий = ТаблицаРазличий[Индекс]; НомерСтроки = СтрокаРазличий.НомерСтроки; НомерСтолбца = СтрокаРазличий.НомерСтолбца; ЭлементФормы.ТекущаяОбласть = РеквизитФормы.Область(НомерСтроки, НомерСтолбца, НомерСтроки, НомерСтолбца); КонецЕсли; КонецПроцедуры &НаСервере Функция ПодготовитьТабличныйДокумент(ТабличныйДокумент) Если ТипЗнч(ТабличныйДокумент) = Тип("ТабличныйДокумент") Тогда Возврат ТабличныйДокумент; КонецЕсли; ДвоичныеДанные = ПолучитьИзВременногоХранилища(ТабличныйДокумент); // ДвоичныеДанные - ИмяВременногоФайла = ПолучитьИмяВременногоФайла("mxl"); ДвоичныеДанные.Записать(ИмяВременногоФайла); Результат = Новый ТабличныйДокумент; Результат.Прочитать(ИмяВременногоФайла); УдалитьФайлы(ИмяВременногоФайла); Возврат Результат; КонецФункции #КонецОбласти
16,130
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 1126, "qsc_code_num_chars": 16130.0, "qsc_code_mean_word_length": 11.53019538, "qsc_code_frac_words_unique": 0.23623446, "qsc_code_frac_chars_top_2grams": 0.01663714, "qsc_code_frac_chars_top_3grams": 0.01478857, "qsc_code_frac_chars_top_4grams": 0.00831857, "qsc_code_frac_chars_dupe_5grams": 0.40460602, "qsc_code_frac_chars_dupe_6grams": 0.3239621, "qsc_code_frac_chars_dupe_7grams": 0.2598783, "qsc_code_frac_chars_dupe_8grams": 0.19009474, "qsc_code_frac_chars_dupe_9grams": 0.12477856, "qsc_code_frac_chars_dupe_10grams": 0.10921975, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0060491, "qsc_code_frac_chars_whitespace": 0.11859888, "qsc_code_size_file_byte": 16130.0, "qsc_code_num_lines": 503.0, "qsc_code_num_chars_line_max": 115.0, "qsc_code_num_chars_line_mean": 32.06759443, "qsc_code_frac_chars_alphabet": 0.90708307, "qsc_code_frac_chars_comments": 0.99349039, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1up-lab/OneupUploaderBundle
tests/Controller/AbstractControllerTest.php
<?php declare(strict_types=1); namespace Oneup\UploaderBundle\Tests\Controller; use Oneup\UploaderBundle\Templating\Helper\UploaderHelper; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Finder\Finder; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\Routing\RouterInterface; abstract class AbstractControllerTest extends WebTestCase { /** * @var array */ protected $createdFiles; /** * @var KernelBrowser */ protected $client; /** * @var array */ protected $requestHeaders; /** * @var ContainerInterface */ protected static $container; /** * @var UploaderHelper */ protected $helper; protected function setUp(): void { self::ensureKernelShutdown(); $this->client = static::createClient(['debug' => false]); $this->client->catchExceptions(false); $this->client->disableReboot(); /** @var ContainerInterface $container */ $container = $this->client->getContainer(); /** @var UploaderHelper $helper */ $helper = $container->get('oneup_uploader.templating.uploader_helper'); /** @var RouterInterface $router */ $router = $container->get('router'); self::$container = $container; $this->helper = $helper; $this->createdFiles = []; $this->requestHeaders = [ 'HTTP_ACCEPT' => 'application/json', ]; $router->getRouteCollection()->all(); } protected function tearDown(): void { foreach ($this->createdFiles as $file) { @unlink($file); } foreach ($this->getUploadedFiles() as $file) { /* @var \SplFileInfo $file */ @unlink($file->getPathname()); } unset($this->client, $this->controller); static::$booted = false; } public function testRoute(): void { $endpoint = $this->helper->endpoint($this->getConfigKey()); $this->assertNotNull($endpoint); $this->assertSame(0, strpos($endpoint, '/_uploader')); } public function testCallByGet(): void { $this->implTestCallBy('GET', 405, 'text/html'); } public function testCallByDelete(): void { $this->implTestCallBy('DELETE', 405, 'text/html'); } public function testCallByPatch(): void { $this->implTestCallBy('PATCH'); } public function testCallByPost(): void { $this->implTestCallBy('POST'); } public function testCallByPut(): void { $this->implTestCallBy('PUT'); } public function testEmptyHttpAcceptHeader(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); // empty HTTP_ACCEPT header $client->request('POST', $endpoint, [], [], []); $response = $client->getResponse(); $this->assertTrue($response->isSuccessful()); $this->assertSame($response->headers->get('Content-Type'), 'text/plain; charset=UTF-8'); } abstract protected function getConfigKey(): string; protected function implTestCallBy(string $method, int $expectedStatusCode = 200, string $expectedContentType = 'application/json'): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); if (405 === $expectedStatusCode) { $this->expectException(MethodNotAllowedHttpException::class); } $client->request($method, $endpoint, [], [], $this->requestHeaders); $response = $client->getResponse(); $this->assertSame($expectedStatusCode, $response->getStatusCode()); $this->assertStringContainsStringIgnoringCase($expectedContentType, (string) $response->headers->get('Content-Type')); } protected function createTempFile(int $size = 128): string { $file = (string) tempnam(sys_get_temp_dir(), 'uploader_'); file_put_contents($file, str_repeat('A', $size)); $this->createdFiles[] = $file; return $file; } protected function getUploadedFiles(): Finder { /** @var string $env */ $env = self::$container->getParameter('kernel.environment'); /** @var string $root */ $root = self::$container->getParameter('kernel.project_dir'); // assemble path $path = sprintf('%s/cache/%s/upload', $root, $env); $finder = new Finder(); return $finder->in($path); } }
4,701
AbstractControllerTest
php
en
php
code
{"qsc_code_num_words": 390, "qsc_code_num_chars": 4701.0, "qsc_code_mean_word_length": 7.28205128, "qsc_code_frac_words_unique": 0.36923077, "qsc_code_frac_chars_top_2grams": 0.03380282, "qsc_code_frac_chars_top_3grams": 0.03873239, "qsc_code_frac_chars_top_4grams": 0.02746479, "qsc_code_frac_chars_dupe_5grams": 0.09647887, "qsc_code_frac_chars_dupe_6grams": 0.0584507, "qsc_code_frac_chars_dupe_7grams": 0.04366197, "qsc_code_frac_chars_dupe_8grams": 0.04366197, "qsc_code_frac_chars_dupe_9grams": 0.04366197, "qsc_code_frac_chars_dupe_10grams": 0.04366197, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00503497, "qsc_code_frac_chars_whitespace": 0.23952351, "qsc_code_size_file_byte": 4701.0, "qsc_code_num_lines": 174.0, "qsc_code_num_chars_line_max": 141.0, "qsc_code_num_chars_line_mean": 27.01724138, "qsc_code_frac_chars_alphabet": 0.78937063, "qsc_code_frac_chars_comments": 0.0863646, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.06422018, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.06076834, "qsc_code_frac_chars_long_word_length": 0.00954598, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.05504587}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1uphealth/fhir-react
src/components/resources/Coverage/Coverage.js
import React from 'react'; import PropTypes from 'prop-types'; import _get from 'lodash/get'; import _has from 'lodash/has'; import Reference from '../../datatypes/Reference'; import Coding from '../../datatypes/Coding'; import UnhandledResourceDataStructure from '../UnhandledResourceDataStructure'; import fhirVersions from '../fhirResourceVersions'; import { Root, Header, Body, Value } from '../../ui'; import Identifier from '../../datatypes/Identifier'; import Accordion from '../../containers/Accordion'; const commonDTO = fhirResource => { const identifier = _get(fhirResource, 'identifier.0'); const period = _has(fhirResource, 'period'); const coverageFrom = _get(fhirResource, 'period.start'); const coverageTo = _get(fhirResource, 'period.end'); return { identifier, period, coverageFrom, coverageTo, }; }; const dstu2DTO = fhirResource => { const planId = _get(fhirResource, 'plan'); const issuer = _get(fhirResource, 'issuer'); const type = _get(fhirResource, 'type'); return { issuer, planId, type, }; }; const stu3DTO = fhirResource => { const issuer = _get(fhirResource, 'payor.0'); const planId = _get(fhirResource, 'grouping.plan'); const type = _get(fhirResource, 'type.coding.0'); const details = { planDescription: _get(fhirResource, 'grouping.planDisplay'), classDescription: _get(fhirResource, 'grouping.classDisplay'), }; const hasDetails = Object.values(details).filter(item => !!item).length > 0; const extensionRaw = _get(fhirResource, 'extension'); const hasExtension = Array.isArray(extensionRaw) && extensionRaw.length > 0; let extension = []; if (hasExtension) { extension = extensionRaw.map(item => ({ coding: [item.valueCoding] })); } return { planId, issuer, type, details, hasDetails, extension, hasExtension, }; }; const r4DTO = fhirResource => { const issuer = _get(fhirResource, 'payor.0'); const planId = _get(fhirResource, 'class.plan'); const type = _get(fhirResource, 'type.coding.0'); const details = { planDescription: _get(fhirResource, 'class.value'), classDescription: _get(fhirResource, 'class.type'), }; const hasDetails = Object.values(details).filter(item => !!item).length > 0; let extension = _get(fhirResource, 'class'); const hasExtension = Array.isArray(extension) && extension.length > 0; if (hasExtension) { extension = extension.map(item => ({ ...item, coding: _get(item, 'type.coding'), })); } return { planId, issuer, type, details, hasDetails, extension, hasExtension, }; }; const resourceDTO = (fhirVersion, fhirResource) => { switch (fhirVersion) { case fhirVersions.DSTU2: { return { ...commonDTO(fhirResource), ...dstu2DTO(fhirResource), }; } case fhirVersions.STU3: { return { ...commonDTO(fhirResource), ...stu3DTO(fhirResource), }; } case fhirVersions.R4: { return { ...commonDTO(fhirResource), ...r4DTO(fhirResource), }; } default: throw Error('Unrecognized the fhir version property type.'); } }; const Coverage = ({ fhirResource, fhirVersion, fhirIcons, onClick, rawOnClick, customId, }) => { let fhirResourceData = {}; try { fhirResourceData = resourceDTO(fhirVersion, fhirResource); } catch (error) { console.warn(error.message); return <UnhandledResourceDataStructure resourceName="Coverage" />; } const { planId, issuer, period, coverageFrom, coverageTo, type, details, hasDetails, extension, hasExtension, identifier, } = fhirResourceData; const issuerReferenceType = _get(issuer, 'reference'); const issuerIdentifierType = _get(issuer, 'identifier'); const tableData = [ { label: 'Issuer', testId: 'issuer', data: issuerReferenceType && <Reference fhirData={issuer} />, status: issuerReferenceType, }, { label: 'Issuer', testId: 'issuer', data: issuerIdentifierType && <Identifier fhirData={issuer.identifier} />, status: issuerIdentifierType, }, { label: 'PlanId', testId: 'planId', data: planId, status: planId, }, { label: 'Coverage', testId: '', data: period && ( <> {coverageFrom && ( <span data-testid="coverageFrom">from: {coverageFrom}</span> )}{' '} {coverageTo && <span data-testid="coverageTo">to: {coverageTo}</span>} </> ), status: period, }, { label: 'Type of coverage', testId: 'type', data: type && <Coding fhirData={type} />, status: type, }, { label: 'Details', testId: 'details', data: hasDetails && ( <> <span>{details.planDescription}</span> {details.classDescription && ( <> {' | '} <span>{details.classDescription}</span> </> )} </> ), status: hasDetails, }, { label: 'Extension', testId: 'extensions', data: hasExtension && extension.map((item, i) => { const coding = Array.isArray(item.coding) ? item.coding : []; return ( <span key={`item-${i}`}> {item.name && <span>{item.name}</span>} {coding.map((code, j) => ( <Coding key={`item-${j}`} fhirData={code} /> ))} </span> ); }), status: hasExtension, }, ]; return ( <Root name="coverage"> <Accordion headerContent={ <Header resourceName="Coverage" additionalContent={ identifier && ( <Value label="Identifier"> <Identifier fhirData={identifier} valueOnly noCursive /> </Value> ) } title="Coverage" icon={fhirIcons} /> } bodyContent={<Body tableData={tableData} />} onClick={onClick} rawOnClick={rawOnClick} customId={customId} /> </Root> ); }; Coverage.propTypes = { fhirResource: PropTypes.shape({}).isRequired, fhirVersion: PropTypes.oneOf([ fhirVersions.DSTU2, fhirVersions.STU3, fhirVersions.R4, ]).isRequired, }; export default Coverage;
6,493
Coverage
js
en
javascript
code
{"qsc_code_num_words": 530, "qsc_code_num_chars": 6493.0, "qsc_code_mean_word_length": 7.08301887, "qsc_code_frac_words_unique": 0.22264151, "qsc_code_frac_chars_top_2grams": 0.07192328, "qsc_code_frac_chars_top_3grams": 0.0213106, "qsc_code_frac_chars_top_4grams": 0.02077784, "qsc_code_frac_chars_dupe_5grams": 0.17741076, "qsc_code_frac_chars_dupe_6grams": 0.14437933, "qsc_code_frac_chars_dupe_7grams": 0.14437933, "qsc_code_frac_chars_dupe_8grams": 0.14437933, "qsc_code_frac_chars_dupe_9grams": 0.14437933, "qsc_code_frac_chars_dupe_10grams": 0.1097496, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00445293, "qsc_code_frac_chars_whitespace": 0.27367935, "qsc_code_size_file_byte": 6493.0, "qsc_code_num_lines": 260.0, "qsc_code_num_chars_line_max": 81.0, "qsc_code_num_chars_line_mean": 24.97307692, "qsc_code_frac_chars_alphabet": 0.79156064, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.3495935, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.09702757, "qsc_code_frac_chars_long_word_length": 0.02710611, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 0.0, "qsc_codejavascript_cate_var_zero": null, "qsc_codejavascript_frac_lines_func_ratio": null, "qsc_codejavascript_num_statement_line": null, "qsc_codejavascript_score_lines_no_logic": null, "qsc_codejavascript_frac_words_legal_var_name": null, "qsc_codejavascript_frac_words_legal_func_name": null, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 1, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1tontech/bootstrap4-snippets
snippets/font-awesome5-icons-pro.yml
# Can be found inside `metadata` folder of font awesome pro zip 500px: changes: - '4.4' - 5.0.0 label: 500px search: terms: [] styles: - brands unicode: f26e abacus: changes: - 5.3.0 label: Abacus search: terms: [] styles: - solid - regular - light unicode: f640 accessible-icon: changes: - 5.0.0 label: Accessible Icon search: terms: - accessibility - handicap - person - wheelchair - wheelchair-alt styles: - brands unicode: f368 accusoft: changes: - 5.0.0 label: Accusoft search: terms: [] styles: - brands unicode: f369 acorn: changes: - 5.4.0 label: Acorn search: terms: - fall - nature - nut - seasonal - tree styles: - solid - regular - light unicode: f6ae acquisitions-incorporated: changes: - 5.4.0 label: Acquisitions Incorporated search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - game - gaming - tabletop styles: - brands unicode: f6af ad: changes: - 5.3.0 label: Ad search: terms: [] styles: - solid - regular - light unicode: f641 address-book: changes: - '4.7' - 5.0.0 - 5.0.3 label: Address Book search: terms: [] styles: - solid - regular - light unicode: f2b9 address-card: changes: - '4.7' - 5.0.0 - 5.0.3 label: Address Card search: terms: [] styles: - solid - regular - light unicode: f2bb adjust: changes: - '1' - 5.0.0 label: adjust search: terms: - contrast styles: - solid - regular - light unicode: f042 adn: changes: - '3.2' - 5.0.0 label: App.net search: terms: [] styles: - brands unicode: f170 adversal: changes: - 5.0.0 label: Adversal search: terms: [] styles: - brands unicode: f36a affiliatetheme: changes: - 5.0.0 label: affiliatetheme search: terms: [] styles: - brands unicode: f36b air-freshener: changes: - 5.2.0 label: Air Freshener search: terms: [] styles: - solid - regular - light unicode: f5d0 alarm-clock: changes: - 5.0.0 label: Alarm Clock search: terms: - date - late - timer - timestamp - watch styles: - solid - regular - light unicode: f34e algolia: changes: - 5.0.0 label: Algolia search: terms: [] styles: - brands unicode: f36c alicorn: changes: - 5.4.0 label: Alicorn search: terms: - fantasy - fauna - horse - mammmal - pegasus - unicorn - wing styles: - solid - regular - light unicode: f6b0 align-center: changes: - '1' - 5.0.0 label: align-center search: terms: - middle - text styles: - solid - regular - light unicode: f037 align-justify: changes: - '1' - 5.0.0 label: align-justify search: terms: - text styles: - solid - regular - light unicode: f039 align-left: changes: - '1' - 5.0.0 label: align-left search: terms: - text styles: - solid - regular - light unicode: f036 align-right: changes: - '1' - 5.0.0 label: align-right search: terms: - text styles: - solid - regular - light unicode: f038 alipay: changes: - 5.3.0 label: Alipay search: terms: [] styles: - brands unicode: f642 allergies: changes: - 5.0.7 label: Allergies search: terms: - freckles - hand - intolerances - pox - spots styles: - solid - regular - light unicode: f461 amazon: changes: - '4.4' - 5.0.0 label: Amazon search: terms: [] styles: - brands unicode: f270 amazon-pay: changes: - 5.0.2 label: Amazon Pay search: terms: [] styles: - brands unicode: f42c ambulance: changes: - '3' - 5.0.0 - 5.0.7 label: ambulance search: terms: - help - machine - support - vehicle styles: - solid - regular - light unicode: f0f9 american-sign-language-interpreting: changes: - '4.6' - 5.0.0 label: American Sign Language Interpreting search: terms: [] styles: - solid - regular - light unicode: f2a3 amilia: changes: - 5.0.0 label: Amilia search: terms: [] styles: - brands unicode: f36d analytics: changes: - 5.3.0 label: Analytics search: terms: [] styles: - solid - regular - light unicode: f643 anchor: changes: - '3.1' - 5.0.0 label: Anchor search: terms: - link styles: - solid - regular - light unicode: f13d android: changes: - '3.2' - 5.0.0 label: Android search: terms: - robot styles: - brands unicode: f17b angellist: changes: - '4.2' - 5.0.0 label: AngelList search: terms: [] styles: - brands unicode: f209 angle-double-down: changes: - '3' - 5.0.0 label: Angle Double Down search: terms: - arrows styles: - solid - regular - light unicode: f103 angle-double-left: changes: - '3' - 5.0.0 label: Angle Double Left search: terms: - arrows - back - laquo - previous - quote styles: - solid - regular - light unicode: f100 angle-double-right: changes: - '3' - 5.0.0 label: Angle Double Right search: terms: - arrows - forward - next - quote - raquo styles: - solid - regular - light unicode: f101 angle-double-up: changes: - '3' - 5.0.0 label: Angle Double Up search: terms: - arrows styles: - solid - regular - light unicode: f102 angle-down: changes: - '3' - 5.0.0 label: angle-down search: terms: - arrow styles: - solid - regular - light unicode: f107 angle-left: changes: - '3' - 5.0.0 label: angle-left search: terms: - arrow - back - previous styles: - solid - regular - light unicode: f104 angle-right: changes: - '3' - 5.0.0 label: angle-right search: terms: - arrow - forward - next styles: - solid - regular - light unicode: f105 angle-up: changes: - '3' - 5.0.0 label: angle-up search: terms: - arrow styles: - solid - regular - light unicode: f106 angry: changes: - 5.1.0 label: Angry Face search: terms: - disapprove - emoticon - face - mad - upset styles: - solid - regular - light unicode: f556 angrycreative: changes: - 5.0.0 label: Angry Creative search: terms: [] styles: - brands unicode: f36e angular: changes: - 5.0.0 label: Angular search: terms: [] styles: - brands unicode: f420 ankh: changes: - 5.3.0 label: Ankh search: terms: - amulet - copper - coptic christianity - copts - crux ansata - egyptian - venus styles: - solid - regular - light unicode: f644 app-store: changes: - 5.0.0 label: App Store search: terms: [] styles: - brands unicode: f36f app-store-ios: changes: - 5.0.0 label: iOS App Store search: terms: [] styles: - brands unicode: f370 apper: changes: - 5.0.0 label: Apper Systems AB search: terms: [] styles: - brands unicode: f371 apple: changes: - '3.2' - 5.0.0 - 5.0.7 label: Apple search: terms: - food - fruit - mac - osx styles: - brands unicode: f179 apple-alt: changes: - 5.2.0 label: Fruit Apple search: terms: - fall - food - fruit - fuji - macintosh - seasonal styles: - solid - regular - light unicode: f5d1 apple-crate: changes: - 5.4.0 label: Apple Crate search: terms: - bushel - container - fall - food - fruit - fuji - macintosh - peck - seasonal styles: - solid - regular - light unicode: f6b1 apple-pay: changes: - 5.0.0 label: Apple Pay search: terms: [] styles: - brands unicode: f415 archive: changes: - '3.2' - 5.0.0 - 5.0.9 label: Archive search: terms: - box - package - storage styles: - solid - regular - light unicode: f187 archway: changes: - 5.1.0 label: Archway search: terms: - arc - monument - road - street styles: - solid - regular - light unicode: f557 arrow-alt-circle-down: changes: - 5.0.0 label: Alternate Arrow Circle Down search: terms: - arrow-circle-o-down - download styles: - solid - regular - light unicode: f358 arrow-alt-circle-left: changes: - 5.0.0 label: Alternate Arrow Circle Left search: terms: - arrow-circle-o-left - back - previous styles: - solid - regular - light unicode: f359 arrow-alt-circle-right: changes: - 5.0.0 label: Alternate Arrow Circle Right search: terms: - arrow-circle-o-right - forward - next styles: - solid - regular - light unicode: f35a arrow-alt-circle-up: changes: - 5.0.0 label: Alternate Arrow Circle Up search: terms: - arrow-circle-o-up styles: - solid - regular - light unicode: f35b arrow-alt-down: changes: - 5.0.0 label: Alternate Arrow Down search: terms: [] styles: - solid - regular - light unicode: f354 arrow-alt-from-bottom: changes: - 5.0.0 label: Alternate Arrow from Bottom search: terms: - download styles: - solid - regular - light unicode: f346 arrow-alt-from-left: changes: - 5.0.0 label: Alternate Arrow from Left search: terms: - back - previous styles: - solid - regular - light unicode: f347 arrow-alt-from-right: changes: - 5.0.0 label: Alternate Arrow from Right search: terms: - forward - next styles: - solid - regular - light unicode: f348 arrow-alt-from-top: changes: - 5.0.0 label: Alternate Arrow from Top search: terms: [] styles: - solid - regular - light unicode: f349 arrow-alt-left: changes: - 5.0.0 label: Alternate Arrow Left search: terms: - back - previous styles: - solid - regular - light unicode: f355 arrow-alt-right: changes: - 5.0.0 label: Alternate Arrow Right search: terms: - forward - next styles: - solid - regular - light unicode: f356 arrow-alt-square-down: changes: - 5.0.0 label: Alternate Arrow Square Down search: terms: [] styles: - solid - regular - light unicode: f350 arrow-alt-square-left: changes: - 5.0.0 label: Alternate Arrow Square Left search: terms: - back - previous styles: - solid - regular - light unicode: f351 arrow-alt-square-right: changes: - 5.0.0 label: Alternate Arrow Square Right search: terms: - forward - next styles: - solid - regular - light unicode: f352 arrow-alt-square-up: changes: - 5.0.0 label: Alternate Arrow Square Up search: terms: [] styles: - solid - regular - light unicode: f353 arrow-alt-to-bottom: changes: - 5.0.0 label: Alternate Arrow to Bottom search: terms: - download styles: - solid - regular - light unicode: f34a arrow-alt-to-left: changes: - 5.0.0 label: Alternate Arrow to Left search: terms: - back - previous styles: - solid - regular - light unicode: f34b arrow-alt-to-right: changes: - 5.0.0 label: Alternate Arrow to Right search: terms: - forward - next styles: - solid - regular - light unicode: f34c arrow-alt-to-top: changes: - 5.0.0 label: Alternate Arrow to Top search: terms: [] styles: - solid - regular - light unicode: f34d arrow-alt-up: changes: - 5.0.0 label: Alternate Arrow Up search: terms: [] styles: - solid - regular - light unicode: f357 arrow-circle-down: changes: - '2' - 5.0.0 label: Arrow Circle Down search: terms: - download styles: - solid - regular - light unicode: f0ab arrow-circle-left: changes: - '2' - 5.0.0 label: Arrow Circle Left search: terms: - back - previous styles: - solid - regular - light unicode: f0a8 arrow-circle-right: changes: - '2' - 5.0.0 label: Arrow Circle Right search: terms: - forward - next styles: - solid - regular - light unicode: f0a9 arrow-circle-up: changes: - '2' - 5.0.0 label: Arrow Circle Up search: terms: [] styles: - solid - regular - light unicode: f0aa arrow-down: changes: - '1' - 5.0.0 label: arrow-down search: terms: - download styles: - solid - regular - light unicode: f063 arrow-from-bottom: changes: - 5.0.0 label: Arrow from Bottom search: terms: - download styles: - solid - regular - light unicode: f342 arrow-from-left: changes: - 5.0.0 label: Arrow from Left search: terms: - back - previous styles: - solid - regular - light unicode: f343 arrow-from-right: changes: - 5.0.0 label: Arrow from Right search: terms: - forward - next styles: - solid - regular - light unicode: f344 arrow-from-top: changes: - 5.0.0 label: Arrow from Top search: terms: [] styles: - solid - regular - light unicode: f345 arrow-left: changes: - '1' - 5.0.0 label: arrow-left search: terms: - back - previous styles: - solid - regular - light unicode: f060 arrow-right: changes: - '1' - 5.0.0 label: arrow-right search: terms: - forward - next styles: - solid - regular - light unicode: f061 arrow-square-down: changes: - 5.0.0 label: Arrow Square Down search: terms: [] styles: - solid - regular - light unicode: f339 arrow-square-left: changes: - 5.0.0 label: Arrow Square Left search: terms: - back - previous styles: - solid - regular - light unicode: f33a arrow-square-right: changes: - 5.0.0 label: Arrow Square Right search: terms: - forward - next styles: - solid - regular - light unicode: f33b arrow-square-up: changes: - 5.0.0 label: Arrow Square Up search: terms: [] styles: - solid - regular - light unicode: f33c arrow-to-bottom: changes: - 5.0.0 label: Arrow to Bottom search: terms: - download styles: - solid - regular - light unicode: f33d arrow-to-left: changes: - 5.0.0 label: Arrow to Left search: terms: - back - previous styles: - solid - regular - light unicode: f33e arrow-to-right: changes: - 5.0.0 label: Arrow to Right search: terms: - forward - next styles: - solid - regular - light unicode: f340 arrow-to-top: changes: - 5.0.0 label: Arrow to Top search: terms: [] styles: - solid - regular - light unicode: f341 arrow-up: changes: - '1' - 5.0.0 label: arrow-up search: terms: [] styles: - solid - regular - light unicode: f062 arrows: changes: - '1' - 5.0.0 label: Arrows search: terms: - move - position - reorder - resize styles: - solid - regular - light unicode: f047 arrows-alt: changes: - '2' - 5.0.0 label: Alternate Arrows search: terms: - arrow - arrows - bigger - enlarge - expand - fullscreen - move - position - reorder - resize styles: - solid - regular - light unicode: f0b2 arrows-alt-h: changes: - 5.0.0 label: Alternate Arrows Horizontal search: terms: - arrows-h - resize styles: - solid - regular - light unicode: f337 arrows-alt-v: changes: - 5.0.0 label: Alternate Arrows Vertical search: terms: - arrows-v - resize styles: - solid - regular - light unicode: f338 arrows-h: changes: - '1' - 5.0.0 label: Arrows Horizontal search: terms: - resize styles: - solid - regular - light unicode: f07e arrows-v: changes: - '1' - 5.0.0 label: Arrows Vertical search: terms: - resize styles: - solid - regular - light unicode: f07d assistive-listening-systems: changes: - '4.6' - 5.0.0 label: Assistive Listening Systems search: terms: [] styles: - solid - regular - light unicode: f2a2 asterisk: changes: - '1' - 5.0.0 label: asterisk search: terms: - details styles: - solid - regular - light unicode: f069 asymmetrik: changes: - 5.0.0 label: 'Asymmetrik, Ltd.' search: terms: [] styles: - brands unicode: f372 at: changes: - '4.2' - 5.0.0 label: At search: terms: - e-mail - email styles: - solid - regular - light unicode: f1fa atlas: changes: - 5.1.0 label: Atlas search: terms: - book - directions - geography - map - wayfinding styles: - solid - regular - light unicode: f558 atom: changes: - 5.2.0 label: Atom search: terms: - atheism - chemistry - science styles: - solid - regular - light unicode: f5d2 atom-alt: changes: - 5.2.0 label: Atom Alt search: terms: [] styles: - solid - regular - light unicode: f5d3 audible: changes: - 5.0.0 label: Audible search: terms: [] styles: - brands unicode: f373 audio-description: changes: - '4.6' - 5.0.0 label: Audio Description search: terms: [] styles: - solid - regular - light unicode: f29e autoprefixer: changes: - 5.0.0 label: Autoprefixer search: terms: [] styles: - brands unicode: f41c avianex: changes: - 5.0.0 label: avianex search: terms: [] styles: - brands unicode: f374 aviato: changes: - 5.0.0 label: Aviato search: terms: [] styles: - brands unicode: f421 award: changes: - 5.1.0 - 5.2.0 label: Award search: terms: - honor - praise - prize - recognition - ribbon styles: - solid - regular - light unicode: f559 aws: changes: - 5.0.0 - 5.1.0 label: Amazon Web Services (AWS) search: terms: [] styles: - brands unicode: f375 axe: changes: - 5.4.0 label: Axe search: terms: - blade - cut - fall - outdoors - seasonal - sharp - swing - tool - weapon styles: - solid - regular - light unicode: f6b2 axe-battle: changes: - 5.4.0 label: Axe Battle search: terms: - Dungeons & Dragons - barbarian - d&d - dnd - fantasy - gimli - lumberjack - melee attack styles: - solid - regular - light unicode: f6b3 backpack: changes: - 5.2.0 label: Backpack search: terms: [] styles: - solid - regular - light unicode: f5d4 backspace: changes: - 5.1.0 label: Backspace search: terms: - command - delete - keyboard - undo styles: - solid - regular - light unicode: f55a backward: changes: - '1' - 5.0.0 label: backward search: terms: - previous - rewind styles: - solid - regular - light unicode: f04a badge: changes: - 5.0.0 label: Badge search: terms: [] styles: - solid - regular - light unicode: f335 badge-check: changes: - 5.0.0 label: Check Badge search: terms: - accept - achievement - agree - award - confirm - correct - done - ok - security - select - success - winner - 'yes' styles: - solid - regular - light unicode: f336 badge-dollar: changes: - 5.3.0 label: Badge Dollar search: terms: [] styles: - solid - regular - light unicode: f645 badge-percent: changes: - 5.3.0 label: Badge Percent search: terms: [] styles: - solid - regular - light unicode: f646 badger-honey: changes: - 5.4.0 label: Honey Badger search: terms: - care - dont - ewww - fauna - mammmal - nasty styles: - solid - regular - light unicode: f6b4 balance-scale: changes: - '4.4' - 5.0.0 - 5.0.13 label: Balance Scale search: terms: - balanced - justice - legal - measure - weight styles: - solid - regular - light unicode: f24e balance-scale-left: changes: - 5.0.13 label: Balance Scale (Left-Weighted) search: terms: - justice - legal - measure - unbalanced - weight styles: - solid - regular - light unicode: f515 balance-scale-right: changes: - 5.0.13 label: Balance Scale (Right-Weighted) search: terms: - justice - legal - measure - unbalanced - weight styles: - solid - regular - light unicode: f516 ballot: changes: - 5.5.0 label: Ballot search: terms: - election - vote - voting styles: - solid - regular - light unicode: f732 ballot-check: changes: - 5.5.0 label: Ballot Check search: terms: - completed - done - election - finished - vote - voting styles: - solid - regular - light unicode: f733 ban: changes: - '1' - 5.0.0 label: ban search: terms: - abort - ban - block - cancel - delete - hide - prohibit - remove - stop - trash styles: - solid - regular - light unicode: f05e band-aid: changes: - 5.0.7 label: Band-Aid search: terms: - bandage - boo boo - ouch styles: - solid - regular - light unicode: f462 bandcamp: changes: - '4.7' - 5.0.0 label: Bandcamp search: terms: [] styles: - brands unicode: f2d5 barcode: changes: - '1' - 5.0.0 label: barcode search: terms: - scan styles: - solid - regular - light unicode: f02a barcode-alt: changes: - 5.0.7 label: Alternate Barcode search: terms: [] styles: - solid - regular - light unicode: f463 barcode-read: changes: - 5.0.7 label: Barcode Read search: terms: [] styles: - solid - regular - light unicode: f464 barcode-scan: changes: - 5.0.7 label: Barcode Scan search: terms: [] styles: - solid - regular - light unicode: f465 bars: changes: - '2' - 5.0.0 label: Bars search: terms: - checklist - drag - hamburger - list - menu - nav - navigation - ol - reorder - settings - todo - ul styles: - solid - regular - light unicode: f0c9 baseball: changes: - 5.0.5 label: Baseball search: terms: [] styles: - solid - regular - light unicode: f432 baseball-ball: changes: - 5.0.5 label: Baseball Ball search: terms: [] styles: - solid - regular - light unicode: f433 basketball-ball: changes: - 5.0.5 label: Basketball Ball search: terms: [] styles: - solid - regular - light unicode: f434 basketball-hoop: changes: - 5.0.5 label: Basketball Hoop search: terms: [] styles: - solid - regular - light unicode: f435 bat: changes: - 5.4.0 label: Bat search: terms: - batman - bruce wayne - flying - gotham - halloween - holiday - mammal - wings styles: - solid - regular - light unicode: f6b5 bath: changes: - '4.7' - 5.0.0 label: Bath search: terms: [] styles: - solid - regular - light unicode: f2cd battery-bolt: changes: - 5.0.0 label: Battery Bolt search: terms: - power - status styles: - solid - regular - light unicode: f376 battery-empty: changes: - '4.4' - 5.0.0 label: Battery Empty search: terms: - power - status styles: - solid - regular - light unicode: f244 battery-full: changes: - '4.4' - 5.0.0 label: Battery Full search: terms: - power - status styles: - solid - regular - light unicode: f240 battery-half: changes: - '4.4' - 5.0.0 label: Battery 1/2 Full search: terms: - power - status styles: - solid - regular - light unicode: f242 battery-quarter: changes: - '4.4' - 5.0.0 label: Battery 1/4 Full search: terms: - power - status styles: - solid - regular - light unicode: f243 battery-slash: changes: - 5.0.0 label: Battery Slash search: terms: - power - status styles: - solid - regular - light unicode: f377 battery-three-quarters: changes: - '4.4' - 5.0.0 label: Battery 3/4 Full search: terms: - power - status styles: - solid - regular - light unicode: f241 bed: changes: - '4.3' - 5.0.0 - 5.1.0 label: Bed search: terms: - lodging - sleep - travel styles: - solid - regular - light unicode: f236 beer: changes: - '3' - 5.0.0 label: beer search: terms: - alcohol - bar - beverage - drink - liquor - mug - stein styles: - solid - regular - light unicode: f0fc behance: changes: - '4.1' - 5.0.0 label: Behance search: terms: [] styles: - brands unicode: f1b4 behance-square: changes: - '4.1' - 5.0.0 - 5.0.3 label: Behance Square search: terms: [] styles: - brands unicode: f1b5 bell: changes: - '2' - 5.0.0 - 5.2.0 label: bell search: terms: - alert - notification - reminder styles: - solid - regular - light unicode: f0f3 bell-school: changes: - 5.2.0 label: Bell School search: terms: [] styles: - solid - regular - light unicode: f5d5 bell-school-slash: changes: - 5.2.0 label: Bell School Slash search: terms: [] styles: - solid - regular - light unicode: f5d6 bell-slash: changes: - '4.2' - 5.0.0 - 5.2.0 label: Bell Slash search: terms: [] styles: - solid - regular - light unicode: f1f6 bezier-curve: changes: - 5.1.0 label: Bezier Curve search: terms: - curves - illustrator - lines - path - vector styles: - solid - regular - light unicode: f55b bible: changes: - 5.3.0 label: Bible search: terms: - book - catholicism - christianity styles: - solid - regular - light unicode: f647 bicycle: changes: - '4.2' - 5.0.0 label: Bicycle search: terms: - bike - gears - transportation - vehicle styles: - solid - regular - light unicode: f206 bimobject: changes: - 5.0.0 label: BIMobject search: terms: [] styles: - brands unicode: f378 binoculars: changes: - '4.2' - 5.0.0 - 5.2.0 label: Binoculars search: terms: [] styles: - solid - regular - light unicode: f1e5 birthday-cake: changes: - '4.2' - 5.0.0 label: Birthday Cake search: terms: [] styles: - solid - regular - light unicode: f1fd bitbucket: changes: - '3.2' - 5.0.0 label: Bitbucket search: terms: - bitbucket-square - git styles: - brands unicode: f171 bitcoin: changes: - 5.0.0 label: Bitcoin search: terms: [] styles: - brands unicode: f379 bity: changes: - 5.0.0 label: Bity search: terms: [] styles: - brands unicode: f37a black-tie: changes: - '4.4' - 5.0.0 label: Font Awesome Black Tie search: terms: [] styles: - brands unicode: f27e blackberry: changes: - 5.0.0 label: BlackBerry search: terms: [] styles: - brands unicode: f37b blanket: changes: - 5.0.9 label: Blanket search: terms: [] styles: - solid - regular - light unicode: f498 blender: changes: - 5.0.13 label: Blender search: terms: [] styles: - solid - regular - light unicode: f517 blender-phone: changes: - 5.4.0 label: Blender Phone search: terms: - appliance - fantasy - silly styles: - solid - regular - light unicode: f6b6 blind: changes: - '4.6' - 5.0.0 label: Blind search: terms: [] styles: - solid - regular - light unicode: f29d blogger: changes: - 5.0.0 label: Blogger search: terms: [] styles: - brands unicode: f37c blogger-b: changes: - 5.0.0 label: Blogger B search: terms: [] styles: - brands unicode: f37d bluetooth: changes: - '4.5' - 5.0.0 label: Bluetooth search: terms: [] styles: - brands unicode: f293 bluetooth-b: changes: - '4.5' - 5.0.0 label: Bluetooth search: terms: [] styles: - brands unicode: f294 bold: changes: - '1' - 5.0.0 label: bold search: terms: [] styles: - solid - regular - light unicode: f032 bolt: changes: - '2' - 5.0.0 - 5.5.0 label: Lightning Bolt search: terms: - electricity - lightning - weather - zap styles: - solid - regular - light unicode: f0e7 bomb: changes: - '4.1' - 5.0.0 label: Bomb search: terms: [] styles: - solid - regular - light unicode: f1e2 bone: changes: - 5.2.0 label: Bone search: terms: [] styles: - solid - regular - light unicode: f5d7 bone-break: changes: - 5.2.0 label: Bone Break search: terms: [] styles: - solid - regular - light unicode: f5d8 bong: changes: - 5.1.0 label: Bong search: terms: - aparatus - cannabis - marijuana - pipe - smoke - smoking styles: - solid - regular - light unicode: f55c book: changes: - '1' - 5.0.0 label: book search: terms: - documentation - read styles: - solid - regular - light unicode: f02d book-alt: changes: - 5.2.0 label: Alternate Book search: terms: [] styles: - solid - regular - light unicode: f5d9 book-dead: changes: - 5.4.0 label: Book of the Dead search: terms: - Dungeons & Dragons - crossbones - d&d - dark arts - death - dnd - documentation - evil - fantasy - halloween - holiday - read - skull - spell styles: - solid - regular - light unicode: f6b7 book-heart: changes: - 5.0.9 - 5.4.0 label: Book with Heart search: terms: [] styles: - solid - regular - light unicode: f499 book-open: changes: - 5.0.13 - 5.1.0 - 5.2.0 label: Book Open search: terms: - flyer - notebook - open book - pamphlet - reading styles: - solid - regular - light unicode: f518 book-reader: changes: - 5.2.0 label: Book Reader search: terms: - library styles: - solid - regular - light unicode: f5da book-spells: changes: - 5.4.0 label: Book of Spells search: terms: - Dungeons & Dragons - d&d - dark arts - dnd - documentation - evil - fantasy - halloween - holiday - mage - magic - read - sorcery - voodoo - witch - wizard styles: - solid - regular - light unicode: f6b8 bookmark: changes: - '1' - 5.0.0 label: bookmark search: terms: - save styles: - solid - regular - light unicode: f02e books: changes: - 5.2.0 label: Books search: terms: [] styles: - solid - regular - light unicode: f5db booth-curtain: changes: - 5.5.0 label: Booth with Curtain search: terms: - changing room - election - vote - voting - voting booth styles: - solid - regular - light unicode: f734 bow-arrow: changes: - 5.4.0 label: Bow Arrow search: terms: - Dungeons & Dragons - archery - d&d - dnd - fantasy - legolas - ranged attack - ranger - weapon styles: - solid - regular - light unicode: f6b9 bowling-ball: changes: - 5.0.5 label: Bowling Ball search: terms: [] styles: - solid - regular - light unicode: f436 bowling-pins: changes: - 5.0.5 label: Bowling Pins search: terms: [] styles: - solid - regular - light unicode: f437 box: changes: - 5.0.7 label: Box search: terms: - package styles: - solid - regular - light unicode: f466 box-alt: changes: - 5.0.9 label: Alternate Box search: terms: [] styles: - solid - regular - light unicode: f49a box-ballot: changes: - 5.5.0 label: Box Ballot search: terms: - election - politics - vote - voting styles: - solid - regular - light unicode: f735 box-check: changes: - 5.0.7 label: Box Check search: terms: - accept - ackage - agree - confirm - correct - done - ok - select - success - todo - 'yes' styles: - solid - regular - light unicode: f467 box-fragile: changes: - 5.0.9 label: Box Fragile search: terms: - package styles: - solid - regular - light unicode: f49b box-full: changes: - 5.0.9 label: Box Full search: terms: - package - packed styles: - solid - regular - light unicode: f49c box-heart: changes: - 5.0.9 label: Box with Heart search: terms: - care - package styles: - solid - regular - light unicode: f49d box-open: changes: - 5.0.9 label: Box Open search: terms: [] styles: - solid - regular - light unicode: f49e box-up: changes: - 5.0.9 label: Box Up search: terms: [] styles: - solid - regular - light unicode: f49f box-usd: changes: - 5.0.9 label: Box with US Dollar search: terms: - $ - dollar-sign - money - usd styles: - solid - regular - light unicode: f4a0 boxes: changes: - 5.0.7 label: Boxes search: terms: [] styles: - solid - regular - light unicode: f468 boxes-alt: changes: - 5.0.9 label: Alternate Boxes search: terms: [] styles: - solid - regular - light unicode: f4a1 boxing-glove: changes: - 5.0.5 label: Boxing Glove search: terms: [] styles: - solid - regular - light unicode: f438 braille: changes: - '4.6' - 5.0.0 label: Braille search: terms: [] styles: - solid - regular - light unicode: f2a1 brain: changes: - 5.2.0 label: Brain search: terms: - cerebellum - gray matter - intellect - medulla oblongata - mind - noodle - wit styles: - solid - regular - light unicode: f5dc briefcase: changes: - '2' - 5.0.0 - 5.3.0 label: Briefcase search: terms: - bag - business - luggage - office - work styles: - solid - regular - light unicode: f0b1 briefcase-medical: changes: - 5.0.7 label: Medical Briefcase search: terms: - health briefcase styles: - solid - regular - light unicode: f469 broadcast-tower: changes: - 5.0.13 label: Broadcast Tower search: terms: - airwaves - radio - waves styles: - solid - regular - light unicode: f519 broom: changes: - 5.0.13 label: Broom search: terms: - clean - firebolt - fly - halloween - holiday - nimbus 2000 - quidditch - sweep - witch styles: - solid - regular - light unicode: f51a browser: changes: - 5.0.0 label: Browser search: terms: - website styles: - solid - regular - light unicode: f37e brush: changes: - 5.1.0 label: Brush search: terms: - bristles - color - handle - painting styles: - solid - regular - light unicode: f55d btc: changes: - '3.2' - 5.0.0 label: BTC search: terms: [] styles: - brands unicode: f15a bug: changes: - '3.2' - 5.0.0 label: Bug search: terms: - insect - report styles: - solid - regular - light unicode: f188 building: changes: - '4.1' - 5.0.0 label: Building search: terms: - apartment - business - company - office - work styles: - solid - regular - light unicode: f1ad bullhorn: changes: - '2' - 5.0.0 - 5.3.0 label: bullhorn search: terms: - announcement - broadcast - louder - megaphone - share styles: - solid - regular - light unicode: f0a1 bullseye: changes: - '3.1' - 5.0.0 - 5.3.0 label: Bullseye search: terms: - target styles: - solid - regular - light unicode: f140 bullseye-arrow: changes: - 5.3.0 label: Bullseye Arrow search: terms: - archery - target styles: - solid - regular - light unicode: f648 bullseye-pointer: changes: - 5.3.0 label: Bullseye Pointer search: terms: - target styles: - solid - regular - light unicode: f649 burn: changes: - 5.0.7 label: Burn search: terms: - energy styles: - solid - regular - light unicode: f46a buromobelexperte: changes: - 5.0.0 label: Büromöbel-Experte GmbH & Co. KG. search: terms: [] styles: - brands unicode: f37f bus: changes: - '4.2' - 5.0.0 - 5.1.0 label: Bus search: terms: - machine - public transportation - transportation - vehicle styles: - solid - regular - light unicode: f207 bus-alt: changes: - 5.1.0 label: Bus Alt search: terms: - machine - public transportation - transportation - vehicle styles: - solid - regular - light unicode: f55e bus-school: changes: - 5.2.0 label: Bus School search: terms: [] styles: - solid - regular - light unicode: f5dd business-time: changes: - 5.3.0 label: Business Time search: terms: - briefcase - business socks - clock - flight of the conchords - wednesday styles: - solid - regular - light unicode: f64a buysellads: changes: - '4.3' - 5.0.0 label: BuySellAds search: terms: [] styles: - brands unicode: f20d cabinet-filing: changes: - 5.3.0 label: Filing Cabinet search: terms: [] styles: - solid - regular - light unicode: f64b calculator: changes: - '4.2' - 5.0.0 - 5.3.0 label: Calculator search: terms: [] styles: - solid - regular - light unicode: f1ec calculator-alt: changes: - 5.3.0 label: Alternate Calculator search: terms: [] styles: - solid - regular - light unicode: f64c calendar: changes: - '3.1' - 5.0.0 label: Calendar search: terms: - calendar-o - date - event - schedule - time - when styles: - solid - regular - light unicode: f133 calendar-alt: changes: - '1' - 5.0.0 label: Alternate Calendar search: terms: - calendar - date - event - schedule - time - when styles: - solid - regular - light unicode: f073 calendar-check: changes: - '4.4' - 5.0.0 label: Calendar Check search: terms: - accept - agree - appointment - confirm - correct - done - ok - select - success - todo styles: - solid - regular - light unicode: f274 calendar-edit: changes: - 5.0.0 label: Calendar Edit search: terms: [] styles: - solid - regular - light unicode: f333 calendar-exclamation: changes: - 5.0.0 label: Calendar Exclamation search: terms: - important styles: - solid - regular - light unicode: f334 calendar-minus: changes: - '4.4' - 5.0.0 label: Calendar Minus search: terms: - delete - negative - remove styles: - solid - regular - light unicode: f272 calendar-plus: changes: - '4.4' - 5.0.0 label: Calendar Plus search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f271 calendar-star: changes: - 5.5.0 label: Calendar Star search: terms: [] styles: - solid - regular - light unicode: f736 calendar-times: changes: - '4.4' - 5.0.0 label: Calendar Times search: terms: - archive - delete - remove - x styles: - solid - regular - light unicode: f273 camera: changes: - '1' - 5.0.0 label: camera search: terms: - photo - picture - record styles: - solid - regular - light unicode: f030 camera-alt: changes: - 5.0.0 label: Alternate Camera search: terms: - photo - picture - record styles: - solid - regular - light unicode: f332 camera-retro: changes: - '1' - 5.0.0 label: Retro Camera search: terms: - photo - picture - record styles: - solid - regular - light unicode: f083 campfire: changes: - 5.4.0 label: Campfire search: terms: - Dungeons & Dragons - caliente - campaign - camping - d&d - dnd - fall - fire - flame - gathering - heat - hot - meeting - outdoors - seasonal - tent - wilderness styles: - solid - regular - light unicode: f6ba campground: changes: - 5.4.0 label: Campground search: terms: - camping - fall - outdoors - seasonal - tent styles: - solid - regular - light unicode: f6bb candle-holder: changes: - 5.4.0 label: Candle Holder search: terms: - fire - flame - halloween - holiday - hot - light - lit - wick styles: - solid - regular - light unicode: f6bc candy-corn: changes: - 5.4.0 label: Candy Corn search: terms: - food - halloween - holiday - sugar - triangles styles: - solid - regular - light unicode: f6bd cannabis: changes: - 5.1.0 label: Cannabis search: terms: - bud - chronic - drugs - endica - endo - ganja - marijuana - mary jane - pot - reefer - sativa - spliff - weed - whacky-tabacky styles: - solid - regular - light unicode: f55f capsules: changes: - 5.0.7 label: Capsules search: terms: - drugs - medicine styles: - solid - regular - light unicode: f46b car: changes: - '4.1' - 5.0.0 - 5.2.0 label: Car search: terms: - machine - transportation - vehicle styles: - solid - regular - light unicode: f1b9 car-alt: changes: - 5.2.0 label: Alternate Car search: terms: [] styles: - solid - regular - light unicode: f5de car-battery: changes: - 5.2.0 label: Car Battery search: terms: [] styles: - solid - regular - light unicode: f5df car-bump: changes: - 5.2.0 label: Car Bump search: terms: [] styles: - solid - regular - light unicode: f5e0 car-crash: changes: - 5.2.0 label: Car Crash search: terms: [] styles: - solid - regular - light unicode: f5e1 car-garage: changes: - 5.2.0 label: Car Garage search: terms: [] styles: - solid - regular - light unicode: f5e2 car-mechanic: changes: - 5.2.0 label: Car Mechanic search: terms: [] styles: - solid - regular - light unicode: f5e3 car-side: changes: - 5.2.0 label: Car Side search: terms: [] styles: - solid - regular - light unicode: f5e4 car-tilt: changes: - 5.2.0 label: Car Tilt search: terms: [] styles: - solid - regular - light unicode: f5e5 car-wash: changes: - 5.2.0 label: Car Wash search: terms: [] styles: - solid - regular - light unicode: f5e6 caret-circle-down: changes: - 5.0.0 label: Caret Circle Down search: terms: - dropdown - menu - more styles: - solid - regular - light unicode: f32d caret-circle-left: changes: - 5.0.0 label: Caret Circle Left search: terms: - back - previous styles: - solid - regular - light unicode: f32e caret-circle-right: changes: - 5.0.0 label: Caret Circle Right search: terms: - forward - next styles: - solid - regular - light unicode: f330 caret-circle-up: changes: - 5.0.0 label: Caret Circle Up search: terms: [] styles: - solid - regular - light unicode: f331 caret-down: changes: - '2' - 5.0.0 label: Caret Down search: terms: - arrow - dropdown - menu - more - triangle down styles: - solid - regular - light unicode: f0d7 caret-left: changes: - '2' - 5.0.0 label: Caret Left search: terms: - arrow - back - previous - triangle left styles: - solid - regular - light unicode: f0d9 caret-right: changes: - '2' - 5.0.0 label: Caret Right search: terms: - arrow - forward - next - triangle right styles: - solid - regular - light unicode: f0da caret-square-down: changes: - '3.2' - 5.0.0 label: Caret Square Down search: terms: - caret-square-o-down - dropdown - menu - more styles: - solid - regular - light unicode: f150 caret-square-left: changes: - '4' - 5.0.0 label: Caret Square Left search: terms: - back - caret-square-o-left - previous styles: - solid - regular - light unicode: f191 caret-square-right: changes: - '3.2' - 5.0.0 label: Caret Square Right search: terms: - caret-square-o-right - forward - next styles: - solid - regular - light unicode: f152 caret-square-up: changes: - '3.2' - 5.0.0 label: Caret Square Up search: terms: - caret-square-o-up styles: - solid - regular - light unicode: f151 caret-up: changes: - '2' - 5.0.0 label: Caret Up search: terms: - arrow - triangle up styles: - solid - regular - light unicode: f0d8 cart-arrow-down: changes: - '4.3' - 5.0.0 label: Shopping Cart Arrow Down search: terms: - shopping styles: - solid - regular - light unicode: f218 cart-plus: changes: - '4.3' - 5.0.0 label: Add to Shopping Cart search: terms: - add - create - new - positive - shopping styles: - solid - regular - light unicode: f217 cat: changes: - 5.4.0 label: Cat search: terms: - feline - halloween - holiday - kitten - kitty - meow - pet styles: - solid - regular - light unicode: f6be cauldron: changes: - 5.4.0 label: Cauldron search: terms: - boil - bubble - cooking - halloween - holiday - magic - pot - sorcery - toil - trouble - witch - wizard styles: - solid - regular - light unicode: f6bf cc-amazon-pay: changes: - 5.0.2 label: Amazon Pay Credit Card search: terms: [] styles: - brands unicode: f42d cc-amex: changes: - '4.2' - 5.0.0 label: American Express Credit Card search: terms: - amex styles: - brands unicode: f1f3 cc-apple-pay: changes: - 5.0.0 label: Apple Pay Credit Card search: terms: [] styles: - brands unicode: f416 cc-diners-club: changes: - '4.4' - 5.0.0 label: Diner's Club Credit Card search: terms: [] styles: - brands unicode: f24c cc-discover: changes: - '4.2' - 5.0.0 label: Discover Credit Card search: terms: [] styles: - brands unicode: f1f2 cc-jcb: changes: - '4.4' - 5.0.0 label: JCB Credit Card search: terms: [] styles: - brands unicode: f24b cc-mastercard: changes: - '4.2' - 5.0.0 label: MasterCard Credit Card search: terms: [] styles: - brands unicode: f1f1 cc-paypal: changes: - '4.2' - 5.0.0 label: Paypal Credit Card search: terms: [] styles: - brands unicode: f1f4 cc-stripe: changes: - '4.2' - 5.0.0 label: Stripe Credit Card search: terms: [] styles: - brands unicode: f1f5 cc-visa: changes: - '4.2' - 5.0.0 label: Visa Credit Card search: terms: [] styles: - brands unicode: f1f0 centercode: changes: - 5.0.0 label: Centercode search: terms: [] styles: - brands unicode: f380 certificate: changes: - '2' - 5.0.0 label: certificate search: terms: - badge - star styles: - solid - regular - light unicode: f0a3 chair: changes: - 5.4.0 label: Chair search: terms: - furniture - seat styles: - solid - regular - light unicode: f6c0 chair-office: changes: - 5.4.0 label: Office Chair search: terms: - furniture - seat styles: - solid - regular - light unicode: f6c1 chalkboard: changes: - 5.0.13 label: Chalkboard search: terms: - blackboard - learning - school - teaching - whiteboard - writing styles: - solid - regular - light unicode: f51b chalkboard-teacher: changes: - 5.0.13 label: Chalkboard Teacher search: terms: - blackboard - instructor - learning - professor - school - whiteboard - writing styles: - solid - regular - light unicode: f51c charging-station: changes: - 5.2.0 label: Charging Station search: terms: [] styles: - solid - regular - light unicode: f5e7 chart-area: changes: - '4.2' - 5.0.0 label: Area Chart search: terms: - analytics - area-chart - graph styles: - solid - regular - light unicode: f1fe chart-bar: changes: - '1' - 5.0.0 - 5.3.0 label: Bar Chart search: terms: - analytics - bar-chart - graph styles: - solid - regular - light unicode: f080 chart-line: changes: - '4.2' - 5.0.0 - 5.3.0 label: Line Chart search: terms: - activity - analytics - dashboard - graph - line-chart styles: - solid - regular - light unicode: f201 chart-line-down: changes: - 5.3.0 label: Line Chart in Down Direction search: terms: [] styles: - solid - regular - light unicode: f64d chart-pie: changes: - '4.2' - 5.0.0 - 5.3.0 label: Pie Chart search: terms: - analytics - graph - pie-chart styles: - solid - regular - light unicode: f200 chart-pie-alt: changes: - 5.3.0 label: Alternate Pie Chart search: terms: [] styles: - solid - regular - light unicode: f64e check: changes: - '1' - 5.0.0 label: Check search: terms: - accept - agree - checkmark - confirm - correct - done - notice - notification - notify - ok - select - success - tick - todo - 'yes' styles: - solid - regular - light unicode: f00c check-circle: changes: - '1' - 5.0.0 label: Check Circle search: terms: - accept - agree - confirm - correct - done - ok - select - success - todo - 'yes' styles: - solid - regular - light unicode: f058 check-double: changes: - 5.1.0 label: Check Double search: terms: - accept - agree - checkmark - confirm - correct - done - notice - notification - notify - ok - select - success - tick - todo styles: - solid - regular - light unicode: f560 check-square: changes: - '3.1' - 5.0.0 label: Check Square search: terms: - accept - agree - checkmark - confirm - correct - done - ok - select - success - todo - 'yes' styles: - solid - regular - light unicode: f14a chess: changes: - 5.0.5 label: Chess search: terms: [] styles: - solid - regular - light unicode: f439 chess-bishop: changes: - 5.0.5 label: Chess Bishop search: terms: [] styles: - solid - regular - light unicode: f43a chess-bishop-alt: changes: - 5.0.5 label: Alternate Chess Bishop search: terms: [] styles: - solid - regular - light unicode: f43b chess-board: changes: - 5.0.5 label: Chess Board search: terms: [] styles: - solid - regular - light unicode: f43c chess-clock: changes: - 5.0.5 label: Chess Clock search: terms: [] styles: - solid - regular - light unicode: f43d chess-clock-alt: changes: - 5.0.5 label: Alternate Chess Clock search: terms: [] styles: - solid - regular - light unicode: f43e chess-king: changes: - 5.0.5 label: Chess King search: terms: [] styles: - solid - regular - light unicode: f43f chess-king-alt: changes: - 5.0.5 label: Alternate Chess King search: terms: [] styles: - solid - regular - light unicode: f440 chess-knight: changes: - 5.0.5 label: Chess Knight search: terms: [] styles: - solid - regular - light unicode: f441 chess-knight-alt: changes: - 5.0.5 label: Alternate Chess Knight search: terms: [] styles: - solid - regular - light unicode: f442 chess-pawn: changes: - 5.0.5 label: Chess Pawn search: terms: [] styles: - solid - regular - light unicode: f443 chess-pawn-alt: changes: - 5.0.5 label: Alternate Chess Pawn search: terms: [] styles: - solid - regular - light unicode: f444 chess-queen: changes: - 5.0.5 label: Chess Queen search: terms: [] styles: - solid - regular - light unicode: f445 chess-queen-alt: changes: - 5.0.5 label: Alternate Chess Queen search: terms: [] styles: - solid - regular - light unicode: f446 chess-rook: changes: - 5.0.5 label: Chess Rook search: terms: [] styles: - solid - regular - light unicode: f447 chess-rook-alt: changes: - 5.0.5 label: Alternate Chess Rook search: terms: [] styles: - solid - regular - light unicode: f448 chevron-circle-down: changes: - '3.1' - 5.0.0 label: Chevron Circle Down search: terms: - arrow - dropdown - menu - more styles: - solid - regular - light unicode: f13a chevron-circle-left: changes: - '3.1' - 5.0.0 label: Chevron Circle Left search: terms: - arrow - back - previous styles: - solid - regular - light unicode: f137 chevron-circle-right: changes: - '3.1' - 5.0.0 label: Chevron Circle Right search: terms: - arrow - forward - next styles: - solid - regular - light unicode: f138 chevron-circle-up: changes: - '3.1' - 5.0.0 label: Chevron Circle Up search: terms: - arrow styles: - solid - regular - light unicode: f139 chevron-double-down: changes: - 5.0.0 label: Chevron Double Down search: terms: [] styles: - solid - regular - light unicode: f322 chevron-double-left: changes: - 5.0.0 label: Chevron Double Left search: terms: - back - bracket - previous styles: - solid - regular - light unicode: f323 chevron-double-right: changes: - 5.0.0 label: Chevron Double Right search: terms: - bracket - forward - next styles: - solid - regular - light unicode: f324 chevron-double-up: changes: - 5.0.0 label: Chevron Double Up search: terms: [] styles: - solid - regular - light unicode: f325 chevron-down: changes: - '1' - 5.0.0 label: chevron-down search: terms: [] styles: - solid - regular - light unicode: f078 chevron-left: changes: - '1' - 5.0.0 label: chevron-left search: terms: - back - bracket - previous styles: - solid - regular - light unicode: f053 chevron-right: changes: - '1' - 5.0.0 label: chevron-right search: terms: - bracket - forward - next styles: - solid - regular - light unicode: f054 chevron-square-down: changes: - 5.0.0 label: Chevron Square Down search: terms: - arrow - dropdown - menu - more styles: - solid - regular - light unicode: f329 chevron-square-left: changes: - 5.0.0 label: Chevron Square Left search: terms: - arrow - back - previous styles: - solid - regular - light unicode: f32a chevron-square-right: changes: - 5.0.0 label: Chevron Square Right search: terms: - arrow - forward - next styles: - solid - regular - light unicode: f32b chevron-square-up: changes: - 5.0.0 label: Chevron Square Up search: terms: - arrow styles: - solid - regular - light unicode: f32c chevron-up: changes: - '1' - 5.0.0 label: chevron-up search: terms: [] styles: - solid - regular - light unicode: f077 child: changes: - '4.1' - 5.0.0 label: Child search: terms: [] styles: - solid - regular - light unicode: f1ae chrome: changes: - '4.4' - 5.0.0 label: Chrome search: terms: - browser styles: - brands unicode: f268 church: changes: - 5.0.13 label: Church search: terms: - building - community - religion styles: - solid - regular - light unicode: f51d circle: changes: - '3' - 5.0.0 label: Circle search: terms: - circle-thin - dot - notification styles: - solid - regular - light unicode: f111 circle-notch: changes: - '4.1' - 5.0.0 label: Circle Notched search: terms: - circle-o-notch styles: - solid - regular - light unicode: f1ce city: changes: - 5.3.0 label: City search: terms: - buildings - busy - skyscrapers - urban - windows styles: - solid - regular - light unicode: f64f claw-marks: changes: - 5.4.0 label: Claw Marks search: terms: - attack - damage - halloween - holiday - rip - scratch - tear - torn styles: - solid - regular - light unicode: f6c2 clipboard: changes: - 5.0.0 label: Clipboard search: terms: - paste styles: - solid - regular - light unicode: f328 clipboard-check: changes: - 5.0.7 label: Clipboard with Check search: terms: - accept - agree - confirm - done - ok - select - success - todo - 'yes' styles: - solid - regular - light unicode: f46c clipboard-list: changes: - 5.0.7 label: Clipboard List search: terms: - checklist - completed - done - finished - intinerary - ol - schedule - todo - ul styles: - solid - regular - light unicode: f46d clipboard-list-check: changes: - 5.5.0 label: Clipboard List with Check search: terms: - checklist - completed - done - election - finished - intinerary - ol - schedule - todo - ul - vote - voting styles: - solid - regular - light unicode: f737 clipboard-prescription: changes: - 5.2.0 label: Clipboard Prescription search: terms: [] styles: - solid - regular - light unicode: f5e8 clock: changes: - '1' - 5.0.0 label: Clock search: terms: - date - late - schedule - timer - timestamp - watch styles: - solid - regular - light unicode: f017 clone: changes: - '4.4' - 5.0.0 label: Clone search: terms: - copy - duplicate styles: - solid - regular - light unicode: f24d closed-captioning: changes: - '4.2' - 5.0.0 label: Closed Captioning search: terms: - cc styles: - solid - regular - light unicode: f20a cloud: changes: - '2' - 5.0.0 - 5.0.11 label: Cloud search: terms: - save styles: - solid - regular - light unicode: f0c2 cloud-download: changes: - '3' - 5.0.0 - 5.0.11 label: Cloud Download search: terms: - import styles: - solid - regular - light unicode: f0ed cloud-download-alt: changes: - 5.0.0 - 5.0.11 label: Alternate Cloud Download search: terms: - import styles: - solid - regular - light unicode: f381 cloud-drizzle: changes: - 5.5.0 label: Cloud with Drizzle search: terms: - precipitation - rain styles: - solid - regular - light unicode: f738 cloud-hail: changes: - 5.5.0 label: Cloud with Hail search: terms: - golf balls - precipitation styles: - solid - regular - light unicode: f739 cloud-hail-mixed: changes: - 5.5.0 label: Cloud with Mixed Hail search: terms: - precipitation - rain - storm styles: - solid - regular - light unicode: f73a cloud-meatball: changes: - 5.5.0 label: Cloud with (a chance of) Meatball search: terms: [] styles: - solid - regular - light unicode: f73b cloud-moon: changes: - 5.4.0 - 5.5.0 label: Cloud with Moon search: terms: - crescent - evening - halloween - holiday - lunar - night - sky styles: - solid - regular - light unicode: f6c3 cloud-moon-rain: changes: - 5.5.0 label: Cloud with Moon and Rain search: terms: [] styles: - solid - regular - light unicode: f73c cloud-rain: changes: - 5.5.0 label: Cloud with Rain search: terms: - precipitation styles: - solid - regular - light unicode: f73d cloud-rainbow: changes: - 5.5.0 label: Cloud with Rainbow search: terms: [] styles: - solid - regular - light unicode: f73e cloud-showers: changes: - 5.5.0 label: Cloud with Showers search: terms: - precipitation - rain styles: - solid - regular - light unicode: f73f cloud-showers-heavy: changes: - 5.5.0 label: Cloud with Heavy Showers search: terms: - precipitation - rain - storm styles: - solid - regular - light unicode: f740 cloud-sleet: changes: - 5.5.0 label: Cloud with Sleet search: terms: - precipitation - winter - wintry mix styles: - solid - regular - light unicode: f741 cloud-snow: changes: - 5.5.0 label: Cloud with Snow search: terms: - precipitation - winter styles: - solid - regular - light unicode: f742 cloud-sun: changes: - 5.4.0 - 5.5.0 label: Cloud with Sun search: terms: - day - daytime - fall - outdoors - seasonal styles: - solid - regular - light unicode: f6c4 cloud-sun-rain: changes: - 5.5.0 label: Cloud with Sun and Rain search: terms: [] styles: - solid - regular - light unicode: f743 cloud-upload: changes: - '3' - 5.0.0 - 5.0.11 label: Cloud Upload search: terms: - import styles: - solid - regular - light unicode: f0ee cloud-upload-alt: changes: - 5.0.0 - 5.0.11 label: Alternate Cloud Upload search: terms: - cloud-upload styles: - solid - regular - light unicode: f382 clouds: changes: - 5.5.0 label: Clouds search: terms: [] styles: - solid - regular - light unicode: f744 clouds-moon: changes: - 5.5.0 label: Clouds with Moon search: terms: [] styles: - solid - regular - light unicode: f745 clouds-sun: changes: - 5.5.0 label: Clouds with Sun search: terms: [] styles: - solid - regular - light unicode: f746 cloudscale: changes: - 5.0.0 label: cloudscale.ch search: terms: [] styles: - brands unicode: f383 cloudsmith: changes: - 5.0.0 label: Cloudsmith search: terms: [] styles: - brands unicode: f384 cloudversify: changes: - 5.0.0 label: cloudversify search: terms: [] styles: - brands unicode: f385 club: changes: - 5.0.0 label: Club search: terms: - card - suit styles: - solid - regular - light unicode: f327 cocktail: changes: - 5.1.0 label: Cocktail search: terms: - alcohol - beverage - drink styles: - solid - regular - light unicode: f561 code: changes: - '3.1' - 5.0.0 label: Code search: terms: - brackets - html styles: - solid - regular - light unicode: f121 code-branch: changes: - 5.0.0 label: Code Branch search: terms: - branch - code-fork - fork - git - github - rebase - svn - vcs - version styles: - solid - regular - light unicode: f126 code-commit: changes: - 5.0.0 - 5.1.1 label: Code Commit search: terms: - commit - git - github - hash - rebase - svn - vcs - version styles: - solid - regular - light unicode: f386 code-merge: changes: - 5.0.0 label: Code Merge search: terms: - git - github - merge - pr - rebase - svn - vcs - version styles: - solid - regular - light unicode: f387 codepen: changes: - '4.1' - 5.0.0 label: Codepen search: terms: [] styles: - brands unicode: f1cb codiepie: changes: - '4.5' - 5.0.0 label: Codie Pie search: terms: [] styles: - brands unicode: f284 coffee: changes: - '3' - 5.0.0 label: Coffee search: terms: - beverage - breakfast - cafe - drink - fall - morning - mug - seasonal - tea styles: - solid - regular - light unicode: f0f4 coffee-togo: changes: - 5.4.0 label: To-Go Coffee search: terms: - beverage - breakfast - cafe - drink - latte - morning - mug - stahhbucks - takeout - tea styles: - solid - regular - light unicode: f6c5 coffin: changes: - 5.4.0 label: Coffin search: terms: - halloween - holiday styles: - solid - regular - light unicode: f6c6 cog: changes: - '1' - 5.0.0 label: cog search: terms: - settings styles: - solid - regular - light unicode: f013 cogs: changes: - '1' - 5.0.0 label: cogs search: terms: - gears - settings styles: - solid - regular - light unicode: f085 coins: changes: - 5.0.13 label: Coins search: terms: [] styles: - solid - regular - light unicode: f51e columns: changes: - '2' - 5.0.0 label: Columns search: terms: - dashboard - panes - split styles: - solid - regular - light unicode: f0db comment: changes: - '1' - 5.0.0 - 5.0.9 label: comment search: terms: - bubble - chat - conversation - feedback - message - note - notification - sms - speech - texting styles: - solid - regular - light unicode: f075 comment-alt: changes: - '4.4' - 5.0.0 label: Alternate Comment search: terms: - bubble - chat - commenting - conversation - feedback - message - note - notification - sms - speech - texting styles: - solid - regular - light unicode: f27a comment-alt-check: changes: - 5.0.9 label: Alternate Comment Check search: terms: [] styles: - solid - regular - light unicode: f4a2 comment-alt-dollar: changes: - 5.3.0 label: Comment Alt-dollar search: terms: [] styles: - solid - regular - light unicode: f650 comment-alt-dots: changes: - 5.0.9 label: Alternate Comment Dots search: terms: [] styles: - solid - regular - light unicode: f4a3 comment-alt-edit: changes: - 5.0.9 label: Alternate Comment Edit search: terms: [] styles: - solid - regular - light unicode: f4a4 comment-alt-exclamation: changes: - 5.0.9 label: Alternate Comment Exclamation search: terms: - important styles: - solid - regular - light unicode: f4a5 comment-alt-lines: changes: - 5.0.9 label: Alternate Comment Lines search: terms: [] styles: - solid - regular - light unicode: f4a6 comment-alt-minus: changes: - 5.0.9 label: Alternate Comment Minus search: terms: - delete - negative - remove styles: - solid - regular - light unicode: f4a7 comment-alt-plus: changes: - 5.0.9 label: Alternate Comment Plus search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f4a8 comment-alt-slash: changes: - 5.0.9 label: Alternate Comment Slash search: terms: [] styles: - solid - regular - light unicode: f4a9 comment-alt-smile: changes: - 5.0.9 label: Alternate Comment Smile search: terms: - happy styles: - solid - regular - light unicode: f4aa comment-alt-times: changes: - 5.0.9 label: Alternate Comment Times search: terms: - archive - delete - remove - x styles: - solid - regular - light unicode: f4ab comment-check: changes: - 5.0.9 label: Comment Check search: terms: [] styles: - solid - regular - light unicode: f4ac comment-dollar: changes: - 5.3.0 label: Comment Dollar search: terms: [] styles: - solid - regular - light unicode: f651 comment-dots: changes: - 5.0.9 label: Comment Dots search: terms: [] styles: - solid - regular - light unicode: f4ad comment-edit: changes: - 5.0.9 label: Comment Edit search: terms: [] styles: - solid - regular - light unicode: f4ae comment-exclamation: changes: - 5.0.9 label: Comment Exclamation search: terms: - important styles: - solid - regular - light unicode: f4af comment-lines: changes: - 5.0.9 label: Comment Lines search: terms: [] styles: - solid - regular - light unicode: f4b0 comment-minus: changes: - 5.0.9 label: Comment Minus search: terms: - delete - negative - remove styles: - solid - regular - light unicode: f4b1 comment-plus: changes: - 5.0.9 label: Comment Plus search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f4b2 comment-slash: changes: - 5.0.9 label: Comment Slash search: terms: [] styles: - solid - regular - light unicode: f4b3 comment-smile: changes: - 5.0.9 label: Comment Smile search: terms: [] styles: - solid - regular - light unicode: f4b4 comment-times: changes: - 5.0.9 label: Comment Times search: terms: - archive - delete - remove - x styles: - solid - regular - light unicode: f4b5 comments: changes: - '1' - 5.0.0 - 5.0.9 label: comments search: terms: - bubble - chat - conversation - feedback - message - note - notification - sms - speech - texting styles: - solid - regular - light unicode: f086 comments-alt: changes: - 5.0.9 label: Alternate Comments search: terms: [] styles: - solid - regular - light unicode: f4b6 comments-alt-dollar: changes: - 5.3.0 label: Alternate Comments Dollar search: terms: [] styles: - solid - regular - light unicode: f652 comments-dollar: changes: - 5.3.0 label: Comments Dollar search: terms: [] styles: - solid - regular - light unicode: f653 compact-disc: changes: - 5.0.13 label: Compact Disc search: terms: - bluray - cd - disc - media styles: - solid - regular - light unicode: f51f compass: changes: - '3.2' - 5.0.0 - 5.2.0 label: Compass search: terms: - directory - location - menu - safari styles: - solid - regular - light unicode: f14e compass-slash: changes: - 5.2.0 label: Compass Slash search: terms: [] styles: - solid - regular - light unicode: f5e9 compress: changes: - 5.0.0 label: Compress search: terms: - collapse - combine - contract - merge - smaller styles: - solid - regular - light unicode: f066 compress-alt: changes: - '1' - 5.0.0 label: Alternate Compress search: terms: - collapse - combine - contract - merge - smaller styles: - solid - regular - light unicode: f422 compress-wide: changes: - 5.0.0 label: Compress Wide search: terms: - collapse - combine - contract - merge - smaller styles: - solid - regular - light unicode: f326 concierge-bell: changes: - 5.1.0 label: Concierge Bell search: terms: - attention - hotel - service - support styles: - solid - regular - light unicode: f562 connectdevelop: changes: - '4.3' - 5.0.0 label: Connect Develop search: terms: [] styles: - brands unicode: f20e container-storage: changes: - 5.0.9 label: Container Storage search: terms: [] styles: - solid - regular - light unicode: f4b7 contao: changes: - '4.4' - 5.0.0 label: Contao search: terms: [] styles: - brands unicode: f26d conveyor-belt: changes: - 5.0.7 label: Conveyor Belt search: terms: [] styles: - solid - regular - light unicode: f46e conveyor-belt-alt: changes: - 5.0.7 label: Alternate Conveyor Belt search: terms: [] styles: - solid - regular - light unicode: f46f cookie: changes: - 5.1.0 label: Cookie search: terms: - baked good - chips - food - snack - sweet - treat styles: - solid - regular - light unicode: f563 cookie-bite: changes: - 5.1.0 label: Cookie Bite search: terms: - baked good - bitten - chips - eating - food - snack - sweet - treat styles: - solid - regular - light unicode: f564 copy: changes: - '2' - 5.0.0 label: Copy search: terms: - clone - duplicate - file - files-o styles: - solid - regular - light unicode: f0c5 copyright: changes: - '4.2' - 5.0.0 label: Copyright search: terms: [] styles: - solid - regular - light unicode: f1f9 corn: changes: - 5.4.0 label: Corn search: terms: - cob - ear - fall - food - kernel - maize - seasonal styles: - solid - regular - light unicode: f6c7 couch: changes: - 5.0.9 label: Couch search: terms: - furniture - sofa styles: - solid - regular - light unicode: f4b8 cow: changes: - 5.4.0 label: Cow search: terms: - agriculture - bovine - farm - fauna - mammmal - moo styles: - solid - regular - light unicode: f6c8 cpanel: changes: - 5.0.0 label: cPanel search: terms: [] styles: - brands unicode: f388 creative-commons: changes: - '4.4' - 5.0.0 - 5.0.11 - 5.1.0 label: Creative Commons search: terms: [] styles: - brands unicode: f25e creative-commons-by: changes: - 5.0.11 label: Creative Commons Attribution search: terms: [] styles: - brands unicode: f4e7 creative-commons-nc: changes: - 5.0.11 label: Creative Commons Noncommercial search: terms: [] styles: - brands unicode: f4e8 creative-commons-nc-eu: changes: - 5.0.11 label: Creative Commons Noncommercial (Euro Sign) search: terms: [] styles: - brands unicode: f4e9 creative-commons-nc-jp: changes: - 5.0.11 label: Creative Commons Noncommercial (Yen Sign) search: terms: [] styles: - brands unicode: f4ea creative-commons-nd: changes: - 5.0.11 label: Creative Commons No Derivative Works search: terms: [] styles: - brands unicode: f4eb creative-commons-pd: changes: - 5.0.11 label: Creative Commons Public Domain search: terms: [] styles: - brands unicode: f4ec creative-commons-pd-alt: changes: - 5.0.11 label: Creative Commons Public Domain Alternate search: terms: [] styles: - brands unicode: f4ed creative-commons-remix: changes: - 5.0.11 label: Creative Commons Remix search: terms: [] styles: - brands unicode: f4ee creative-commons-sa: changes: - 5.0.11 label: Creative Commons Share Alike search: terms: [] styles: - brands unicode: f4ef creative-commons-sampling: changes: - 5.0.11 label: Creative Commons Sampling search: terms: [] styles: - brands unicode: f4f0 creative-commons-sampling-plus: changes: - 5.0.11 label: Creative Commons Sampling + search: terms: [] styles: - brands unicode: f4f1 creative-commons-share: changes: - 5.0.11 label: Creative Commons Share search: terms: [] styles: - brands unicode: f4f2 creative-commons-zero: changes: - 5.0.11 - 5.4.0 label: Creative Commons CC0 search: terms: [] styles: - brands unicode: f4f3 credit-card: changes: - '2' - 5.0.0 label: Credit Card search: terms: - buy - checkout - credit-card-alt - debit - money - payment - purchase styles: - solid - regular - light unicode: f09d credit-card-blank: changes: - 5.0.0 label: Credit Card Blank search: terms: - buy - checkout - debit - money - payment - purchase styles: - solid - regular - light unicode: f389 credit-card-front: changes: - 5.0.0 label: Credit Card Front search: terms: - buy - checkout - chip - debit - money - payment - purchase styles: - solid - regular - light unicode: f38a cricket: changes: - 5.0.5 label: Cricket search: terms: [] styles: - solid - regular - light unicode: f449 critical-role: changes: - 5.4.0 label: Critical Role search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - game - gaming - tabletop styles: - brands unicode: f6c9 crop: changes: - '3.1' - 5.0.0 - 5.1.0 label: crop search: terms: - design styles: - solid - regular - light unicode: f125 crop-alt: changes: - 5.1.0 label: Alternate Crop search: terms: [] styles: - solid - regular - light unicode: f565 cross: changes: - 5.3.0 label: Cross search: terms: - catholicism - christianity styles: - solid - regular - light unicode: f654 crosshairs: changes: - '1' - 5.0.0 label: Crosshairs search: terms: - gpd - picker - position styles: - solid - regular - light unicode: f05b crow: changes: - 5.0.13 label: Crow search: terms: - bird - bullfrog - fauna - halloween - holiday - toad styles: - solid - regular - light unicode: f520 crown: changes: - 5.0.13 label: Crown search: terms: [] styles: - solid - regular - light unicode: f521 css3: changes: - '3.1' - 5.0.0 label: CSS 3 Logo search: terms: - code styles: - brands unicode: f13c css3-alt: changes: - 5.0.0 label: Alternate CSS3 Logo search: terms: [] styles: - brands unicode: f38b cube: changes: - '4.1' - 5.0.0 label: Cube search: terms: - package styles: - solid - regular - light unicode: f1b2 cubes: changes: - '4.1' - 5.0.0 label: Cubes search: terms: - packages styles: - solid - regular - light unicode: f1b3 curling: changes: - 5.0.5 label: Curling search: terms: [] styles: - solid - regular - light unicode: f44a cut: changes: - '2' - 5.0.0 - 5.1.0 label: Cut search: terms: - scissors styles: - solid - regular - light unicode: f0c4 cuttlefish: changes: - 5.0.0 label: Cuttlefish search: terms: [] styles: - brands unicode: f38c d-and-d: changes: - 5.0.0 label: Dungeons & Dragons search: terms: [] styles: - brands unicode: f38d d-and-d-beyond: changes: - 5.4.0 label: D&D Beyond search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - gaming - tabletop styles: - brands unicode: f6ca dagger: changes: - 5.4.0 label: Dagger search: terms: - Dungeons & Dragons - blade - d&d - dnd - fantasy - melee attack - rogue - sting - weapon styles: - solid - regular - light unicode: f6cb dashcube: changes: - '4.3' - 5.0.0 - 5.0.3 label: DashCube search: terms: [] styles: - brands unicode: f210 database: changes: - '4.1' - 5.0.0 label: Database search: terms: [] styles: - solid - regular - light unicode: f1c0 deaf: changes: - '4.6' - 5.0.0 label: Deaf search: terms: [] styles: - solid - regular - light unicode: f2a4 delicious: changes: - '4.1' - 5.0.0 label: Delicious Logo search: terms: [] styles: - brands unicode: f1a5 democrat: changes: - 5.5.0 label: Democrat search: terms: - american - democratic party - donkey - election - left - left-wing - liberal - politics - usa styles: - solid - regular - light unicode: f747 deploydog: changes: - 5.0.0 label: deploy.dog search: terms: [] styles: - brands unicode: f38e deskpro: changes: - 5.0.0 label: Deskpro search: terms: [] styles: - brands unicode: f38f desktop: changes: - '3' - 5.0.0 label: Desktop search: terms: - computer - cpu - demo - desktop - device - machine - monitor - pc - screen styles: - solid - regular - light unicode: f108 desktop-alt: changes: - 5.0.0 label: Alternate Desktop search: terms: - apple - computer - cpu - demo - desktop - device - imac - machine - monitor - screen styles: - solid - regular - light unicode: f390 dev: changes: - 5.4.0 label: DEV search: terms: [] styles: - brands unicode: f6cc deviantart: changes: - '4.1' - 5.0.0 label: deviantART search: terms: [] styles: - brands unicode: f1bd dewpoint: changes: - 5.5.0 label: Dewpoint search: terms: [] styles: - solid - regular - light unicode: f748 dharmachakra: changes: - 5.3.0 label: Dharmachakra search: terms: - buddhism - buddhist - wheel of dharma styles: - solid - regular - light unicode: f655 diagnoses: changes: - 5.0.7 label: Diagnoses search: terms: [] styles: - solid - regular - light unicode: f470 diamond: changes: - '4.3' - 5.0.0 label: Diamond search: terms: - gem - gemstone styles: - solid - regular - light unicode: f219 dice: changes: - 5.0.13 label: Dice search: terms: - chance - gambling - game - roll styles: - solid - regular - light unicode: f522 dice-d10: changes: - 5.4.0 label: Dice D10 search: terms: - Dungeons & Dragons - chance - d&d - dnd - fantasy - gambling - game - roll styles: - solid - regular - light unicode: f6cd dice-d12: changes: - 5.4.0 label: Dice D12 search: terms: - Dungeons & Dragons - chance - d&d - dnd - fantasy - gambling - game - roll styles: - solid - regular - light unicode: f6ce dice-d20: changes: - 5.4.0 label: Dice D20 search: terms: - Dungeons & Dragons - chance - d&d - dnd - fantasy - gambling - game - roll styles: - solid - regular - light unicode: f6cf dice-d4: changes: - 5.4.0 label: Dice D4 search: terms: - Dungeons & Dragons - chance - d&d - dnd - fantasy - gambling - game - roll styles: - solid - regular - light unicode: f6d0 dice-d6: changes: - 5.4.0 label: Dice D6 search: terms: - Dungeons & Dragons - chance - d&d - dnd - fantasy - gambling - game - roll styles: - solid - regular - light unicode: f6d1 dice-d8: changes: - 5.4.0 label: Dice D8 search: terms: - Dungeons & Dragons - chance - d&d - dnd - fantasy - gambling - game - roll styles: - solid - regular - light unicode: f6d2 dice-five: changes: - 5.0.13 label: Dice Five search: terms: - chance - gambling - game - roll styles: - solid - regular - light unicode: f523 dice-four: changes: - 5.0.13 label: Dice Four search: terms: - chance - gambling - game - roll styles: - solid - regular - light unicode: f524 dice-one: changes: - 5.0.13 label: Dice One search: terms: - chance - gambling - game - roll styles: - solid - regular - light unicode: f525 dice-six: changes: - 5.0.13 label: Dice Six search: terms: - chance - gambling - game - roll styles: - solid - regular - light unicode: f526 dice-three: changes: - 5.0.13 label: Dice Three search: terms: - chance - gambling - game - roll styles: - solid - regular - light unicode: f527 dice-two: changes: - 5.0.13 label: Dice Two search: terms: - chance - gambling - game - roll styles: - solid - regular - light unicode: f528 digg: changes: - '4.1' - 5.0.0 label: Digg Logo search: terms: [] styles: - brands unicode: f1a6 digital-ocean: changes: - 5.0.0 label: Digital Ocean search: terms: [] styles: - brands unicode: f391 digital-tachograph: changes: - 5.1.0 label: Digital Tachograph search: terms: [] styles: - solid - regular - light unicode: f566 diploma: changes: - 5.2.0 label: Diploma search: terms: [] styles: - solid - regular - light unicode: f5ea directions: changes: - 5.2.0 label: Directions search: terms: [] styles: - solid - regular - light unicode: f5eb discord: changes: - 5.0.0 label: Discord search: terms: [] styles: - brands unicode: f392 discourse: changes: - 5.0.0 - 5.0.3 label: Discourse search: terms: [] styles: - brands unicode: f393 divide: changes: - 5.0.13 label: Divide search: terms: [] styles: - solid - regular - light unicode: f529 dizzy: changes: - 5.1.0 label: Dizzy Face search: terms: - dazed - disapprove - emoticon - face styles: - solid - regular - light unicode: f567 dna: changes: - 5.0.7 - 5.0.10 label: DNA search: terms: - double helix - helix styles: - solid - regular - light unicode: f471 do-not-enter: changes: - 5.2.0 label: Do Not-enter search: terms: [] styles: - solid - regular - light unicode: f5ec dochub: changes: - 5.0.0 label: DocHub search: terms: [] styles: - brands unicode: f394 docker: changes: - 5.0.0 label: Docker search: terms: [] styles: - brands unicode: f395 dog: changes: - 5.4.0 label: Dog search: terms: - canine - fauna - mammmal - pet - pooch - puppy - woof styles: - solid - regular - light unicode: f6d3 dog-leashed: changes: - 5.4.0 label: Leashed Dog search: terms: - canine - fauna - mammmal - pet - pooch - puppy - walk - woof styles: - solid - regular - light unicode: f6d4 dollar-sign: changes: - '3.2' - 5.0.0 - 5.0.9 label: Dollar Sign search: terms: - $ - dollar-sign - money - price - usd styles: - solid - regular - light unicode: f155 dolly: changes: - 5.0.7 label: Dolly search: terms: [] styles: - solid - regular - light unicode: f472 dolly-empty: changes: - 5.0.7 label: Dolly Empty search: terms: [] styles: - solid - regular - light unicode: f473 dolly-flatbed: changes: - 5.0.7 label: Dolly Flatbed search: terms: [] styles: - solid - regular - light unicode: f474 dolly-flatbed-alt: changes: - 5.0.7 label: Alternate Dolly Flatbed search: terms: [] styles: - solid - regular - light unicode: f475 dolly-flatbed-empty: changes: - 5.0.7 label: Dolly Flatbed-empty search: terms: [] styles: - solid - regular - light unicode: f476 donate: changes: - 5.0.9 label: Donate search: terms: - generosity - give styles: - solid - regular - light unicode: f4b9 door-closed: changes: - 5.0.13 label: Door Closed search: terms: [] styles: - solid - regular - light unicode: f52a door-open: changes: - 5.0.13 label: Door Open search: terms: [] styles: - solid - regular - light unicode: f52b dot-circle: changes: - '4' - 5.0.0 label: Dot Circle search: terms: - bullseye - notification - target styles: - solid - regular - light unicode: f192 dove: changes: - 5.0.9 label: Dove search: terms: - bird - fauna - flying - peace styles: - solid - regular - light unicode: f4ba download: changes: - '1' - 5.0.0 label: Download search: terms: - import styles: - solid - regular - light unicode: f019 draft2digital: changes: - 5.0.0 label: Draft2digital search: terms: [] styles: - brands unicode: f396 drafting-compass: changes: - 5.1.0 label: Drafting Compass search: terms: - mechanical drawing - plot - plotting styles: - solid - regular - light unicode: f568 dragon: changes: - 5.4.0 label: Dragon search: terms: - Dungeons & Dragons - d&d - dnd - fantasy styles: - solid - regular - light unicode: f6d5 draw-circle: changes: - 5.2.0 label: Draw Circle search: terms: [] styles: - solid - regular - light unicode: f5ed draw-polygon: changes: - 5.2.0 label: Draw Polygon search: terms: [] styles: - solid - regular - light unicode: f5ee draw-square: changes: - 5.2.0 label: Draw Square search: terms: [] styles: - solid - regular - light unicode: f5ef dribbble: changes: - 5.0.0 label: Dribbble search: terms: [] styles: - brands unicode: f17d dribbble-square: changes: - 5.0.0 label: Dribbble Square search: terms: [] styles: - brands unicode: f397 dropbox: changes: - '3.2' - 5.0.0 - 5.0.1 label: Dropbox search: terms: [] styles: - brands unicode: f16b drum: changes: - 5.1.0 label: Drum search: terms: - instrument - music - percussion - snare - sound styles: - solid - regular - light unicode: f569 drum-steelpan: changes: - 5.1.0 label: Drum Steelpan search: terms: - calypso - instrument - music - percussion - reggae - snare - sound - steel - tropical styles: - solid - regular - light unicode: f56a drumstick: changes: - 5.4.0 label: Drumstick search: terms: - bone - chicken - fall - food - leg - poultry - seasonal - turkey styles: - solid - regular - light unicode: f6d6 drumstick-bite: changes: - 5.4.0 label: Drumstick with Bite Taken Out search: terms: [] styles: - solid - regular - light unicode: f6d7 drupal: changes: - '4.1' - 5.0.0 label: Drupal Logo search: terms: [] styles: - brands unicode: f1a9 duck: changes: - 5.4.0 label: Duck search: terms: - bath - bird - fauna - quack - rubber styles: - solid - regular - light unicode: f6d8 dumbbell: changes: - 5.0.5 label: Dumbbell search: terms: - exercise - gym - strength - weight - weight-lifting styles: - solid - regular - light unicode: f44b dungeon: changes: - 5.4.0 label: Dungeon search: terms: - Dungeons & Dragons - d&d - dnd - door - entrance - fantasy - gate styles: - solid - regular - light unicode: f6d9 dyalog: changes: - 5.0.0 label: Dyalog search: terms: [] styles: - brands unicode: f399 ear: changes: - 5.2.0 label: Ear search: terms: [] styles: - solid - regular - light unicode: f5f0 earlybirds: changes: - 5.0.0 label: Earlybirds search: terms: [] styles: - brands unicode: f39a ebay: changes: - 5.0.11 label: eBay search: terms: [] styles: - brands unicode: f4f4 eclipse: changes: - 5.5.0 label: Eclipse search: terms: [] styles: - solid - regular - light unicode: f749 eclipse-alt: changes: - 5.5.0 label: Alternate Eclipse search: terms: [] styles: - solid - regular - light unicode: f74a edge: changes: - '4.5' - 5.0.0 label: Edge Browser search: terms: - browser - ie styles: - brands unicode: f282 edit: changes: - '1' - 5.0.0 label: Edit search: terms: - edit - pen - pencil - update - write styles: - solid - regular - light unicode: f044 eject: changes: - '1' - 5.0.0 label: eject search: terms: [] styles: - solid - regular - light unicode: f052 elementor: changes: - 5.0.3 label: Elementor search: terms: [] styles: - brands unicode: f430 elephant: changes: - 5.4.0 label: Elephant search: terms: - dumbo - fauna - mammmal - null - pachyderm - trunk styles: - solid - regular - light unicode: f6da ellipsis-h: changes: - '3.1' - 5.0.0 label: Horizontal Ellipsis search: terms: - dots - drag - kebab - list - menu - nav - navigation - ol - reorder - settings - ul styles: - solid - regular - light unicode: f141 ellipsis-h-alt: changes: - 5.0.0 label: Alternate Horizontal Ellipsis search: terms: - dots - drag - kebab - list - menu - nav - navigation - ol - reorder - settings - ul styles: - solid - regular - light unicode: f39b ellipsis-v: changes: - '3.1' - 5.0.0 label: Vertical Ellipsis search: terms: - dots - drag - kebab - list - menu - nav - navigation - ol - reorder - settings - ul styles: - solid - regular - light unicode: f142 ellipsis-v-alt: changes: - 5.0.0 label: Alternate Vertical Ellipsis search: terms: - dots - drag - kebab - list - menu - nav - navigation - ol - reorder - settings - ul styles: - solid - regular - light unicode: f39c ello: changes: - 5.2.0 label: Ello search: terms: [] styles: - brands unicode: f5f1 ember: changes: - 5.0.0 - 5.0.3 label: Ember search: terms: [] styles: - brands unicode: f423 empire: changes: - '4.1' - 5.0.0 label: Galactic Empire search: terms: [] styles: - brands unicode: f1d1 empty-set: changes: - 5.3.0 label: Empty Set search: terms: [] styles: - solid - regular - light unicode: f656 engine-warning: changes: - 5.2.0 label: Engine Warning search: terms: [] styles: - solid - regular - light unicode: f5f2 envelope: changes: - '2' - 5.0.0 label: Envelope search: terms: - e-mail - email - letter - mail - message - notification - support styles: - solid - regular - light unicode: f0e0 envelope-open: changes: - '4.7' - 5.0.0 label: Envelope Open search: terms: - e-mail - email - letter - mail - message - notification - support styles: - solid - regular - light unicode: f2b6 envelope-open-dollar: changes: - 5.3.0 label: Envelope Open-dollar search: terms: [] styles: - solid - regular - light unicode: f657 envelope-open-text: changes: - 5.3.0 label: Envelope Open-text search: terms: [] styles: - solid - regular - light unicode: f658 envelope-square: changes: - '4.1' - 5.0.0 label: Envelope Square search: terms: - e-mail - email - letter - mail - message - notification - support styles: - solid - regular - light unicode: f199 envira: changes: - '4.6' - 5.0.0 label: Envira Gallery search: terms: - leaf styles: - brands unicode: f299 equals: changes: - 5.0.13 label: Equals search: terms: [] styles: - solid - regular - light unicode: f52c eraser: changes: - '3.1' - 5.0.0 label: eraser search: terms: - delete - remove styles: - solid - regular - light unicode: f12d erlang: changes: - 5.0.0 - 5.0.3 label: Erlang search: terms: [] styles: - brands unicode: f39d ethereum: changes: - 5.0.2 label: Ethereum search: terms: [] styles: - brands unicode: f42e etsy: changes: - '4.7' - 5.0.0 label: Etsy search: terms: [] styles: - brands unicode: f2d7 euro-sign: changes: - '3.2' - 5.0.0 label: Euro Sign search: terms: - eur styles: - solid - regular - light unicode: f153 exchange: changes: - '3' - 5.0.0 label: Exchange search: terms: - arrow - arrows - reciprocate - return - swap - transfer styles: - solid - regular - light unicode: f0ec exchange-alt: changes: - 5.0.0 label: Alternate Exchange search: terms: - arrow - arrows - exchange - reciprocate - return - swap - transfer styles: - solid - regular - light unicode: f362 exclamation: changes: - '3.1' - 5.0.0 label: exclamation search: terms: - alert - danger - error - important - notice - notification - notify - problem - warning styles: - solid - regular - light unicode: f12a exclamation-circle: changes: - '1' - 5.0.0 label: Exclamation Circle search: terms: - alert - danger - error - important - notice - notification - notify - problem - warning styles: - solid - regular - light unicode: f06a exclamation-square: changes: - 5.0.0 label: Exclamation Square search: terms: - alert - danger - error - important - notice - notification - notify - problem - warning styles: - solid - regular - light unicode: f321 exclamation-triangle: changes: - '1' - 5.0.0 label: Exclamation Triangle search: terms: - alert - danger - error - important - notice - notification - notify - problem - warning styles: - solid - regular - light unicode: f071 expand: changes: - 5.0.0 label: Expand search: terms: - bigger - enlarge - resize styles: - solid - regular - light unicode: f065 expand-alt: changes: - '1' - 5.0.0 label: Alternate Expand search: terms: - bigger - enlarge - resize styles: - solid - regular - light unicode: f424 expand-arrows: changes: - 5.0.0 label: Expand Arrows search: terms: - bigger - enlarge - move - resize styles: - solid - regular - light unicode: f31d expand-arrows-alt: changes: - 5.0.0 label: Alternate Expand Arrows search: terms: - arrows-alt - bigger - enlarge - move - resize styles: - solid - regular - light unicode: f31e expand-wide: changes: - 5.0.0 label: Expand Wide search: terms: - bigger - enlarge - resize styles: - solid - regular - light unicode: f320 expeditedssl: changes: - '4.4' - 5.0.0 label: ExpeditedSSL search: terms: [] styles: - brands unicode: f23e external-link: changes: - '1' - 5.0.0 label: External Link search: terms: - new - open styles: - solid - regular - light unicode: f08e external-link-alt: changes: - 5.0.0 label: Alternate External Link search: terms: - external-link - new - open styles: - solid - regular - light unicode: f35d external-link-square: changes: - '3.1' - 5.0.0 label: External Link Square search: terms: - new - open styles: - solid - regular - light unicode: f14c external-link-square-alt: changes: - 5.0.0 label: Alternate External Link Square search: terms: - external-link-square - new - open styles: - solid - regular - light unicode: f360 eye: changes: - '1' - 5.0.0 label: Eye search: terms: - optic - see - seen - show - sight - views - visible styles: - solid - regular - light unicode: f06e eye-dropper: changes: - '4.2' - 5.0.0 - 5.1.0 label: Eye Dropper search: terms: - eyedropper styles: - solid - regular - light unicode: f1fb eye-evil: changes: - 5.4.0 label: Evil Eye search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - sauron - see - seen - show - sight styles: - solid - regular - light unicode: f6db eye-slash: changes: - '1' - 5.0.0 label: Eye Slash search: terms: - blind - hide - show - toggle - unseen - views - visible - visiblity styles: - solid - regular - light unicode: f070 facebook: changes: - '2' - 5.0.0 label: Facebook search: terms: - facebook-official - social network styles: - brands unicode: f09a facebook-f: changes: - 5.0.0 label: Facebook F search: terms: - facebook styles: - brands unicode: f39e facebook-messenger: changes: - 5.0.0 label: Facebook Messenger search: terms: [] styles: - brands unicode: f39f facebook-square: changes: - '1' - 5.0.0 label: Facebook Square search: terms: - social network styles: - brands unicode: f082 fantasy-flight-games: changes: - 5.4.0 label: Fantasy Flight-games search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - game - gaming - tabletop styles: - brands unicode: f6dc fast-backward: changes: - '1' - 5.0.0 label: fast-backward search: terms: - beginning - first - previous - rewind - start styles: - solid - regular - light unicode: f049 fast-forward: changes: - '1' - 5.0.0 label: fast-forward search: terms: - end - last - next styles: - solid - regular - light unicode: f050 fax: changes: - '4.1' - 5.0.0 - 5.3.0 label: Fax search: terms: [] styles: - solid - regular - light unicode: f1ac feather: changes: - 5.0.13 - 5.1.0 label: Feather search: terms: - bird - light - plucked - quill styles: - solid - regular - light unicode: f52d feather-alt: changes: - 5.1.0 label: Alternate Feather search: terms: - bird - light - plucked - quill styles: - solid - regular - light unicode: f56b female: changes: - '3.2' - 5.0.0 label: Female search: terms: - human - person - profile - user - woman styles: - solid - regular - light unicode: f182 field-hockey: changes: - 5.0.5 label: Field Hockey search: terms: [] styles: - solid - regular - light unicode: f44c fighter-jet: changes: - '3' - 5.0.0 label: fighter-jet search: terms: - airplane - fast - fly - goose - maverick - plane - quick - top gun - transportation - travel styles: - solid - regular - light unicode: f0fb file: changes: - '3.2' - 5.0.0 label: File search: terms: - document - new - page - pdf - resume styles: - solid - regular - light unicode: f15b file-alt: changes: - '3.2' - 5.0.0 label: Alternate File search: terms: - document - file-text - invoice - new - page - pdf styles: - solid - regular - light unicode: f15c file-archive: changes: - '4.1' - 5.0.0 label: Archive File search: terms: - .zip - bundle - compress - compression - download - zip styles: - solid - regular - light unicode: f1c6 file-audio: changes: - '4.1' - 5.0.0 label: Audio File search: terms: [] styles: - solid - regular - light unicode: f1c7 file-certificate: changes: - 5.2.0 label: File Certificate search: terms: [] styles: - solid - regular - light unicode: f5f3 file-chart-line: changes: - 5.3.0 label: Chart Line File search: terms: - analytics - data - projection - report styles: - solid - regular - light unicode: f659 file-chart-pie: changes: - 5.3.0 label: Pie Chart File search: terms: - analytics - data - projection - report styles: - solid - regular - light unicode: f65a file-check: changes: - 5.0.0 label: Check File search: terms: - accept - agree - confirm - done - ok - select - success - synced - todo styles: - solid - regular - light unicode: f316 file-code: changes: - '4.1' - 5.0.0 label: Code File search: terms: [] styles: - solid - regular - light unicode: f1c9 file-contract: changes: - 5.1.0 label: File Contract search: terms: - agreement - binding - document - legal - signature styles: - solid - regular - light unicode: f56c file-csv: changes: - 5.4.0 label: File CSV search: terms: - spreadsheets styles: - solid - regular - light unicode: f6dd file-download: changes: - 5.1.0 label: File Download search: terms: [] styles: - solid - regular - light unicode: f56d file-edit: changes: - 5.0.0 label: Edit File search: terms: - pen styles: - solid - regular - light unicode: f31c file-excel: changes: - '4.1' - 5.0.0 label: Excel File search: terms: [] styles: - solid - regular - light unicode: f1c3 file-exclamation: changes: - 5.0.0 label: Exclamation File search: terms: - important styles: - solid - regular - light unicode: f31a file-export: changes: - 5.1.0 label: File Export search: terms: [] styles: - solid - regular - light unicode: f56e file-image: changes: - '4.1' - 5.0.0 label: Image File search: terms: [] styles: - solid - regular - light unicode: f1c5 file-import: changes: - 5.1.0 label: File Import search: terms: [] styles: - solid - regular - light unicode: f56f file-invoice: changes: - 5.1.0 label: File Invoice search: terms: - bill - document - receipt styles: - solid - regular - light unicode: f570 file-invoice-dollar: changes: - 5.1.0 label: File Invoice with US Dollar search: terms: - $ - bill - document - dollar-sign - money - receipt - usd styles: - solid - regular - light unicode: f571 file-medical: changes: - 5.0.7 label: Medical File search: terms: [] styles: - solid - regular - light unicode: f477 file-medical-alt: changes: - 5.0.7 label: Alternate Medical File search: terms: [] styles: - solid - regular - light unicode: f478 file-minus: changes: - 5.0.0 label: Minus File search: terms: - delete - negative - remove styles: - solid - regular - light unicode: f318 file-pdf: changes: - '4.1' - 5.0.0 label: PDF File search: terms: [] styles: - solid - regular - light unicode: f1c1 file-plus: changes: - 5.0.0 label: Plus File search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f319 file-powerpoint: changes: - '4.1' - 5.0.0 label: Powerpoint File search: terms: [] styles: - solid - regular - light unicode: f1c4 file-prescription: changes: - 5.1.0 label: File Prescription search: terms: - drugs - medical - medicine - rx styles: - solid - regular - light unicode: f572 file-signature: changes: - 5.1.0 label: File Signature search: terms: - John Hancock - contract - document - name styles: - solid - regular - light unicode: f573 file-spreadsheet: changes: - 5.3.0 label: Spreadsheet File search: terms: - excel - numbers - sheets - xls styles: - solid - regular - light unicode: f65b file-times: changes: - 5.0.0 label: Times File search: terms: - archive - delete - remove - x styles: - solid - regular - light unicode: f317 file-upload: changes: - 5.1.0 label: File Upload search: terms: [] styles: - solid - regular - light unicode: f574 file-user: changes: - 5.3.0 label: User File search: terms: - account - personnel - profile styles: - solid - regular - light unicode: f65c file-video: changes: - '4.1' - 5.0.0 label: Video File search: terms: [] styles: - solid - regular - light unicode: f1c8 file-word: changes: - '4.1' - 5.0.0 label: Word File search: terms: [] styles: - solid - regular - light unicode: f1c2 fill: changes: - 5.1.0 label: Fill search: terms: - bucket - color - paint - paint bucket styles: - solid - regular - light unicode: f575 fill-drip: changes: - 5.1.0 label: Fill Drip search: terms: - bucket - color - drop - paint - paint bucket - spill styles: - solid - regular - light unicode: f576 film: changes: - '1' - 5.0.0 label: Film search: terms: - movie styles: - solid - regular - light unicode: f008 film-alt: changes: - 5.0.0 label: Alternate Film search: terms: [] styles: - solid - regular - light unicode: f3a0 filter: changes: - '2' - 5.0.0 label: Filter search: terms: - funnel - options styles: - solid - regular - light unicode: f0b0 fingerprint: changes: - 5.1.0 label: Fingerprint search: terms: - human - id - identification - lock - smudge - touch - unique - unlock styles: - solid - regular - light unicode: f577 fire: changes: - '1' - 5.0.0 label: fire search: terms: - caliente - flame - heat - hot - popular styles: - solid - regular - light unicode: f06d fire-extinguisher: changes: - '3.1' - 5.0.0 label: fire-extinguisher search: terms: [] styles: - solid - regular - light unicode: f134 fire-smoke: changes: - 5.5.0 label: Fire and Smoke search: terms: [] styles: - solid - regular - light unicode: f74b firefox: changes: - '4.4' - 5.0.0 - 5.0.1 label: Firefox search: terms: - browser styles: - brands unicode: f269 first-aid: changes: - 5.0.7 label: First Aid search: terms: [] styles: - solid - regular - light unicode: f479 first-order: changes: - '4.6' - 5.0.0 label: First Order search: terms: [] styles: - brands unicode: f2b0 first-order-alt: changes: - 5.0.12 label: Alternate First Order search: terms: [] styles: - brands unicode: f50a firstdraft: changes: - 5.0.0 label: firstdraft search: terms: [] styles: - brands unicode: f3a1 fish: changes: - 5.1.0 label: Fish search: terms: - fauna - gold - swimming styles: - solid - regular - light unicode: f578 fist-raised: changes: - 5.4.0 label: Raised Fist search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - hand - ki - monk - resist - strength - unarmed combat styles: - solid - regular - light unicode: f6de flag: changes: - '1' - 5.0.0 label: flag search: terms: - country - notice - notification - notify - pole - report - symbol styles: - solid - regular - light unicode: f024 flag-alt: changes: - 5.5.0 label: Alternate Flag search: terms: - country - notice - notification - notify - pole - report - symbol styles: - solid - regular - light unicode: f74c flag-checkered: changes: - '3.1' - 5.0.0 label: flag-checkered search: terms: - notice - notification - notify - pole - racing - report - symbol styles: - solid - regular - light unicode: f11e flag-usa: changes: - 5.5.0 label: United States of America Flag search: terms: - betsy ross - country - old glory - stars - stripes - symbol styles: - solid - regular - light unicode: f74d flame: changes: - 5.4.0 label: Flame search: terms: - Dungeons & Dragons - caliente - d&d - dnd - fantasy - heat - hot styles: - solid - regular - light unicode: f6df flask: changes: - '2' - 5.0.0 label: Flask search: terms: - beaker - experimental - labs - science styles: - solid - regular - light unicode: f0c3 flask-poison: changes: - 5.4.0 label: Flask Poison search: terms: - beverage - container - drink - halloween - health - holiday - power styles: - solid - regular - light unicode: f6e0 flask-potion: changes: - 5.4.0 label: Flask Potion search: terms: - Dungeons & Dragons - alert - beaker - beverage - container - d&d - danger - dangerous - deadly - death - dnd - drink - fantasy - halloween - heal - health - holiday - magic - mana - science styles: - solid - regular - light unicode: f6e1 flickr: changes: - '3.2' - 5.0.0 label: Flickr search: terms: [] styles: - brands unicode: f16e flipboard: changes: - 5.0.5 - 5.0.9 label: Flipboard search: terms: [] styles: - brands unicode: f44d flushed: changes: - 5.1.0 label: Flushed Face search: terms: - embarrassed - emoticon - face styles: - solid - regular - light unicode: f579 fly: changes: - 5.0.0 label: Fly search: terms: [] styles: - brands unicode: f417 fog: changes: - 5.5.0 label: Fog search: terms: - opaque - san francisco - visibility styles: - solid - regular - light unicode: f74e folder: changes: - '1' - 5.0.0 - 5.3.0 label: Folder search: terms: [] styles: - solid - regular - light unicode: f07b folder-minus: changes: - 5.3.0 label: Folder Minus search: terms: - archive - delete - negative - remove styles: - solid - regular - light unicode: f65d folder-open: changes: - '1' - 5.0.0 label: Folder Open search: terms: [] styles: - solid - regular - light unicode: f07c folder-plus: changes: - 5.3.0 label: Folder Plus search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f65e folder-times: changes: - 5.3.0 label: Folder Times search: terms: - archive - delete - remove - x styles: - solid - regular - light unicode: f65f folders: changes: - 5.3.0 label: Folders search: terms: [] styles: - solid - regular - light unicode: f660 font: changes: - '1' - 5.0.0 label: font search: terms: - text styles: - solid - regular - light unicode: f031 font-awesome: changes: - '4.6' - 5.0.0 label: Font Awesome search: terms: - meanpath styles: - brands unicode: f2b4 font-awesome-alt: changes: - 5.0.0 label: Alternate Font Awesome search: terms: [] styles: - brands unicode: f35c font-awesome-flag: changes: - 5.0.0 - 5.0.1 label: Font Awesome Flag search: terms: [] styles: - brands unicode: f425 font-awesome-logo-full: changes: - 5.0.11 label: Font Awesome Full Logo ligatures: - Font Awesome private: true search: terms: [] styles: - solid - regular - light - brands unicode: f4e6 fonticons: changes: - '4.4' - 5.0.0 label: Fonticons search: terms: [] styles: - brands unicode: f280 fonticons-fi: changes: - 5.0.0 label: Fonticons Fi search: terms: [] styles: - brands unicode: f3a2 football-ball: changes: - 5.0.5 label: Football Ball search: terms: - fall - pigskin - seasonal styles: - solid - regular - light unicode: f44e football-helmet: changes: - 5.0.5 label: Football Helmet search: terms: [] styles: - solid - regular - light unicode: f44f forklift: changes: - 5.0.7 label: Forklift search: terms: [] styles: - solid - regular - light unicode: f47a fort-awesome: changes: - '4.5' - 5.0.0 - 5.0.3 label: Fort Awesome search: terms: - castle styles: - brands unicode: f286 fort-awesome-alt: changes: - 5.0.0 label: Alternate Fort Awesome search: terms: - castle styles: - brands unicode: f3a3 forumbee: changes: - '4.3' - 5.0.0 label: Forumbee search: terms: [] styles: - brands unicode: f211 forward: changes: - '1' - 5.0.0 label: forward search: terms: - forward - next styles: - solid - regular - light unicode: f04e foursquare: changes: - '3.2' - 5.0.0 label: Foursquare search: terms: [] styles: - brands unicode: f180 fragile: changes: - 5.0.9 label: Fragile search: terms: [] styles: - solid - regular - light unicode: f4bb free-code-camp: changes: - '4.7' - 5.0.0 label: Free Code Camp search: terms: [] styles: - brands unicode: f2c5 freebsd: changes: - 5.0.0 label: FreeBSD search: terms: [] styles: - brands unicode: f3a4 frog: changes: - 5.0.13 label: Frog search: terms: - amphibian - bullfrog - fauna - hop - kermit - kiss - prince - ribbit - toad - wart styles: - solid - regular - light unicode: f52e frown: changes: - '3.1' - 5.0.0 - 5.0.9 - 5.1.0 label: Frowning Face search: terms: - disapprove - emoticon - face - rating - sad styles: - solid - regular - light unicode: f119 frown-open: changes: - 5.1.0 label: Frowning Face With Open Mouth search: terms: - disapprove - emoticon - face - rating - sad styles: - solid - regular - light unicode: f57a fulcrum: changes: - 5.0.12 label: Fulcrum search: terms: [] styles: - brands unicode: f50b function: changes: - 5.3.0 label: Function search: terms: [] styles: - solid - regular - light unicode: f661 funnel-dollar: changes: - 5.3.0 label: Funnel Dollar search: terms: [] styles: - solid - regular - light unicode: f662 futbol: changes: - '4.2' - 5.0.0 - 5.0.5 label: Futbol search: terms: - ball - football - soccer styles: - solid - regular - light unicode: f1e3 galactic-republic: changes: - 5.0.12 label: Galactic Republic search: terms: - politics - star wars styles: - brands unicode: f50c galactic-senate: changes: - 5.0.12 label: Galactic Senate search: terms: - star wars styles: - brands unicode: f50d gamepad: changes: - '3.1' - 5.0.0 label: Gamepad search: terms: - controller styles: - solid - regular - light unicode: f11b gas-pump: changes: - 5.0.13 label: Gas Pump search: terms: [] styles: - solid - regular - light unicode: f52f gas-pump-slash: changes: - 5.2.0 label: Gas Pump-slash search: terms: [] styles: - solid - regular - light unicode: f5f4 gavel: changes: - '2' - 5.0.0 label: Gavel search: terms: - hammer - judge - lawyer - opinion styles: - solid - regular - light unicode: f0e3 gem: changes: - 5.0.0 label: Gem search: terms: - diamond styles: - solid - regular - light unicode: f3a5 genderless: changes: - '4.4' - 5.0.0 label: Genderless search: terms: [] styles: - solid - regular - light unicode: f22d get-pocket: changes: - '4.4' - 5.0.0 label: Get Pocket search: terms: [] styles: - brands unicode: f265 gg: changes: - '4.4' - 5.0.0 label: GG Currency search: terms: [] styles: - brands unicode: f260 gg-circle: changes: - '4.4' - 5.0.0 label: GG Currency Circle search: terms: [] styles: - brands unicode: f261 ghost: changes: - 5.4.0 label: Ghost search: terms: - apparition - blinky - clyde - floating - halloween - holiday - inky - pinky - spirit styles: - solid - regular - light unicode: f6e2 gift: changes: - '1' - 5.0.0 - 5.0.9 label: gift search: terms: - generosity - giving - party - present - wrapped styles: - solid - regular - light unicode: f06b gift-card: changes: - 5.3.0 label: Gift Card search: terms: [] styles: - solid - regular - light unicode: f663 git: changes: - '4.1' - 5.0.0 label: Git search: terms: [] styles: - brands unicode: f1d3 git-square: changes: - '4.1' - 5.0.0 label: Git Square search: terms: [] styles: - brands unicode: f1d2 github: changes: - '2' - 5.0.0 label: GitHub search: terms: - octocat styles: - brands unicode: f09b github-alt: changes: - '3' - 5.0.0 label: Alternate GitHub search: terms: - octocat styles: - brands unicode: f113 github-square: changes: - '1' - 5.0.0 label: GitHub Square search: terms: - octocat styles: - brands unicode: f092 gitkraken: changes: - 5.0.0 label: GitKraken search: terms: [] styles: - brands unicode: f3a6 gitlab: changes: - '4.6' - 5.0.0 label: GitLab search: terms: - Axosoft styles: - brands unicode: f296 gitter: changes: - 5.0.0 label: Gitter search: terms: [] styles: - brands unicode: f426 glass-martini: changes: - '1' - 5.0.0 - 5.1.0 label: Martini Glass search: terms: - alcohol - bar - beverage - drink - glass - liquor - martini styles: - solid - regular - light unicode: f000 glass-martini-alt: changes: - 5.1.0 label: Alternate Glass Martini search: terms: [] styles: - solid - regular - light unicode: f57b glasses: changes: - 5.0.13 label: Glasses search: terms: - foureyes - hipster - nerd - reading - sight - spectacles styles: - solid - regular - light unicode: f530 glasses-alt: changes: - 5.2.0 label: Alternate Glasses search: terms: [] styles: - solid - regular - light unicode: f5f5 glide: changes: - '4.6' - 5.0.0 label: Glide search: terms: [] styles: - brands unicode: f2a5 glide-g: changes: - '4.6' - 5.0.0 label: Glide G search: terms: [] styles: - brands unicode: f2a6 globe: changes: - '2' - 5.0.0 - 5.0.9 label: Globe search: terms: - all - coordinates - country - earth - global - gps - language - localize - location - map - online - place - planet - translate - travel - world styles: - solid - regular - light unicode: f0ac globe-africa: changes: - 5.1.0 label: Globe with Africa shown search: terms: - all - country - earth - global - gps - language - localize - location - map - online - place - planet - translate - travel - world styles: - solid - regular - light unicode: f57c globe-americas: changes: - 5.1.0 label: Globe with Americas shown search: terms: - all - country - earth - global - gps - language - localize - location - map - online - place - planet - translate - travel - world styles: - solid - regular - light unicode: f57d globe-asia: changes: - 5.1.0 label: Globe with Asia shown search: terms: - all - country - earth - global - gps - language - localize - location - map - online - place - planet - translate - travel - world styles: - solid - regular - light unicode: f57e globe-stand: changes: - 5.2.0 label: Globe Stand search: terms: [] styles: - solid - regular - light unicode: f5f6 gofore: changes: - 5.0.0 label: Gofore search: terms: [] styles: - brands unicode: f3a7 golf-ball: changes: - 5.0.5 label: Golf Ball search: terms: [] styles: - solid - regular - light unicode: f450 golf-club: changes: - 5.0.5 label: Golf Club search: terms: [] styles: - solid - regular - light unicode: f451 goodreads: changes: - 5.0.0 label: Goodreads search: terms: [] styles: - brands unicode: f3a8 goodreads-g: changes: - 5.0.0 label: Goodreads G search: terms: [] styles: - brands unicode: f3a9 google: changes: - '4.1' - 5.0.0 label: Google Logo search: terms: [] styles: - brands unicode: f1a0 google-drive: changes: - 5.0.0 label: Google Drive search: terms: [] styles: - brands unicode: f3aa google-play: changes: - 5.0.0 label: Google Play search: terms: [] styles: - brands unicode: f3ab google-plus: changes: - '4.6' - 5.0.0 label: Google Plus search: terms: - google-plus-circle - google-plus-official styles: - brands unicode: f2b3 google-plus-g: changes: - '2' - 5.0.0 label: Google Plus G search: terms: - google-plus - social network styles: - brands unicode: f0d5 google-plus-square: changes: - '2' - 5.0.0 label: Google Plus Square search: terms: - social network styles: - brands unicode: f0d4 google-wallet: changes: - '4.2' - 5.0.0 label: Google Wallet search: terms: [] styles: - brands unicode: f1ee gopuram: changes: - 5.3.0 label: Gopuram search: terms: - building - entrance - hinduism - temple - tower styles: - solid - regular - light unicode: f664 graduation-cap: changes: - '4.1' - 5.0.0 - 5.2.0 label: Graduation Cap search: terms: - learning - school - student styles: - solid - regular - light unicode: f19d gratipay: changes: - '3.2' - 5.0.0 label: Gratipay (Gittip) search: terms: - favorite - heart - like - love styles: - brands unicode: f184 grav: changes: - '4.7' - 5.0.0 label: Grav search: terms: [] styles: - brands unicode: f2d6 greater-than: changes: - 5.0.13 label: Greater Than search: terms: [] styles: - solid - regular - light unicode: f531 greater-than-equal: changes: - 5.0.13 label: Greater Than Equal To search: terms: [] styles: - solid - regular - light unicode: f532 grimace: changes: - 5.1.0 label: Grimacing Face search: terms: - cringe - emoticon - face styles: - solid - regular - light unicode: f57f grin: changes: - 5.1.0 label: Grinning Face search: terms: - emoticon - face - laugh - smile styles: - solid - regular - light unicode: f580 grin-alt: changes: - 5.1.0 label: Alternate Grinning Face search: terms: - emoticon - face - laugh - smile styles: - solid - regular - light unicode: f581 grin-beam: changes: - 5.1.0 label: Grinning Face With Smiling Eyes search: terms: - emoticon - face - laugh - smile styles: - solid - regular - light unicode: f582 grin-beam-sweat: changes: - 5.1.0 label: Grinning Face With Sweat search: terms: - emoticon - face - smile styles: - solid - regular - light unicode: f583 grin-hearts: changes: - 5.1.0 label: Smiling Face With Heart-Eyes search: terms: - emoticon - face - love - smile styles: - solid - regular - light unicode: f584 grin-squint: changes: - 5.1.0 label: Grinning Squinting Face search: terms: - emoticon - face - laugh - smile styles: - solid - regular - light unicode: f585 grin-squint-tears: changes: - 5.1.0 label: Rolling on the Floor Laughing search: terms: - emoticon - face - happy - smile styles: - solid - regular - light unicode: f586 grin-stars: changes: - 5.1.0 label: Star-Struck search: terms: - emoticon - face - star-struck styles: - solid - regular - light unicode: f587 grin-tears: changes: - 5.1.0 label: Face With Tears of Joy search: terms: - LOL - emoticon - face styles: - solid - regular - light unicode: f588 grin-tongue: changes: - 5.1.0 label: Face With Tongue search: terms: - LOL - emoticon - face styles: - solid - regular - light unicode: f589 grin-tongue-squint: changes: - 5.1.0 label: Squinting Face With Tongue search: terms: - LOL - emoticon - face styles: - solid - regular - light unicode: f58a grin-tongue-wink: changes: - 5.1.0 label: Winking Face With Tongue search: terms: - LOL - emoticon - face styles: - solid - regular - light unicode: f58b grin-wink: changes: - 5.1.0 - 5.1.1 label: Grinning Winking Face search: terms: - emoticon - face - flirt - laugh - smile styles: - solid - regular - light unicode: f58c grip-horizontal: changes: - 5.1.0 label: Grip Horizontal search: terms: - affordance - drag - drop - grab - handle styles: - solid - regular - light unicode: f58d grip-vertical: changes: - 5.1.0 label: Grip Vertical search: terms: - affordance - drag - drop - grab - handle styles: - solid - regular - light unicode: f58e gripfire: changes: - 5.0.0 label: 'Gripfire, Inc.' search: terms: [] styles: - brands unicode: f3ac grunt: changes: - 5.0.0 label: Grunt search: terms: [] styles: - brands unicode: f3ad gulp: changes: - 5.0.0 label: Gulp search: terms: [] styles: - brands unicode: f3ae h-square: changes: - '3' - 5.0.0 label: H Square search: terms: - hospital - hotel styles: - solid - regular - light unicode: f0fd h1: changes: - 5.0.0 label: H1 Heading search: terms: - header styles: - solid - regular - light unicode: f313 h2: changes: - 5.0.0 label: H2 Heading search: terms: - header styles: - solid - regular - light unicode: f314 h3: changes: - 5.0.0 label: H3 Heading search: terms: - header styles: - solid - regular - light unicode: f315 hacker-news: changes: - '4.1' - 5.0.0 label: Hacker News search: terms: [] styles: - brands unicode: f1d4 hacker-news-square: changes: - 5.0.0 label: Hacker News Square search: terms: [] styles: - brands unicode: f3af hackerrank: changes: - 5.2.0 label: Hackerrank search: terms: [] styles: - brands unicode: f5f7 hammer: changes: - 5.4.0 label: Hammer search: terms: - admin - fix - repair - settings - tool styles: - solid - regular - light unicode: f6e3 hammer-war: changes: - 5.4.0 label: Hammer War search: terms: - Dungeons & Dragons - cleric - d&d - dnd - dwarf - fantasy - melee attack - weapon styles: - solid - regular - light unicode: f6e4 hamsa: changes: - 5.3.0 label: Hamsa search: terms: - amulet - christianity - islam - jewish - judaism - muslim - protection styles: - solid - regular - light unicode: f665 hand-heart: changes: - 5.0.9 label: Hand with Heart search: terms: [] styles: - solid - regular - light unicode: f4bc hand-holding: changes: - 5.0.9 label: Hand Holding search: terms: [] styles: - solid - regular - light unicode: f4bd hand-holding-box: changes: - 5.0.7 - 5.0.9 label: Hand Holding Box search: terms: [] styles: - solid - regular - light unicode: f47b hand-holding-heart: changes: - 5.0.9 label: Hand Holding Heart search: terms: [] styles: - solid - regular - light unicode: f4be hand-holding-magic: changes: - 5.4.0 label: Hand Holding-magic search: terms: - Dungeons & Dragons - cast - d&d - dnd - fantasy - mage - spell - witch - wizard styles: - solid - regular - light unicode: f6e5 hand-holding-seedling: changes: - 5.0.9 label: Hand Holding Seedling search: terms: [] styles: - solid - regular - light unicode: f4bf hand-holding-usd: changes: - 5.0.9 label: Hand Holding US Dollar search: terms: - $ - dollar sign - donation - giving - money - price styles: - solid - regular - light unicode: f4c0 hand-holding-water: changes: - 5.0.9 label: Hand Holding Water search: terms: [] styles: - solid - regular - light unicode: f4c1 hand-lizard: changes: - '4.4' - 5.0.0 label: Lizard (Hand) search: terms: [] styles: - solid - regular - light unicode: f258 hand-paper: changes: - '4.4' - 5.0.0 label: Paper (Hand) search: terms: - stop styles: - solid - regular - light unicode: f256 hand-peace: changes: - '4.4' - 5.0.0 label: Peace (Hand) search: terms: [] styles: - solid - regular - light unicode: f25b hand-point-down: changes: - '2' - 5.0.0 label: Hand Pointing Down search: terms: - finger - hand-o-down - point styles: - solid - regular - light unicode: f0a7 hand-point-left: changes: - '2' - 5.0.0 label: Hand Pointing Left search: terms: - back - finger - hand-o-left - left - point - previous styles: - solid - regular - light unicode: f0a5 hand-point-right: changes: - '2' - 5.0.0 label: Hand Pointing Right search: terms: - finger - forward - hand-o-right - next - point - right styles: - solid - regular - light unicode: f0a4 hand-point-up: changes: - '2' - 5.0.0 label: Hand Pointing Up search: terms: - finger - hand-o-up - point styles: - solid - regular - light unicode: f0a6 hand-pointer: changes: - '4.4' - 5.0.0 label: Pointer (Hand) search: terms: - select styles: - solid - regular - light unicode: f25a hand-receiving: changes: - 5.0.7 - 5.0.9 label: Hand Receiving search: terms: [] styles: - solid - regular - light unicode: f47c hand-rock: changes: - '4.4' - 5.0.0 label: Rock (Hand) search: terms: [] styles: - solid - regular - light unicode: f255 hand-scissors: changes: - '4.4' - 5.0.0 label: Scissors (Hand) search: terms: [] styles: - solid - regular - light unicode: f257 hand-spock: changes: - '4.4' - 5.0.0 label: Spock (Hand) search: terms: [] styles: - solid - regular - light unicode: f259 hands: changes: - 5.0.9 label: Hands search: terms: [] styles: - solid - regular - light unicode: f4c2 hands-heart: changes: - 5.0.9 label: Hands Heart search: terms: [] styles: - solid - regular - light unicode: f4c3 hands-helping: changes: - 5.0.9 label: Helping Hands search: terms: - aid - assistance - partnership - volunteering styles: - solid - regular - light unicode: f4c4 hands-usd: changes: - 5.0.9 label: Hands with US Dollar search: terms: - $ - dollar sign - donation - giving - money - price - usd styles: - solid - regular - light unicode: f4c5 handshake: changes: - '4.7' - 5.0.0 - 5.0.9 label: Handshake search: terms: - greeting - partnership styles: - solid - regular - light unicode: f2b5 handshake-alt: changes: - 5.0.9 label: Alternate Handshake search: terms: - greeting - partnership styles: - solid - regular - light unicode: f4c6 hanukiah: changes: - 5.4.0 label: Hanukiah search: terms: - candle - hanukkah - jewish - judaism - light styles: - solid - regular - light unicode: f6e6 hashtag: changes: - '4.5' - 5.0.0 label: Hashtag search: terms: [] styles: - solid - regular - light unicode: f292 hat-witch: changes: - 5.4.0 label: Witch's Hat search: terms: - cloth - clothing - halloween - holiday - mage - magic - sorceror styles: - solid - regular - light unicode: f6e7 hat-wizard: changes: - 5.4.0 label: Wizard's Hat search: terms: - Dungeons & Dragons - buckle - cloth - clothing - d&d - dnd - fantasy - halloween - holiday - mage - magic - pointy - witch styles: - solid - regular - light unicode: f6e8 haykal: changes: - 5.3.0 label: Haykal search: terms: - bahai - bahá'í - star styles: - solid - regular - light unicode: f666 hdd: changes: - '2' - 5.0.0 label: HDD search: terms: - cpu - hard drive - harddrive - machine - save - storage styles: - solid - regular - light unicode: f0a0 head-side: changes: - 5.4.0 label: Head Side search: terms: - profile styles: - solid - regular - light unicode: f6e9 head-vr: changes: - 5.4.0 label: Head VR search: terms: - occulus - profile - reality - virtual styles: - solid - regular - light unicode: f6ea heading: changes: - '4.1' - 5.0.0 label: heading search: terms: - header styles: - solid - regular - light unicode: f1dc headphones: changes: - '1' - 5.0.0 label: headphones search: terms: - audio - listen - music - sound - speaker styles: - solid - regular - light unicode: f025 headphones-alt: changes: - 5.1.0 label: Alternate Headphones search: terms: - audio - listen - music - sound - speaker styles: - solid - regular - light unicode: f58f headset: changes: - 5.1.0 label: Headset search: terms: - audio - gamer - gaming - listen - live chat - microphone - shot caller - sound - support - telemarketer styles: - solid - regular - light unicode: f590 heart: changes: - '1' - 5.0.0 - 5.0.9 label: Heart search: terms: - favorite - like - love styles: - solid - regular - light unicode: f004 heart-circle: changes: - 5.0.9 label: Heart Circle search: terms: - favorite - like - love styles: - solid - regular - light unicode: f4c7 heart-rate: changes: - 5.2.0 label: Heart Rate search: terms: [] styles: - solid - regular - light unicode: f5f8 heart-square: changes: - 5.0.9 label: Heart Square search: terms: - favorite - like - love styles: - solid - regular - light unicode: f4c8 heartbeat: changes: - '4.3' - 5.0.0 - 5.0.7 label: Heartbeat search: terms: - ekg - lifeline - vital signs styles: - solid - regular - light unicode: f21e helicopter: changes: - 5.0.13 label: Helicopter search: terms: - airwolf - apache - chopper - flight - fly styles: - solid - regular - light unicode: f533 helmet-battle: changes: - 5.4.0 label: Battle Helmet search: terms: - Dungeons & Dragons - armor - clothing - d&d - dnd - fantasy - hat - knight - paladin styles: - solid - regular - light unicode: f6eb hexagon: changes: - 5.0.0 label: Hexagon search: terms: [] styles: - solid - regular - light unicode: f312 highlighter: changes: - 5.1.0 label: Highlighter search: terms: - edit - marker - sharpie - update - write styles: - solid - regular - light unicode: f591 hiking: changes: - 5.4.0 label: Hiking search: terms: - activity - backpack - fall - fitness - outdoors - seasonal - walking styles: - solid - regular - light unicode: f6ec hippo: changes: - 5.4.0 label: Hippo search: terms: - fauna - hungry - mammmal styles: - solid - regular - light unicode: f6ed hips: changes: - 5.0.5 label: Hips search: terms: [] styles: - brands unicode: f452 hire-a-helper: changes: - 5.0.0 label: HireAHelper search: terms: [] styles: - brands unicode: f3b0 history: changes: - '4.1' - 5.0.0 label: History search: terms: [] styles: - solid - regular - light unicode: f1da hockey-mask: changes: - 5.4.0 label: Hockey Mask search: terms: - clothing - friday - halloween - holiday - jason - protection - thirteenth styles: - solid - regular - light unicode: f6ee hockey-puck: changes: - 5.0.5 label: Hockey Puck search: terms: [] styles: - solid - regular - light unicode: f453 hockey-sticks: changes: - 5.0.5 label: Hockey Sticks search: terms: [] styles: - solid - regular - light unicode: f454 home: changes: - '1' - 5.0.0 label: home search: terms: - house - main styles: - solid - regular - light unicode: f015 home-heart: changes: - 5.0.9 label: Home Heart search: terms: [] styles: - solid - regular - light unicode: f4c9 hood-cloak: changes: - 5.4.0 label: Hood Cloak search: terms: - Dungeons & Dragons - clothing - d&d - dnd - fantasy - hat - rogue - stealth styles: - solid - regular - light unicode: f6ef hooli: changes: - 5.0.0 label: Hooli search: terms: [] styles: - brands unicode: f427 hornbill: changes: - 5.1.0 label: Hornbill search: terms: [] styles: - brands unicode: f592 horse: changes: - 5.4.0 label: Horse search: terms: - equus - fauna - mammmal - neigh styles: - solid - regular - light unicode: f6f0 hospital: changes: - '3' - 5.0.0 label: hospital search: terms: - building - emergency room - medical center styles: - solid - regular - light unicode: f0f8 hospital-alt: changes: - 5.0.7 label: Alternate Hospital search: terms: - building - emergency room - medical center styles: - solid - regular - light unicode: f47d hospital-symbol: changes: - 5.0.7 label: Hospital Symbol search: terms: [] styles: - solid - regular - light unicode: f47e hot-tub: changes: - 5.1.0 label: Hot Tub search: terms: [] styles: - solid - regular - light unicode: f593 hotel: changes: - 5.1.0 label: Hotel search: terms: - building - lodging styles: - solid - regular - light unicode: f594 hotjar: changes: - 5.0.0 label: Hotjar search: terms: [] styles: - brands unicode: f3b1 hourglass: changes: - '4.4' - 5.0.0 label: Hourglass search: terms: [] styles: - solid - regular - light unicode: f254 hourglass-end: changes: - '4.4' - 5.0.0 label: Hourglass End search: terms: [] styles: - solid - regular - light unicode: f253 hourglass-half: changes: - '4.4' - 5.0.0 label: Hourglass Half search: terms: [] styles: - solid - regular - light unicode: f252 hourglass-start: changes: - '4.4' - 5.0.0 label: Hourglass Start search: terms: [] styles: - solid - regular - light unicode: f251 house-damage: changes: - 5.4.0 label: Damaged House search: terms: - devastation - home styles: - solid - regular - light unicode: f6f1 house-flood: changes: - 5.5.0 label: Flooded House search: terms: [] styles: - solid - regular - light unicode: f74f houzz: changes: - '4.4' - 5.0.0 - 5.0.9 label: Houzz search: terms: [] styles: - brands unicode: f27c hryvnia: changes: - 5.4.0 label: Hryvnia search: terms: - money styles: - solid - regular - light unicode: f6f2 html5: changes: - '3.1' - 5.0.0 label: HTML 5 Logo search: terms: [] styles: - brands unicode: f13b hubspot: changes: - 5.0.0 label: HubSpot search: terms: [] styles: - brands unicode: f3b2 humidity: changes: - 5.5.0 label: Humidity search: terms: [] styles: - solid - regular - light unicode: f750 hurricane: changes: - 5.5.0 label: Hurricane search: terms: - coriolis effect - eye - storm - tropical cyclone - typhoon styles: - solid - regular - light unicode: f751 i-cursor: changes: - '4.4' - 5.0.0 label: I Beam Cursor search: terms: [] styles: - solid - regular - light unicode: f246 id-badge: changes: - '4.7' - 5.0.0 - 5.0.3 label: Identification Badge search: terms: [] styles: - solid - regular - light unicode: f2c1 id-card: changes: - '4.7' - 5.0.0 - 5.0.3 label: Identification Card search: terms: - document - identification - issued styles: - solid - regular - light unicode: f2c2 id-card-alt: changes: - 5.0.7 label: Alternate Identification Card search: terms: - demographics styles: - solid - regular - light unicode: f47f image: changes: - '1' - 5.0.0 label: Image search: terms: - album - photo - picture styles: - solid - regular - light unicode: f03e images: changes: - '1' - 5.0.0 label: Images search: terms: - album - photo - picture styles: - solid - regular - light unicode: f302 imdb: changes: - '4.7' - 5.0.0 label: IMDB search: terms: [] styles: - brands unicode: f2d8 inbox: changes: - '1' - 5.0.0 label: inbox search: terms: [] styles: - solid - regular - light unicode: f01c inbox-in: changes: - 5.0.0 label: Inbox In search: terms: [] styles: - solid - regular - light unicode: f310 inbox-out: changes: - 5.0.0 label: Inbox Out search: terms: [] styles: - solid - regular - light unicode: f311 indent: changes: - '1' - 5.0.0 label: Indent search: terms: [] styles: - solid - regular - light unicode: f03c industry: changes: - '4.4' - 5.0.0 label: Industry search: terms: - factory - manufacturing styles: - solid - regular - light unicode: f275 industry-alt: changes: - 5.0.0 label: Alternate Industry search: terms: - factory - manufacturing styles: - solid - regular - light unicode: f3b3 infinity: changes: - 5.0.13 - 5.3.0 label: Infinity search: terms: [] styles: - solid - regular - light unicode: f534 info: changes: - '3.1' - 5.0.0 label: Info search: terms: - details - help - information - more styles: - solid - regular - light unicode: f129 info-circle: changes: - '1' - 5.0.0 label: Info Circle search: terms: - details - help - information - more styles: - solid - regular - light unicode: f05a info-square: changes: - 5.0.0 label: Info Square search: terms: - details - help - information - more styles: - solid - regular - light unicode: f30f inhaler: changes: - 5.2.0 label: Inhaler search: terms: [] styles: - solid - regular - light unicode: f5f9 instagram: changes: - '4.6' - 5.0.0 label: Instagram search: terms: [] styles: - brands unicode: f16d integral: changes: - 5.3.0 label: Integral search: terms: [] styles: - solid - regular - light unicode: f667 internet-explorer: changes: - '4.4' - 5.0.0 label: Internet-explorer search: terms: - browser - ie styles: - brands unicode: f26b intersection: changes: - 5.3.0 label: Intersection search: terms: [] styles: - solid - regular - light unicode: f668 inventory: changes: - 5.0.7 label: Inventory search: terms: [] styles: - solid - regular - light unicode: f480 ioxhost: changes: - '4.2' - 5.0.0 label: ioxhost search: terms: [] styles: - brands unicode: f208 italic: changes: - '1' - 5.0.0 label: italic search: terms: - italics styles: - solid - regular - light unicode: f033 itunes: changes: - 5.0.0 label: iTunes search: terms: [] styles: - brands unicode: f3b4 itunes-note: changes: - 5.0.0 label: Itunes Note search: terms: [] styles: - brands unicode: f3b5 jack-o-lantern: changes: - 5.0.0 label: Jack-o'-lantern search: terms: - carve - face - halloween - holiday - lantern - pumpkin - smile styles: - solid - regular - light unicode: f30e java: changes: - 5.0.10 label: Java search: terms: [] styles: - brands unicode: f4e4 jedi: changes: - 5.3.0 label: Jedi search: terms: - star wars styles: - solid - regular - light unicode: f669 jedi-order: changes: - 5.0.12 label: Jedi Order search: terms: - star wars styles: - brands unicode: f50e jenkins: changes: - 5.0.0 label: Jenkis search: terms: [] styles: - brands unicode: f3b6 joget: changes: - 5.0.0 label: Joget search: terms: [] styles: - brands unicode: f3b7 joint: changes: - 5.1.0 label: Joint search: terms: - blunt - cannabis - doobie - drugs - marijuana - roach - smoke - smoking - spliff styles: - solid - regular - light unicode: f595 joomla: changes: - '4.1' - 5.0.0 label: Joomla Logo search: terms: [] styles: - brands unicode: f1aa journal-whills: changes: - 5.3.0 label: Journal of the Whills search: terms: - book - jedi - star wars - the force styles: - solid - regular - light unicode: f66a js: changes: - 5.0.0 label: JavaScript (JS) search: terms: [] styles: - brands unicode: f3b8 js-square: changes: - 5.0.0 - 5.0.3 label: JavaScript (JS) Square search: terms: [] styles: - brands unicode: f3b9 jsfiddle: changes: - '4.1' - 5.0.0 label: jsFiddle search: terms: [] styles: - brands unicode: f1cc kaaba: changes: - 5.3.0 label: Kaaba search: terms: - building - cube - islam - muslim styles: - solid - regular - light unicode: f66b kaggle: changes: - 5.2.0 label: Kaggle search: terms: [] styles: - brands unicode: f5fa key: changes: - '1' - 5.0.0 label: key search: terms: - password - unlock styles: - solid - regular - light unicode: f084 key-skeleton: changes: - 5.4.0 label: Key Skeleton search: terms: - halloween - holiday - password - unlock styles: - solid - regular - light unicode: f6f3 keybase: changes: - 5.0.11 label: Keybase search: terms: [] styles: - brands unicode: f4f5 keyboard: changes: - '3.1' - 5.0.0 label: Keyboard search: terms: - input - type styles: - solid - regular - light unicode: f11c keycdn: changes: - 5.0.0 label: KeyCDN search: terms: [] styles: - brands unicode: f3ba keynote: changes: - 5.3.0 label: Keynote search: terms: - lecture - panel - seminar - speak - speaker - talk styles: - solid - regular - light unicode: f66c khanda: changes: - 5.3.0 label: Khanda search: terms: - chakkar - sikh - sikhism - sword styles: - solid - regular - light unicode: f66d kickstarter: changes: - 5.0.0 label: Kickstarter search: terms: [] styles: - brands unicode: f3bb kickstarter-k: changes: - 5.0.0 label: Kickstarter K search: terms: [] styles: - brands unicode: f3bc kidneys: changes: - 5.2.0 label: Kidneys search: terms: [] styles: - solid - regular - light unicode: f5fb kiss: changes: - 5.1.0 - 5.1.1 label: Kissing Face search: terms: - beso - emoticon - face - love - smooch styles: - solid - regular - light unicode: f596 kiss-beam: changes: - 5.1.0 label: Kissing Face With Smiling Eyes search: terms: - beso - emoticon - face - love - smooch styles: - solid - regular - light unicode: f597 kiss-wink-heart: changes: - 5.1.0 label: Face Blowing a Kiss search: terms: - beso - emoticon - face - love - smooch styles: - solid - regular - light unicode: f598 kite: changes: - 5.4.0 label: Kite search: terms: - air - benjamin - fall - flying - franklin - outdoors - seasonal - sky - wind styles: - solid - regular - light unicode: f6f4 kiwi-bird: changes: - 5.0.13 label: Kiwi Bird search: terms: - bird - fauna styles: - solid - regular - light unicode: f535 knife-kitchen: changes: - 5.4.0 label: Knife Kitchen search: terms: - chef - cut - halloween - holiday - tool styles: - solid - regular - light unicode: f6f5 korvue: changes: - 5.0.2 label: KORVUE search: terms: [] styles: - brands unicode: f42f lambda: changes: - 5.3.0 label: Lambda search: terms: [] styles: - solid - regular - light unicode: f66e lamp: changes: - 5.0.9 - 5.0.10 label: Lamp search: terms: [] styles: - solid - regular - light unicode: f4ca landmark: changes: - 5.3.0 label: Landmark search: terms: - building - historic - memoroable - politics styles: - solid - regular - light unicode: f66f landmark-alt: changes: - 5.5.0 label: Alternative Landmark search: terms: - building - historic - memoroable - politics styles: - solid - regular - light unicode: f752 language: changes: - '4.1' - 5.0.0 label: Language search: terms: - dialect - idiom - localize - speech - translate - vernacular styles: - solid - regular - light unicode: f1ab laptop: changes: - '3' - 5.0.0 - 5.2.0 label: Laptop search: terms: - computer - cpu - dell - demo - device - dude you're getting - mac - macbook - machine - pc styles: - solid - regular - light unicode: f109 laptop-code: changes: - 5.2.0 label: Laptop Code search: terms: [] styles: - solid - regular - light unicode: f5fc laravel: changes: - 5.0.0 - 5.0.3 label: Laravel search: terms: [] styles: - brands unicode: f3bd lastfm: changes: - '4.2' - 5.0.0 label: last.fm search: terms: [] styles: - brands unicode: f202 lastfm-square: changes: - '4.2' - 5.0.0 - 5.0.11 label: last.fm Square search: terms: [] styles: - brands unicode: f203 laugh: changes: - 5.1.0 label: Grinning Face With Big Eyes search: terms: - LOL - emoticon - face - laugh styles: - solid - regular - light unicode: f599 laugh-beam: changes: - 5.1.0 label: Laugh Face with Beaming Eyes search: terms: - LOL - emoticon - face styles: - solid - regular - light unicode: f59a laugh-squint: changes: - 5.1.0 label: Laughing Squinting Face search: terms: - LOL - emoticon - face styles: - solid - regular - light unicode: f59b laugh-wink: changes: - 5.1.0 label: Laughing Winking Face search: terms: - LOL - emoticon - face styles: - solid - regular - light unicode: f59c layer-group: changes: - 5.2.0 label: Layer Group search: terms: - layers styles: - solid - regular - light unicode: f5fd layer-minus: changes: - 5.2.0 label: Layer Minus search: terms: - delete - negative - remove styles: - solid - regular - light unicode: f5fe layer-plus: changes: - 5.2.0 label: Layer Plus search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f5ff leaf: changes: - '1' - 5.0.0 - 5.0.9 label: leaf search: terms: - eco - flora - nature - plant styles: - solid - regular - light unicode: f06c leaf-heart: changes: - 5.0.9 label: Leaf with a Heart search: terms: - eco - flora - nature - plant styles: - solid - regular - light unicode: f4cb leaf-maple: changes: - 5.4.0 label: Maple Leaf search: terms: - eco - fall - flora - nature - plant - seasonal styles: - solid - regular - light unicode: f6f6 leaf-oak: changes: - 5.4.0 label: Oak Leaf search: terms: - eco - fall - flora - nature - plant - seasonal styles: - solid - regular - light unicode: f6f7 leanpub: changes: - '4.3' - 5.0.0 label: Leanpub search: terms: [] styles: - brands unicode: f212 lemon: changes: - '1' - 5.0.0 label: Lemon search: terms: - food styles: - solid - regular - light unicode: f094 less: changes: - 5.0.0 label: Less search: terms: [] styles: - brands unicode: f41d less-than: changes: - 5.0.13 label: Less Than search: terms: [] styles: - solid - regular - light unicode: f536 less-than-equal: changes: - 5.0.13 label: Less Than Equal To search: terms: [] styles: - solid - regular - light unicode: f537 level-down: changes: - '3.1' - 5.0.0 label: Level Down search: terms: - arrow styles: - solid - regular - light unicode: f149 level-down-alt: changes: - 5.0.0 label: Alternate Level Down search: terms: - level-down styles: - solid - regular - light unicode: f3be level-up: changes: - '3.1' - 5.0.0 label: Level Up search: terms: - arrow styles: - solid - regular - light unicode: f148 level-up-alt: changes: - 5.0.0 label: Alternate Level Up search: terms: - level-up styles: - solid - regular - light unicode: f3bf life-ring: changes: - '4.1' - 5.0.0 label: Life Ring search: terms: - support styles: - solid - regular - light unicode: f1cd lightbulb: changes: - '3' - 5.0.0 - 5.3.0 label: Lightbulb search: terms: - idea - inspiration styles: - solid - regular - light unicode: f0eb lightbulb-dollar: changes: - 5.3.0 label: Lightbulb Dollar search: terms: [] styles: - solid - regular - light unicode: f670 lightbulb-exclamation: changes: - 5.3.0 label: Lightbulb Exclamation search: terms: [] styles: - solid - regular - light unicode: f671 lightbulb-on: changes: - 5.3.0 label: Lightbulb On search: terms: [] styles: - solid - regular - light unicode: f672 lightbulb-slash: changes: - 5.3.0 label: Lightbulb Slash search: terms: [] styles: - solid - regular - light unicode: f673 line: changes: - 5.0.0 label: Line search: terms: [] styles: - brands unicode: f3c0 link: changes: - '2' - 5.0.0 label: Link search: terms: - chain styles: - solid - regular - light unicode: f0c1 linkedin: changes: - '1' - 5.0.0 label: LinkedIn search: terms: - linkedin-square styles: - brands unicode: f08c linkedin-in: changes: - '2' - 5.0.0 - 5.4.1 label: LinkedIn In search: terms: - linkedin styles: - brands unicode: f0e1 linode: changes: - '4.7' - 5.0.0 label: Linode search: terms: [] styles: - brands unicode: f2b8 linux: changes: - '3.2' - 5.0.0 label: Linux search: terms: - tux styles: - brands unicode: f17c lips: changes: - 5.2.0 label: Lips search: terms: [] styles: - solid - regular - light unicode: f600 lira-sign: changes: - '4' - 5.0.0 label: Turkish Lira Sign search: terms: - try - turkish styles: - solid - regular - light unicode: f195 list: changes: - '1' - 5.0.0 label: List search: terms: - checklist - completed - done - finished - ol - todo - ul styles: - solid - regular - light unicode: f03a list-alt: changes: - '1' - 5.0.0 label: Alternate List search: terms: - checklist - completed - done - finished - ol - todo - ul styles: - solid - regular - light unicode: f022 list-ol: changes: - '2' - 5.0.0 label: list-ol search: terms: - checklist - list - numbers - ol - todo - ul styles: - solid - regular - light unicode: f0cb list-ul: changes: - '2' - 5.0.0 label: list-ul search: terms: - checklist - list - ol - todo - ul styles: - solid - regular - light unicode: f0ca location: changes: - 5.2.0 label: Location search: terms: [] styles: - solid - regular - light unicode: f601 location-arrow: changes: - '3.1' - 5.0.0 label: location-arrow search: terms: - address - coordinates - gps - location - map - place - where styles: - solid - regular - light unicode: f124 location-circle: changes: - 5.2.0 label: Location Circle search: terms: [] styles: - solid - regular - light unicode: f602 location-slash: changes: - 5.2.0 label: Location Slash search: terms: [] styles: - solid - regular - light unicode: f603 lock: changes: - '1' - 5.0.0 label: lock search: terms: - admin - protect - security styles: - solid - regular - light unicode: f023 lock-alt: changes: - 5.0.0 label: Alternate Lock search: terms: - admin - protect - security styles: - solid - regular - light unicode: f30d lock-open: changes: - '3.1' - 5.0.0 - 5.0.1 label: Lock Open search: terms: - admin - lock - open - password - protect styles: - solid - regular - light unicode: f3c1 lock-open-alt: changes: - '3.1' - 5.0.0 label: Alternate Lock Open search: terms: - admin - lock - password - protect styles: - solid - regular - light unicode: f3c2 long-arrow-alt-down: changes: - 5.0.0 label: Alternate Long Arrow Down search: terms: - long-arrow-down styles: - solid - regular - light unicode: f309 long-arrow-alt-left: changes: - 5.0.0 label: Alternate Long Arrow Left search: terms: - back - long-arrow-left - previous styles: - solid - regular - light unicode: f30a long-arrow-alt-right: changes: - 5.0.0 label: Alternate Long Arrow Right search: terms: - long-arrow-right styles: - solid - regular - light unicode: f30b long-arrow-alt-up: changes: - 5.0.0 label: Alternate Long Arrow Up search: terms: - long-arrow-up styles: - solid - regular - light unicode: f30c long-arrow-down: changes: - '3.2' - 5.0.0 label: Long Arrow Down search: terms: [] styles: - solid - regular - light unicode: f175 long-arrow-left: changes: - '3.2' - 5.0.0 label: Long Arrow Left search: terms: - back - previous styles: - solid - regular - light unicode: f177 long-arrow-right: changes: - '3.2' - 5.0.0 label: Long Arrow Right search: terms: [] styles: - solid - regular - light unicode: f178 long-arrow-up: changes: - '3.2' - 5.0.0 label: Long Arrow Up search: terms: [] styles: - solid - regular - light unicode: f176 loveseat: changes: - 5.0.9 label: Loveseat search: terms: - furniture styles: - solid - regular - light unicode: f4cc low-vision: changes: - '4.6' - 5.0.0 label: Low Vision search: terms: [] styles: - solid - regular - light unicode: f2a8 luchador: changes: - 5.0.5 label: Luchador search: terms: [] styles: - solid - regular - light unicode: f455 luggage-cart: changes: - 5.1.0 label: Luggage Cart search: terms: [] styles: - solid - regular - light unicode: f59d lungs: changes: - 5.2.0 label: Lungs search: terms: [] styles: - solid - regular - light unicode: f604 lyft: changes: - 5.0.0 label: lyft search: terms: [] styles: - brands unicode: f3c3 mace: changes: - 5.4.0 label: Mace search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - melee attack - weapon - windu styles: - solid - regular - light unicode: f6f8 magento: changes: - 5.0.0 label: Magento search: terms: [] styles: - brands unicode: f3c4 magic: changes: - '2' - 5.0.0 - 5.1.0 label: magic search: terms: - autocomplete - automatic - mage - magic - spell - witch - wizard styles: - solid - regular - light unicode: f0d0 magnet: changes: - '1' - 5.0.0 label: magnet search: terms: [] styles: - solid - regular - light unicode: f076 mail-bulk: changes: - 5.3.0 label: Mail Bulk search: terms: [] styles: - solid - regular - light unicode: f674 mailchimp: changes: - 5.1.0 label: Mailchimp search: terms: [] styles: - brands unicode: f59e male: changes: - '3.2' - 5.0.0 label: Male search: terms: - human - man - person - profile - user styles: - solid - regular - light unicode: f183 mandalorian: changes: - 5.0.12 label: Mandalorian search: terms: [] styles: - brands unicode: f50f mandolin: changes: - 5.4.0 label: Mandolin search: terms: - Dungeons & Dragons - bard - d&d - dnd - fantasy - instrument - lute - music - song - strings styles: - solid - regular - light unicode: f6f9 map: changes: - '4.4' - 5.0.0 - 5.1.0 label: Map search: terms: - coordinates - location - paper - place - travel styles: - solid - regular - light unicode: f279 map-marked: changes: - 5.1.0 label: Map Marked search: terms: - address - coordinates - destination - gps - localize - location - map - paper - pin - place - point of interest - position - route - travel - where styles: - solid - regular - light unicode: f59f map-marked-alt: changes: - 5.1.0 label: Alternate Map Marked search: terms: - address - coordinates - destination - gps - localize - location - map - paper - pin - place - point of interest - position - route - travel - where styles: - solid - regular - light unicode: f5a0 map-marker: changes: - '1' - 5.0.0 label: map-marker search: terms: - address - coordinates - gps - localize - location - map - pin - place - position - travel - where styles: - solid - regular - light unicode: f041 map-marker-alt: changes: - 5.0.0 label: Alternate Map Marker search: terms: - address - coordinates - gps - localize - location - map - pin - place - position - travel - where styles: - solid - regular - light unicode: f3c5 map-marker-alt-slash: changes: - 5.2.0 label: Alternate Map Marker Slash search: terms: [] styles: - solid - regular - light unicode: f605 map-marker-check: changes: - 5.2.0 label: Map Marker Check search: terms: [] styles: - solid - regular - light unicode: f606 map-marker-edit: changes: - 5.2.0 label: Map Marker Edit search: terms: [] styles: - solid - regular - light unicode: f607 map-marker-exclamation: changes: - 5.2.0 label: Map Marker Exclamation search: terms: [] styles: - solid - regular - light unicode: f608 map-marker-minus: changes: - 5.2.0 label: Map Marker Minus search: terms: - delete - negative - remove styles: - solid - regular - light unicode: f609 map-marker-plus: changes: - 5.2.0 label: Map Marker Plus search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f60a map-marker-question: changes: - 5.2.0 label: Map Marker Question search: terms: [] styles: - solid - regular - light unicode: f60b map-marker-slash: changes: - 5.2.0 label: Map Marker Slash search: terms: [] styles: - solid - regular - light unicode: f60c map-marker-smile: changes: - 5.2.0 label: Map Marker Smile search: terms: [] styles: - solid - regular - light unicode: f60d map-marker-times: changes: - 5.2.0 label: Map Marker Times search: terms: - archive - delete - remove - x styles: - solid - regular - light unicode: f60e map-pin: changes: - '4.4' - 5.0.0 - 5.2.0 label: Map Pin search: terms: - address - coordinates - gps - localize - location - map - marker - place - position - travel - where styles: - solid - regular - light unicode: f276 map-signs: changes: - '4.4' - 5.0.0 - 5.2.0 label: Map Signs search: terms: [] styles: - solid - regular - light unicode: f277 markdown: changes: - 5.2.0 label: Markdown search: terms: [] styles: - brands unicode: f60f marker: changes: - 5.1.0 label: Marker search: terms: - edit - sharpie - update - write styles: - solid - regular - light unicode: f5a1 mars: changes: - '4.3' - 5.0.0 label: Mars search: terms: - male styles: - solid - regular - light unicode: f222 mars-double: changes: - '4.3' - 5.0.0 label: Mars Double search: terms: [] styles: - solid - regular - light unicode: f227 mars-stroke: changes: - '4.3' - 5.0.0 label: Mars Stroke search: terms: [] styles: - solid - regular - light unicode: f229 mars-stroke-h: changes: - '4.3' - 5.0.0 label: Mars Stroke Horizontal search: terms: [] styles: - solid - regular - light unicode: f22b mars-stroke-v: changes: - '4.3' - 5.0.0 label: Mars Stroke Vertical search: terms: [] styles: - solid - regular - light unicode: f22a mask: changes: - 5.4.0 label: Mask search: terms: - costume - disguise - halloween - holiday - secret - super hero styles: - solid - regular - light unicode: f6fa mastodon: changes: - 5.0.11 label: Mastodon search: terms: [] styles: - brands unicode: f4f6 maxcdn: changes: - '3.1' - 5.0.0 label: MaxCDN search: terms: [] styles: - brands unicode: f136 medal: changes: - 5.1.0 label: Medal search: terms: [] styles: - solid - regular - light unicode: f5a2 medapps: changes: - 5.0.0 label: MedApps search: terms: [] styles: - brands unicode: f3c6 medium: changes: - '4.3' - 5.0.0 label: Medium search: terms: [] styles: - brands unicode: f23a medium-m: changes: - 5.0.0 label: Medium M search: terms: [] styles: - brands unicode: f3c7 medkit: changes: - '3' - 5.0.0 label: medkit search: terms: - first aid - firstaid - health - help - support styles: - solid - regular - light unicode: f0fa medrt: changes: - 5.0.0 label: MRT search: terms: [] styles: - brands unicode: f3c8 meetup: changes: - '4.7' - 5.0.0 label: Meetup search: terms: [] styles: - brands unicode: f2e0 megaphone: changes: - 5.3.0 label: Megaphone search: terms: - announcement - broadcast - bullhorn - louder - share styles: - solid - regular - light unicode: f675 megaport: changes: - 5.1.0 label: Megaport search: terms: [] styles: - brands unicode: f5a3 meh: changes: - '3.1' - 5.0.0 - 5.0.9 - 5.1.0 label: Neutral Face search: terms: - emoticon - face - neutral - rating styles: - solid - regular - light unicode: f11a meh-blank: changes: - 5.1.0 label: Face Without Mouth search: terms: - emoticon - face - neutral - rating styles: - solid - regular - light unicode: f5a4 meh-rolling-eyes: changes: - 5.1.0 label: Face With Rolling Eyes search: terms: - emoticon - face - neutral - rating styles: - solid - regular - light unicode: f5a5 memory: changes: - 5.0.13 label: Memory search: terms: - DIMM - RAM styles: - solid - regular - light unicode: f538 menorah: changes: - 5.3.0 - 5.4.0 label: Menorah search: terms: - candle - hanukkah - jewish - judaism - light styles: - solid - regular - light unicode: f676 mercury: changes: - '4.3' - 5.0.0 label: Mercury search: terms: - transgender styles: - solid - regular - light unicode: f223 meteor: changes: - 5.5.0 label: Meteor search: terms: [] styles: - solid - regular - light unicode: f753 microchip: changes: - '4.7' - 5.0.0 label: Microchip search: terms: - cpu - processor styles: - solid - regular - light unicode: f2db microphone: changes: - '3.1' - 5.0.0 - 5.0.13 label: microphone search: terms: - record - sound - voice styles: - solid - regular - light unicode: f130 microphone-alt: changes: - 5.0.0 - 5.0.13 label: Alternate Microphone search: terms: - record - sound - voice styles: - solid - regular - light unicode: f3c9 microphone-alt-slash: changes: - 5.0.13 label: Alternate Microphone Slash search: terms: - disable - mute - record - sound - voice styles: - solid - regular - light unicode: f539 microphone-slash: changes: - '3.1' - 5.0.0 - 5.0.13 label: Microphone Slash search: terms: - disable - mute - record - sound - voice styles: - solid - regular - light unicode: f131 microscope: changes: - 5.2.0 label: Microscope search: terms: [] styles: - solid - regular - light unicode: f610 microsoft: changes: - 5.0.0 label: Microsoft search: terms: [] styles: - brands unicode: f3ca mind-share: changes: - 5.3.0 label: Mind Share search: terms: - brain - brainstorming - meeting - planning styles: - solid - regular - light unicode: f677 minus: changes: - '1' - 5.0.0 label: minus search: terms: - collapse - delete - hide - minify - negative - remove - trash styles: - solid - regular - light unicode: f068 minus-circle: changes: - '1' - 5.0.0 label: Minus Circle search: terms: - delete - hide - negative - remove - trash styles: - solid - regular - light unicode: f056 minus-hexagon: changes: - 5.0.0 label: Minus Hexagon search: terms: - delete - hide - negative - remove - trash styles: - solid - regular - light unicode: f307 minus-octagon: changes: - 5.0.0 label: Minus Octagon search: terms: - delete - hide - negative - remove - trash styles: - solid - regular - light unicode: f308 minus-square: changes: - '3.1' - 5.0.0 label: Minus Square search: terms: - collapse - delete - hide - minify - negative - remove - trash styles: - solid - regular - light unicode: f146 mix: changes: - 5.0.0 - 5.0.3 label: Mix search: terms: [] styles: - brands unicode: f3cb mixcloud: changes: - '4.5' - 5.0.0 label: Mixcloud search: terms: [] styles: - brands unicode: f289 mizuni: changes: - 5.0.0 label: Mizuni search: terms: [] styles: - brands unicode: f3cc mobile: changes: - '3' - 5.0.0 label: Mobile Phone search: terms: - apple - call - cell phone - cellphone - device - iphone - number - screen - telephone - text styles: - solid - regular - light unicode: f10b mobile-alt: changes: - 5.0.0 label: Alternate Mobile search: terms: - apple - call - cell phone - cellphone - device - iphone - number - screen - telephone - text styles: - solid - regular - light unicode: f3cd mobile-android: changes: - 5.0.0 label: Mobile Android search: terms: - android - call - cell phone - cellphone - device - number - screen - telephone - text styles: - solid - regular - light unicode: f3ce mobile-android-alt: changes: - 5.0.0 label: Alternate Mobile Android search: terms: - android - call - cell phone - cellphone - device - number - screen - telephone - text styles: - solid - regular - light unicode: f3cf modx: changes: - '4.5' - 5.0.0 label: MODX search: terms: [] styles: - brands unicode: f285 monero: changes: - 5.0.0 label: Monero search: terms: [] styles: - brands unicode: f3d0 money-bill: changes: - '2' - 5.0.0 - 5.0.13 label: Money Bill search: terms: - buy - cash - checkout - money - payment - price - purchase styles: - solid - regular - light unicode: f0d6 money-bill-alt: changes: - 5.0.0 - 5.0.13 label: Alternate Money Bill search: terms: - buy - cash - checkout - money - payment - price - purchase styles: - solid - regular - light unicode: f3d1 money-bill-wave: changes: - 5.0.13 label: Wavy Money Bill search: terms: [] styles: - solid - regular - light unicode: f53a money-bill-wave-alt: changes: - 5.0.13 label: Alternate Wavy Money Bill search: terms: [] styles: - solid - regular - light unicode: f53b money-check: changes: - 5.0.13 label: Money Check search: terms: - bank check - cheque styles: - solid - regular - light unicode: f53c money-check-alt: changes: - 5.0.13 label: Alternate Money Check search: terms: - bank check - cheque styles: - solid - regular - light unicode: f53d monitor-heart-rate: changes: - 5.2.0 label: Monitor Heart Rate search: terms: [] styles: - solid - regular - light unicode: f611 monkey: changes: - 5.4.0 label: Monkey search: terms: - banana - fauna - mammmal - tail styles: - solid - regular - light unicode: f6fb monument: changes: - 5.1.0 label: Monument search: terms: - building - historic - memoroable styles: - solid - regular - light unicode: f5a6 moon: changes: - '3.2' - 5.0.0 label: Moon search: terms: - contrast - crescent - darker - lunar - night styles: - solid - regular - light unicode: f186 moon-cloud: changes: - 5.5.0 label: Moon with Cloud search: terms: [] styles: - solid - regular - light unicode: f754 moon-stars: changes: - 5.5.0 label: Moon with Stars search: terms: - crescent - lunar styles: - solid - regular - light unicode: f755 mortar-pestle: changes: - 5.1.0 label: Mortar Pestle search: terms: - crush - culinary - grind - medical - mix - spices styles: - solid - regular - light unicode: f5a7 mosque: changes: - 5.3.0 label: Mosque search: terms: - building - islam - muslim styles: - solid - regular - light unicode: f678 motorcycle: changes: - '4.3' - 5.0.0 label: Motorcycle search: terms: - bike - machine - transportation - vehicle styles: - solid - regular - light unicode: f21c mountain: changes: - 5.4.0 label: Mountain search: terms: [] styles: - solid - regular - light unicode: f6fc mountains: changes: - 5.4.0 label: Mountains search: terms: [] styles: - solid - regular - light unicode: f6fd mouse-pointer: changes: - '4.4' - 5.0.0 - 5.0.3 label: Mouse Pointer search: terms: - select styles: - solid - regular - light unicode: f245 music: changes: - '1' - 5.0.0 - 5.2.0 label: Music search: terms: - note - sound styles: - solid - regular - light unicode: f001 napster: changes: - 5.0.0 label: Napster search: terms: [] styles: - brands unicode: f3d2 narwhal: changes: - 5.4.0 label: Narwhal search: terms: - fauna - mammmal styles: - solid - regular - light unicode: f6fe neos: changes: - 5.2.0 label: Neos search: terms: [] styles: - brands unicode: f612 network-wired: changes: - 5.4.0 label: Wired Network search: terms: [] styles: - solid - regular - light unicode: f6ff neuter: changes: - '4.3' - 5.0.0 label: Neuter search: terms: [] styles: - solid - regular - light unicode: f22c newspaper: changes: - '4.2' - 5.0.0 label: Newspaper search: terms: - article - press styles: - solid - regular - light unicode: f1ea nimblr: changes: - 5.1.0 label: Nimblr search: terms: [] styles: - brands unicode: f5a8 nintendo-switch: changes: - 5.0.0 label: Nintendo Switch search: terms: [] styles: - brands unicode: f418 node: changes: - 5.0.0 label: Node.js search: terms: [] styles: - brands unicode: f419 node-js: changes: - 5.0.0 - 5.0.3 label: Node.js JS search: terms: [] styles: - brands unicode: f3d3 not-equal: changes: - 5.0.13 label: Not Equal search: terms: [] styles: - solid - regular - light unicode: f53e notes-medical: changes: - 5.0.7 label: Medical Notes search: terms: [] styles: - solid - regular - light unicode: f481 npm: changes: - 5.0.0 label: npm search: terms: [] styles: - brands unicode: f3d4 ns8: changes: - 5.0.0 label: NS8 search: terms: [] styles: - brands unicode: f3d5 nutritionix: changes: - 5.0.0 label: Nutritionix search: terms: [] styles: - brands unicode: f3d6 object-group: changes: - '4.4' - 5.0.0 label: Object Group search: terms: - design styles: - solid - regular - light unicode: f247 object-ungroup: changes: - '4.4' - 5.0.0 label: Object Ungroup search: terms: - design styles: - solid - regular - light unicode: f248 octagon: changes: - 5.0.0 label: Octagon search: terms: [] styles: - solid - regular - light unicode: f306 odnoklassniki: changes: - '4.4' - 5.0.0 label: Odnoklassniki search: terms: [] styles: - brands unicode: f263 odnoklassniki-square: changes: - '4.4' - 5.0.0 label: Odnoklassniki Square search: terms: [] styles: - brands unicode: f264 oil-can: changes: - 5.2.0 label: Oil Can search: terms: [] styles: - solid - regular - light unicode: f613 oil-temp: changes: - 5.2.0 label: Oil Temp search: terms: [] styles: - solid - regular - light unicode: f614 old-republic: changes: - 5.0.12 label: Old Republic search: terms: - politics - star wars styles: - brands unicode: f510 om: changes: - 5.3.0 label: Om search: terms: - buddhism - hinduism - jainism - mantra styles: - solid - regular - light unicode: f679 omega: changes: - 5.3.0 label: Omega search: terms: [] styles: - solid - regular - light unicode: f67a opencart: changes: - '4.4' - 5.0.0 label: OpenCart search: terms: [] styles: - brands unicode: f23d openid: changes: - '4.1' - 5.0.0 label: OpenID search: terms: [] styles: - brands unicode: f19b opera: changes: - '4.4' - 5.0.0 label: Opera search: terms: [] styles: - brands unicode: f26a optin-monster: changes: - '4.4' - 5.0.0 label: Optin Monster search: terms: [] styles: - brands unicode: f23c osi: changes: - 5.0.0 label: Open Source Initiative search: terms: [] styles: - brands unicode: f41a otter: changes: - 5.4.0 label: Otter search: terms: - fauna - mammmal styles: - solid - regular - light unicode: f700 outdent: changes: - '1' - 5.0.0 label: Outdent search: terms: [] styles: - solid - regular - light unicode: f03b page4: changes: - 5.0.0 label: page4 Corporation search: terms: [] styles: - brands unicode: f3d7 pagelines: changes: - '4' - 5.0.0 label: Pagelines search: terms: - eco - flora - leaf - leaves - nature - plant - tree styles: - brands unicode: f18c paint-brush: changes: - '4.2' - 5.0.0 - 5.1.0 label: Paint Brush search: terms: [] styles: - solid - regular - light unicode: f1fc paint-brush-alt: changes: - 5.1.0 label: Alternate Paint Brush search: terms: [] styles: - solid - regular - light unicode: f5a9 paint-roller: changes: - 5.1.0 label: Paint Roller search: terms: - brush - painting - tool styles: - solid - regular - light unicode: f5aa palette: changes: - 5.0.13 label: Palette search: terms: - colors - painting styles: - solid - regular - light unicode: f53f palfed: changes: - 5.0.0 - 5.0.3 label: Palfed search: terms: [] styles: - brands unicode: f3d8 pallet: changes: - 5.0.7 label: Pallet search: terms: [] styles: - solid - regular - light unicode: f482 pallet-alt: changes: - 5.0.7 label: Alternate Pallet search: terms: [] styles: - solid - regular - light unicode: f483 paper-plane: changes: - '4.1' - 5.0.0 label: Paper Plane search: terms: [] styles: - solid - regular - light unicode: f1d8 paperclip: changes: - '2' - 5.0.0 label: Paperclip search: terms: - attachment styles: - solid - regular - light unicode: f0c6 parachute-box: changes: - 5.0.9 label: Parachute Box search: terms: - aid - assistance - rescue - supplies styles: - solid - regular - light unicode: f4cd paragraph: changes: - '4.1' - 5.0.0 label: paragraph search: terms: [] styles: - solid - regular - light unicode: f1dd parking: changes: - 5.0.13 label: Parking search: terms: [] styles: - solid - regular - light unicode: f540 parking-circle: changes: - 5.2.0 label: Parking Circle search: terms: [] styles: - solid - regular - light unicode: f615 parking-circle-slash: changes: - 5.2.0 label: Parking Circle-slash search: terms: [] styles: - solid - regular - light unicode: f616 parking-slash: changes: - 5.2.0 label: Parking Slash search: terms: [] styles: - solid - regular - light unicode: f617 passport: changes: - 5.1.0 label: Passport search: terms: - document - identification - issued styles: - solid - regular - light unicode: f5ab pastafarianism: changes: - 5.3.0 label: Pastafarianism search: terms: - agnosticism - atheism - flying spaghetti monster - fsm styles: - solid - regular - light unicode: f67b paste: changes: - '2' - 5.0.0 label: Paste search: terms: - clipboard - copy styles: - solid - regular - light unicode: f0ea patreon: changes: - 5.0.0 - 5.0.3 label: Patreon search: terms: [] styles: - brands unicode: f3d9 pause: changes: - '1' - 5.0.0 label: pause search: terms: - wait styles: - solid - regular - light unicode: f04c pause-circle: changes: - '4.5' - 5.0.0 label: Pause Circle search: terms: [] styles: - solid - regular - light unicode: f28b paw: changes: - '4.1' - 5.0.0 label: Paw search: terms: - animal - pet styles: - solid - regular - light unicode: f1b0 paw-alt: changes: - 5.4.0 label: Paw Alt search: terms: - pet styles: - solid - regular - light unicode: f701 paw-claws: changes: - 5.4.0 label: Paw Claws search: terms: - Dungeons & Dragons - animal - beast - d&d - dnd - fantasy - pet styles: - solid - regular - light unicode: f702 paypal: changes: - '4.2' - 5.0.0 label: Paypal search: terms: [] styles: - brands unicode: f1ed peace: changes: - 5.3.0 label: Peace search: terms: [] styles: - solid - regular - light unicode: f67c pegasus: changes: - 5.4.0 label: Pegasus search: terms: - fantasy - horse - wings styles: - solid - regular - light unicode: f703 pen: changes: - 5.0.0 - 5.1.0 label: Pen search: terms: - design - edit - update - write styles: - solid - regular - light unicode: f304 pen-alt: changes: - 5.0.0 - 5.1.0 label: Alternate Pen search: terms: - design - edit - update - write styles: - solid - regular - light unicode: f305 pen-fancy: changes: - 5.1.0 label: Pen Fancy search: terms: - design - edit - fountain pen - update - write styles: - solid - regular - light unicode: f5ac pen-nib: changes: - 5.1.0 label: Pen Nib search: terms: - design - edit - fountain pen - update - write styles: - solid - regular - light unicode: f5ad pen-square: changes: - '3.1' - 5.0.0 label: Pen Square search: terms: - edit - pencil-square - update - write styles: - solid - regular - light unicode: f14b pencil: changes: - '1' - 5.0.0 label: pencil search: terms: - design - edit - update - write styles: - solid - regular - light unicode: f040 pencil-alt: changes: - 5.0.0 label: Alternate Pencil search: terms: - design - edit - pencil - update - write styles: - solid - regular - light unicode: f303 pencil-paintbrush: changes: - 5.2.0 label: Pencil Paintbrush search: terms: [] styles: - solid - regular - light unicode: f618 pencil-ruler: changes: - 5.1.0 label: Pencil Ruler search: terms: [] styles: - solid - regular - light unicode: f5ae pennant: changes: - 5.0.5 label: Pennant search: terms: [] styles: - solid - regular - light unicode: f456 penny-arcade: changes: - 5.4.0 label: Penny Arcade search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - game - gaming - pax - tabletop styles: - brands unicode: f704 people-carry: changes: - 5.0.9 label: People Carry search: terms: - movers styles: - solid - regular - light unicode: f4ce percent: changes: - '4.5' - 5.0.0 label: Percent search: terms: [] styles: - solid - regular - light unicode: f295 percentage: changes: - 5.0.13 label: Percentage search: terms: [] styles: - solid - regular - light unicode: f541 periscope: changes: - 5.0.0 label: Periscope search: terms: [] styles: - brands unicode: f3da person-booth: changes: - 5.5.0 label: Person Entering Booth search: terms: - changing - changing room - election - human - person - vote - voting styles: - solid - regular - light unicode: f756 person-carry: changes: - 5.0.9 label: Person Carry search: terms: - human - lift - mover - person - transport styles: - solid - regular - light unicode: f4cf person-dolly: changes: - 5.0.9 label: Person and Dolly search: terms: - human - lift - mover - person - transport styles: - solid - regular - light unicode: f4d0 person-dolly-empty: changes: - 5.0.9 label: Person and Empty Dolly search: terms: - human - lift - mover - person - transport styles: - solid - regular - light unicode: f4d1 person-sign: changes: - 5.5.0 label: Person Holding Sign search: terms: - advocate - human - information - person - protest - protester - volunteer styles: - solid - regular - light unicode: f757 phabricator: changes: - 5.0.0 label: Phabricator search: terms: [] styles: - brands unicode: f3db phoenix-framework: changes: - 5.0.0 - 5.0.3 label: Phoenix Framework search: terms: [] styles: - brands unicode: f3dc phoenix-squadron: changes: - 5.0.12 label: Phoenix Squadron search: terms: [] styles: - brands unicode: f511 phone: changes: - '2' - 5.0.0 label: Phone search: terms: - call - earphone - number - support - telephone - voice styles: - solid - regular - light unicode: f095 phone-office: changes: - 5.3.0 label: Office Phone search: terms: [] styles: - solid - regular - light unicode: f67d phone-plus: changes: - 5.0.9 label: Phone Plus search: terms: - positive styles: - solid - regular - light unicode: f4d2 phone-slash: changes: - 5.0.0 - 5.0.9 label: Phone Slash search: terms: [] styles: - solid - regular - light unicode: f3dd phone-square: changes: - '2' - 5.0.0 label: Phone Square search: terms: - call - number - support - telephone - voice styles: - solid - regular - light unicode: f098 phone-volume: changes: - '4.6' - 5.0.0 - 5.0.3 label: Phone Volume search: terms: - telephone - volume-control-phone styles: - solid - regular - light unicode: f2a0 php: changes: - 5.0.5 label: PHP search: terms: [] styles: - brands unicode: f457 pi: changes: - 5.3.0 label: Pi search: terms: [] styles: - solid - regular - light unicode: f67e pie: changes: - 5.4.0 label: Pie search: terms: [] styles: - solid - regular - light unicode: f705 pied-piper: changes: - '4.6' - 5.0.0 - 5.0.10 label: Pied Piper Logo search: terms: [] styles: - brands unicode: f2ae pied-piper-alt: changes: - '4.1' - 5.0.0 label: Alternate Pied Piper Logo search: terms: [] styles: - brands unicode: f1a8 pied-piper-hat: changes: - 5.0.10 label: Pied Piper-hat search: terms: - clothing styles: - brands unicode: f4e5 pied-piper-pp: changes: - '4.1' - 5.0.0 label: Pied Piper PP Logo (Old) search: terms: [] styles: - brands unicode: f1a7 pig: changes: - 5.4.0 label: Pig search: terms: - agriculture - farm - fauna - mammmal - oink styles: - solid - regular - light unicode: f706 piggy-bank: changes: - 5.0.9 label: Piggy Bank search: terms: - save - savings styles: - solid - regular - light unicode: f4d3 pills: changes: - 5.0.7 label: Pills search: terms: - drugs - medicine styles: - solid - regular - light unicode: f484 pinterest: changes: - '2' - 5.0.0 label: Pinterest search: terms: [] styles: - brands unicode: f0d2 pinterest-p: changes: - '4.3' - 5.0.0 label: Pinterest P search: terms: [] styles: - brands unicode: f231 pinterest-square: changes: - '2' - 5.0.0 label: Pinterest Square search: terms: [] styles: - brands unicode: f0d3 place-of-worship: changes: - 5.3.0 label: Place Of Worship search: terms: [] styles: - solid - regular - light unicode: f67f plane: changes: - '1' - 5.0.0 - 5.0.13 label: plane search: terms: - airplane - destination - fly - location - mode - travel - trip styles: - solid - regular - light unicode: f072 plane-alt: changes: - 5.0.0 label: Alternate Plane search: terms: [] styles: - solid - regular - light unicode: f3de plane-arrival: changes: - 5.1.0 label: Plane Arrival search: terms: - airplane - arriving - destination - fly - land - landing - location - mode - travel - trip styles: - solid - regular - light unicode: f5af plane-departure: changes: - 5.1.0 label: Plane Departure search: terms: - airplane - departing - destination - fly - location - mode - take off - taking off - travel - trip styles: - solid - regular - light unicode: f5b0 play: changes: - '1' - 5.0.0 label: play search: terms: - music - playing - sound - start styles: - solid - regular - light unicode: f04b play-circle: changes: - '3.1' - 5.0.0 label: Play Circle search: terms: - playing - start styles: - solid - regular - light unicode: f144 playstation: changes: - 5.0.0 label: PlayStation search: terms: [] styles: - brands unicode: f3df plug: changes: - '4.2' - 5.0.0 label: Plug search: terms: - connect - online - power styles: - solid - regular - light unicode: f1e6 plus: changes: - '1' - 5.0.0 - 5.0.13 label: plus search: terms: - add - create - expand - new - positive styles: - solid - regular - light unicode: f067 plus-circle: changes: - '1' - 5.0.0 label: Plus Circle search: terms: - add - create - expand - new - positive styles: - solid - regular - light unicode: f055 plus-hexagon: changes: - 5.0.0 label: Plus Hexagon search: terms: - add - create - expand - new - positive styles: - solid - regular - light unicode: f300 plus-octagon: changes: - 5.0.0 label: Plus Octagon search: terms: - add - create - expand - new - positive styles: - solid - regular - light unicode: f301 plus-square: changes: - '3' - 5.0.0 label: Plus Square search: terms: - add - create - expand - new - positive styles: - solid - regular - light unicode: f0fe podcast: changes: - '4.7' - 5.0.0 label: Podcast search: terms: [] styles: - solid - regular - light unicode: f2ce podium: changes: - 5.3.0 label: Podium search: terms: - lecture - panel - seminar - speak - speaker - speech - talk styles: - solid - regular - light unicode: f680 podium-star: changes: - 5.5.0 label: Podium with Star search: terms: - debate - election - keynote - politics - speak - speaker - speech styles: - solid - regular - light unicode: f758 poll: changes: - 5.3.0 label: Poll search: terms: - results - survey - vote - voting styles: - solid - regular - light unicode: f681 poll-h: changes: - 5.3.0 label: Poll H search: terms: - results - survey - vote - voting styles: - solid - regular - light unicode: f682 poll-people: changes: - 5.5.0 label: Poll People search: terms: - candidates - election - people - person - results - survey - vote - voting styles: - solid - regular - light unicode: f759 poo: changes: - 5.0.0 - 5.0.9 label: Poo search: terms: [] styles: - solid - regular - light unicode: f2fe poo-storm: changes: - 5.5.0 label: Poo Storm search: terms: - mess - poop - shit styles: - solid - regular - light unicode: f75a poop: changes: - 5.2.0 label: Poop search: terms: [] styles: - solid - regular - light unicode: f619 portrait: changes: - 5.0.0 - 5.0.3 label: Portrait search: terms: [] styles: - solid - regular - light unicode: f3e0 pound-sign: changes: - '3.2' - 5.0.0 label: Pound Sign search: terms: - gbp styles: - solid - regular - light unicode: f154 power-off: changes: - '1' - 5.0.0 label: Power Off search: terms: - 'on' - reboot - restart styles: - solid - regular - light unicode: f011 pray: changes: - 5.3.0 label: Pray search: terms: [] styles: - solid - regular - light unicode: f683 praying-hands: changes: - 5.3.0 label: Praying Hands search: terms: [] styles: - solid - regular - light unicode: f684 prescription: changes: - 5.1.0 label: Prescription search: terms: - drugs - medical - medicine - rx styles: - solid - regular - light unicode: f5b1 prescription-bottle: changes: - 5.0.7 label: Prescription Bottle search: terms: - drugs - medical - medicine - rx styles: - solid - regular - light unicode: f485 prescription-bottle-alt: changes: - 5.0.7 label: Alternate Prescription Bottle search: terms: - drugs - medical - medicine - rx styles: - solid - regular - light unicode: f486 presentation: changes: - 5.3.0 label: Presentation search: terms: - keynote - lecture - panel - powerpoint - ppt - seminar - slides - speak - speaker - talk styles: - solid - regular - light unicode: f685 print: changes: - '1' - 5.0.0 - 5.3.0 label: print search: terms: [] styles: - solid - regular - light unicode: f02f print-slash: changes: - 5.3.0 label: Print Slash search: terms: [] styles: - solid - regular - light unicode: f686 procedures: changes: - 5.0.7 label: Procedures search: terms: [] styles: - solid - regular - light unicode: f487 product-hunt: changes: - '4.5' - 5.0.0 label: Product Hunt search: terms: [] styles: - brands unicode: f288 project-diagram: changes: - 5.0.13 label: Project Diagram search: terms: [] styles: - solid - regular - light unicode: f542 pumpkin: changes: - 5.4.0 label: Pumpkin search: terms: [] styles: - solid - regular - light unicode: f707 pushed: changes: - 5.0.0 label: Pushed search: terms: [] styles: - brands unicode: f3e1 puzzle-piece: changes: - '3.1' - 5.0.0 label: Puzzle Piece search: terms: - add-on - addon - section styles: - solid - regular - light unicode: f12e python: changes: - 5.0.0 label: Python search: terms: [] styles: - brands unicode: f3e2 qq: changes: - '4.1' - 5.0.0 label: QQ search: terms: [] styles: - brands unicode: f1d6 qrcode: changes: - '1' - 5.0.0 label: qrcode search: terms: - scan styles: - solid - regular - light unicode: f029 question: changes: - '3.1' - 5.0.0 label: Question search: terms: - help - information - support - unknown styles: - solid - regular - light unicode: f128 question-circle: changes: - '1' - 5.0.0 label: Question Circle search: terms: - help - information - support - unknown styles: - solid - regular - light unicode: f059 question-square: changes: - 5.0.0 label: Question Square search: terms: - help - information - support - unknown styles: - solid - regular - light unicode: f2fd quidditch: changes: - 5.0.5 label: Quidditch search: terms: [] styles: - solid - regular - light unicode: f458 quinscape: changes: - 5.0.5 label: QuinScape search: terms: [] styles: - brands unicode: f459 quora: changes: - '4.7' - 5.0.0 label: Quora search: terms: [] styles: - brands unicode: f2c4 quote-left: changes: - '3' - 5.0.0 - 5.0.9 label: quote-left search: terms: [] styles: - solid - regular - light unicode: f10d quote-right: changes: - '3' - 5.0.0 - 5.0.9 label: quote-right search: terms: [] styles: - solid - regular - light unicode: f10e quran: changes: - 5.3.0 label: Quran search: terms: - book - islam - muslim styles: - solid - regular - light unicode: f687 r-project: changes: - 5.0.11 - 5.0.12 label: R Project search: terms: [] styles: - brands unicode: f4f7 rabbit: changes: - 5.4.0 label: Rabbit search: terms: - bunny - fast - fauna - hare - mammmal - speed - wabbit styles: - solid - regular - light unicode: f708 rabbit-fast: changes: - 5.4.0 label: Fast Rabbit search: terms: - bunny - fast - fauna - hare - mammmal - running - speed - wabbit styles: - solid - regular - light unicode: f709 racquet: changes: - 5.0.5 label: Racquet search: terms: [] styles: - solid - regular - light unicode: f45a rainbow: changes: - 5.5.0 label: Rainbow search: terms: [] styles: - solid - regular - light unicode: f75b raindrops: changes: - 5.5.0 label: Raindrops search: terms: - precipitation styles: - solid - regular - light unicode: f75c ram: changes: - 5.4.0 label: Ram search: terms: - fauna - horns - mammmal styles: - solid - regular - light unicode: f70a ramp-loading: changes: - 5.0.9 label: Ramp Loading search: terms: [] styles: - solid - regular - light unicode: f4d4 random: changes: - '1' - 5.0.0 label: random search: terms: - shuffle - sort styles: - solid - regular - light unicode: f074 ravelry: changes: - '4.7' - 5.0.0 label: Ravelry search: terms: [] styles: - brands unicode: f2d9 react: changes: - 5.0.0 label: React search: terms: [] styles: - brands unicode: f41b reacteurope: changes: - 5.5.0 label: ReactEurope search: terms: [] styles: - brands unicode: f75d readme: changes: - 5.0.9 - 5.0.10 label: ReadMe search: terms: [] styles: - brands unicode: f4d5 rebel: changes: - '4.1' - 5.0.0 label: Rebel Alliance search: terms: [] styles: - brands unicode: f1d0 receipt: changes: - 5.0.13 label: Receipt search: terms: - check - invoice - table styles: - solid - regular - light unicode: f543 rectangle-landscape: changes: - 5.0.0 label: Landscape Rectangle search: terms: [] styles: - solid - regular - light unicode: f2fa rectangle-portrait: changes: - 5.0.0 label: Portrait Rectangle search: terms: [] styles: - solid - regular - light unicode: f2fb rectangle-wide: changes: - 5.0.0 label: Wide Rectangle search: terms: [] styles: - solid - regular - light unicode: f2fc recycle: changes: - '4.1' - 5.0.0 label: Recycle search: terms: [] styles: - solid - regular - light unicode: f1b8 red-river: changes: - 5.0.0 label: red river search: terms: [] styles: - brands unicode: f3e3 reddit: changes: - '4.1' - 5.0.0 label: reddit Logo search: terms: [] styles: - brands unicode: f1a1 reddit-alien: changes: - '4.5' - 5.0.0 label: reddit Alien search: terms: [] styles: - brands unicode: f281 reddit-square: changes: - '4.1' - 5.0.0 label: reddit Square search: terms: [] styles: - brands unicode: f1a2 redo: changes: - '1' - 5.0.0 label: Redo search: terms: - forward - refresh - reload - repeat styles: - solid - regular - light unicode: f01e redo-alt: changes: - 5.0.0 label: Alternate Redo search: terms: - forward - refresh - reload - repeat styles: - solid - regular - light unicode: f2f9 registered: changes: - '4.4' - 5.0.0 label: Registered Trademark search: terms: [] styles: - solid - regular - light unicode: f25d renren: changes: - '3.2' - 5.0.0 label: Renren search: terms: [] styles: - brands unicode: f18b repeat: changes: - 5.0.0 label: Repeat search: terms: [] styles: - solid - regular - light unicode: f363 repeat-1: changes: - 5.0.0 label: Repeat 1 search: terms: [] styles: - solid - regular - light unicode: f365 repeat-1-alt: changes: - 5.0.0 label: Alternate Repeat 1 search: terms: [] styles: - solid - regular - light unicode: f366 repeat-alt: changes: - 5.0.0 label: Alternate Repeat search: terms: [] styles: - solid - regular - light unicode: f364 reply: changes: - '3' - 5.0.0 label: Reply search: terms: [] styles: - solid - regular - light unicode: f3e5 reply-all: changes: - '3.1' - 5.0.0 label: reply-all search: terms: [] styles: - solid - regular - light unicode: f122 replyd: changes: - 5.0.0 label: replyd search: terms: [] styles: - brands unicode: f3e6 republican: changes: - 5.5.0 label: Republican search: terms: - american - conservative - election - elephant - politics - republican party - right - right-wing - usa styles: - solid - regular - light unicode: f75e researchgate: changes: - 5.0.11 label: Researchgate search: terms: [] styles: - brands unicode: f4f8 resolving: changes: - 5.0.0 label: Resolving search: terms: [] styles: - brands unicode: f3e7 retweet: changes: - '1' - 5.0.0 label: Retweet search: terms: - refresh - reload - share - swap styles: - solid - regular - light unicode: f079 retweet-alt: changes: - 5.0.0 label: Alternate Retweet search: terms: - refresh - reload - share - swap styles: - solid - regular - light unicode: f361 rev: changes: - 5.1.0 - 5.1.1 label: Rev.io search: terms: [] styles: - brands unicode: f5b2 ribbon: changes: - 5.0.9 label: Ribbon search: terms: - badge - cause - lapel - pin styles: - solid - regular - light unicode: f4d6 ring: changes: - 5.4.0 label: Ring search: terms: - Dungeons & Dragons - Gollum - band - binding - d&d - dnd - fantasy - jewelry - precious styles: - solid - regular - light unicode: f70b road: changes: - '1' - 5.0.0 - 5.2.0 label: road search: terms: - street styles: - solid - regular - light unicode: f018 robot: changes: - 5.0.13 label: Robot search: terms: [] styles: - solid - regular - light unicode: f544 rocket: changes: - '3.1' - 5.0.0 label: rocket search: terms: - app styles: - solid - regular - light unicode: f135 rocketchat: changes: - 5.0.0 - 5.4.2 label: Rocket.Chat search: terms: [] styles: - brands unicode: f3e8 rockrms: changes: - 5.0.0 label: Rockrms search: terms: [] styles: - brands unicode: f3e9 route: changes: - 5.0.9 label: Route search: terms: [] styles: - solid - regular - light unicode: f4d7 route-highway: changes: - 5.2.0 - 5.3.0 label: Route Highway search: terms: [] styles: - solid - regular - light unicode: f61a route-interstate: changes: - 5.2.0 - 5.3.0 label: Route Interstate search: terms: [] styles: - solid - regular - light unicode: f61b rss: changes: - '2' - 5.0.0 label: rss search: terms: - blog styles: - solid - regular - light unicode: f09e rss-square: changes: - '3.1' - 5.0.0 label: RSS Square search: terms: - blog - feed styles: - solid - regular - light unicode: f143 ruble-sign: changes: - '4' - 5.0.0 label: Ruble Sign search: terms: - rub styles: - solid - regular - light unicode: f158 ruler: changes: - 5.0.13 label: Ruler search: terms: [] styles: - solid - regular - light unicode: f545 ruler-combined: changes: - 5.0.13 label: Ruler Combined search: terms: [] styles: - solid - regular - light unicode: f546 ruler-horizontal: changes: - 5.0.13 label: Ruler Horizontal search: terms: [] styles: - solid - regular - light unicode: f547 ruler-triangle: changes: - 5.2.0 label: Ruler Triangle search: terms: [] styles: - solid - regular - light unicode: f61c ruler-vertical: changes: - 5.0.13 label: Ruler Vertical search: terms: [] styles: - solid - regular - light unicode: f548 running: changes: - 5.4.0 label: Running search: terms: - jog - sprint styles: - solid - regular - light unicode: f70c rupee-sign: changes: - '3.2' - 5.0.0 label: Indian Rupee Sign search: terms: - indian - inr styles: - solid - regular - light unicode: f156 sad-cry: changes: - 5.1.0 label: Crying Face search: terms: - emoticon - face - tear - tears styles: - solid - regular - light unicode: f5b3 sad-tear: changes: - 5.1.0 label: Loudly Crying Face search: terms: - emoticon - face - tear - tears styles: - solid - regular - light unicode: f5b4 safari: changes: - '4.4' - 5.0.0 label: Safari search: terms: - browser styles: - brands unicode: f267 sass: changes: - 5.0.0 label: Sass search: terms: [] styles: - brands unicode: f41e save: changes: - '2' - 5.0.0 label: Save search: terms: - floppy - floppy-o styles: - solid - regular - light unicode: f0c7 scalpel: changes: - 5.2.0 label: Scalpel search: terms: [] styles: - solid - regular - light unicode: f61d scalpel-path: changes: - 5.2.0 label: Scalpel Path search: terms: [] styles: - solid - regular - light unicode: f61e scanner: changes: - 5.0.7 label: Scanner search: terms: [] styles: - solid - regular - light unicode: f488 scanner-keyboard: changes: - 5.0.7 label: Scanner Keyboard search: terms: [] styles: - solid - regular - light unicode: f489 scanner-touchscreen: changes: - 5.0.7 label: Scanner Touchscreen search: terms: [] styles: - solid - regular - light unicode: f48a scarecrow: changes: - 5.4.0 label: Scarecrow search: terms: - halloween - holiday styles: - solid - regular - light unicode: f70d schlix: changes: - 5.0.0 label: SCHLIX search: terms: [] styles: - brands unicode: f3ea school: changes: - 5.0.13 label: School search: terms: [] styles: - solid - regular - light unicode: f549 screwdriver: changes: - 5.0.13 label: Screwdriver search: terms: - admin - fix - repair - settings - tool styles: - solid - regular - light unicode: f54a scribd: changes: - '4.5' - 5.0.0 label: Scribd search: terms: [] styles: - brands unicode: f28a scroll: changes: - 5.4.0 label: Scroll search: terms: - Dungeons & Dragons - announcement - d&d - dnd - fantasy - paper styles: - solid - regular - light unicode: f70e scroll-old: changes: - 5.4.0 label: Scroll Old search: terms: - Dungeons & Dragons - ancient - announcement - d&d - dnd - fantasy - paper - relic - worn styles: - solid - regular - light unicode: f70f scrubber: changes: - 5.0.0 label: Scrubber search: terms: [] styles: - solid - regular - light unicode: f2f8 scythe: changes: - 5.4.0 label: Scythe search: terms: - Dungeons & Dragons - blade - d&d - dnd - fantasy - weapon styles: - solid - regular - light unicode: f710 search: changes: - '1' - 5.0.0 label: Search search: terms: - bigger - enlarge - magnify - preview - zoom styles: - solid - regular - light unicode: f002 search-dollar: changes: - 5.3.0 label: Search Dollar search: terms: [] styles: - solid - regular - light unicode: f688 search-location: changes: - 5.3.0 label: Search Location search: terms: [] styles: - solid - regular - light unicode: f689 search-minus: changes: - '1' - 5.0.0 - 5.0.13 label: Search Minus search: terms: - minify - negative - smaller - zoom - zoom out styles: - solid - regular - light unicode: f010 search-plus: changes: - '1' - 5.0.0 label: Search Plus search: terms: - bigger - enlarge - magnify - positive - zoom - zoom in styles: - solid - regular - light unicode: f00e searchengin: changes: - 5.0.0 label: Searchengin search: terms: [] styles: - brands unicode: f3eb seedling: changes: - 5.0.9 label: Seedling search: terms: [] styles: - solid - regular - light unicode: f4d8 sellcast: changes: - 5.0.0 label: Sellcast search: terms: - eercast styles: - brands unicode: f2da sellsy: changes: - '4.3' - 5.0.0 label: Sellsy search: terms: [] styles: - brands unicode: f213 server: changes: - '4.3' - 5.0.0 label: Server search: terms: - cpu styles: - solid - regular - light unicode: f233 servicestack: changes: - 5.0.0 label: Servicestack search: terms: [] styles: - brands unicode: f3ec shapes: changes: - 5.2.0 label: Shapes search: terms: - circle - square - triangle styles: - solid - regular - light unicode: f61f share: changes: - '1' - 5.0.0 label: Share search: terms: [] styles: - solid - regular - light unicode: f064 share-all: changes: - 5.0.0 label: Share All search: terms: [] styles: - solid - regular - light unicode: f367 share-alt: changes: - '4.1' - 5.0.0 label: Alternate Share search: terms: [] styles: - solid - regular - light unicode: f1e0 share-alt-square: changes: - '4.1' - 5.0.0 label: Alternate Share Square search: terms: [] styles: - solid - regular - light unicode: f1e1 share-square: changes: - '3.1' - 5.0.0 label: Share Square search: terms: - send - social styles: - solid - regular - light unicode: f14d sheep: changes: - 5.4.0 label: Sheep search: terms: - agriculture - farming - fauna - mammmal - wool - yarn styles: - solid - regular - light unicode: f711 shekel-sign: changes: - '4.2' - 5.0.0 label: Shekel Sign search: terms: - ils styles: - solid - regular - light unicode: f20b shield: changes: - '3.1' - 5.0.0 label: shield search: terms: - achievement - armor - award - block - cleric - defend - defense - holy - paladin - security - winner styles: - solid - regular - light unicode: f132 shield-alt: changes: - 5.0.0 label: Alternate Shield search: terms: - achievement - award - block - defend - security - winner styles: - solid - regular - light unicode: f3ed shield-check: changes: - 5.0.0 label: shield search: terms: - achievement - award - block - defend - security - success - winner styles: - solid - regular - light unicode: f2f7 shield-cross: changes: - 5.4.0 label: Shield Cross search: terms: - Dungeons & Dragons - block - crusader - d&d - defend - dnd - fantasy - security - templar styles: - solid - regular - light unicode: f712 ship: changes: - '4.3' - 5.0.0 label: Ship search: terms: - boat - sea styles: - solid - regular - light unicode: f21a shipping-fast: changes: - 5.0.7 label: Shipping Fast search: terms: [] styles: - solid - regular - light unicode: f48b shipping-timed: changes: - 5.0.7 label: Shipping Timed search: terms: [] styles: - solid - regular - light unicode: f48c shirtsinbulk: changes: - '4.3' - 5.0.0 label: Shirts in Bulk search: terms: [] styles: - brands unicode: f214 shoe-prints: changes: - 5.0.13 label: Shoe Prints search: terms: - feet - footprints - steps styles: - solid - regular - light unicode: f54b shopping-bag: changes: - '4.5' - 5.0.0 label: Shopping Bag search: terms: [] styles: - solid - regular - light unicode: f290 shopping-basket: changes: - '4.5' - 5.0.0 label: Shopping Basket search: terms: [] styles: - solid - regular - light unicode: f291 shopping-cart: changes: - '1' - 5.0.0 label: shopping-cart search: terms: - buy - checkout - payment - purchase styles: - solid - regular - light unicode: f07a shopware: changes: - 5.1.0 label: Shopware search: terms: [] styles: - brands unicode: f5b5 shovel: changes: - 5.4.0 label: Shovel search: terms: [] styles: - solid - regular - light unicode: f713 shower: changes: - '4.7' - 5.0.0 label: Shower search: terms: [] styles: - solid - regular - light unicode: f2cc shredder: changes: - 5.3.0 label: Shredder search: terms: [] styles: - solid - regular - light unicode: f68a shuttle-van: changes: - 5.1.0 label: Shuttle Van search: terms: - machine - public-transportation - transportation - vehicle styles: - solid - regular - light unicode: f5b6 shuttlecock: changes: - 5.0.5 label: Shuttlecock search: terms: [] styles: - solid - regular - light unicode: f45b sigma: changes: - 5.3.0 label: Sigma (Summation) search: terms: - summation styles: - solid - regular - light unicode: f68b sign: changes: - 5.0.9 label: Sign search: terms: [] styles: - solid - regular - light unicode: f4d9 sign-in: changes: - '1' - 5.0.0 label: Sign In search: terms: - arrow - enter - join - log in - login - sign in - sign up - signin - signup styles: - solid - regular - light unicode: f090 sign-in-alt: changes: - 5.0.0 label: Alternate Sign In search: terms: - arrow - enter - join - log in - login - sign in - sign up - sign-in - signin - signup styles: - solid - regular - light unicode: f2f6 sign-language: changes: - '4.6' - 5.0.0 label: Sign Language search: terms: [] styles: - solid - regular - light unicode: f2a7 sign-out: changes: - '1' - 5.0.0 label: Sign Out search: terms: - arrow - exit - leave - log out - logout styles: - solid - regular - light unicode: f08b sign-out-alt: changes: - 5.0.0 label: Alternate Sign Out search: terms: - arrow - exit - leave - log out - logout - sign-out styles: - solid - regular - light unicode: f2f5 signal: changes: - '1' - 5.0.0 - 5.3.0 label: signal search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f012 signal-1: changes: - 5.3.0 label: Signal 1 search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f68c signal-2: changes: - 5.3.0 label: Signal 2 search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f68d signal-3: changes: - 5.3.0 label: Signal 3 search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f68e signal-4: changes: - 5.3.0 label: Signal 4 search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f68f signal-alt: changes: - 5.3.0 label: Signal Alternate search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f690 signal-alt-1: changes: - 5.3.0 label: Signal Alternate 1 search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f691 signal-alt-2: changes: - 5.3.0 label: Signal Alternate 2 search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f692 signal-alt-3: changes: - 5.3.0 label: Signal Alternate 3 search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f693 signal-alt-slash: changes: - 5.3.0 label: Signal Alternate Slash search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f694 signal-slash: changes: - 5.3.0 label: Signal Slash search: terms: - bars - graph - online - status styles: - solid - regular - light unicode: f695 signature: changes: - 5.1.0 label: Signature search: terms: - John Hancock - cursive - name - writing styles: - solid - regular - light unicode: f5b7 simplybuilt: changes: - '4.3' - 5.0.0 label: SimplyBuilt search: terms: [] styles: - brands unicode: f215 sistrix: changes: - 5.0.0 label: SISTRIX search: terms: [] styles: - brands unicode: f3ee sitemap: changes: - '2' - 5.0.0 - 5.0.13 label: Sitemap search: terms: - directory - hierarchy - ia - information architecture - organization styles: - solid - regular - light unicode: f0e8 sith: changes: - 5.0.12 label: Sith search: terms: [] styles: - brands unicode: f512 skeleton: changes: - 5.2.0 label: Skeleton search: terms: [] styles: - solid - regular - light unicode: f620 skull: changes: - 5.0.13 label: Skull search: terms: - bones - skeleton - yorick styles: - solid - regular - light unicode: f54c skull-crossbones: changes: - 5.4.0 label: Skull & Crossbones search: terms: - Dungeons & Dragons - alert - bones - d&d - danger - dead - deadly - death - dnd - fantasy - halloween - holiday - jolly-roger - pirate - poison - skeleton - warning styles: - solid - regular - light unicode: f714 skyatlas: changes: - '4.3' - 5.0.0 - 5.0.3 label: skyatlas search: terms: [] styles: - brands unicode: f216 skype: changes: - '3.2' - 5.0.0 label: Skype search: terms: [] styles: - brands unicode: f17e slack: changes: - '4.1' - 5.0.0 label: Slack Logo search: terms: - anchor - hash - hashtag styles: - brands unicode: f198 slack-hash: changes: - 5.0.0 label: Slack Hashtag search: terms: - anchor - hash - hashtag styles: - brands unicode: f3ef slash: changes: - 5.4.0 label: Slash search: terms: [] styles: - solid - regular - light unicode: f715 sliders-h: changes: - '4.1' - 5.0.0 - 5.0.11 label: Horizontal Sliders search: terms: - settings - sliders styles: - solid - regular - light unicode: f1de sliders-h-square: changes: - 5.0.0 label: Square Horizontal Sliders search: terms: [] styles: - solid - regular - light unicode: f3f0 sliders-v: changes: - 5.0.0 - 5.0.11 label: Vertical Sliders search: terms: [] styles: - solid - regular - light unicode: f3f1 sliders-v-square: changes: - 5.0.0 label: Square Vertical Sliders search: terms: [] styles: - solid - regular - light unicode: f3f2 slideshare: changes: - '4.2' - 5.0.0 label: Slideshare search: terms: [] styles: - brands unicode: f1e7 smile: changes: - '3.1' - 5.0.0 - 5.0.9 - 5.1.0 label: Smiling Face search: terms: - approve - emoticon - face - happy - rating - satisfied styles: - solid - regular - light unicode: f118 smile-beam: changes: - 5.1.0 label: Beaming Face With Smiling Eyes search: terms: - emoticon - face - happy - positive styles: - solid - regular - light unicode: f5b8 smile-plus: changes: - 5.0.9 - 5.1.0 label: Smiling Face Plus search: terms: - emoticon - face - happy styles: - solid - regular - light unicode: f5b9 smile-wink: changes: - 5.1.0 label: Winking Face search: terms: - emoticon - face - happy styles: - solid - regular - light unicode: f4da smog: changes: - 5.5.0 label: Smog search: terms: - dragon styles: - solid - regular - light unicode: f75f smoke: changes: - 5.5.0 label: Smoke search: terms: [] styles: - solid - regular - light unicode: f760 smoking: changes: - 5.0.7 label: Smoking search: terms: - cigarette - nicotine - smoking status styles: - solid - regular - light unicode: f48d smoking-ban: changes: - 5.0.13 label: Smoking Ban search: terms: - no smoking - non-smoking styles: - solid - regular - light unicode: f54d snake: changes: - 5.4.0 label: Snake search: terms: - cobra - fauna - reptile - slither styles: - solid - regular - light unicode: f716 snapchat: changes: - '4.6' - 5.0.0 label: Snapchat search: terms: [] styles: - brands unicode: f2ab snapchat-ghost: changes: - '4.6' - 5.0.0 label: Snapchat Ghost search: terms: [] styles: - brands unicode: f2ac snapchat-square: changes: - '4.6' - 5.0.0 label: Snapchat Square search: terms: [] styles: - brands unicode: f2ad snow-blowing: changes: - 5.5.0 label: Snow Blowing search: terms: - blizzard - precipitation - storm - winter styles: - solid - regular - light unicode: f761 snowflake: changes: - '4.7' - 5.0.0 - 5.5.0 label: Snowflake search: terms: - precipitation - seasonal - winter styles: - solid - regular - light unicode: f2dc socks: changes: - 5.3.0 label: Socks search: terms: - business socks - business time - flight of the conchords - wednesday styles: - solid - regular - light unicode: f696 solar-panel: changes: - 5.1.0 label: Solar Panel search: terms: - clean - eco-friendly - energy - green - sun styles: - solid - regular - light unicode: f5ba sort: changes: - '2' - 5.0.0 label: Sort search: terms: - order styles: - solid - regular - light unicode: f0dc sort-alpha-down: changes: - '3.2' - 5.0.0 label: Sort Alpha Down search: terms: - sort-alpha-asc styles: - solid - regular - light unicode: f15d sort-alpha-up: changes: - '3.2' - 5.0.0 label: Sort Alpha Up search: terms: - sort-alpha-desc styles: - solid - regular - light unicode: f15e sort-amount-down: changes: - '3.2' - 5.0.0 label: Sort Amount Down search: terms: - sort-amount-asc styles: - solid - regular - light unicode: f160 sort-amount-up: changes: - '3.2' - 5.0.0 label: Sort Amount Up search: terms: - sort-amount-desc styles: - solid - regular - light unicode: f161 sort-down: changes: - '2' - 5.0.0 label: Sort Down (Descending) search: terms: - arrow - descending - sort-desc styles: - solid - regular - light unicode: f0dd sort-numeric-down: changes: - '3.2' - 5.0.0 label: Sort Numeric Down search: terms: - numbers - sort-numeric-asc styles: - solid - regular - light unicode: f162 sort-numeric-up: changes: - '3.2' - 5.0.0 label: Sort Numeric Up search: terms: - numbers - sort-numeric-desc styles: - solid - regular - light unicode: f163 sort-up: changes: - '2' - 5.0.0 label: Sort Up (Ascending) search: terms: - arrow - ascending - sort-asc styles: - solid - regular - light unicode: f0de soundcloud: changes: - '4.1' - 5.0.0 label: SoundCloud search: terms: [] styles: - brands unicode: f1be spa: changes: - 5.1.0 label: Spa search: terms: - flora - mindfullness - plant - wellness styles: - solid - regular - light unicode: f5bb space-shuttle: changes: - '4.1' - 5.0.0 label: Space Shuttle search: terms: - astronaut - machine - nasa - rocket - transportation styles: - solid - regular - light unicode: f197 spade: changes: - 5.0.0 label: Spade search: terms: [] styles: - solid - regular - light unicode: f2f4 speakap: changes: - 5.0.0 - 5.4.0 label: Speakap search: terms: [] styles: - brands unicode: f3f3 spider: changes: - 5.4.0 label: Spider search: terms: - arachnid - bug - charlotte - crawl - eight - halloween - holiday styles: - solid - regular - light unicode: f717 spider-black-widow: changes: - 5.4.0 label: Black Widow Spider search: terms: - alert - arachnid - bug - charlotte - crawl - danger - dangerous - deadly - eight - error - halloween - holiday styles: - solid - regular - light unicode: f718 spider-web: changes: - 5.4.0 label: Spider Web search: terms: - halloween - holiday styles: - solid - regular - light unicode: f719 spinner: changes: - '3' - 5.0.0 label: Spinner search: terms: - loading - progress styles: - solid - regular - light unicode: f110 spinner-third: changes: - 5.0.0 label: Spinner Third search: terms: [] styles: - solid - regular - light unicode: f3f4 splotch: changes: - 5.1.0 label: Splotch search: terms: [] styles: - solid - regular - light unicode: f5bc spotify: changes: - '4.1' - 5.0.0 label: Spotify search: terms: [] styles: - brands unicode: f1bc spray-can: changes: - 5.1.0 label: Spray Can search: terms: [] styles: - solid - regular - light unicode: f5bd square: changes: - '2' - 5.0.0 label: Square search: terms: - block - box styles: - solid - regular - light unicode: f0c8 square-full: changes: - 5.0.5 label: Square Full search: terms: [] styles: - solid - regular - light unicode: f45c square-root: changes: - 5.3.0 label: Square Root search: terms: [] styles: - solid - regular - light unicode: f697 square-root-alt: changes: - 5.3.0 label: Square Root Alternate search: terms: [] styles: - solid - regular - light unicode: f698 squarespace: changes: - 5.1.0 label: Squarespace search: terms: [] styles: - brands unicode: f5be squirrel: changes: - 5.4.0 label: Squirrel search: terms: [] styles: - solid - regular - light unicode: f71a stack-exchange: changes: - '4' - 5.0.0 - 5.0.3 label: Stack Exchange search: terms: [] styles: - brands unicode: f18d stack-overflow: changes: - '3.2' - 5.0.0 label: Stack Overflow search: terms: [] styles: - brands unicode: f16c staff: changes: - 5.4.0 label: Staff search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - mage - weapon styles: - solid - regular - light unicode: f71b stamp: changes: - 5.1.0 label: Stamp search: terms: [] styles: - solid - regular - light unicode: f5bf star: changes: - '1' - 5.0.0 label: Star search: terms: - achievement - award - favorite - important - night - rating - score styles: - solid - regular - light unicode: f005 star-and-crescent: changes: - 5.3.0 label: Star and Crescent search: terms: - islam - muslim styles: - solid - regular - light unicode: f699 star-exclamation: changes: - 5.0.0 label: Exclamation Star search: terms: - achievement - award - favorite - night - rating - score styles: - solid - regular - light unicode: f2f3 star-half: changes: - '1' - 5.0.0 label: star-half search: terms: - achievement - award - rating - score - star-half-empty - star-half-full styles: - solid - regular - light unicode: f089 star-half-alt: changes: - 5.1.0 label: Alternate Star Half search: terms: - achievement - award - rating - score - star-half-empty - star-half-full styles: - solid - regular - light unicode: f5c0 star-of-david: changes: - 5.3.0 label: Star of David search: terms: - jewish - judaism styles: - solid - regular - light unicode: f69a star-of-life: changes: - 5.2.0 label: Star of Life search: terms: [] styles: - solid - regular - light unicode: f621 stars: changes: - 5.5.0 label: Stars search: terms: [] styles: - solid - regular - light unicode: f762 staylinked: changes: - 5.0.0 label: StayLinked search: terms: [] styles: - brands unicode: f3f5 steam: changes: - '4.1' - 5.0.0 label: Steam search: terms: [] styles: - brands unicode: f1b6 steam-square: changes: - '4.1' - 5.0.0 label: Steam Square search: terms: [] styles: - brands unicode: f1b7 steam-symbol: changes: - 5.0.0 label: Steam Symbol search: terms: [] styles: - brands unicode: f3f6 steering-wheel: changes: - 5.2.0 label: Wheel Steering search: terms: [] styles: - solid - regular - light unicode: f622 step-backward: changes: - '1' - 5.0.0 label: step-backward search: terms: - beginning - first - previous - rewind - start styles: - solid - regular - light unicode: f048 step-forward: changes: - '1' - 5.0.0 label: step-forward search: terms: - end - last - next styles: - solid - regular - light unicode: f051 stethoscope: changes: - '3' - 5.0.0 - 5.0.7 label: Stethoscope search: terms: [] styles: - solid - regular - light unicode: f0f1 sticker-mule: changes: - 5.0.0 label: Sticker Mule search: terms: [] styles: - brands unicode: f3f7 sticky-note: changes: - '4.4' - 5.0.0 label: Sticky Note search: terms: [] styles: - solid - regular - light unicode: f249 stomach: changes: - 5.2.0 label: Stomach search: terms: [] styles: - solid - regular - light unicode: f623 stop: changes: - '1' - 5.0.0 label: stop search: terms: - block - box - square styles: - solid - regular - light unicode: f04d stop-circle: changes: - '4.5' - 5.0.0 label: Stop Circle search: terms: [] styles: - solid - regular - light unicode: f28d stopwatch: changes: - 5.0.0 label: Stopwatch search: terms: - time styles: - solid - regular - light unicode: f2f2 store: changes: - 5.0.13 label: Store search: terms: [] styles: - solid - regular - light unicode: f54e store-alt: changes: - 5.0.13 label: Alternate Store search: terms: [] styles: - solid - regular - light unicode: f54f strava: changes: - 5.0.0 - 5.0.1 label: Strava search: terms: [] styles: - brands unicode: f428 stream: changes: - 5.0.13 label: Stream search: terms: [] styles: - solid - regular - light unicode: f550 street-view: changes: - '4.3' - 5.0.0 - 5.2.0 label: Street View search: terms: - map styles: - solid - regular - light unicode: f21d strikethrough: changes: - '2' - 5.0.0 label: Strikethrough search: terms: [] styles: - solid - regular - light unicode: f0cc stripe: changes: - 5.0.0 - 5.0.3 label: Stripe search: terms: [] styles: - brands unicode: f429 stripe-s: changes: - 5.0.1 label: Stripe S search: terms: [] styles: - brands unicode: f42a stroopwafel: changes: - 5.0.13 label: Stroopwafel search: terms: - dessert - food - sweets - waffle styles: - solid - regular - light unicode: f551 studiovinari: changes: - 5.0.0 label: Studio Vinari search: terms: [] styles: - brands unicode: f3f8 stumbleupon: changes: - '4.1' - 5.0.0 label: StumbleUpon Logo search: terms: [] styles: - brands unicode: f1a4 stumbleupon-circle: changes: - '4.1' - 5.0.0 label: StumbleUpon Circle search: terms: [] styles: - brands unicode: f1a3 subscript: changes: - '3.1' - 5.0.0 label: subscript search: terms: [] styles: - solid - regular - light unicode: f12c subway: changes: - '4.3' - 5.0.0 label: Subway search: terms: - machine - railway - train - transportation - vehicle styles: - solid - regular - light unicode: f239 suitcase: changes: - '3' - 5.0.0 - 5.0.9 label: Suitcase search: terms: - baggage - luggage - move - suitcase - travel - trip styles: - solid - regular - light unicode: f0f2 suitcase-rolling: changes: - 5.1.0 label: Suitcase Rolling search: terms: [] styles: - solid - regular - light unicode: f5c1 sun: changes: - '3.2' - 5.0.0 - 5.5.0 label: Sun search: terms: - brighten - contrast - day - lighter - sol - solar - star - weather styles: - solid - regular - light unicode: f185 sun-cloud: changes: - 5.5.0 label: Sun with Cloud search: terms: [] styles: - solid - regular - light unicode: f763 sun-dust: changes: - 5.5.0 label: Sun Dust search: terms: - dry - heat styles: - solid - regular - light unicode: f764 sun-haze: changes: - 5.5.0 label: Sun Haze search: terms: - heat - sweltering styles: - solid - regular - light unicode: f765 sunrise: changes: - 5.5.0 label: Sunrise search: terms: - dawn - day - daybreak - daylight - daytime - morning - sun up styles: - solid - regular - light unicode: f766 sunset: changes: - 5.5.0 label: Sunset search: terms: - dusk - night - nighttime - sun down styles: - solid - regular - light unicode: f767 superpowers: changes: - '4.7' - 5.0.0 label: Superpowers search: terms: [] styles: - brands unicode: f2dd superscript: changes: - '3.1' - 5.0.0 label: superscript search: terms: - exponential styles: - solid - regular - light unicode: f12b supple: changes: - 5.0.0 label: Supple search: terms: [] styles: - brands unicode: f3f9 surprise: changes: - 5.1.0 label: Hushed Face search: terms: - emoticon - face - shocked styles: - solid - regular - light unicode: f5c2 swatchbook: changes: - 5.1.0 label: Swatchbook search: terms: [] styles: - solid - regular - light unicode: f5c3 swimmer: changes: - 5.1.0 label: Swimmer search: terms: - athlete - head - man - person - water styles: - solid - regular - light unicode: f5c4 swimming-pool: changes: - 5.1.0 label: Swimming Pool search: terms: - ladder - recreation - water styles: - solid - regular - light unicode: f5c5 sword: changes: - 5.4.0 label: Sword search: terms: - Dungeons & Dragons - blade - d&d - dnd - fantasy - weapon styles: - solid - regular - light unicode: f71c swords: changes: - 5.4.0 label: Swords search: terms: - Dungeons & Dragons - blade - d&d - dnd - fantasy - weapon styles: - solid - regular - light unicode: f71d synagogue: changes: - 5.3.0 label: Synagogue search: terms: - building - jewish - judaism - star of david - temple styles: - solid - regular - light unicode: f69b sync: changes: - '1' - 5.0.0 label: Sync search: terms: - exchange - refresh - reload - rotate - swap styles: - solid - regular - light unicode: f021 sync-alt: changes: - 5.0.0 label: Alternate Sync search: terms: - refresh - reload - rotate styles: - solid - regular - light unicode: f2f1 syringe: changes: - 5.0.7 label: Syringe search: terms: - immunizations - needle styles: - solid - regular - light unicode: f48e table: changes: - '2' - 5.0.0 label: table search: terms: - data - excel - spreadsheet styles: - solid - regular - light unicode: f0ce table-tennis: changes: - 5.0.5 label: Table Tennis search: terms: [] styles: - solid - regular - light unicode: f45d tablet: changes: - '3' - 5.0.0 label: tablet search: terms: - apple - device - ipad - kindle - screen styles: - solid - regular - light unicode: f10a tablet-alt: changes: - 5.0.0 label: Alternate Tablet search: terms: - apple - device - ipad - kindle - screen styles: - solid - regular - light unicode: f3fa tablet-android: changes: - 5.0.0 label: Tablet Android search: terms: - device - screen styles: - solid - regular - light unicode: f3fb tablet-android-alt: changes: - 5.0.0 label: Alternate Tablet Android search: terms: - device - screen styles: - solid - regular - light unicode: f3fc tablet-rugged: changes: - 5.0.7 label: Rugged Tablet search: terms: - device - durable - screen - tough styles: - solid - regular - light unicode: f48f tablets: changes: - 5.0.7 label: Tablets search: terms: - drugs - medicine styles: - solid - regular - light unicode: f490 tachometer: changes: - '2' - 5.0.0 - 5.2.0 label: Tachometer search: terms: - dashboard - fast - speedometer styles: - solid - regular - light unicode: f0e4 tachometer-alt: changes: - 5.0.0 - 5.2.0 label: Alternate Tachometer search: terms: - dashboard - tachometer styles: - solid - regular - light unicode: f3fd tachometer-alt-average: changes: - 5.2.0 label: Tachometer Alternate Average search: terms: [] styles: - solid - regular - light unicode: f624 tachometer-alt-fast: changes: - 5.2.0 label: Tachometer Alternate Fast search: terms: [] styles: - solid - regular - light unicode: f625 tachometer-alt-fastest: changes: - 5.2.0 label: Tachometer Alternate Fastest search: terms: [] styles: - solid - regular - light unicode: f626 tachometer-alt-slow: changes: - 5.2.0 label: Tachometer Alternate Slow search: terms: [] styles: - solid - regular - light unicode: f627 tachometer-alt-slowest: changes: - 5.2.0 label: Tachometer Alternate Slowest search: terms: [] styles: - solid - regular - light unicode: f628 tachometer-average: changes: - 5.2.0 label: Tachometer Average search: terms: [] styles: - solid - regular - light unicode: f629 tachometer-fast: changes: - 5.2.0 label: Tachometer Fast search: terms: [] styles: - solid - regular - light unicode: f62a tachometer-fastest: changes: - 5.2.0 label: Tachometer Fastest search: terms: [] styles: - solid - regular - light unicode: f62b tachometer-slow: changes: - 5.2.0 label: Tachometer Slow search: terms: [] styles: - solid - regular - light unicode: f62c tachometer-slowest: changes: - 5.2.0 label: Tachometer Slowest search: terms: [] styles: - solid - regular - light unicode: f62d tag: changes: - '1' - 5.0.0 label: tag search: terms: - label styles: - solid - regular - light unicode: f02b tags: changes: - '1' - 5.0.0 label: tags search: terms: - labels styles: - solid - regular - light unicode: f02c tally: changes: - 5.3.0 label: Tally search: terms: [] styles: - solid - regular - light unicode: f69c tape: changes: - 5.0.9 label: Tape search: terms: [] styles: - solid - regular - light unicode: f4db tasks: changes: - '2' - 5.0.0 label: Tasks search: terms: - downloading - downloads - loading - progress - settings styles: - solid - regular - light unicode: f0ae taxi: changes: - '4.1' - 5.0.0 - 5.1.0 label: Taxi search: terms: - cab - cabbie - car - car service - lyft - machine - transportation - uber - vehicle styles: - solid - regular - light unicode: f1ba teamspeak: changes: - 5.0.11 - 5.1.0 label: TeamSpeak search: terms: [] styles: - brands unicode: f4f9 teeth: changes: - 5.2.0 label: Teeth search: terms: [] styles: - solid - regular - light unicode: f62e teeth-open: changes: - 5.2.0 label: Teeth Open search: terms: [] styles: - solid - regular - light unicode: f62f telegram: changes: - '4.7' - 5.0.0 label: Telegram search: terms: [] styles: - brands unicode: f2c6 telegram-plane: changes: - 5.0.0 label: Telegram Plane search: terms: [] styles: - brands unicode: f3fe temperature-frigid: changes: - 5.5.0 label: Temperature Frigid search: terms: - cold - mercury - thermometer - winter styles: - solid - regular - light unicode: f768 temperature-high: changes: - 5.5.0 label: High Temperature search: terms: - mercury - thermometer - warm styles: - solid - regular - light unicode: f769 temperature-hot: changes: - 5.5.0 label: Temperature Hot search: terms: - heat - mercury - summer - thermometer styles: - solid - regular - light unicode: f76a temperature-low: changes: - 5.5.0 label: Low Temperature search: terms: - cool - mercury - thermometer styles: - solid - regular - light unicode: f76b tencent-weibo: changes: - '4.1' - 5.0.0 label: Tencent Weibo search: terms: [] styles: - brands unicode: f1d5 tennis-ball: changes: - 5.0.5 label: Tennis Ball search: terms: [] styles: - solid - regular - light unicode: f45e terminal: changes: - '3.1' - 5.0.0 label: Terminal search: terms: - code - command - console - prompt styles: - solid - regular - light unicode: f120 text-height: changes: - '1' - 5.0.0 label: text-height search: terms: [] styles: - solid - regular - light unicode: f034 text-width: changes: - '1' - 5.0.0 label: text-width search: terms: [] styles: - solid - regular - light unicode: f035 th: changes: - '1' - 5.0.0 label: th search: terms: - blocks - boxes - grid - squares styles: - solid - regular - light unicode: f00a th-large: changes: - '1' - 5.0.0 label: th-large search: terms: - blocks - boxes - grid - squares styles: - solid - regular - light unicode: f009 th-list: changes: - '1' - 5.0.0 label: th-list search: terms: - checklist - completed - done - finished - ol - todo - ul styles: - solid - regular - light unicode: f00b the-red-yeti: changes: - 5.3.0 label: The Red Yeti search: terms: [] styles: - brands unicode: f69d theater-masks: changes: - 5.2.0 label: Theater Masks search: terms: [] styles: - solid - regular - light unicode: f630 themeco: changes: - 5.1.0 label: Themeco search: terms: [] styles: - brands unicode: f5c6 themeisle: changes: - '4.6' - 5.0.0 label: ThemeIsle search: terms: [] styles: - brands unicode: f2b2 thermometer: changes: - 5.0.7 label: Thermometer search: terms: - mercury - status - temperature styles: - solid - regular - light unicode: f491 thermometer-empty: changes: - '4.7' - 5.0.0 label: Thermometer Empty search: terms: - mercury - status - temperature styles: - solid - regular - light unicode: f2cb thermometer-full: changes: - '4.7' - 5.0.0 label: Thermometer Full search: terms: - fever - mercury - status - temperature styles: - solid - regular - light unicode: f2c7 thermometer-half: changes: - '4.7' - 5.0.0 label: Thermometer 1/2 Full search: terms: - mercury - status - temperature styles: - solid - regular - light unicode: f2c9 thermometer-quarter: changes: - '4.7' - 5.0.0 label: Thermometer 1/4 Full search: terms: - mercury - status - temperature styles: - solid - regular - light unicode: f2ca thermometer-three-quarters: changes: - '4.7' - 5.0.0 label: Thermometer 3/4 Full search: terms: - mercury - status - temperature styles: - solid - regular - light unicode: f2c8 theta: changes: - 5.3.0 label: Theta search: terms: [] styles: - solid - regular - light unicode: f69e think-peaks: changes: - 5.4.2 label: Think Peaks search: terms: [] styles: - brands unicode: f731 thumbs-down: changes: - '3.2' - 5.0.0 label: thumbs-down search: terms: - disagree - disapprove - dislike - hand - thumbs-o-down styles: - solid - regular - light unicode: f165 thumbs-up: changes: - '3.2' - 5.0.0 label: thumbs-up search: terms: - agree - approve - favorite - hand - like - ok - okay - success - thumbs-o-up - 'yes' - you got it dude styles: - solid - regular - light unicode: f164 thumbtack: changes: - '1' - 5.0.0 label: Thumbtack search: terms: - coordinates - location - marker - pin - thumb-tack styles: - solid - regular - light unicode: f08d thunderstorm: changes: - 5.5.0 label: Thunderstorm search: terms: - bolt - lightning - precipitation - rain - storm styles: - solid - regular - light unicode: f76c thunderstorm-moon: changes: - 5.5.0 label: Thunderstorm with Moon search: terms: [] styles: - solid - regular - light unicode: f76d thunderstorm-sun: changes: - 5.5.0 label: Thunderstorm with Sun search: terms: [] styles: - solid - regular - light unicode: f76e ticket: changes: - '3.1' - 5.0.0 label: Ticket search: terms: - movie - pass - support styles: - solid - regular - light unicode: f145 ticket-alt: changes: - 5.0.0 label: Alternate Ticket search: terms: - ticket styles: - solid - regular - light unicode: f3ff tilde: changes: - 5.3.0 label: Tilde search: terms: [] styles: - solid - regular - light unicode: f69f times: changes: - '1' - 5.0.0 - 5.0.13 label: Times search: terms: - close - cross - error - exit - incorrect - notice - notification - notify - problem - wrong - x styles: - solid - regular - light unicode: f00d times-circle: changes: - '1' - 5.0.0 label: Times Circle search: terms: - close - cross - exit - incorrect - notice - notification - notify - problem - wrong - x styles: - solid - regular - light unicode: f057 times-hexagon: changes: - 5.0.0 label: Times Hexagon search: terms: - close - cross - exit - incorrect - notice - notification - notify - problem - wrong - x styles: - solid - regular - light unicode: f2ee times-octagon: changes: - 5.0.0 label: Times Octagon search: terms: - close - cross - exit - incorrect - notice - notification - notify - problem - wrong - x styles: - solid - regular - light unicode: f2f0 times-square: changes: - '4.7' - 5.0.0 label: Times Square search: terms: - close - cross - incorrect - notice - notification - notify - problem - window - wrong styles: - solid - regular - light unicode: f2d3 tint: changes: - '1' - 5.0.0 - 5.1.0 label: tint search: terms: - drop - droplet - raindrop - waterdrop styles: - solid - regular - light unicode: f043 tint-slash: changes: - 5.1.0 label: Tint Slash search: terms: [] styles: - solid - regular - light unicode: f5c7 tire: changes: - 5.2.0 label: Tire search: terms: - wheel styles: - solid - regular - light unicode: f631 tire-flat: changes: - 5.2.0 label: Tire Flat search: terms: [] styles: - solid - regular - light unicode: f632 tire-pressure-warning: changes: - 5.2.0 label: Tire Pressure-warning search: terms: [] styles: - solid - regular - light unicode: f633 tire-rugged: changes: - 5.2.0 label: Tire Rugged search: terms: [] styles: - solid - regular - light unicode: f634 tired: changes: - 5.1.0 label: Tired Face search: terms: - emoticon - face - grumpy styles: - solid - regular - light unicode: f5c8 toggle-off: changes: - '4.2' - 5.0.0 label: Toggle Off search: terms: - switch styles: - solid - regular - light unicode: f204 toggle-on: changes: - '4.2' - 5.0.0 label: Toggle On search: terms: - switch styles: - solid - regular - light unicode: f205 toilet-paper: changes: - 5.4.0 label: Toilet Paper search: terms: - bathroom - halloween - holiday - lavatory - prank - restroom - roll styles: - solid - regular - light unicode: f71e toilet-paper-alt: changes: - 5.4.0 label: Alternate Toilet Paper search: terms: - bathroom - halloween - holiday - lavatory - prank - restroom - roll styles: - solid - regular - light unicode: f71f tombstone: changes: - 5.4.0 label: Tombstone search: terms: - cemetery - cross - dead - death - delete - grave - halloween - holiday - remove styles: - solid - regular - light unicode: f720 tombstone-alt: changes: - 5.4.0 label: Alternate Tombstone search: terms: - cemetery - cross - dead - death - delete - grave - halloween - holiday - remove styles: - solid - regular - light unicode: f721 toolbox: changes: - 5.0.13 label: Toolbox search: terms: - admin - container - fix - repair - settings - tools styles: - solid - regular - light unicode: f552 tooth: changes: - 5.1.0 label: Tooth search: terms: - bicuspid - dental - molar - mouth - teeth styles: - solid - regular - light unicode: f5c9 toothbrush: changes: - 5.2.0 label: Toothbrush search: terms: [] styles: - solid - regular - light unicode: f635 torah: changes: - 5.3.0 label: Torah search: terms: - book - jewish - judaism styles: - solid - regular - light unicode: f6a0 torii-gate: changes: - 5.3.0 label: Torii Gate search: terms: - building - shintoism styles: - solid - regular - light unicode: f6a1 tornado: changes: - 5.5.0 label: Tornado search: terms: - cyclone - dorothy - landspout - toto - twister - vortext - waterspout - whirlwind styles: - solid - regular - light unicode: f76f tractor: changes: - 5.4.0 label: Tractor search: terms: [] styles: - solid - regular - light unicode: f722 trade-federation: changes: - 5.0.12 label: Trade Federation search: terms: [] styles: - brands unicode: f513 trademark: changes: - '4.4' - 5.0.0 label: Trademark search: terms: [] styles: - solid - regular - light unicode: f25c traffic-cone: changes: - 5.2.0 label: Traffic Cone search: terms: [] styles: - solid - regular - light unicode: f636 traffic-light: changes: - 5.2.0 label: Traffic Light search: terms: [] styles: - solid - regular - light unicode: f637 traffic-light-go: changes: - 5.2.0 label: Traffic Light-go search: terms: [] styles: - solid - regular - light unicode: f638 traffic-light-slow: changes: - 5.2.0 label: Traffic Light-slow search: terms: [] styles: - solid - regular - light unicode: f639 traffic-light-stop: changes: - 5.2.0 label: Traffic Light-stop search: terms: [] styles: - solid - regular - light unicode: f63a train: changes: - '4.3' - 5.0.0 label: Train search: terms: - bullet - locomotive - railway styles: - solid - regular - light unicode: f238 transgender: changes: - '4.3' - 5.0.0 label: Transgender search: terms: - intersex styles: - solid - regular - light unicode: f224 transgender-alt: changes: - '4.3' - 5.0.0 label: Alternate Transgender search: terms: [] styles: - solid - regular - light unicode: f225 trash: changes: - '4.2' - 5.0.0 label: Trash search: terms: - delete - garbage - hide - remove styles: - solid - regular - light unicode: f1f8 trash-alt: changes: - 5.0.0 label: Alternate Trash search: terms: - delete - garbage - hide - remove - trash - trash-o styles: - solid - regular - light unicode: f2ed treasure-chest: changes: - 5.4.0 label: Treasure Chest search: terms: - Dungeons & Dragons - booty - d&d - dnd - fantasy - gold - hidden - loot - reward - trap styles: - solid - regular - light unicode: f723 tree: changes: - '4.1' - 5.0.0 label: Tree search: terms: - bark - fall - flora - forest - nature - plant - seasonal styles: - solid - regular - light unicode: f1bb tree-alt: changes: - 5.0.0 label: Alternate Tree search: terms: - bark - fall - flora - forest - nature - plant - seasonal styles: - solid - regular - light unicode: f400 trees: changes: - 5.4.0 label: Trees search: terms: - bark - fall - flora - forest - nature - plant - seasonal styles: - solid - regular - light unicode: f724 trello: changes: - '3.2' - 5.0.0 label: Trello search: terms: [] styles: - brands unicode: f181 triangle: changes: - 5.0.0 label: Triangle search: terms: [] styles: - solid - regular - light unicode: f2ec tripadvisor: changes: - '4.4' - 5.0.0 label: TripAdvisor search: terms: [] styles: - brands unicode: f262 trophy: changes: - '1' - 5.0.0 label: trophy search: terms: - achievement - award - cup - game - winner styles: - solid - regular - light unicode: f091 trophy-alt: changes: - 5.0.0 label: Alternate Trophy search: terms: - achievement - award - cup - game - star - winner styles: - solid - regular - light unicode: f2eb truck: changes: - '2' - 5.0.0 - 5.0.7 label: truck search: terms: - delivery - shipping styles: - solid - regular - light unicode: f0d1 truck-container: changes: - 5.0.9 label: Truck Container search: terms: [] styles: - solid - regular - light unicode: f4dc truck-couch: changes: - 5.0.9 label: Truck Couch search: terms: [] styles: - solid - regular - light unicode: f4dd truck-loading: changes: - 5.0.9 label: Truck Loading search: terms: [] styles: - solid - regular - light unicode: f4de truck-monster: changes: - 5.2.0 label: Truck Monster search: terms: [] styles: - solid - regular - light unicode: f63b truck-moving: changes: - 5.0.9 label: Truck Moving search: terms: [] styles: - solid - regular - light unicode: f4df truck-pickup: changes: - 5.2.0 label: Truck Side search: terms: [] styles: - solid - regular - light unicode: f63c truck-ramp: changes: - 5.0.9 label: Truck Ramp search: terms: [] styles: - solid - regular - light unicode: f4e0 tshirt: changes: - 5.0.13 label: T-Shirt search: terms: - cloth - clothing styles: - solid - regular - light unicode: f553 tty: changes: - '4.2' - 5.0.0 label: TTY search: terms: [] styles: - solid - regular - light unicode: f1e4 tumblr: changes: - '3.2' - 5.0.0 label: Tumblr search: terms: [] styles: - brands unicode: f173 tumblr-square: changes: - '3.2' - 5.0.0 label: Tumblr Square search: terms: [] styles: - brands unicode: f174 turkey: changes: - 5.4.0 label: Turkey search: terms: - bird - fall - food - meal - poultry - seasonal - thanksgiving styles: - solid - regular - light unicode: f725 turtle: changes: - 5.4.0 label: Turtle search: terms: - cowabunga - donatello - fauna - leonardo - michaelangelo - raphael - reptile - shell - slow styles: - solid - regular - light unicode: f726 tv: changes: - '4.4' - 5.0.0 label: Television search: terms: - computer - display - monitor - television styles: - solid - regular - light unicode: f26c tv-retro: changes: - 5.0.0 label: Retro Televison search: terms: [] styles: - solid - regular - light unicode: f401 twitch: changes: - '4.2' - 5.0.0 label: Twitch search: terms: [] styles: - brands unicode: f1e8 twitter: changes: - '2' - 5.0.0 label: Twitter search: terms: - social network - tweet styles: - brands unicode: f099 twitter-square: changes: - '1' - 5.0.0 label: Twitter Square search: terms: - social network - tweet styles: - brands unicode: f081 typo3: changes: - 5.0.1 label: Typo3 search: terms: [] styles: - brands unicode: f42b uber: changes: - 5.0.0 label: Uber search: terms: [] styles: - brands unicode: f402 uikit: changes: - 5.0.0 label: UIkit search: terms: [] styles: - brands unicode: f403 umbrella: changes: - '2' - 5.0.0 label: Umbrella search: terms: - protection - rain styles: - solid - regular - light unicode: f0e9 umbrella-beach: changes: - 5.1.0 label: Umbrella Beach search: terms: - protection - recreation - sun styles: - solid - regular - light unicode: f5ca underline: changes: - '2' - 5.0.0 label: Underline search: terms: [] styles: - solid - regular - light unicode: f0cd undo: changes: - '2' - 5.0.0 label: Undo search: terms: - back - control z - exchange - oops - return - rotate - swap styles: - solid - regular - light unicode: f0e2 undo-alt: changes: - 5.0.0 label: Alternate Undo search: terms: - back - control z - exchange - oops - return - swap styles: - solid - regular - light unicode: f2ea unicorn: changes: - 5.4.0 label: Unicorn search: terms: - fantasy - fauna - horn - horse styles: - solid - regular - light unicode: f727 union: changes: - 5.3.0 label: Union search: terms: [] styles: - solid - regular - light unicode: f6a2 uniregistry: changes: - 5.0.0 label: Uniregistry search: terms: [] styles: - brands unicode: f404 universal-access: changes: - '4.6' - 5.0.0 label: Universal Access search: terms: [] styles: - solid - regular - light unicode: f29a university: changes: - '4.1' - 5.0.0 - 5.0.3 label: University search: terms: - bank - institution styles: - solid - regular - light unicode: f19c unlink: changes: - '3.1' - 5.0.0 label: unlink search: terms: - chain - chain-broken - remove styles: - solid - regular - light unicode: f127 unlock: changes: - '2' - 5.0.0 label: unlock search: terms: - admin - lock - password - protect styles: - solid - regular - light unicode: f09c unlock-alt: changes: - '3.1' - 5.0.0 label: Alternate Unlock search: terms: - admin - lock - password - protect styles: - solid - regular - light unicode: f13e untappd: changes: - 5.0.0 label: Untappd search: terms: [] styles: - brands unicode: f405 upload: changes: - '1' - 5.0.0 label: Upload search: terms: - export - publish styles: - solid - regular - light unicode: f093 usb: changes: - '4.5' - 5.0.0 label: USB search: terms: [] styles: - brands unicode: f287 usd-circle: changes: - 5.0.0 - 5.0.9 label: US Dollar Circle search: terms: - $ - dollar-sign - money - price - usd styles: - solid - regular - light unicode: f2e8 usd-square: changes: - 5.0.0 - 5.0.9 label: US Dollar Square search: terms: - $ - dollar-sign - money - price - usd styles: - solid - regular - light unicode: f2e9 user: changes: - '1' - 5.0.0 - 5.0.3 - 5.0.11 label: User search: terms: - account - avatar - head - human - man - person - profile styles: - solid - regular - light unicode: f007 user-alt: changes: - 5.0.0 - 5.0.3 - 5.0.11 label: Alternate User search: terms: - account - avatar - head - human - man - person - profile styles: - solid - regular - light unicode: f406 user-alt-slash: changes: - 5.0.11 label: Alternate User Slash search: terms: [] styles: - solid - regular - light unicode: f4fa user-astronaut: changes: - 5.0.11 label: User Astronaut search: terms: - avatar - clothing - cosmonaut - space - suit styles: - solid - regular - light unicode: f4fb user-chart: changes: - 5.3.0 label: User Chart search: terms: [] styles: - solid - regular - light unicode: f6a3 user-check: changes: - 5.0.11 label: User Check search: terms: [] styles: - solid - regular - light unicode: f4fc user-circle: changes: - '4.7' - 5.0.0 - 5.0.3 - 5.0.11 label: User Circle search: terms: - account - avatar - head - human - man - person - profile styles: - solid - regular - light unicode: f2bd user-clock: changes: - 5.0.11 label: User Clock search: terms: [] styles: - solid - regular - light unicode: f4fd user-cog: changes: - 5.0.11 label: User Cog search: terms: [] styles: - solid - regular - light unicode: f4fe user-crown: changes: - 5.3.0 label: User Crown search: terms: [] styles: - solid - regular - light unicode: f6a4 user-edit: changes: - 5.0.11 label: User Edit search: terms: [] styles: - solid - regular - light unicode: f4ff user-friends: changes: - 5.0.11 label: User Friends search: terms: [] styles: - solid - regular - light unicode: f500 user-graduate: changes: - 5.0.11 label: User Graduate search: terms: - cap - clothing - commencement - gown - graduation - student styles: - solid - regular - light unicode: f501 user-injured: changes: - 5.4.0 label: User Injured search: terms: - cast - ouch - sling styles: - solid - regular - light unicode: f728 user-lock: changes: - 5.0.11 label: User Lock search: terms: [] styles: - solid - regular - light unicode: f502 user-md: changes: - '2' - 5.0.0 - 5.0.3 - 5.0.7 - 5.0.11 label: user-md search: terms: - doctor - job - medical - nurse - occupation - profile styles: - solid - regular - light unicode: f0f0 user-minus: changes: - 5.0.11 label: User Minus search: terms: - delete - negative - remove styles: - solid - regular - light unicode: f503 user-ninja: changes: - 5.0.11 label: User Ninja search: terms: - assassin - avatar - dangerous - deadly - sneaky styles: - solid - regular - light unicode: f504 user-plus: changes: - '4.3' - 5.0.0 - 5.0.3 - 5.0.11 label: User Plus search: terms: - positive - sign up - signup styles: - solid - regular - light unicode: f234 user-secret: changes: - '4.3' - 5.0.0 - 5.0.3 - 5.0.11 label: User Secret search: terms: - clothing - coat - hat - incognito - privacy - spy - whisper styles: - solid - regular - light unicode: f21b user-shield: changes: - 5.0.11 label: User Shield search: terms: [] styles: - solid - regular - light unicode: f505 user-slash: changes: - 5.0.11 label: User Slash search: terms: - ban - remove styles: - solid - regular - light unicode: f506 user-tag: changes: - 5.0.11 label: User Tag search: terms: [] styles: - solid - regular - light unicode: f507 user-tie: changes: - 5.0.11 label: User Tie search: terms: - avatar - business - clothing - formal styles: - solid - regular - light unicode: f508 user-times: changes: - '4.3' - 5.0.0 - 5.0.3 - 5.0.11 label: Remove User search: terms: - archive - delete - remove - x styles: - solid - regular - light unicode: f235 users: changes: - '2' - 5.0.0 - 5.0.3 - 5.0.11 label: Users search: terms: - people - persons - profiles styles: - solid - regular - light unicode: f0c0 users-class: changes: - 5.2.0 label: Users Class search: terms: [] styles: - solid - regular - light unicode: f63d users-cog: changes: - 5.0.11 label: Users Cog search: terms: [] styles: - solid - regular - light unicode: f509 users-crown: changes: - 5.3.0 label: Users Crown search: terms: [] styles: - solid - regular - light unicode: f6a5 ussunnah: changes: - 5.0.0 label: us-Sunnah Foundation search: terms: [] styles: - brands unicode: f407 utensil-fork: changes: - 5.0.0 label: Utensil Fork search: terms: [] styles: - solid - regular - light unicode: f2e3 utensil-knife: changes: - 5.0.0 label: Utensil Knife search: terms: - cut - tool styles: - solid - regular - light unicode: f2e4 utensil-spoon: changes: - 5.0.0 label: Utensil Spoon search: terms: - spoon styles: - solid - regular - light unicode: f2e5 utensils: changes: - 5.0.0 label: Utensils search: terms: - cutlery - dinner - eat - food - knife - restaurant - spoon styles: - solid - regular - light unicode: f2e7 utensils-alt: changes: - 5.0.0 label: Alternate Utensils search: terms: [] styles: - solid - regular - light unicode: f2e6 vaadin: changes: - 5.0.0 label: Vaadin search: terms: [] styles: - brands unicode: f408 value-absolute: changes: - 5.3.0 label: Value Absolute search: terms: [] styles: - solid - regular - light unicode: f6a6 vector-square: changes: - 5.1.0 label: Vector Square search: terms: - anchors - lines - object styles: - solid - regular - light unicode: f5cb venus: changes: - '4.3' - 5.0.0 label: Venus search: terms: - female styles: - solid - regular - light unicode: f221 venus-double: changes: - '4.3' - 5.0.0 label: Venus Double search: terms: [] styles: - solid - regular - light unicode: f226 venus-mars: changes: - '4.3' - 5.0.0 label: Venus Mars search: terms: [] styles: - solid - regular - light unicode: f228 viacoin: changes: - '4.3' - 5.0.0 label: Viacoin search: terms: [] styles: - brands unicode: f237 viadeo: changes: - '4.6' - 5.0.0 label: Video search: terms: [] styles: - brands unicode: f2a9 viadeo-square: changes: - '4.6' - 5.0.0 label: Video Square search: terms: [] styles: - brands unicode: f2aa vial: changes: - 5.0.7 label: Vial search: terms: - test tube styles: - solid - regular - light unicode: f492 vials: changes: - 5.0.7 label: Vials search: terms: - lab results - test tubes styles: - solid - regular - light unicode: f493 viber: changes: - 5.0.0 - 5.0.3 label: Viber search: terms: [] styles: - brands unicode: f409 video: changes: - '1' - 5.0.0 - 5.0.9 label: Video search: terms: - camera - film - movie - record - video-camera styles: - solid - regular - light unicode: f03d video-plus: changes: - 5.0.9 label: Video Plus search: terms: - add - create - new - positive styles: - solid - regular - light unicode: f4e1 video-slash: changes: - 5.0.9 label: Video Slash search: terms: [] styles: - solid - regular - light unicode: f4e2 vihara: changes: - 5.3.0 label: Vihara search: terms: - buddhism - buddhist - building - monastery styles: - solid - regular - light unicode: f6a7 vimeo: changes: - 5.0.0 label: Vimeo search: terms: [] styles: - brands unicode: f40a vimeo-square: changes: - '4' - 5.0.0 label: Vimeo Square search: terms: [] styles: - brands unicode: f194 vimeo-v: changes: - '4.4' - 5.0.0 label: Vimeo search: terms: - vimeo styles: - brands unicode: f27d vine: changes: - '4.1' - 5.0.0 label: Vine search: terms: [] styles: - brands unicode: f1ca vk: changes: - '3.2' - 5.0.0 label: VK search: terms: [] styles: - brands unicode: f189 vnv: changes: - 5.0.0 label: VNV search: terms: [] styles: - brands unicode: f40b volcano: changes: - 5.5.0 label: Volcano search: terms: [] styles: - solid - regular - light unicode: f770 volleyball-ball: changes: - 5.0.5 label: Volleyball Ball search: terms: [] styles: - solid - regular - light unicode: f45f volume: changes: - 5.3.0 label: Volume search: terms: - audio - control - music - sound - speaker styles: - solid - regular - light unicode: f6a8 volume-down: changes: - '1' - 5.0.0 - 5.3.0 label: Volume Down search: terms: - audio - lower - music - quieter - sound - speaker styles: - solid - regular - light unicode: f027 volume-mute: changes: - 5.3.0 label: Volume Mute search: terms: [] styles: - solid - regular - light unicode: f6a9 volume-off: changes: - '1' - 5.0.0 - 5.3.0 label: Volume Off search: terms: - audio - music - mute - sound styles: - solid - regular - light unicode: f026 volume-slash: changes: - 5.0.0 - 5.3.0 label: Volume Slash search: terms: - audio - ban - music - mute - sound styles: - solid - regular - light unicode: f2e2 volume-up: changes: - '1' - 5.0.0 - 5.3.0 label: Volume Up search: terms: - audio - higher - louder - music - sound - speaker styles: - solid - regular - light unicode: f028 vote-nay: changes: - 5.5.0 label: Vote Nay search: terms: - cast - election - negative - 'no' - politics - reject - voting styles: - solid - regular - light unicode: f771 vote-yea: changes: - 5.5.0 label: Vote Yea search: terms: - accept - cast - election - politics - positive - 'yes' styles: - solid - regular - light unicode: f772 vr-cardboard: changes: - 5.4.0 label: Cardboard VR search: terms: - google - reality - virtual styles: - solid - regular - light unicode: f729 vuejs: changes: - 5.0.0 label: Vue.js search: terms: [] styles: - brands unicode: f41f walking: changes: - 5.0.13 label: Walking search: terms: [] styles: - solid - regular - light unicode: f554 wallet: changes: - 5.0.13 label: Wallet search: terms: [] styles: - solid - regular - light unicode: f555 wand: changes: - 5.4.0 - 5.4.1 label: Wand search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - halloween - holiday - weapon styles: - solid - regular - light unicode: f72a wand-magic: changes: - 5.4.0 label: Wand Magic search: terms: - autocomplete - automatic - fantasy - halloween - holiday - magic - weapon - witch - wizard styles: - solid - regular - light unicode: f72b warehouse: changes: - 5.0.7 label: Warehouse search: terms: [] styles: - solid - regular - light unicode: f494 warehouse-alt: changes: - 5.0.7 label: Alternate Warehouse search: terms: [] styles: - solid - regular - light unicode: f495 watch: changes: - 5.0.0 label: Watch search: terms: [] styles: - solid - regular - light unicode: f2e1 watch-fitness: changes: - 5.2.0 label: Watch Fitness search: terms: [] styles: - solid - regular - light unicode: f63e water: changes: - 5.5.0 label: Water search: terms: [] styles: - solid - regular - light unicode: f773 water-lower: changes: - 5.5.0 label: Lower Water Level search: terms: [] styles: - solid - regular - light unicode: f774 water-rise: changes: - 5.5.0 label: Rising Water Level search: terms: [] styles: - solid - regular - light unicode: f775 weebly: changes: - 5.1.0 label: Weebly search: terms: [] styles: - brands unicode: f5cc weibo: changes: - '3.2' - 5.0.0 label: Weibo search: terms: [] styles: - brands unicode: f18a weight: changes: - 5.0.7 label: Weight search: terms: - measurement - scale - weight styles: - solid - regular - light unicode: f496 weight-hanging: changes: - 5.1.0 label: Hanging Weight search: terms: - anvil - heavy - measurement styles: - solid - regular - light unicode: f5cd weixin: changes: - '4.1' - 5.0.0 - 5.0.3 label: Weixin (WeChat) search: terms: [] styles: - brands unicode: f1d7 whale: changes: - 5.4.0 label: Whale search: terms: - fauna - mammal - swimming styles: - solid - regular - light unicode: f72c whatsapp: changes: - '4.3' - 5.0.0 label: What's App search: terms: [] styles: - brands unicode: f232 whatsapp-square: changes: - 5.0.0 label: What's App Square search: terms: [] styles: - brands unicode: f40c wheat: changes: - 5.4.0 label: Wheat search: terms: - argriculture - fall - farming - food - grain - seasonal styles: - solid - regular - light unicode: f72d wheelchair: changes: - '4' - 5.0.0 label: Wheelchair search: terms: - handicap - person styles: - solid - regular - light unicode: f193 whistle: changes: - 5.0.5 - 5.0.7 label: Whistle search: terms: [] styles: - solid - regular - light unicode: f460 whmcs: changes: - 5.0.0 label: WHMCS search: terms: [] styles: - brands unicode: f40d wifi: changes: - '4.2' - 5.0.0 - 5.3.0 label: WiFi search: terms: [] styles: - solid - regular - light unicode: f1eb wifi-1: changes: - 5.3.0 label: Wifi 1 search: terms: [] styles: - solid - regular - light unicode: f6aa wifi-2: changes: - 5.3.0 label: Wifi 2 search: terms: [] styles: - solid - regular - light unicode: f6ab wifi-slash: changes: - 5.3.0 label: Wifi Slash search: terms: [] styles: - solid - regular - light unicode: f6ac wikipedia-w: changes: - '4.4' - 5.0.0 label: Wikipedia W search: terms: [] styles: - brands unicode: f266 wind: changes: - 5.4.0 - 5.5.0 label: Wind search: terms: - air - blow - breeze - fall - seasonal styles: - solid - regular - light unicode: f72e wind-warning: changes: - 5.5.0 label: Wind Warning search: terms: [] styles: - solid - regular - light unicode: f776 window: changes: - 5.0.0 label: Window search: terms: [] styles: - solid - regular - light unicode: f40e window-alt: changes: - 5.0.0 label: Alternate Window search: terms: [] styles: - solid - regular - light unicode: f40f window-close: changes: - '4.7' - 5.0.0 label: Window Close search: terms: [] styles: - solid - regular - light unicode: f410 window-maximize: changes: - '4.7' - 5.0.0 label: Window Maximize search: terms: [] styles: - solid - regular - light unicode: f2d0 window-minimize: changes: - '4.7' - 5.0.0 label: Window Minimize search: terms: [] styles: - solid - regular - light unicode: f2d1 window-restore: changes: - '4.7' - 5.0.0 label: Window Restore search: terms: [] styles: - solid - regular - light unicode: f2d2 windows: changes: - '3.2' - 5.0.0 label: Windows search: terms: - microsoft styles: - brands unicode: f17a windsock: changes: - 5.5.0 label: Windsock search: terms: [] styles: - solid - regular - light unicode: f777 wine-bottle: changes: - 5.4.0 label: Wine Bottle search: terms: - alcohol - beverage - drink - glass - grapes styles: - solid - regular - light unicode: f72f wine-glass: changes: - 5.0.9 - 5.1.0 label: Wine Glass search: terms: - alcohol - beverage - drink - grapes styles: - solid - regular - light unicode: f4e3 wine-glass-alt: changes: - 5.1.0 label: Alternate Wine Glas search: terms: - alcohol - beverage - drink - grapes styles: - solid - regular - light unicode: f5ce wix: changes: - 5.1.0 label: Wix search: terms: [] styles: - brands unicode: f5cf wizards-of-the-coast: changes: - 5.4.0 label: Wizards of the Coast search: terms: - Dungeons & Dragons - d&d - dnd - fantasy - game - gaming - tabletop styles: - brands unicode: f730 wolf-pack-battalion: changes: - 5.0.12 label: Wolf Pack Battalion search: terms: [] styles: - brands unicode: f514 won-sign: changes: - '3.2' - 5.0.0 label: Won Sign search: terms: - krw styles: - solid - regular - light unicode: f159 wordpress: changes: - '4.1' - 5.0.0 label: WordPress Logo search: terms: [] styles: - brands unicode: f19a wordpress-simple: changes: - 5.0.0 label: Wordpress Simple search: terms: [] styles: - brands unicode: f411 wpbeginner: changes: - '4.6' - 5.0.0 label: WPBeginner search: terms: [] styles: - brands unicode: f297 wpexplorer: changes: - '4.7' - 5.0.0 label: WPExplorer search: terms: [] styles: - brands unicode: f2de wpforms: changes: - '4.6' - 5.0.0 label: WPForms search: terms: [] styles: - brands unicode: f298 wpressr: changes: - 5.4.2 label: wpressr search: terms: - rendact styles: - brands unicode: f3e4 wrench: changes: - '2' - 5.0.0 - 5.0.13 label: Wrench search: terms: - fix - settings - spanner - tool - update styles: - solid - regular - light unicode: f0ad x-ray: changes: - 5.0.7 label: X-Ray search: terms: - radiological images - radiology styles: - solid - regular - light unicode: f497 xbox: changes: - 5.0.0 label: Xbox search: terms: [] styles: - brands unicode: f412 xing: changes: - '3.2' - 5.0.0 label: Xing search: terms: [] styles: - brands unicode: f168 xing-square: changes: - '3.2' - 5.0.0 label: Xing Square search: terms: [] styles: - brands unicode: f169 y-combinator: changes: - '4.4' - 5.0.0 label: Y Combinator search: terms: [] styles: - brands unicode: f23b yahoo: changes: - '4.1' - 5.0.0 - 5.0.3 label: Yahoo Logo search: terms: [] styles: - brands unicode: f19e yandex: changes: - 5.0.0 label: Yandex search: terms: [] styles: - brands unicode: f413 yandex-international: changes: - 5.0.0 label: Yandex International search: terms: [] styles: - brands unicode: f414 yelp: changes: - '4.2' - 5.0.0 label: Yelp search: terms: [] styles: - brands unicode: f1e9 yen-sign: changes: - '3.2' - 5.0.0 label: Yen Sign search: terms: - jpy - money styles: - solid - regular - light unicode: f157 yin-yang: changes: - 5.3.0 label: Yin Yang search: terms: - daoism - opposites - taoism styles: - solid - regular - light unicode: f6ad yoast: changes: - '4.6' - 5.0.0 - 5.0.3 label: Yoast search: terms: [] styles: - brands unicode: f2b1 youtube: changes: - '3.2' - 5.0.0 label: YouTube search: terms: - film - video - youtube-play - youtube-square styles: - brands unicode: f167 youtube-square: changes: - 5.0.3 label: YouTube Square search: terms: [] styles: - brands unicode: f431 zhihu: changes: - 5.2.0 label: Zhihu search: terms: [] styles: - brands unicode: f63f
316,911
font-awesome5-icons-pro
yml
en
yaml
data
{"qsc_code_num_words": 34726, "qsc_code_num_chars": 316911.0, "qsc_code_mean_word_length": 4.76481599, "qsc_code_frac_words_unique": 0.12244428, "qsc_code_frac_chars_top_2grams": 0.11853405, "qsc_code_frac_chars_top_3grams": 0.15153841, "qsc_code_frac_chars_top_4grams": 0.19363241, "qsc_code_frac_chars_dupe_5grams": 0.71645625, "qsc_code_frac_chars_dupe_6grams": 0.55547162, "qsc_code_frac_chars_dupe_7grams": 0.45085004, "qsc_code_frac_chars_dupe_8grams": 0.29700296, "qsc_code_frac_chars_dupe_9grams": 0.19820141, "qsc_code_frac_chars_dupe_10grams": 0.14750125, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.05668112, "qsc_code_frac_chars_whitespace": 0.37498856, "qsc_code_size_file_byte": 316911.0, "qsc_code_num_lines": 23688.0, "qsc_code_num_chars_line_max": 64.0, "qsc_code_num_chars_line_mean": 13.3785461, "qsc_code_frac_chars_alphabet": 0.77868261, "qsc_code_frac_chars_comments": 0.00019879, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.74137713, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00458264, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1uphealth/fhir-react
src/components/resources/Coverage/Coverage.stories.js
import React from 'react'; import { defaultArgTypes } from '../../defaultArgTypes'; import Coverage from './Coverage'; import fhirVersions from '../fhirResourceVersions'; import exampleCoverageDstu2 from '../../../fixtures/dstu2/resources/coverage/example1.json'; import exampleCoverageStu3 from '../../../fixtures/stu3/resources/coverage/example1.json'; import example2CoverageStu3 from '../../../fixtures/stu3/resources/coverage/example2.json'; import exampleCoverageR4 from '../../../fixtures/r4/resources/coverage/example1.json'; import example2CoverageR4 from '../../../fixtures/r4/resources/coverage/example2.json'; import fhirIcons from '../../../fixtures/example-icons'; import CoverageIcon from '../../../assets/containers/Coverage/coverage.svg'; export default { title: 'Coverage', component: Coverage, argTypes: { ...defaultArgTypes, }, }; const Template = args => <Coverage {...args} />; export const DefaultVisualizationDSTU2 = Template.bind({}); DefaultVisualizationDSTU2.args = { fhirVersion: fhirVersions.DSTU2, fhirResource: exampleCoverageDstu2, fhirIcons: require('../../../assets/containers/Coverage/coverage.svg'), }; export const ExampleOfSTU3 = Template.bind({}); ExampleOfSTU3.args = { fhirVersion: fhirVersions.STU3, fhirResource: exampleCoverageStu3, fhirIcons: CoverageIcon, }; export const Example2OfSTU3 = Template.bind({}); Example2OfSTU3.args = { fhirVersion: fhirVersions.STU3, fhirResource: example2CoverageStu3, fhirIcons: fhirIcons, }; export const ExampleOfR4 = Template.bind({}); ExampleOfR4.args = { fhirVersion: fhirVersions.R4, fhirResource: exampleCoverageR4, fhirIcons: false, }; export const Example2OfR4 = Template.bind({}); Example2OfR4.args = { fhirVersion: fhirVersions.R4, fhirResource: example2CoverageR4, fhirIcons: 'random text', }; export const ExampleWithoutFhirVersionProperty = Template.bind({}); ExampleWithoutFhirVersionProperty.args = { fhirResource: exampleCoverageStu3, };
1,987
Coverage.stories
js
en
javascript
code
{"qsc_code_num_words": 173, "qsc_code_num_chars": 1987.0, "qsc_code_mean_word_length": 8.57225434, "qsc_code_frac_words_unique": 0.27745665, "qsc_code_frac_chars_top_2grams": 0.04855024, "qsc_code_frac_chars_top_3grams": 0.09103169, "qsc_code_frac_chars_top_4grams": 0.05866487, "qsc_code_frac_chars_dupe_5grams": 0.32703978, "qsc_code_frac_chars_dupe_6grams": 0.05529332, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0247191, "qsc_code_frac_chars_whitespace": 0.10417715, "qsc_code_size_file_byte": 1987.0, "qsc_code_num_lines": 63.0, "qsc_code_num_chars_line_max": 93.0, "qsc_code_num_chars_line_mean": 31.53968254, "qsc_code_frac_chars_alphabet": 0.80842697, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.24528302, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.24006039, "qsc_code_frac_chars_long_word_length": 0.22294917, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 0.0, "qsc_codejavascript_cate_var_zero": null, "qsc_codejavascript_frac_lines_func_ratio": null, "qsc_codejavascript_num_statement_line": null, "qsc_codejavascript_score_lines_no_logic": null, "qsc_codejavascript_frac_words_legal_var_name": null, "qsc_codejavascript_frac_words_legal_func_name": null, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 1, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-admin/src/main/resources/static/ajax/libs/typeahead/bootstrap3-typeahead.min.js
!function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):e(t.jQuery)}(this,function(t){"use strict";var e=function(s,i){this.$element=t(s),this.options=t.extend({},e.defaults,i),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.select=this.options.select||this.select,this.autoSelect="boolean"!=typeof this.options.autoSelect||this.options.autoSelect,this.highlighter=this.options.highlighter||this.highlighter,this.render=this.options.render||this.render,this.updater=this.options.updater||this.updater,this.displayText=this.options.displayText||this.displayText,this.itemLink=this.options.itemLink||this.itemLink,this.itemTitle=this.options.itemTitle||this.itemTitle,this.followLinkOnSelect=this.options.followLinkOnSelect||this.followLinkOnSelect,this.source=this.options.source,this.delay=this.options.delay,this.theme=this.options.theme&&this.options.themes&&this.options.themes[this.options.theme]||e.defaults.themes[e.defaults.theme],this.$menu=t(this.options.menu||this.theme.menu),this.$appendTo=this.options.appendTo?t(this.options.appendTo):null,this.fitToElement="boolean"==typeof this.options.fitToElement&&this.options.fitToElement,this.shown=!1,this.listen(),this.showHintOnFocus=("boolean"==typeof this.options.showHintOnFocus||"all"===this.options.showHintOnFocus)&&this.options.showHintOnFocus,this.afterSelect=this.options.afterSelect,this.afterEmptySelect=this.options.afterEmptySelect,this.addItem=!1,this.value=this.$element.val()||this.$element.text(),this.keyPressed=!1,this.focused=this.$element.is(":focus"),this.changeInputOnSelect=this.options.changeInputOnSelect||this.changeInputOnSelect,this.changeInputOnMove=this.options.changeInputOnMove||this.changeInputOnMove,this.openLinkInNewTab=this.options.openLinkInNewTab||this.openLinkInNewTab,this.selectOnBlur=this.options.selectOnBlur||this.selectOnBlur,this.showCategoryHeader=this.options.showCategoryHeader||this.showCategoryHeader};e.prototype={constructor:e,setDefault:function(t){if(this.$element.data("active",t),this.autoSelect||t){var e=this.updater(t);e||(e=""),this.$element.val(this.displayText(e)||e).text(this.displayText(e)||e).change(),this.afterSelect(e)}return this.hide()},select:function(){var t=this.$menu.find(".active").data("value");if(this.$element.data("active",t),this.autoSelect||t){var e=this.updater(t);e||(e=""),this.changeInputOnSelect&&this.$element.val(this.displayText(e)||e).text(this.displayText(e)||e).change(),this.followLinkOnSelect&&this.itemLink(t)?(this.openLinkInNewTab?window.open(this.itemLink(t),"_blank"):document.location=this.itemLink(t),this.afterSelect(e)):this.followLinkOnSelect&&!this.itemLink(t)?this.afterEmptySelect(e):this.afterSelect(e)}else this.afterEmptySelect();return this.hide()},updater:function(t){return t},setSource:function(t){this.source=t},show:function(){var e,s=t.extend({},this.$element.position(),{height:this.$element[0].offsetHeight}),i="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight;if(this.shown?e=this.$menu:this.$appendTo?(e=this.$menu.appendTo(this.$appendTo),this.hasSameParent=this.$appendTo.is(this.$element.parent())):(e=this.$menu.insertAfter(this.$element),this.hasSameParent=!0),!this.hasSameParent){e.css("position","fixed");var o=this.$element.offset();s.top=o.top,s.left=o.left}var n=t(e).parent().hasClass("dropup")?"auto":s.top+s.height+i,h=t(e).hasClass("dropdown-menu-right")?"auto":s.left;return e.css({top:n,left:h}).show(),!0===this.options.fitToElement&&e.css("width",this.$element.outerWidth()+"px"),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(e){if(this.query=null!=e?e:this.$element.val(),this.query.length<this.options.minLength&&!this.options.showHintOnFocus)return this.shown?this.hide():this;var s=t.proxy(function(){t.isFunction(this.source)&&3===this.source.length?this.source(this.query,t.proxy(this.process,this),t.proxy(this.process,this)):t.isFunction(this.source)?this.source(this.query,t.proxy(this.process,this)):this.source&&this.process(this.source)},this);clearTimeout(this.lookupWorker),this.lookupWorker=setTimeout(s,this.delay)},process:function(e){var s=this;return e=t.grep(e,function(t){return s.matcher(t)}),(e=this.sorter(e)).length||this.options.addItem?(e.length>0?this.$element.data("active",e[0]):this.$element.data("active",null),"all"!=this.options.items&&(e=e.slice(0,this.options.items)),this.options.addItem&&e.push(this.options.addItem),this.render(e).show()):this.shown?this.hide():this},matcher:function(t){return~this.displayText(t).toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){for(var e,s=[],i=[],o=[];e=t.shift();){var n=this.displayText(e);n.toLowerCase().indexOf(this.query.toLowerCase())?~n.indexOf(this.query)?i.push(e):o.push(e):s.push(e)}return s.concat(i,o)},highlighter:function(t){var e=this.query;if(""===e)return t;var s,i=t.match(/(>)([^<]*)(<)/g),o=[],n=[];if(i&&i.length)for(s=0;s<i.length;++s)i[s].length>2&&o.push(i[s]);else(o=[]).push(t);e=e.replace(/[\(\)\/\.\*\+\?\[\]]/g,function(t){return"\\"+t});var h,a=new RegExp(e,"g");for(s=0;s<o.length;++s)(h=o[s].match(a))&&h.length>0&&n.push(o[s]);for(s=0;s<n.length;++s)t=t.replace(n[s],n[s].replace(a,"<strong>$&</strong>"));return t},render:function(e){var s=this,i=this,o=!1,n=[],h=s.options.separator;return t.each(e,function(t,s){t>0&&s[h]!==e[t-1][h]&&n.push({__type:"divider"}),this.showCategoryHeader&&(!s[h]||0!==t&&s[h]===e[t-1][h]||n.push({__type:"category",name:s[h]})),n.push(s)}),e=t(n).map(function(e,n){if("category"==(n.__type||!1))return t(s.options.headerHtml||s.theme.headerHtml).text(n.name)[0];if("divider"==(n.__type||!1))return t(s.options.headerDivider||s.theme.headerDivider)[0];var h=i.displayText(n);return(e=t(s.options.item||s.theme.item).data("value",n)).find(s.options.itemContentSelector||s.theme.itemContentSelector).addBack(s.options.itemContentSelector||s.theme.itemContentSelector).html(s.highlighter(h,n)),s.options.followLinkOnSelect&&e.find("a").attr("href",i.itemLink(n)),e.find("a").attr("title",i.itemTitle(n)),h==i.$element.val()&&(e.addClass("active"),i.$element.data("active",n),o=!0),e[0]}),this.autoSelect&&!o&&(e.filter(":not(.dropdown-header)").first().addClass("active"),this.$element.data("active",e.first().data("value"))),this.$menu.html(e),this},displayText:function(t){return void 0!==t&&void 0!==t.name?t.name:t},itemLink:function(t){return null},itemTitle:function(t){return null},next:function(e){var s=this.$menu.find(".active").removeClass("active").next();for(s.length||(s=t(this.$menu.find(t(this.options.item||this.theme.item).prop("tagName"))[0]));s.hasClass("divider")||s.hasClass("dropdown-header");)s=s.next();s.addClass("active");var i=this.updater(s.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(i)||i)},prev:function(e){var s=this.$menu.find(".active").removeClass("active").prev();for(s.length||(s=this.$menu.find(t(this.options.item||this.theme.item).prop("tagName")).last());s.hasClass("divider")||s.hasClass("dropdown-header");)s=s.prev();s.addClass("active");var i=this.updater(s.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(i)||i)},listen:function(){this.$element.on("focus.bootstrap3Typeahead",t.proxy(this.focus,this)).on("blur.bootstrap3Typeahead",t.proxy(this.blur,this)).on("keypress.bootstrap3Typeahead",t.proxy(this.keypress,this)).on("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead",t.proxy(this.input,this)).on("keyup.bootstrap3Typeahead",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown.bootstrap3Typeahead",t.proxy(this.keydown,this));var e=t(this.options.item||this.theme.item).prop("tagName");"ontouchstart"in document.documentElement?this.$menu.on("touchstart",e,t.proxy(this.touchstart,this)).on("touchend",e,t.proxy(this.click,this)):this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter",e,t.proxy(this.mouseenter,this)).on("mouseleave",e,t.proxy(this.mouseleave,this)).on("mousedown",t.proxy(this.mousedown,this))},destroy:function(){this.$element.data("typeahead",null),this.$element.data("active",null),this.$element.unbind("focus.bootstrap3Typeahead").unbind("blur.bootstrap3Typeahead").unbind("keypress.bootstrap3Typeahead").unbind("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead").unbind("keyup.bootstrap3Typeahead"),this.eventSupported("keydown")&&this.$element.unbind("keydown.bootstrap3-typeahead"),this.$menu.remove(),this.destroyed=!0},eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},move:function(t){if(this.shown)switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:if(t.shiftKey)return;t.preventDefault(),this.prev();break;case 40:if(t.shiftKey)return;t.preventDefault(),this.next()}},keydown:function(e){17!==e.keyCode&&(this.keyPressed=!0,this.suppressKeyPressRepeat=~t.inArray(e.keyCode,[40,38,9,13,27]),this.shown||40!=e.keyCode?this.move(e):this.lookup())},keypress:function(t){this.suppressKeyPressRepeat||this.move(t)},input:function(t){var e=this.$element.val()||this.$element.text();this.value!==e&&(this.value=e,this.lookup())},keyup:function(t){if(!this.destroyed)switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:if(!this.shown||this.showHintOnFocus&&!this.keyPressed)return;this.select();break;case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide()}},focus:function(t){this.focused||(this.focused=!0,this.keyPressed=!1,this.options.showHintOnFocus&&!0!==this.skipShowHintOnFocus&&("all"===this.options.showHintOnFocus?this.lookup(""):this.lookup())),this.skipShowHintOnFocus&&(this.skipShowHintOnFocus=!1)},blur:function(t){this.mousedover||this.mouseddown||!this.shown?this.mouseddown&&(this.skipShowHintOnFocus=!0,this.$element.focus(),this.mouseddown=!1):(this.selectOnBlur&&this.select(),this.hide(),this.focused=!1,this.keyPressed=!1)},click:function(t){t.preventDefault(),this.skipShowHintOnFocus=!0,this.select(),this.$element.focus(),this.hide()},mouseenter:function(e){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},mouseleave:function(t){this.mousedover=!1,!this.focused&&this.shown&&this.hide()},mousedown:function(t){this.mouseddown=!0,this.$menu.one("mouseup",function(t){this.mouseddown=!1}.bind(this))},touchstart:function(e){e.preventDefault(),this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},touchend:function(t){t.preventDefault(),this.select(),this.$element.focus()}};var s=t.fn.typeahead;t.fn.typeahead=function(s){var i=arguments;return"string"==typeof s&&"getActive"==s?this.data("active"):this.each(function(){var o=t(this),n=o.data("typeahead"),h="object"==typeof s&&s;n||o.data("typeahead",n=new e(this,h)),"string"==typeof s&&n[s]&&(i.length>1?n[s].apply(n,Array.prototype.slice.call(i,1)):n[s]())})},e.defaults={source:[],items:8,minLength:1,scrollHeight:0,autoSelect:!0,afterSelect:t.noop,afterEmptySelect:t.noop,addItem:!1,followLinkOnSelect:!1,delay:0,separator:"category",changeInputOnSelect:!0,changeInputOnMove:!0,openLinkInNewTab:!1,selectOnBlur:!0,showCategoryHeader:!0,theme:"bootstrap3",themes:{bootstrap3:{menu:'<ul class="typeahead dropdown-menu" role="listbox"></ul>',item:'<li><a class="dropdown-item" href="#" role="option"></a></li>',itemContentSelector:"a",headerHtml:'<li class="dropdown-header"></li>',headerDivider:'<li class="divider" role="separator"></li>'},bootstrap4:{menu:'<div class="typeahead dropdown-menu" role="listbox"></div>',item:'<button class="dropdown-item" role="option"></button>',itemContentSelector:".dropdown-item",headerHtml:'<h6 class="dropdown-header"></h6>',headerDivider:'<div class="dropdown-divider"></div>'}}},t.fn.typeahead.Constructor=e,t.fn.typeahead.noConflict=function(){return t.fn.typeahead=s,this},t(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var s=t(this);s.data("typeahead")||s.typeahead(s.data())})});
12,253
bootstrap3-typeahead.min
js
en
javascript
code
{"qsc_code_num_words": 1870, "qsc_code_num_chars": 12253.0, "qsc_code_mean_word_length": 4.91016043, "qsc_code_frac_words_unique": 0.12352941, "qsc_code_frac_chars_top_2grams": 0.0598998, "qsc_code_frac_chars_top_3grams": 0.01633631, "qsc_code_frac_chars_top_4grams": 0.0137225, "qsc_code_frac_chars_dupe_5grams": 0.23360924, "qsc_code_frac_chars_dupe_6grams": 0.15900675, "qsc_code_frac_chars_dupe_7grams": 0.12698758, "qsc_code_frac_chars_dupe_8grams": 0.10738401, "qsc_code_frac_chars_dupe_9grams": 0.10738401, "qsc_code_frac_chars_dupe_10grams": 0.08211719, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0095434, "qsc_code_frac_chars_whitespace": 0.00799804, "qsc_code_size_file_byte": 12253.0, "qsc_code_num_lines": 1.0, "qsc_code_num_chars_line_max": 12253.0, "qsc_code_num_chars_line_mean": 12253.0, "qsc_code_frac_chars_alphabet": 0.7458659, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.11971601, "qsc_code_frac_chars_long_word_length": 0.05459442, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 1.0, "qsc_codejavascript_cate_var_zero": 0.0, "qsc_codejavascript_frac_lines_func_ratio": 1.0, "qsc_codejavascript_num_statement_line": 1.0, "qsc_codejavascript_score_lines_no_logic": 18.0, "qsc_codejavascript_frac_words_legal_var_name": 1.0, "qsc_codejavascript_frac_words_legal_func_name": 1.0, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 1, "qsc_code_num_chars_line_max": 1, "qsc_code_num_chars_line_mean": 1, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 0, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 1, "qsc_codejavascript_score_lines_no_logic": 1, "qsc_codejavascript_frac_lines_print": 0}
1ven/do
client/components/Activity.js
import React, { PropTypes } from 'react'; import { Link } from 'react-router'; function Activity({ items }) { function crop(title) { return title.length > 10 ? title.slice(0, 10) + '...' : title; } return ( <div className="b-activity"> <span className="b-activity__title">Activity</span> <div className="b-activity__items"> {items.map((item, i) => ( <div className="b-activity__item" key={i} > <div className="b-activity__item-text"> {item.action}&nbsp;'{crop(item.entry.title)}'&nbsp;{item.type} </div> <span className="b-activity__date">{item.date}</span> </div> ))} </div> </div> ); } Activity.defaultProps = { items: [], }; Activity.propTypes = { items: PropTypes.arrayOf( PropTypes.shape({ id: PropTypes.number, action: PropTypes.string, type: PropTypes.string, date: PropTypes.string, noLink: PropTypes.bool, entry: PropTypes.shape({ title: PropTypes.string, link: PropTypes.string, }), }) ), }; export default Activity;
1,162
Activity
js
en
javascript
code
{"qsc_code_num_words": 118, "qsc_code_num_chars": 1162.0, "qsc_code_mean_word_length": 5.39830508, "qsc_code_frac_words_unique": 0.33898305, "qsc_code_frac_chars_top_2grams": 0.09419152, "qsc_code_frac_chars_top_3grams": 0.16954474, "qsc_code_frac_chars_top_4grams": 0.13186813, "qsc_code_frac_chars_dupe_5grams": 0.08163265, "qsc_code_frac_chars_dupe_6grams": 0.08163265, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00601685, "qsc_code_frac_chars_whitespace": 0.2848537, "qsc_code_size_file_byte": 1162.0, "qsc_code_num_lines": 49.0, "qsc_code_num_chars_line_max": 77.0, "qsc_code_num_chars_line_mean": 23.71428571, "qsc_code_frac_chars_alphabet": 0.76052948, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.13636364, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.12134251, "qsc_code_frac_chars_long_word_length": 0.03872633, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 0.0, "qsc_codejavascript_cate_var_zero": null, "qsc_codejavascript_frac_lines_func_ratio": null, "qsc_codejavascript_num_statement_line": null, "qsc_codejavascript_score_lines_no_logic": null, "qsc_codejavascript_frac_words_legal_var_name": null, "qsc_codejavascript_frac_words_legal_func_name": null, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 1, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1ven/do
client/components/BoardTile.js
import React, { PropTypes } from 'react'; import { Link } from 'react-router'; import { addModifiers } from '../utils'; import IconItem from './IconItem'; import Icon from './Icon'; import MenuList from './MenuList'; import ToggleMenu from './ToggleMenu'; function BoardTile({ id, link, title, starred, listsLength, cardsLength, onRemoveClick, onEditClick, onToggleStarredClick, }) { return ( <div className="b-board-tile"> <div className="b-board-tile__top"> <div className="b-board-tile__left"> <span className="b-board-tile__title">{title}</span> </div> <div className="b-board-tile__right"> <div className="b-board-tile__right-item"> <a className="b-board-tile__toggle-starred" onClick={() => onToggleStarredClick(id, starred)} > {starred ? ( <Icon name="star" /> ) : ( <Icon name="star-empty" /> )} </a> </div> <div className="b-board-tile__right-item"> <ToggleMenu menu={ <MenuList modifiers={['sm']} items={[{ title: 'Edit', onClick: () => onEditClick(id), }, { title: 'Remove', onClick: () => onRemoveClick(id), }]} /> } /> </div> </div> </div> <div className="b-board-tile__bottom"> <div className="b-board-tile__left"> <div className="b-board-tile__board-info"> <div className="b-board-tile__icon-item"> <IconItem iconWidth="15" iconName="list" > {listsLength} </IconItem> </div> <div className="b-board-tile__icon-item"> <IconItem iconWidth="14" iconName="card" > {cardsLength} </IconItem> </div> </div> </div> <div className="b-board-tile__right"> <Link className="b-board-tile__more" to={link} > More </Link> </div> </div> </div> ); } BoardTile.propTypes = { id: PropTypes.string.isRequired, title: PropTypes.string.isRequired, link: PropTypes.string.isRequired, starred: PropTypes.bool.isRequired, listsLength: PropTypes.number.isRequired, cardsLength: PropTypes.number.isRequired, onRemoveClick: PropTypes.func.isRequired, onEditClick: PropTypes.func.isRequired, onToggleStarredClick: PropTypes.func.isRequired, }; export default BoardTile;
2,789
BoardTile
js
en
javascript
code
{"qsc_code_num_words": 239, "qsc_code_num_chars": 2789.0, "qsc_code_mean_word_length": 5.78661088, "qsc_code_frac_words_unique": 0.25941423, "qsc_code_frac_chars_top_2grams": 0.10845987, "qsc_code_frac_chars_top_3grams": 0.1626898, "qsc_code_frac_chars_top_4grams": 0.20607375, "qsc_code_frac_chars_dupe_5grams": 0.27259581, "qsc_code_frac_chars_dupe_6grams": 0.22487346, "qsc_code_frac_chars_dupe_7grams": 0.18510484, "qsc_code_frac_chars_dupe_8grams": 0.11279826, "qsc_code_frac_chars_dupe_9grams": 0.06796819, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00224845, "qsc_code_frac_chars_whitespace": 0.36213697, "qsc_code_size_file_byte": 2789.0, "qsc_code_num_lines": 101.0, "qsc_code_num_chars_line_max": 64.0, "qsc_code_num_chars_line_mean": 27.61386139, "qsc_code_frac_chars_alphabet": 0.77515458, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.24489796, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.14593044, "qsc_code_frac_chars_long_word_length": 0.05234851, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 0.0, "qsc_codejavascript_cate_var_zero": null, "qsc_codejavascript_frac_lines_func_ratio": null, "qsc_codejavascript_num_statement_line": null, "qsc_codejavascript_score_lines_no_logic": null, "qsc_codejavascript_frac_words_legal_var_name": null, "qsc_codejavascript_frac_words_legal_func_name": null, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 1, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1ven/do
client/components/UserBox.js
import React, { PropTypes } from 'react'; import MenuList from './MenuList'; import Toggle from './Toggle'; import Icon from './Icon'; function UserBox({ user: { username, role, }, avatar, onSignOutClick, onIndexClick, }) { const wrap = ( <div className="b-user-box__wrap"> <div className="b-user-box__icon"> <Icon name="chevron-down" /> </div> <div className="b-user-box__left"> <span className="b-user-box__username"> @{username} </span> <span className="b-user-box__role"> {role || 'user'} </span> </div> <div className="b-user-box__right"> <img alt="avatar" className="b-user-box__avatar" src={avatar} /> </div> </div> ); const menu = ( <div className="b-user-box__menu"> <MenuList items={[{ title: 'Main page', onClick: onIndexClick, }, { title: 'Sign out', onClick: onSignOutClick, }]} /> </div> ); return ( <div className="b-user-box"> <Toggle link={wrap} content={menu} animationName="a-fade-in-down" /> </div> ); } UserBox.propTypes = { user: PropTypes.shape({ username: PropTypes.string.isRequired, role: PropTypes.string, }), avatar: PropTypes.string.isRequired, onSignOutClick: PropTypes.func.isRequired, onIndexClick: PropTypes.func.isRequired, }; export default UserBox;
1,516
UserBox
js
en
javascript
code
{"qsc_code_num_words": 151, "qsc_code_num_chars": 1516.0, "qsc_code_mean_word_length": 5.41721854, "qsc_code_frac_words_unique": 0.33774834, "qsc_code_frac_chars_top_2grams": 0.11002445, "qsc_code_frac_chars_top_3grams": 0.15403423, "qsc_code_frac_chars_top_4grams": 0.18704156, "qsc_code_frac_chars_dupe_5grams": 0.21515892, "qsc_code_frac_chars_dupe_6grams": 0.11491443, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0, "qsc_code_frac_chars_whitespace": 0.29881266, "qsc_code_size_file_byte": 1516.0, "qsc_code_num_lines": 73.0, "qsc_code_num_chars_line_max": 48.0, "qsc_code_num_chars_line_mean": 20.76712329, "qsc_code_frac_chars_alphabet": 0.76952023, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.20588235, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.14973615, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 0.0, "qsc_codejavascript_cate_var_zero": null, "qsc_codejavascript_frac_lines_func_ratio": null, "qsc_codejavascript_num_statement_line": null, "qsc_codejavascript_score_lines_no_logic": null, "qsc_codejavascript_frac_words_legal_var_name": null, "qsc_codejavascript_frac_words_legal_func_name": null, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 1, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1wheel/swoopy-drag
index.js
import * as d3 from "d3"; export function swoopyDrag(){ var x = function(d){ return d } var y = function(d){ return d } var annotations = [] var annotationSel var draggable = false var dispatch = d3.dispatch('drag') var textDrag = d3.drag() .on('drag', function(d){ var x = d3.event.x var y = d3.event.y d.textOffset = [x, y].map(Math.round) d3.select(this).call(translate, d.textOffset) dispatch.call('drag') }) .subject(function(d){ return {x: d.textOffset[0], y: d.textOffset[1]} }) var circleDrag = d3.drag() .on('drag', function(d){ var x = d3.event.x var y = d3.event.y d.pos = [x, y].map(Math.round) var parentSel = d3.select(this.parentNode) var path = '' var points = parentSel.selectAll('circle').data() if (points[0].type == 'A'){ path = calcCirclePath(points) } else{ points.forEach(function(d){ path = path + d.type + d.pos }) } parentSel.select('path').attr('d', path).datum().path = path d3.select(this).call(translate, d.pos) dispatch.call('drag') }) .subject(function(d){ return {x: d.pos[0], y: d.pos[1]} }) var rv = function(sel){ annotationSel = sel.html('').selectAll('g') .data(annotations).enter() .append('g') .call(translate, function(d){ return [x(d), y(d)] }) var textSel = annotationSel.append('text') .call(translate, ƒ('textOffset')) .text(ƒ('text')) annotationSel.append('path') .attr('d', ƒ('path')) if (!draggable) return annotationSel.style('cursor', 'pointer') textSel.call(textDrag) annotationSel.selectAll('circle').data(function(d){ var points = [] if (~d.path.indexOf('A')){ //handle arc paths seperatly -- only one circle supported var pathNode = d3.select(this).select('path').node() var l = pathNode.getTotalLength() points = [0, .5, 1].map(function(d){ var p = pathNode.getPointAtLength(d*l) return {pos: [p.x, p.y], type: 'A'} }) } else{ var i = 1 var type = 'M' var commas = 0 for (var j = 1; j < d.path.length; j++){ var curChar = d.path[j] if (curChar == ',') commas++ if (curChar == 'L' || curChar == 'C' || commas == 2){ points.push({pos: d.path.slice(i, j).split(','), type: type}) type = curChar i = j + 1 commas = 0 } } points.push({pos: d.path.slice(i, j).split(','), type: type}) } return points }).enter().append('circle') .attr('r', 8) .attr('fill', 'rgba(0,0,0,0)') .attr('stroke', '#333') .attr('stroke-dasharray', '2 2') .call(translate, ƒ('pos')) .call(circleDrag) dispatch.call('drag') } rv.annotations = function(_x){ if (typeof(_x) == 'undefined') return annotations annotations = _x return rv } rv.x = function(_x){ if (typeof(_x) == 'undefined') return x x = _x return rv } rv.y = function(_x){ if (typeof(_x) == 'undefined') return y y = _x return rv } rv.draggable = function(_x){ if (typeof(_x) == 'undefined') return draggable draggable = _x return rv } rv.on = function() { var value = dispatch.on.apply(dispatch, arguments); return value === dispatch ? rv : value; } return rv //convert 3 points to an Arc Path function calcCirclePath(points){ var a = points[0].pos var b = points[2].pos var c = points[1].pos var A = dist(b, c) var B = dist(c, a) var C = dist(a, b) var angle = Math.acos((A*A + B*B - C*C)/(2*A*B)) //calc radius of circle var K = .5*A*B*Math.sin(angle) var r = A*B*C/4/K r = Math.round(r*1000)/1000 //large arc flag var laf = +(Math.PI/2 > angle) //sweep flag var saf = +((b[0] - a[0])*(c[1] - a[1]) - (b[1] - a[1])*(c[0] - a[0]) < 0) return ['M', a, 'A', r, r, 0, laf, saf, b].join(' ') } function dist(a, b){ return Math.sqrt( Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2)) } //no jetpack dependency function translate(sel, pos){ sel.attr('transform', function(d){ var posStr = typeof(pos) == 'function' ? pos(d) : pos return 'translate(' + posStr + ')' }) } function ƒ(str){ return function(d){ return d[str] } } }
4,526
index
js
en
javascript
code
{"qsc_code_num_words": 614, "qsc_code_num_chars": 4526.0, "qsc_code_mean_word_length": 3.86319218, "qsc_code_frac_words_unique": 0.21172638, "qsc_code_frac_chars_top_2grams": 0.0455312, "qsc_code_frac_chars_top_3grams": 0.03794266, "qsc_code_frac_chars_top_4grams": 0.02866779, "qsc_code_frac_chars_dupe_5grams": 0.21711636, "qsc_code_frac_chars_dupe_6grams": 0.18212479, "qsc_code_frac_chars_dupe_7grams": 0.16020236, "qsc_code_frac_chars_dupe_8grams": 0.10455312, "qsc_code_frac_chars_dupe_9grams": 0.10455312, "qsc_code_frac_chars_dupe_10grams": 0.07082631, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02156924, "qsc_code_frac_chars_whitespace": 0.29319487, "qsc_code_size_file_byte": 4526.0, "qsc_code_num_lines": 181.0, "qsc_code_num_chars_line_max": 80.0, "qsc_code_num_chars_line_mean": 25.00552486, "qsc_code_frac_chars_alphabet": 0.71991247, "qsc_code_frac_chars_comments": 0.03667698, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.16176471, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.05067645, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 1.0, "qsc_codejavascript_cate_var_zero": 0.0, "qsc_codejavascript_frac_lines_func_ratio": 0.05882353, "qsc_codejavascript_num_statement_line": 0.01470588, "qsc_codejavascript_score_lines_no_logic": 0.22794118, "qsc_codejavascript_frac_words_legal_var_name": 0.88888889, "qsc_codejavascript_frac_words_legal_func_name": 0.875, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 0, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1wheel/swoopy-drag
index.html
<!DOCTYPE html> <meta charset="utf-8"> <style> body{ width: 900px; margin: 0px auto; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F5F5F5; } h1{ } h1, h3{ margin: 50px; text-align: center; } h3{ margin-bottom: 30px; } svg{ overflow: visible; } text { font-size: 12px; text-shadow: 0 1px 0 #F5F5F5, 1px 0 0 #F5F5F5, 0 -1px 0 #F5F5F5, -1px 0 0 #F5F5F5; } .axis line, .axis path { fill: none; stroke: #000; shape-rendering: crispEdges; } .annotations path{ fill: none; stroke: black; } .annotations g:hover circle{ stroke: red; } .annotations g:hover text{ fill: red; } div.tooltip { top: -1000px; position: absolute; padding: 10px; background: rgba(255, 255, 255, .90); border: 1px solid lightgray; pointer-events: none; z-index: 100; } .tooltip-hidden{ opacity: 0; } #graph{ display: inline-block; width: 500px; position: relative; z-index: 2; } #annotations-update{ display: inline-block; width: 380px; position: relative; top: -25px; left: -120px; /*background: #eee;*/ } .mono, m{ font-family: monospace; display: inline; font-size: 14px; background: #ddd; padding: .05em; padding-left: .2em; padding-right: .2em; border-radius: 2px; } p{ max-width: 600px; margin: 0px auto; font-size: 16px; line-height: 1.4em; } pre{ font-size: 14px; margin: 0px; margin-left: 136px; padding-left: 15px; border-left: 1px solid #ccc; } p, pre{ margin-bottom: 30px; } #resizable { position: relative; width: 500px; height: 520px; margin-bottom: 40px; } #resizable .resizer { position: absolute; width: 10px; top: 0; bottom: 0; right: -44px; background: #ccc; opacity: .5; cursor: pointer; } a{ color: black; } </style> <body> <h1><a href='https://github.com/1wheel/swoopy-drag'>swoopyDrag.js</a></h1> <h3 style='margin-bottom: 50px;'>Artisanal label placement for d3 graphics</h3> <p> <i>“The annotation layer is the most important thing we do”</i> —Amanda Cox </p> <p> <span class='mono'>swoopyDrag</span> helps you hand place annotations on d3 graphics. It takes an array of objects representing annotations and turns them into lines and labels. Drag the text and control circles below to update the annotations array: </p> <div style='padding-top: 20px; padding-bottom: 15px;'> <div id='graph'> </div> <div id='annotations-update'></div> </div> <p> The <span class='mono'>x</span> and <span class='mono'>y</span> functions are called on each annotation to determine its position. In the annotations array here, the <span class='mono'>sepalWidth</span> and <span class='mono'>sepalLength</span> properties are the data values of point the annotation refers to. The functions passed to <span class='mono'>x</span> and <span class='mono'>y</span> look up these values and encode them as pixel position using the same scale set up to position the circles. <pre> var swoopy = d3.swoopyDrag() .x(d => xScale(d.sepalWidth)) .y(d => yScale(d.sepalLength)) .draggable(true) .annotations(annotations) </pre> <p> Setting <m>draggable</m> to <m>true</m> adds control points to the path strings and enables label dragging - turn on while developing and off when you're ready to publish. <p> The shape of each annotation's line is determined by the <span class='mono'>path</span> property, the text by the <span class='mono'>text</span> property and the position of the text by the <span class='mono'>testOffset</span> property. Currently only <a href='https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands'>straight paths</a> (paths of the form <m>M 0,0 L 10,10</m>), <a href='https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands'>béziers</a> (paths of the form <m>M 0,0 C 10,10 10,15, 20,15</m>) and circular arcs are supported—see my interactive path string <a href='http://roadtolarissa.com/blog/2015/02/22/svg-path-strings/'>tutorial</a> for more details. </p> <p> The annotations are added to the page just like <m>d3.svg.axis</m> - append a new <m>group</m> element and use <m>call</m>: </p> <pre> var swoopySel = svg.append('g').call(swoopy) </pre> <p>After posititioning the labels, open the <a href='https://developer.chrome.com/devtools/docs/console'>dev tools</a>, run <m>copy(annotations)</m> in the console and paste over the old <m>annotations</m> array in your text editor. <h3>Responsive</h3> <div id="resizable" style='padding-top: 20px; padding-bottom: 15px;'> <div class="resizer"></div> </div> <p> Since each annotation's position is determined primarily by scales, lines and labels will still point to the correct position when the chart size changes. As the chart shrinks though, the annotations might overlap or cover up data points. To show fewer or differently positioned labels on mobile, you could create multiple annotation arrays for different screen sizes: </p> <pre> d3.swoopyDrag() .annotations(innerWidth < 800 ? mobileAnnotations : desktopAnnotations) </pre> <p> Alternatively if there's just one or two problematic annotations that only work above or below some sizes, you could add <m>maxWidth</m> and <m>minWidth</m> properties to the overlapping annotations and filter: </p> <pre> d3.swoopyDrag() .annotations(annotations.filter(function(d){ return (typeof(d.minWidth) == 'undefined' || innerWidth > d.minWidth) && (typeof(d.maxWidth) == 'undefined' || innerWidth < d.maxWidth) })) </pre> <h3>Arrowheads</h3> <p>SVG has native support for <a href='https://developer.mozilla.org/en-US/docs/Web/SVG/Element/marker'>arrowheads</a>, but they can be a little fiddly to get working. First, add a <m>marker</m> element to the page the describes the shape of the arrow: </p> <pre> svg.append('marker') .attr('id', 'arrow') .attr('viewBox', '-10 -10 20 20') .attr('markerWidth', 20) .attr('markerHeight', 20) .attr('orient', 'auto') .append('path') .attr('d', 'M-6.75,-6.75 L 0,0 L -6.75,6.75') </pre> <p>Next, select paths in each annotation and set their <m>marker-end</m> attribute: <pre> swoopySel.selectAll('path').attr('marker-end', 'url(#arrow)') </pre> <h3>Text Wrap</h3> <p>Multiline text can be added with <a href='https://github.com/gka/d3-jetpack'>d3-jetpack</a>. Select all of the <m>text</m> elements, clear the existing text, then use <m>d3.wordwrap</m> and <m>tspans</m> to wrap the text: </p> <pre> swoopySel.selectAll('text') .each(function(d){ d3.select(this) .text('') //clear existing text .tspans(d3.wordwrap(d.text, 20)) //wrap after 20 char }) </pre> <p> <h3>Styling</h3> <p>On the page, annotations are made up of a <m>group</m> containing a <m>path</m> and a <m>text</m> element. Annotation data is bound to them, making it possible to control the style of individual annotations. <p>To customize the color of the text you could add a <m>textColor</m> property to the annotation data and use it to set the <m>fill</m> of the <m>text</m>: <pre> swoopySel.selectAll('text').style('fill', d => d.textColor || '#000') </pre> <p>Or you could add a <m>highlight</m> class to some of the annotations: <pre> swoopySel.selectAll('g').attr('class', d => d.class) </pre> <p>And emphasize them with css: <pre> g.highlight text{ font-weight: 700; } g.highlight path{ stroke-width: 2; } </pre> <h3>Examples</h3> <p style='line-height: 2.8em;'> <a href='http://bl.ocks.org/1wheel/68073eeba4d19c454a8c25fcd6e9e68a'>d3-module-faces</a> <br> <a href='http://roadtolarissa.com/nba-minutes/'>Minute by Minute Point Differentials</a> <br> <a href='http://roadtolarissa.com/nba-win-loss/'>NBA Win/Loss Records</a> <br> <a href='http://www.nytimes.com/interactive/2016/08/09/us/elections/Bush-Rubio-and-Kasich-Donors-give-to-Clinton.html'>Bush and Kasich Donors Give to Clinton</a> </p> <h3>Other Tools</h3> <p style='line-height: 2.8em;'> <a href='https://github.com/bizweekgraphics/swoopyarrows'>swoopyarrows</a> creates fancier swoops, including circular and loopy arcs. <br> <a href='http://twitter.github.io/labella.js/'>labella.js</a> uses a force directed layout to position timeline labels with no overlap. <br> <a href='http://nytimes.github.io/svg-crowbar/'>svg-crowbar</a> lets you export a <m>svg</m> file and add annotations manually. <br> <a href='http://ai2html.org/'>ai2html</a> is an illustrator script that creates responsive <m>html</m>. <br> </P> <h3>Contribute</h3> <p style='text-align: center; margin-bottom: 80px;'> <a href='http://github.com/1wheel/swoopy-drag'>github.com/1wheel/swoopy-drag</a> </p> <div class='tooltip'></div> </body> <script src="lib/d3v4+jetpack.js"></script> <script src='swoopy-drag.js'></script> <script> var ƒ = d3.f var annotations = [ { "sepalWidth": 4.4, "sepalLength": 5.7, "path": "M-49,-61L-6,-8", "text": "Setosa", "textOffset": [ -83, -65 ] }, { "sepalWidth": 3.8, "sepalLength": 7.7, "path": "M 15,114 A 128.931 128.931 0 1 1 -10,-32", "text": "Virginica", "textOffset": [ -11, 105 ] }, { "sepalWidth": 2.3, "sepalLength": 5, "path": "M-5,86C-47,82,-55,18,-9,4", "text": "Versicolor", "textOffset": [ -2, 92 ] } ] var dragToResize = { "sepalWidth": 4.4, "sepalLength": 5, "path": "M22,-283C84,-279,84,-356,18,-350", "text": "Drag to resize", "textOffset": [ 91, -334 ] } var c = d3.conventions({parentSel: d3.select('#graph'), width: 450}) var swoopy = d3.swoopyDrag() .draggable(true) .x(ƒ('sepalWidth', c.x)) .y(ƒ('sepalLength', c.y)) .annotations(annotations) .on('drag', function(){ annotationText.text('var annotations = ' + JSON.stringify(annotations, null, 2)) }) var annotationText = d3.select('#annotations-update').append('pre') d3.tsv('lib/data.tsv', function(res){ data = res c.x.domain(d3.extent(data, ƒ('sepalWidth')) ).nice() c.y.domain(d3.extent(data, ƒ('sepalLength'))).nice() c.drawAxis() c.svg.select('.x.axis').append("text") .attr("class", "label") .attr("x", c.width) .attr("y", -6) .attr("fill", "#000") .style("text-anchor", "end") .text("Sepal Width (cm)"); c.svg.select('.y.axis').append("text") .attr("class", "label") .attr("transform", "rotate(-90)") .attr("y", 6) .attr("dy", ".71em") .attr("fill", "#000") .style("text-anchor", "end") .text("Sepal Length (cm)") c.svg.appendMany(data, 'circle') .attr('cx', ƒ('sepalWidth', c.x)) .attr('cy', ƒ('sepalLength', c.y)) .attr('fill', ƒ('species', d3.scaleOrdinal(d3.schemeCategory10))) .attr('r', 5) .attr('stroke', '#000') .call(d3.attachTooltip) var swoopySel = c.svg.append('g.annotations') .call(swoopy) swoopySel.selectAll('path') .attr('marker-end', 'url(#arrow)') // swoopySel.selectAll('text') // .each(function(d){ // d3.select(this) // .text('') // .tspans(d.text.split(' ')) // }) c.svg.append('marker') .attr('id', 'arrow') .attr('viewBox', '-10 -10 20 20') .attr('markerWidth', 20) .attr('markerHeight', 20) .attr('orient', 'auto') .append('path') .attr('d', 'M-6.75,-6.75 L 0,0 L -6.75,6.75') !(function(){ var resizable = d3.select('#resizable'); var resizer = resizable.select('.resizer'); var r = d3.conventions({parentSel: d3.select('#resizable'), width: 450}) r.x.domain(d3.extent(data, ƒ('sepalWidth')) ).nice() r.y.domain(d3.extent(data, ƒ('sepalLength'))).nice() r.drawAxis() var circles = r.svg.appendMany(data, 'circle') .attr('cx', ƒ('sepalWidth', r.x)) .attr('cy', ƒ('sepalLength', r.y)) .attr('fill', ƒ('species', d3.scaleOrdinal(d3.schemeCategory10))) .attr('r', 5) .attr('stroke', '#000') .call(d3.attachTooltip) swoopy.draggable(false).annotations(annotations.concat(dragToResize)) var swoopySel = r.svg.append('g.annotations').call(swoopy) swoopySel.selectAll('path') .attr('marker-end', 'url(#arrow)') swoopySel.selectAll('text').style('fill', 'black') resizer.call(d3.drag().on('drag', function(){ setWidth(d3.mouse(this.parentNode)[0]) })) var curX, isGrowing function setWidth(x){ curX = x x = Math.min(Math.max(50, x - r.margin.left - r.margin.right), 1000) r.x.range([0, x]) resizable.style('width', x + 'px'); circles.attr('cx', ƒ('sepalWidth', r.x)) swoopySel.selectAll('g').translate(function(d){ return [r.x(d.sepalWidth), r.y(d.sepalLength)] }) r.svg.select('.x.axis').call(r.xAxis) } setWidth(500) lastScroll = new Date() d3.select(window).on('scroll.dragjigger', function(){ lastScroll = new Date() }) d3.timer(function(){ if (lastScroll < new Date() - 600) return var min = 400 var max = 800 var mid = (min + max)/2 if (curX < min) isGrowing = true if (curX > max) isGrowing = false var step = Math.max(1, Math.abs(600)) setWidth(curX + (isGrowing ? 1 : -1)*5) }) })() }) </script>
13,287
index
html
en
html
code
{"qsc_code_num_words": 1945, "qsc_code_num_chars": 13287.0, "qsc_code_mean_word_length": 4.36452442, "qsc_code_frac_words_unique": 0.28123393, "qsc_code_frac_chars_top_2grams": 0.00942396, "qsc_code_frac_chars_top_3grams": 0.01531394, "qsc_code_frac_chars_top_4grams": 0.00777477, "qsc_code_frac_chars_dupe_5grams": 0.25020615, "qsc_code_frac_chars_dupe_6grams": 0.19366239, "qsc_code_frac_chars_dupe_7grams": 0.18459182, "qsc_code_frac_chars_dupe_8grams": 0.17116268, "qsc_code_frac_chars_dupe_9grams": 0.1187419, "qsc_code_frac_chars_dupe_10grams": 0.09895158, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.04354631, "qsc_code_frac_chars_whitespace": 0.18250922, "qsc_code_size_file_byte": 13287.0, "qsc_code_num_lines": 509.0, "qsc_code_num_chars_line_max": 691.0, "qsc_code_num_chars_line_mean": 26.10412574, "qsc_code_frac_chars_alphabet": 0.73780151, "qsc_code_frac_chars_comments": 0.01121397, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.32291667, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01302083, "qsc_code_frac_chars_string_length": 0.18608722, "qsc_code_frac_chars_long_word_length": 0.00433823, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.34861142, "qsc_codehtml_num_chars_text": 4632.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/CommonForms/СвязанныеДокументы/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) ОпределитьНастройки(); Если ЗначениеЗаполнено(Параметры.ОбъектОтбора) Тогда ОсновнойОбъект = Параметры.ОбъектОтбора; КонецЕсли; ИсходныйОбъект = ОсновнойОбъект; Если ЗначениеЗаполнено(ОсновнойОбъект) Тогда ОбновитьДеревоСтруктурыПодчиненности(); КонецЕсли; КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура Обновить(Команда) ВывестиСтруктуруПодчиненности(); КонецПроцедуры &НаКлиенте Процедура ВывестиДляТекущего(Команда) ТекущийОбъект = Элементы.ТаблицаОтчета.ТекущаяОбласть.Расшифровка; Если Не ЗначениеЗаполнено(ТекущийОбъект) Тогда Возврат; КонецЕсли; ОсновнойОбъект = ТекущийОбъект; ВывестиСтруктуруПодчиненности(); КонецПроцедуры &НаКлиенте Процедура ИзменитьПометкуУдаления(Команда) ОчиститьСообщения(); ВыбранныеЭлементы = ВыбранныеЭлементы(); Если ВыбранныеЭлементы.Количество() = 0 Тогда Возврат; КонецЕсли; Статистика = СтатистикаПоВыбраннымЭлементам(ВыбранныеЭлементы); Сценарий = СценарийИзмененияПометкиУдаления(ВыбранныеЭлементы, Статистика); Сценарий.Вставить("ВыбранныеЭлементы", ВыбранныеЭлементы); Обработчик = Новый ОписаниеОповещения("ВыполнитьСценарийИзмененияПометкиУдаления", ЭтотОбъект, Сценарий); ПоказатьВопрос(Обработчик, Сценарий.Вопрос, РежимДиалогаВопрос.ДаНет); КонецПроцедуры &НаКлиенте Процедура Провести(Команда) ИзменитьПроведениеДокументов(РежимЗаписиДокумента.Проведение); КонецПроцедуры &НаКлиенте Процедура ОтменитьПроведение(Команда) ИзменитьПроведениеДокументов(РежимЗаписиДокумента.ОтменаПроведения); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции #Область ПроцедурыВыводаВТабличныйДокумент &НаСервере Процедура ВывестиТабличныйДокумент() ТаблицаОтчета.Очистить(); Макет = ПолучитьОбщийМакет("СтруктураПодчиненности"); ВывестиРодительскиеЭлементыДерева(ДеревоРодительскиеОбъекты.ПолучитьЭлементы(), Макет); ВывестиТекущийОбъект(Макет); ВывестиПодчиненныеЭлементыДерева(ДеревоПодчиненныеОбъекты.ПолучитьЭлементы(), Макет); КонецПроцедуры // Параметры: // СтрокиДерева - ДанныеФормыКоллекцияЭлементовДерева // Макет - ТабличныйДокумент // УровниРекурсии - Число // &НаСервере Процедура ВывестиРодительскиеЭлементыДерева(СтрокиДерева, Макет, УровниРекурсии = 1) Счетчик = СтрокиДерева.Количество(); Пока Счетчик > 0 Цикл ТекущаяСтрокаДерева = СтрокиДерева.Получить(Счетчик - 1); ПодчиненныеЭлементыСтрокиДерева = ТекущаяСтрокаДерева.ПолучитьЭлементы(); ВывестиРодительскиеЭлементыДерева(ПодчиненныеЭлементыСтрокиДерева, Макет, УровниРекурсии + 1); Для Уровень = 1 По УровниРекурсии Цикл Если Уровень = УровниРекурсии Тогда Если СтрокиДерева.Индекс(ТекущаяСтрокаДерева) < (СтрокиДерева.Количество() - 1) Тогда Область = Макет.ПолучитьОбласть("КоннекторВерхПравоНиз"); Иначе Область = Макет.ПолучитьОбласть("КоннекторПравоНиз"); КонецЕсли; Иначе Если ВыводитьВертикальныйКоннектор(УровниРекурсии - Уровень + 1, ТекущаяСтрокаДерева, Ложь) Тогда Область = Макет.ПолучитьОбласть("КоннекторВерхНиз"); Иначе Область = Макет.ПолучитьОбласть("Отступ"); КонецЕсли; КонецЕсли; Если Уровень = 1 Тогда ТаблицаОтчета.Вывести(Область); Иначе ТаблицаОтчета.Присоединить(Область); КонецЕсли; КонецЦикла; ВывестиПредставлениеИКартинку(ТекущаяСтрокаДерева, Макет, Ложь, Ложь); Счетчик = Счетчик - 1; КонецЦикла; КонецПроцедуры &НаСервере Процедура ВывестиПредставлениеИКартинку(СтрокаДерева, Макет, ЭтоТекущийОбъект = Ложь, ЭтоПодчиненный = Неопределено) МетаданныеОбъекта = СтрокаДерева.Ссылка.Метаданные(); ЭтоДокумент = ОбщегоНазначения.ЭтоДокумент(МетаданныеОбъекта); ЕстьРодителиСуммарно = ДеревоРодительскиеОбъекты.ПолучитьЭлементы().Количество() > 0; ЕстьПодчиненныеСуммарно = ДеревоПодчиненныеОбъекты.ПолучитьЭлементы().Количество() > 0; ЕстьПодчиненные = ТипЗнч(СтрокаДерева) = Тип("ДанныеФормыЭлементДерева") И СтрокаДерева.ПолучитьЭлементы().Количество() > 0; // Вывод картинки Если СтрокаДерева.Проведен Тогда Если ЭтоТекущийОбъект Тогда Если ЕстьПодчиненныеСуммарно И ЕстьРодителиСуммарно Тогда ОбластьКартинка = Макет.ПолучитьОбласть("ДокументПроведенКоннекторВерхНиз"); ИначеЕсли ЕстьПодчиненныеСуммарно Тогда ОбластьКартинка = Макет.ПолучитьОбласть("ДокументПроведенКоннекторНиз"); Иначе ОбластьКартинка = Макет.ПолучитьОбласть("ДокументПроведенКоннекторВерх"); КонецЕсли; ИначеЕсли ЭтоПодчиненный = Истина Тогда Если ЕстьПодчиненные Тогда ОбластьКартинка = Макет.ПолучитьОбласть("ДокументПроведенКоннекторЛевоНиз"); Иначе ОбластьКартинка = Макет.ПолучитьОбласть("ДокументПроведен"); КонецЕсли; Иначе Если ЕстьПодчиненные Тогда ОбластьКартинка = Макет.ПолучитьОбласть("ДокументПроведенКоннекторЛевоВерх"); Иначе ОбластьКартинка = Макет.ПолучитьОбласть("ДокументПроведен"); КонецЕсли; КонецЕсли; ИначеЕсли СтрокаДерева.ПометкаУдаления Тогда Если ЭтоТекущийОбъект Тогда Если ЕстьПодчиненныеСуммарно И ЕстьРодителиСуммарно Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументПомеченНаУдалениеКоннекторВерхНиз", "СправочникПВХПомеченНаУдалениеКоннекторВерхНиз"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); ИначеЕсли ЕстьПодчиненныеСуммарно Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументПомеченНаУдалениеКоннекторНиз", "СправочникПВХПомеченНаУдалениеКоннекторНиз"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); Иначе ИмяОбласти = ?(ЭтоДокумент, "ДокументПомеченНаУдалениеКоннекторВерх", "СправочникПВХПомеченНаУдалениеКоннекторВерх"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); КонецЕсли; ИначеЕсли ЭтоПодчиненный = Истина Тогда Если ЕстьПодчиненные Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументПомеченНаУдалениеКоннекторЛевоНиз", "СправочникПВХПомеченНаУдалениеКоннекторЛевоНиз"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); Иначе ИмяОбласти = ?(ЭтоДокумент, "ДокументПомеченНаУдаление", "СправочникПВХПомеченНаУдалениеКоннекторЛево"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); КонецЕсли; Иначе Если ЕстьПодчиненные Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументПомеченНаУдалениеКоннекторЛевоВерх", "СправочникПВХПомеченНаУдалениеКоннекторЛевоВерх"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); Иначе ИмяОбласти = ?(ЭтоДокумент, "ДокументПомеченНаУдаление", "СправочникПВХПомеченНаУдалениеКоннекторЛево"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); КонецЕсли; КонецЕсли; Иначе Если ЭтоТекущийОбъект Тогда Если ЕстьПодчиненныеСуммарно И ЕстьРодителиСуммарно Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументЗаписанКоннекторВерхНиз", "СправочникПВХКоннекторВерхНиз"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); ИначеЕсли ЕстьПодчиненныеСуммарно Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументЗаписанКоннекторНиз", "СправочникПВХКоннекторНиз"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); Иначе ИмяОбласти = ?(ЭтоДокумент, "ДокументЗаписанКоннекторВерх", "СправочникПВХКоннекторВерх"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); КонецЕсли; ИначеЕсли ЭтоПодчиненный = Истина Тогда Если ЕстьПодчиненные Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументЗаписанКоннекторЛевоНиз", "СправочникПВХКоннекторЛевоНиз"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); Иначе ИмяОбласти = ?(ЭтоДокумент, "ДокументЗаписан", "СправочникПВХКоннекторЛево"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); КонецЕсли; Иначе Если ЕстьПодчиненные Тогда ИмяОбласти = ?(ЭтоДокумент, "ДокументЗаписанКоннекторЛевоВерх", "СправочникПВХКоннекторЛевоВерх"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); Иначе ИмяОбласти = ?(ЭтоДокумент, "ДокументЗаписан", "СправочникПВХКоннекторЛево"); ОбластьКартинка = Макет.ПолучитьОбласть(ИмяОбласти); КонецЕсли; КонецЕсли; КонецЕсли; Если ЭтоТекущийОбъект Тогда ТаблицаОтчета.Вывести(ОбластьКартинка) Иначе ТаблицаОтчета.Присоединить(ОбластьКартинка); КонецЕсли; // Вывод объекта ОбластьОбъект = Макет.ПолучитьОбласть(?(ЭтоТекущийОбъект, "ТекущийОбъект", "Объект")); ОбластьОбъект.Параметры.ПредставлениеОбъекта = СтрокаДерева.Представление; ОбластьОбъект.Параметры.Объект = СтрокаДерева.Ссылка; ТаблицаОтчета.Присоединить(ОбластьОбъект); КонецПроцедуры // Определяет необходимость вывода вертикального коннектора в табличный документ. // // Параметры: // УровеньВверх - Число - на каком количестве уровней выше находится // родитель от которого будет рисоваться вертикальный коннектор. // СтрокаДерева - ДанныеФормыЭлементДерева - исходная строка дерева значений // от которой ведется отсчет. // Возвращаемое значение: // Булево - необходимость вывода в области вертикального коннектора. // &НаСервере Функция ВыводитьВертикальныйКоннектор(УровеньВверх, СтрокаДерева, ИщемСредиПодчиненных = Истина) ТекущаяСтрока = СтрокаДерева; Для инд = 1 По УровеньВверх Цикл ТекущаяСтрока = ТекущаяСтрока.ПолучитьРодителя(); Если инд = УровеньВверх Тогда ИскомыйРодитель = ТекущаяСтрока; ИначеЕсли инд = (УровеньВверх-1) Тогда ИскомаяСтрока = ТекущаяСтрока; КонецЕсли; КонецЦикла; Если ИскомыйРодитель = Неопределено Тогда Если ИщемСредиПодчиненных Тогда ПодчиненныеЭлементыРодителя = ДеревоПодчиненныеОбъекты.ПолучитьЭлементы(); Иначе ПодчиненныеЭлементыРодителя = ДеревоРодительскиеОбъекты.ПолучитьЭлементы(); КонецЕсли; Иначе ПодчиненныеЭлементыРодителя = ИскомыйРодитель.ПолучитьЭлементы(); КонецЕсли; Возврат ПодчиненныеЭлементыРодителя.Индекс(ИскомаяСтрока) < (ПодчиненныеЭлементыРодителя.Количество()-1); КонецФункции // Выводит в табличный документ строку с документом, для которого формируется структура подчиненности. // // Параметры: // Макет - ТабличныйДокумент // &НаСервере Процедура ВывестиТекущийОбъект(Макет) Выборка = ЗапросПоРеквизитамОбъектов(ОсновнойОбъект).Выполнить().Выбрать(); Если Выборка.Следующий() Тогда ПереопределяемоеПредставление = ПредставлениеОбъектаДляВывода(Выборка); Если ПереопределяемоеПредставление <> Неопределено Тогда СтруктураРеквизитов = ОбщегоНазначения.СтрокаТаблицыЗначенийВСтруктуру(Выборка.Владелец().Выгрузить()[0]); СтруктураРеквизитов.Представление = ПереопределяемоеПредставление; ВывестиПредставлениеИКартинку(СтруктураРеквизитов, Макет, Истина); Иначе СтруктураРеквизитов = ОбщегоНазначения.СтрокаТаблицыЗначенийВСтруктуру(Выборка.Владелец().Выгрузить()[0]); СтруктураРеквизитов.Представление = ПредставлениеОбъектаДляВыводаВОтчет(Выборка); ВывестиПредставлениеИКартинку(СтруктураРеквизитов, Макет, Истина); КонецЕсли; КонецЕсли; КонецПроцедуры // Параметры: // Выборка - ВыборкаИзРезультатаЗапроса // - ДанныеФормыЭлементДерева - набор данных на основании которого формируется представление. // // Возвращаемое значение: // Строка - сформированное представление. // &НаСервере Функция ПредставлениеОбъектаДляВыводаВОтчет(Выборка) ПредставлениеОбъекта = Выборка.Представление; МетаданныеОбъекта = Выборка.Ссылка.Метаданные(); Если ОбщегоНазначения.ЭтоДокумент(МетаданныеОбъекта) Тогда Если (Выборка.СуммаДокумента <> 0) И (Выборка.СуммаДокумента <> NULL) Тогда ПредставлениеОбъекта = ПредставлениеОбъекта + " " + НСтр("ru = 'на сумму'") + " " + Выборка.СуммаДокумента + " " + Выборка.Валюта; КонецЕсли; Иначе ПредставлениеОбъекта = ПредставлениеОбъекта + " (" + ОбщегоНазначения.ПредставлениеОбъекта(МетаданныеОбъекта) + ")"; КонецЕсли; Возврат ПредставлениеОбъекта; КонецФункции // Параметры: // СтрокиДерева - ДанныеФормыКоллекцияЭлементовДерева // Макет - ТабличныйДокумент // УровниРекурсии - Число // &НаСервере Процедура ВывестиПодчиненныеЭлементыДерева(СтрокиДерева, Макет, УровниРекурсии = 1) Для каждого СтрокаДерева Из СтрокиДерева Цикл ЭтоИсходныйОбъект = (СтрокаДерева.Ссылка = ИсходныйОбъект); ПодчиненныеЭлементыДерева = СтрокаДерева.ПолучитьЭлементы(); // Вывод коннекторов Для Уровень = 1 По УровниРекурсии Цикл Если УровниРекурсии > Уровень Тогда Если ВыводитьВертикальныйКоннектор(УровниРекурсии - Уровень + 1,СтрокаДерева) Тогда Область = Макет.ПолучитьОбласть("КоннекторВерхНиз"); Иначе Область = Макет.ПолучитьОбласть("Отступ"); КонецЕсли; Иначе Если СтрокиДерева.Количество() > 1 И (СтрокиДерева.Индекс(СтрокаДерева) <> (СтрокиДерева.Количество() - 1)) Тогда Область = Макет.ПолучитьОбласть("КоннекторВерхПравоНиз"); Иначе Область = Макет.ПолучитьОбласть("КоннекторВерхПраво"); КонецЕсли; КонецЕсли; Область.Параметры.Документ = ?(ЭтоИсходныйОбъект, Неопределено, СтрокаДерева.Ссылка); Если Уровень = 1 Тогда ТаблицаОтчета.Вывести(Область); Иначе ТаблицаОтчета.Присоединить(Область); КонецЕсли; КонецЦикла; ВывестиПредставлениеИКартинку(СтрокаДерева, Макет, Ложь, Истина); ВывестиПодчиненныеЭлементыДерева(ПодчиненныеЭлементыДерева, Макет, УровниРекурсии + 1); КонецЦикла; КонецПроцедуры &НаКлиенте Процедура ВывестиСтруктуруПодчиненности() ОбновитьДеревоСтруктурыПодчиненности(); КонецПроцедуры #КонецОбласти #Область ПроцедурыПостроенияДереваПодчиненностиДокументов &НаСервере Процедура ОбновитьДеревоСтруктурыПодчиненности() Если Не ОсновнойДокументДоступен() Тогда ТекстСообщения = НСтр("ru = 'Документ, для которого сформирован отчет о структуре подчиненности, стал недоступен.'"); ОбщегоНазначения.СообщитьПользователю(ТекстСообщения); Возврат; КонецЕсли; Заголовок = Метаданные.ОбщиеФормы.СвязанныеДокументы.Представление() + ": " + ОбщегоНазначения.ПредметСтрокой(ОсновнойОбъект); СформироватьДеревьяДокументов(); ВывестиТабличныйДокумент(); КонецПроцедуры &НаСервере Процедура СформироватьДеревьяДокументов() ДеревоРодительскиеОбъекты.ПолучитьЭлементы().Очистить(); ДеревоПодчиненныеОбъекты.ПолучитьЭлементы().Очистить(); ВыведенныеОбъекты = Новый Соответствие; ВывестиРодительскиеОбъекты(ОсновнойОбъект, ДеревоРодительскиеОбъекты, ВыведенныеОбъекты); ВывестиПодчиненныеОбъекты(ОсновнойОбъект, ДеревоПодчиненныеОбъекты, ВыведенныеОбъекты); КонецПроцедуры &НаСервере Функция ОсновнойДокументДоступен() Запрос = Новый Запрос( "ВЫБРАТЬ РАЗРЕШЕННЫЕ | 1 |ИЗ | &ИмяТаблицы КАК Таб |ГДЕ | Таб.Ссылка = &ТекущийОбъект |"); Запрос.Текст = СтрЗаменить(Запрос.Текст, "&ИмяТаблицы", ОсновнойОбъект.Метаданные().ПолноеИмя()); Запрос.УстановитьПараметр("ТекущийОбъект", ОсновнойОбъект); Возврат Не Запрос.Выполнить().Пустой(); КонецФункции // Параметры: // СписокОбъектов - Массив // - ДокументСсылка // - СправочникСсылка // - ПланВидовХарактеристикСсылка // // Возвращаемое значение: // Запрос // &НаСервере Функция ЗапросПоРеквизитамОбъектов(СписокОбъектов) ОбъектыПоТипу = Новый Соответствие; Если ТипЗнч(СписокОбъектов) = Тип("Массив") Тогда Для каждого ТекущийОбъект Из СписокОбъектов Цикл Объекты = ОбъектыПоТипу[ТекущийОбъект.Метаданные()]; Если Объекты = Неопределено Тогда Объекты = Новый Массив; ОбъектыПоТипу[ТекущийОбъект.Метаданные()] = Объекты; КонецЕсли; Объекты.Добавить(ТекущийОбъект); КонецЦикла; Иначе ОбъектыПоТипу[СписокОбъектов.Метаданные()] = ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(СписокОбъектов); КонецЕсли; Запрос = Новый Запрос; ТекстыЗапросов = Новый Массив; Для каждого ТипОбъекта Из ОбъектыПоТипу Цикл ТекстЗапроса = "ВЫБРАТЬ РАЗРЕШЕННЫЕ | &Дата КАК Дата, | Ссылка, | &Проведен КАК Проведен, | ПометкаУдаления, | &Сумма КАК СуммаДокумента, | &Валюта КАК Валюта, | &Представление |ИЗ | &ИмяТаблицы |ГДЕ | Ссылка В (&Ссылка) |"; МетаданныеОбъекта = ТипОбъекта.Ключ; ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&ИмяТаблицы", МетаданныеОбъекта.ПолноеИмя()); Если ОбщегоНазначения.ЭтоДокумент(МетаданныеОбъекта) Тогда ИмяРеквизитаСумма = ИмяРеквизитаДокумента(МетаданныеОбъекта, "СуммаДокумента"); ИмяРеквизитаВалюта = ИмяРеквизитаДокумента(МетаданныеОбъекта, "Валюта"); ИмяРеквизитаПроведен = "Проведен"; ИмяРеквизитаДата = "Дата"; Иначе ИмяРеквизитаСумма = Неопределено; ИмяРеквизитаВалюта = Неопределено; ИмяРеквизитаПроведен = "Ложь"; ИмяРеквизитаДата = "Ложь"; КонецЕсли; ЗаменитьТекстЗапроса(ТекстЗапроса, МетаданныеОбъекта, "&Дата", ИмяРеквизитаДата, Истина); ЗаменитьТекстЗапроса(ТекстЗапроса, МетаданныеОбъекта, "&Проведен", ИмяРеквизитаПроведен, Истина); ЗаменитьТекстЗапроса(ТекстЗапроса, МетаданныеОбъекта, "&Сумма", ИмяРеквизитаСумма); ЗаменитьТекстЗапроса(ТекстЗапроса, МетаданныеОбъекта, "&Валюта", ИмяРеквизитаВалюта); ДопРеквизиты = РеквизитыДляПредставления(МетаданныеОбъекта.ПолноеИмя(), МетаданныеОбъекта.Имя); ТекстПредставление = "Представление КАК Представление"; // @query-part Для Индекс = 1 По 3 Цикл ТекстПредставление = ТекстПредставление + ", | " + ?(ДопРеквизиты.Количество() >= Индекс, ДопРеквизиты[Индекс - 1], "NULL") + " КАК ДополнительныйРеквизит" + Индекс; // @query-part-2, @query-part-3 КонецЦикла; ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&Представление", ТекстПредставление); ИмяПараметра = "Ссылка" + СтрЗаменить(МетаданныеОбъекта.ПолноеИмя(), ".", "_"); ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&Ссылка", "&" + ИмяПараметра); Запрос.УстановитьПараметр(ИмяПараметра, ТипОбъекта.Значение); Если ТекстыЗапросов.Количество() > 0 Тогда ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "ВЫБРАТЬ РАЗРЕШЕННЫЕ", "ВЫБРАТЬ"); // @query-part-1, @query-part-2 КонецЕсли; ТекстыЗапросов.Добавить(ТекстЗапроса); КонецЦикла; Запрос.Текст = СтрСоединить(ТекстыЗапросов, Символы.ПС + "ОБЪЕДИНИТЬ ВСЕ" + Символы.ПС); // @query-part Возврат Запрос; КонецФункции &НаСервере Процедура ВывестиРодительскиеОбъекты(ТекущийОбъект, ДеревоРодитель, ВыведенныеОбъекты, СлужебныеОбъекты = Неопределено, ИндексСвязейОбъектов = Неопределено) МетаданныеОбъекта = ТекущийОбъект.Метаданные(); СписокРеквизитов = Новый Массив; Если СлужебныеОбъекты = Неопределено Тогда СлужебныеОбъекты = Новый Соответствие; КонецЕсли; Если ИндексСвязейОбъектов = Неопределено Тогда ИндексСвязейОбъектов = Новый Соответствие; КонецЕсли; Для Каждого Реквизит Из МетаданныеОбъекта.Реквизиты Цикл Если Не Метаданные.КритерииОтбора.СвязанныеДокументы.Состав.Содержит(Реквизит) Тогда Продолжить; КонецЕсли; Для Каждого ТекущийТип Из Реквизит.Тип.Типы() Цикл МетаданныеРеквизита = МетаданныеТипаРеквизита(ТекущийТип); Если МетаданныеРеквизита.Метаданные = Неопределено Тогда Продолжить; КонецЕсли; ЗначениеРеквизита = ТекущийОбъект[Реквизит.Имя]; Если ЗначениеЗаполнено(ЗначениеРеквизита) И ТипЗнч(ЗначениеРеквизита) = ТекущийТип И ЗначениеРеквизита <> ТекущийОбъект И СписокРеквизитов.Найти(ЗначениеРеквизита) = Неопределено Тогда СписокРеквизитов.Добавить(ЗначениеРеквизита); КонецЕсли; КонецЦикла; КонецЦикла; Для Каждого ТабличнаяЧасть Из МетаданныеОбъекта.ТабличныеЧасти Цикл ИменаРеквизитов = ""; СодержимоеТЧ = ТекущийОбъект[ТабличнаяЧасть.Имя].Выгрузить(); // ТаблицаЗначений Для Каждого Реквизит Из ТабличнаяЧасть.Реквизиты Цикл Если Не Метаданные.КритерииОтбора.СвязанныеДокументы.Состав.Содержит(Реквизит) Тогда Продолжить; КонецЕсли; Для Каждого ТекущийТип Из Реквизит.Тип.Типы() Цикл МетаданныеРеквизита = МетаданныеТипаРеквизита(ТекущийТип); Если МетаданныеРеквизита.Метаданные = Неопределено Тогда Продолжить; КонецЕсли; ИменаРеквизитов = ИменаРеквизитов + ?(ИменаРеквизитов = "", "", ", ") + Реквизит.Имя; Прервать; КонецЦикла; КонецЦикла; СодержимоеТЧ.Свернуть(ИменаРеквизитов); Для Каждого КолонкаТЧ Из СодержимоеТЧ.Колонки Цикл Для Каждого СтрокаТЧ Из СодержимоеТЧ Цикл ЗначениеРеквизита = СтрокаТЧ[КолонкаТЧ.Имя]; МетаданныеЗначения = МетаданныеТипаРеквизита(ТипЗнч(ЗначениеРеквизита)); Если МетаданныеЗначения.Метаданные = Неопределено Тогда Продолжить; КонецЕсли; Если ЗначениеРеквизита = ТекущийОбъект Или СписокРеквизитов.Найти(ЗначениеРеквизита) <> Неопределено Тогда Продолжить; КонецЕсли; СписокРеквизитов.Добавить(ЗначениеРеквизита); КонецЦикла; КонецЦикла; КонецЦикла; Если СписокРеквизитов.Количество() > 0 Тогда ВыводимыеОбъекты = ЗапросПоРеквизитамОбъектов(СписокРеквизитов).Выполнить().Выгрузить(); ВыводимыеОбъекты.Сортировать("Дата"); Для каждого ВыводимыйОбъект Из ВыводимыеОбъекты Цикл Если ИндексСвязейОбъектов[ТекущийОбъект] = ВыводимыйОбъект.Ссылка Тогда Продолжить; КонецЕсли; ИндексСвязейОбъектов[ТекущийОбъект] = ВыводимыйОбъект.Ссылка; НоваяСтрока = ДобавитьСтрокуВДерево(ДеревоРодитель, ВыводимыйОбъект, ВыведенныеОбъекты); Если НоваяСтрока <> Неопределено И Не ДобавляемыйОбъектИмеетсяСредиРодителей(ДеревоРодитель, ВыводимыйОбъект.Ссылка) Тогда // @skip-check query-in-loop - Рекурсивный алгоритм обработки дерева. ВывестиРодительскиеОбъекты(ВыводимыйОбъект.Ссылка, НоваяСтрока, ВыведенныеОбъекты, СлужебныеОбъекты, ИндексСвязейОбъектов); ИначеЕсли СлужебныеОбъекты[ВыводимыйОбъект.Ссылка] = Неопределено Тогда СлужебныеОбъекты[ВыводимыйОбъект.Ссылка] = Истина; // @skip-check query-in-loop - Рекурсивный алгоритм обработки дерева. ВывестиРодительскиеОбъекты(ВыводимыйОбъект.Ссылка, ДеревоРодитель, ВыведенныеОбъекты, СлужебныеОбъекты, ИндексСвязейОбъектов); КонецЕсли; КонецЦикла; КонецЕсли; КонецПроцедуры // Параметры: // ТипРеквизита - Тип // // Возвращаемое значение: // Структура: // * Метаданные - ОбъектМетаданных // * ЭтоДокумент - Булево // &НаСервереБезКонтекста Функция МетаданныеТипаРеквизита(ТипРеквизита) Результат = Новый Структура("Метаданные, ЭтоДокумент", Неопределено, Ложь); МетаданныеРеквизита = Метаданные.НайтиПоТипу(ТипРеквизита); Если МетаданныеРеквизита = Неопределено Тогда Возврат Результат; КонецЕсли; Если Не ОбщегоНазначения.ОбъектМетаданныхДоступенПоФункциональнымОпциям(МетаданныеРеквизита) Или Не ПравоДоступа("Просмотр", МетаданныеРеквизита) Тогда Возврат Результат; КонецЕсли; Результат.ЭтоДокумент = Метаданные.Документы.Содержит(МетаданныеРеквизита); Если Не Результат.ЭтоДокумент И Не Метаданные.Справочники.Содержит(МетаданныеРеквизита) И Не Метаданные.ПланыВидовХарактеристик.Содержит(МетаданныеРеквизита) Тогда Возврат Результат; КонецЕсли; Результат.Метаданные = МетаданныеРеквизита; Возврат Результат; КонецФункции // Параметры: // СтрокаРодитель - ДанныеФормыДерево // - ДанныеФормыЭлементДерева // ИскомыйОбъект - ЛюбаяСсылка // // Возвращаемое значение: // Булево // &НаСервере Функция ДобавляемыйОбъектИмеетсяСредиРодителей(СтрокаРодитель, ИскомыйОбъект) Если ИскомыйОбъект = ОсновнойОбъект Тогда Возврат Истина; КонецЕсли; Если ТипЗнч(СтрокаРодитель) = Тип("ДанныеФормыДерево") Тогда Возврат Ложь; КонецЕсли; ТекущийРодитель = СтрокаРодитель; Пока ТекущийРодитель <> Неопределено Цикл Если ТекущийРодитель.Ссылка = ИскомыйОбъект Тогда Возврат Истина; КонецЕсли; ТекущийРодитель = ТекущийРодитель.ПолучитьРодителя(); КонецЦикла; Возврат Ложь; КонецФункции &НаСервере Процедура ЗаменитьТекстЗапроса(ТекстЗапроса, МетаданныеОбъекта, ЧтоЗаменять, ИмяРеквизита, НеИскатьВРеквизитах = Ложь) ЕстьРеквизит = НеИскатьВРеквизитах Или МетаданныеОбъекта.Реквизиты.Найти(ИмяРеквизита) <> Неопределено; ТекстЗапроса = СтрЗаменить(ТекстЗапроса, ЧтоЗаменять, ?(ЕстьРеквизит, ИмяРеквизита, "NULL")); КонецПроцедуры // Возвращает ссылки на связанные объекты. // // Возвращаемое значение: // ТаблицаЗначений: // * Ссылка - СправочникСсылка // - ДокументСсылка // &НаСервере Функция ОбъектыПоКритериюОтбора(ЗначениеКритерияОтбора) ШаблонЗапроса = "ВЫБРАТЬ РАЗРЕШЕННЫЕ | ПсевдонимТаблицы.Ссылка КАК Ссылка |ИЗ | ИмяТаблицы КАК ПсевдонимТаблицы |ГДЕ | ПсевдонимТаблицы.ИмяРеквизита = &ЗначениеКритерияОтбора"; ШаблонЗапросаОбъединения = "ВЫБРАТЬ | ПсевдонимТаблицы.Ссылка КАК Ссылка |ИЗ | ИмяТаблицы КАК ПсевдонимТаблицы |ГДЕ | ПсевдонимТаблицы.ИмяРеквизита = &ЗначениеКритерияОтбора"; ЧастиЗапроса = Новый Массив; ТекстЧастиЗапроса = ""; Для Каждого ЭлементСостава Из Метаданные.КритерииОтбора.СвязанныеДокументы.Состав Цикл Если НЕ ЭлементСостава.Тип.СодержитТип(ТипЗнч(ЗначениеКритерияОтбора)) Тогда Продолжить; КонецЕсли; ПутьКДанным = ЭлементСостава.ПолноеИмя(); Если СтрНайти(ПутьКДанным, "ТабличнаяЧасть") Тогда ОбъектМетаданных = ЭлементСостава.Родитель().Родитель(); Иначе ОбъектМетаданных = ЭлементСостава.Родитель(); КонецЕсли; Если НЕ ПравоДоступа("Чтение", ОбъектМетаданных) Тогда Продолжить; КонецЕсли; Точка = СтрНайти(ПутьКДанным, ".", НаправлениеПоиска.СКонца); ИмяРеквизита = Сред(ПутьКДанным, Точка + 1); ИмяТаблицы = ЭлементСостава.Родитель().ПолноеИмя(); ИмяТаблицы = СтрЗаменить(ИмяТаблицы, "ТабличнаяЧасть.", ""); Точка = СтрНайти(ИмяТаблицы, ".", НаправлениеПоиска.СКонца); ПсевдонимТаблицы = "Таблица_" + Сред(ИмяТаблицы, Точка + 1); ТекстЧастиЗапроса = ?(ТекстЧастиЗапроса = "", ШаблонЗапроса, ШаблонЗапросаОбъединения); ТекстЧастиЗапроса = СтрЗаменить(ТекстЧастиЗапроса, "ИмяТаблицы", ИмяТаблицы); ТекстЧастиЗапроса = СтрЗаменить(ТекстЧастиЗапроса, "ПсевдонимТаблицы", ПсевдонимТаблицы); ТекстЧастиЗапроса = СтрЗаменить(ТекстЧастиЗапроса, "ИмяРеквизита", ИмяРеквизита); ЧастиЗапроса.Добавить(ТекстЧастиЗапроса); КонецЦикла; Если ЧастиЗапроса.Количество() > 0 Тогда Запрос = Новый Запрос; Разделитель = Символы.ПС + "ОБЪЕДИНИТЬ" + Символы.ПС; Запрос.Текст = СтрСоединить(ЧастиЗапроса, Разделитель); Запрос.УстановитьПараметр("ЗначениеКритерияОтбора", ЗначениеКритерияОтбора); Возврат Запрос.Выполнить().Выгрузить(); Иначе Возврат Новый ТаблицаЗначений; КонецЕсли; КонецФункции &НаСервере Процедура ВывестиПодчиненныеОбъекты(ТекущийОбъект, ДеревоРодитель, ВыведенныеОбъекты, СлужебныеОбъекты = Неопределено, ИндексСвязейОбъектов = Неопределено) Таблица = ОбъектыПоКритериюОтбора(ТекущийОбъект); Если Таблица = Неопределено Тогда Возврат; КонецЕсли; Если СлужебныеОбъекты = Неопределено Тогда СлужебныеОбъекты = Новый Соответствие; КонецЕсли; Если ИндексСвязейОбъектов = Неопределено Тогда ИндексСвязейОбъектов = Новый Соответствие; КонецЕсли; СписокОбъектов = Новый Массив; Для Каждого СтрокаТаблицы Из Таблица Цикл ТекущаяСсылка = СтрокаТаблицы.Ссылка; // СправочникСсылка, ДокументСсылка МетаданныеОбъекта = ТекущаяСсылка.Метаданные(); Если Не ПравоДоступа("Просмотр", МетаданныеОбъекта) Тогда Продолжить; КонецЕсли; СписокОбъектов.Добавить(ТекущаяСсылка); КонецЦикла; Если СписокОбъектов.Количество() = 0 Тогда Возврат; КонецЕсли; ВыводимыеОбъекты = ЗапросПоРеквизитамОбъектов(СписокОбъектов).Выполнить().Выгрузить(); ВыводимыеОбъекты.Сортировать("Дата"); Для каждого ВыводимыйОбъект Из ВыводимыеОбъекты Цикл Если ИндексСвязейОбъектов[ТекущийОбъект] = ВыводимыйОбъект.Ссылка Тогда Продолжить; КонецЕсли; ИндексСвязейОбъектов[ТекущийОбъект] = ВыводимыйОбъект.Ссылка; НоваяСтрока = ДобавитьСтрокуВДерево(ДеревоРодитель, ВыводимыйОбъект, ВыведенныеОбъекты, Истина); Если НоваяСтрока <> Неопределено И Не ДобавляемыйОбъектИмеетсяСредиРодителей(ДеревоРодитель, ВыводимыйОбъект.Ссылка) Тогда // @skip-check query-in-loop - Рекурсивный алгоритм обработки дерева. ВывестиПодчиненныеОбъекты(ВыводимыйОбъект.Ссылка, НоваяСтрока, ВыведенныеОбъекты, СлужебныеОбъекты, ИндексСвязейОбъектов); ИначеЕсли СлужебныеОбъекты[ВыводимыйОбъект.Ссылка] = Неопределено Тогда СлужебныеОбъекты.Вставить(ВыводимыйОбъект.Ссылка, Истина); // @skip-check query-in-loop - Рекурсивный алгоритм обработки дерева. ВывестиПодчиненныеОбъекты(ВыводимыйОбъект.Ссылка, ДеревоРодитель, ВыведенныеОбъекты, СлужебныеОбъекты, ИндексСвязейОбъектов); КонецЕсли; КонецЦикла; КонецПроцедуры &НаСервере Функция ДобавитьСтрокуВДерево(Родитель, Данные, ВыведенныеОбъекты, ЭтоПодчиненный = Ложь) УстановитьЧастотуВыводаОбъекта(Данные.Ссылка, ВыведенныеОбъекты, ЭтоПодчиненный); Если Не ВыводитьТекущийОбъект(Родитель, Данные.Ссылка, ВыведенныеОбъекты, ЭтоПодчиненный) Тогда Возврат Неопределено; КонецЕсли; НоваяСтрока = Родитель.ПолучитьЭлементы().Добавить(); ОбщиеСвойства = "Ссылка, Представление, СуммаДокумента, Валюта, Проведен, ПометкаУдаления"; ЗаполнитьЗначенияСвойств(НоваяСтрока, Данные, ОбщиеСвойства); ПереопределенноеПредставление = ПредставлениеОбъектаДляВывода(Данные); Если ПереопределенноеПредставление <> Неопределено Тогда НоваяСтрока.Представление = ПереопределенноеПредставление; Иначе НоваяСтрока.Представление = ПредставлениеОбъектаДляВыводаВОтчет(Данные); КонецЕсли; Возврат НоваяСтрока; КонецФункции &НаСервере Функция ВыводитьТекущийОбъект(Родитель, ТекущийОбъект, ВыведенныеОбъекты, ЭтоПодчиненный, Отказ = Ложь) Выводился = ВыведенныеОбъекты[ТекущийОбъект]; Если Выводился = Неопределено Тогда Выводился = НовыеСвойстваЧастотыВыводаОбъекта(); КонецЕсли; СвойстваОбъекта = НовыеСвойстваОбъекта(); СвойстваОбъекта.ЭтоОсновной = (ТекущийОбъект = ОсновнойОбъект); СвойстваОбъекта.ЭтоПодчиненный = ЭтоПодчиненный; СвойстваОбъекта.Выводился = Выводился; Если СвойстваОбъекта.ЭтоОсновной Или ТекущийОбъектВыводилсяВВетке(Родитель, ТекущийОбъект) Тогда Отказ = Истина; КонецЕсли; СтруктураПодчиненностиПереопределяемый.ПередВыводомСвязанногоОбъекта(ТекущийОбъект, СвойстваОбъекта, Отказ); Возврат Не Отказ; КонецФункции &НаСервере Функция НовыеСвойстваОбъекта() СвойстваОбъекта = Новый Структура; СвойстваОбъекта.Вставить("ЭтоОсновной", Ложь); СвойстваОбъекта.Вставить("ЭтоСлужебный", Ложь); СвойстваОбъекта.Вставить("ЭтоПодчиненный", Ложь); СвойстваОбъекта.Вставить("Выводился", НовыеСвойстваЧастотыВыводаОбъекта()); Возврат СвойстваОбъекта; КонецФункции &НаСервере Функция ТекущийОбъектВыводилсяВВетке(Знач Родитель, Знач ТекущийОбъект, Выводился = Ложь) Пока Родитель <> Неопределено Цикл ЭтоСтрока = (ТипЗнч(Родитель) = Тип("ДанныеФормыЭлементДерева")); Если ЭтоСтрока И ТекущийОбъект = Родитель.Ссылка Тогда Выводился = Истина; Возврат Выводился; КонецЕсли; Для Каждого Элемент Из Родитель.ПолучитьЭлементы() Цикл Если ТекущийОбъект = Элемент.Ссылка Тогда Выводился = Истина; Прервать; КонецЕсли; КонецЦикла; Если ЭтоСтрока И Не Выводился Тогда Родитель = Родитель.ПолучитьРодителя(); Иначе Прервать; КонецЕсли; КонецЦикла; Возврат Выводился; КонецФункции &НаСервере Процедура УстановитьЧастотуВыводаОбъекта(ТекущийОбъект, ВыведенныеОбъекты, ЭтоПодчиненный) Выводился = ВыведенныеОбъекты[ТекущийОбъект]; Если Выводился = Неопределено Тогда Выводился = НовыеСвойстваЧастотыВыводаОбъекта(); КонецЕсли; Выводился.Итого = Выводился.Итого + 1; Если ЭтоПодчиненный Тогда Выводился.ВПодчиненных = Выводился.ВПодчиненных + 1; КонецЕсли; ВыведенныеОбъекты.Вставить(ТекущийОбъект, Выводился); КонецПроцедуры &НаСервере Функция НовыеСвойстваЧастотыВыводаОбъекта() СвойстваЧастотыВывода = Новый Структура; СвойстваЧастотыВывода.Вставить("Итого", 0); СвойстваЧастотыВывода.Вставить("ВПодчиненных", 0); Возврат СвойстваЧастотыВывода; КонецФункции &НаСервере Функция ИмяРеквизитаДокумента(Знач МетаданныеОбъекта, Знач ИмяРеквизита) ИменаРеквизитов = Настройки.Реквизиты[МетаданныеОбъекта.ПолноеИмя()]; Если ИменаРеквизитов <> Неопределено Тогда Результат = ИменаРеквизитов[ИмяРеквизита]; Возврат ?(Результат <> Неопределено, Результат, ИмяРеквизита); КонецЕсли; // Для обратной совместимости. ИмяРеквизитаДокумента = СтруктураПодчиненностиПереопределяемый.ИмяРеквизитаДокумента(МетаданныеОбъекта.Имя, ИмяРеквизита); // АПК:222 Если ИмяРеквизита = "СуммаДокумента" Тогда Возврат ?(ИмяРеквизитаДокумента = Неопределено, "СуммаДокумента", ИмяРеквизитаДокумента); ИначеЕсли ИмяРеквизита = "Валюта" Тогда Возврат ?(ИмяРеквизитаДокумента = Неопределено, "Валюта", ИмяРеквизитаДокумента); КонецЕсли; КонецФункции &НаСервере Процедура ОпределитьНастройки() НастройкиПодсистемы = Новый Структура; НастройкиПодсистемы.Вставить("Реквизиты", Новый Соответствие); НастройкиПодсистемы.Вставить("РеквизитыДляПредставления", Новый Соответствие); СтруктураПодчиненностиПереопределяемый.ПриОпределенииНастроек(НастройкиПодсистемы); Настройки = НастройкиПодсистемы; КонецПроцедуры &НаСервере Функция РеквизитыДляПредставления(Знач ПолноеИмяОбъектаМетаданных, Знач ИмяОбъектаМетаданных) Результат = Настройки.РеквизитыДляПредставления[ПолноеИмяОбъектаМетаданных]; Если Результат <> Неопределено Тогда Возврат Результат; КонецЕсли; // Для обратной совместимости. Возврат СтруктураПодчиненностиПереопределяемый.МассивРеквизитовОбъектаДляФормированияПредставления(ИмяОбъектаМетаданных); // АПК:222 КонецФункции &НаСервере Функция ПредставлениеОбъектаДляВывода(Данные) Результат = ""; СтандартнаяОбработка = Истина; СтруктураПодчиненностиПереопределяемый.ПриПолученииПредставления(ТипЗнч(Данные.Ссылка), Данные, Результат, СтандартнаяОбработка); Если Не СтандартнаяОбработка Тогда Возврат Результат; КонецЕсли; // Для обратной совместимости. Возврат СтруктураПодчиненностиПереопределяемый.ПредставлениеОбъектаДляВыводаВОтчет(Данные); // АПК:222 КонецФункции #КонецОбласти #Область ПроцедурыИзмененияСостоянияОбъектов &НаКлиенте Функция ВыбранныеЭлементы() ВыбранныеЭлементы = Новый Массив; ВыделенныеОбласти = Элементы.ТаблицаОтчета.ПолучитьВыделенныеОбласти(); Для Каждого ВыделеннаяОбласть Из ВыделенныеОбласти Цикл Если ТипЗнч(ВыделеннаяОбласть) <> Тип("ОбластьЯчеекТабличногоДокумента") Тогда Продолжить; КонецЕсли; Границы = ГраницыВыделеннойОбласти(ВыделеннаяОбласть); Для НомерКолонки = Границы.Лево По Границы.Право Цикл Для НомерСтроки = Границы.Верх По Границы.Низ Цикл Ячейка = ТаблицаОтчета.Область(НомерСтроки, НомерКолонки, НомерСтроки, НомерКолонки); Если ЗначениеЗаполнено(Ячейка.Расшифровка) Тогда ВыбранныеЭлементы.Добавить(Ячейка.Расшифровка); КонецЕсли; КонецЦикла; КонецЦикла; КонецЦикла; Возврат ВыбранныеЭлементы; КонецФункции &НаКлиенте Функция ГраницыВыделеннойОбласти(ВыделеннаяОбласть) Границы = Новый Структура("Лево, Верх, Низ, Право"); ЗаполнитьЗначенияСвойств(Границы, ВыделеннаяОбласть); Если Границы.Лево = 0 Тогда Границы.Лево = 1; КонецЕсли; Если Границы.Верх = 0 Тогда Границы.Верх = 1; КонецЕсли; Если Границы.Низ = 0 Тогда Границы.Низ = 1; КонецЕсли; Если Границы.Право = 0 Тогда Границы.Право = 1; КонецЕсли; Возврат Границы; КонецФункции // Изменение пометки удаления. &НаСервереБезКонтекста Функция СтатистикаПоВыбраннымЭлементам(ВыбранныеЭлементы) Статистика = Новый Структура; Статистика.Вставить("СПометкойНаУдаление", Новый Соответствие); Статистика.Вставить("БезПометкиНаУдаление", Новый Соответствие); СвойстваЭлементов = ОбщегоНазначения.ЗначенияРеквизитовОбъектов(ВыбранныеЭлементы, "ПометкаУдаления, Представление"); Для Каждого Элемент Из ВыбранныеЭлементы Цикл СвойстваЭлемента = СвойстваЭлементов[Элемент]; Если СвойстваЭлемента.ПометкаУдаления Тогда Статистика.СПометкойНаУдаление.Вставить(Элемент, СвойстваЭлемента.Представление); Иначе Статистика.БезПометкиНаУдаление.Вставить(Элемент, СвойстваЭлемента.Представление); КонецЕсли; КонецЦикла; Возврат Статистика; КонецФункции // Возвращаемое значение: // Структура: // * Пояснение - Строка // * Ссылка - Строка // * Оповещение - Строка // * Вопрос - Строка // * Пометка - Булево // &НаКлиенте Функция СценарийИзмененияПометкиУдаления(ВыбранныеЭлементы, СтатистикаПоВыбраннымЭлементам) Сценарий = Новый Структура; Сценарий.Вставить("Пометка", Ложь); Сценарий.Вставить("Вопрос", ""); Сценарий.Вставить("Оповещение", ""); Сценарий.Вставить("Ссылка", ""); Сценарий.Вставить("Пояснение", ""); КоличествоВыбранныхЭлементов = ВыбранныеЭлементы.Количество(); КоличествоПомеченныхНаУдаление = СтатистикаПоВыбраннымЭлементам.СПометкойНаУдаление.Количество(); Если КоличествоВыбранныхЭлементов = 1 Тогда Элемент = ВыбранныеЭлементы[0]; Сценарий.Ссылка = ПолучитьНавигационнуюСсылку(Элемент); Если КоличествоПомеченныхНаУдаление = 0 Тогда ПредставлениеЭлемента = СтатистикаПоВыбраннымЭлементам.БезПометкиНаУдаление[Элемент]; Сценарий.Пометка = Истина; Сценарий.Оповещение = НСтр("ru = 'Пометка удаления установлена'"); Сценарий.Пояснение = ПредставлениеЭлемента; Сценарий.Вопрос = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Пометить ""%1"" на удаление?'"), ПредставлениеЭлемента); Иначе ПредставлениеЭлемента = СтатистикаПоВыбраннымЭлементам.СПометкойНаУдаление[Элемент]; Сценарий.Оповещение = НСтр("ru = 'Пометка удаления снята'"); Сценарий.Пояснение = ПредставлениеЭлемента; Сценарий.Вопрос = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Снять с ""%1"" пометку на удаление?'"), ПредставлениеЭлемента); КонецЕсли; Иначе Сценарий.Пояснение = Заголовок; Если КоличествоПомеченныхНаУдаление = 0 Тогда Сценарий.Пометка = Истина; Сценарий.Вопрос = НСтр("ru = 'Пометить выделенные элементы на удаление?'"); Сценарий.Оповещение = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Пометка удаления установлена (%1)'"), КоличествоВыбранныхЭлементов); ИначеЕсли КоличествоПомеченныхНаУдаление = КоличествоВыбранныхЭлементов Тогда Сценарий.Вопрос = НСтр("ru = 'Снять с выделенных элементов пометку на удаление?'"); Сценарий.Оповещение = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Пометка удаления снята (%1)'"), КоличествоВыбранныхЭлементов); Иначе // Если часть выбранных элементов помечена на удаление, то система должна обработать только их, сняв пометку. ВыбранныеЭлементы.Очистить(); Для Каждого Элемент Из СтатистикаПоВыбраннымЭлементам.СПометкойНаУдаление Цикл ВыбранныеЭлементы.Добавить(Элемент.Ключ); КонецЦикла; Сценарий = СценарийИзмененияПометкиУдаления(ВыбранныеЭлементы, СтатистикаПоВыбраннымЭлементам); КонецЕсли; КонецЕсли; Возврат Сценарий; КонецФункции // Параметры: // Ответ - КодВозвратаДиалога // Сценарий - см. СценарийИзмененияПометкиУдаления // &НаКлиенте Процедура ВыполнитьСценарийИзмененияПометкиУдаления(Ответ, Сценарий) Экспорт Если Ответ <> КодВозвратаДиалога.Да Тогда Возврат; КонецЕсли; Ошибки = ИзменитьПометкуУдаленияЭлементов(Сценарий.ВыбранныеЭлементы, Сценарий.Пометка); Если Ошибки.Количество() > 0 Тогда ПредупредитьОбОшибкеПриИзмененииЭлементов(Ошибки, "ПометкаУдаления"); Иначе ПоказатьОповещениеПользователя( Сценарий.Оповещение, Сценарий.Ссылка, Сценарий.Пояснение, БиблиотекаКартинок.ДиалогИнформация); КонецЕсли; ОбщегоНазначенияКлиент.ОповеститьОбИзмененииОбъектов(Сценарий.ВыбранныеЭлементы); КонецПроцедуры &НаСервере Функция ИзменитьПометкуУдаленияЭлементов(ВыбранныеЭлементы, Пометка) Ошибки = Новый Массив; Для Каждого Элемент Из ВыбранныеЭлементы Цикл НачатьТранзакцию(); Попытка Блокировка = Новый БлокировкаДанных; ЭлементБлокировки = Блокировка.Добавить(Элемент.Метаданные().ПолноеИмя()); ЭлементБлокировки.УстановитьЗначение("Ссылка", Элемент); Блокировка.Заблокировать(); ВыбранныйОбъект = Элемент.ПолучитьОбъект(); ЗаблокироватьДанныеДляРедактирования(Элемент); ВыбранныйОбъект.УстановитьПометкуУдаления(Пометка); ЗафиксироватьТранзакцию(); Исключение ОтменитьТранзакцию(); ЗаписьЖурналаРегистрации(НСтр("ru = 'Связанные документы.Изменение пометки удаления'", ОбщегоНазначения.КодОсновногоЯзыка()), УровеньЖурналаРегистрации.Ошибка,, Элемент, ОбработкаОшибок.ПодробноеПредставлениеОшибки(ИнформацияОбОшибке())); Ошибки.Добавить(ОбработкаОшибок.КраткоеПредставлениеОшибки(ИнформацияОбОшибке())); КонецПопытки; КонецЦикла; ОбновитьДеревоСтруктурыПодчиненности(); Возврат Ошибки; КонецФункции &НаКлиенте Процедура ИзменитьПроведениеДокументов(Режим) ОчиститьСообщения(); ВыбранныеДокументы = ВыбранныеЭлементы(); Если ВыбранныеДокументы.Количество() = 0 Тогда Возврат; КонецЕсли; Ошибки = Новый Массив; ОбработанныеДокументы = ОбработанныеДокументы(ВыбранныеДокументы, Режим, Ошибки); КоличествоОбработанныхДокументов = ОбработанныеДокументы.Количество(); Если Ошибки.Количество() > 0 Тогда ПредупредитьОбОшибкеПриИзмененииЭлементов(Ошибки, "Проведение"); Возврат; КонецЕсли; Если КоличествоОбработанныхДокументов = 0 Тогда Возврат; КонецЕсли; Если КоличествоОбработанныхДокументов = 1 Тогда Документ = ВыбранныеДокументы[0]; Оповещение = НСтр("ru = 'Изменение'"); Ссылка = ПолучитьНавигационнуюСсылку(Документ); Пояснение = ОбработанныеДокументы[Документ]; Иначе Ссылка = ""; Пояснение = Заголовок; Оповещение = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Изменение (%1)'"), КоличествоОбработанныхДокументов); КонецЕсли; ПоказатьОповещениеПользователя(Оповещение, Ссылка, Пояснение, БиблиотекаКартинок.ДиалогИнформация); ОбщегоНазначенияКлиент.ОповеститьОбИзмененииОбъектов(ВыбранныеДокументы); КонецПроцедуры &НаСервере Функция ОбработанныеДокументы(ВыбранныеДокументы, Режим, Ошибки) ОбработанныеДокументы = Новый Соответствие; Индекс = ВыбранныеДокументы.ВГраница(); Пока Индекс >= 0 Цикл МетаданныеОбъекта = ВыбранныеДокументы[Индекс].Метаданные(); ПроведениеРазрешено = Метаданные.СвойстваОбъектов.Проведение.Разрешить; Если Не ОбщегоНазначения.ЭтоДокумент(МетаданныеОбъекта) Или МетаданныеОбъекта.Проведение <> ПроведениеРазрешено Тогда ВыбранныеДокументы.Удалить(Индекс); КонецЕсли; Индекс = Индекс - 1; КонецЦикла; Если ВыбранныеДокументы.Количество() = 0 Тогда Возврат ОбработанныеДокументы; КонецЕсли; СвойстваДокументов = ОбщегоНазначения.ЗначенияРеквизитовОбъектов(ВыбранныеДокументы, "Проведен, Представление"); Индекс = ВыбранныеДокументы.ВГраница(); Пока Индекс >= 0 Цикл Документ = ВыбранныеДокументы[Индекс]; СвойстваДокумента = СвойстваДокументов[Документ]; Если Режим = РежимЗаписиДокумента.ОтменаПроведения И Не СвойстваДокумента.Проведен Тогда ВыбранныеДокументы.Удалить(Индекс); Индекс = Индекс - 1; Продолжить; КонецЕсли; Индекс = Индекс - 1; НачатьТранзакцию(); Попытка Блокировка = Новый БлокировкаДанных; ЭлементБлокировки = Блокировка.Добавить(Документ.Метаданные().ПолноеИмя()); ЭлементБлокировки.УстановитьЗначение("Ссылка", Документ); Блокировка.Заблокировать(); ВыбранныйОбъект = Документ.ПолучитьОбъект(); // ДокументОбъект Если ВыбранныйОбъект.ПроверитьЗаполнение() Тогда ЗаблокироватьДанныеДляРедактирования(Документ); ВыбранныйОбъект.Записать(Режим); КонецЕсли; ОбработанныеДокументы.Вставить(Документ, СвойстваДокумента.Представление); ЗафиксироватьТранзакцию(); Исключение ОтменитьТранзакцию(); ЗаписьЖурналаРегистрации(НСтр("ru = 'Связанные документы.Проведение документа'", ОбщегоНазначения.КодОсновногоЯзыка()), УровеньЖурналаРегистрации.Ошибка,, Документ, ОбработкаОшибок.ПодробноеПредставлениеОшибки(ИнформацияОбОшибке())); Ошибки.Добавить(ОбработкаОшибок.КраткоеПредставлениеОшибки(ИнформацияОбОшибке())); КонецПопытки; КонецЦикла; ОбновитьДеревоСтруктурыПодчиненности(); Возврат ОбработанныеДокументы; КонецФункции // Общее. &НаКлиенте Процедура ПредупредитьОбОшибкеПриИзмененииЭлементов(Ошибки, Сценарий) ОшибкиСвернутые = ОбщегоНазначенияКлиентСервер.СвернутьМассив(Ошибки); Если ОшибкиСвернутые.Количество() = 1 Тогда ТекстПредупреждения = ОшибкиСвернутые[0]; Иначе ШаблонПредупреждения = ?(Сценарий = "ПометкаУдаления", НСтр("ru = 'Не удалось изменить пометку удаления документов: |%1'"), НСтр("ru = 'Не удалось провести документы: |%1'")); ТекстПредупреждения = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( ШаблонПредупреждения, СтрСоединить(ОшибкиСвернутые, Символы.ПС)); КонецЕсли; ПоказатьПредупреждение(, ТекстПредупреждения); КонецПроцедуры #КонецОбласти #КонецОбласти
45,035
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 3247, "qsc_code_num_chars": 45035.0, "qsc_code_mean_word_length": 10.82722513, "qsc_code_frac_words_unique": 0.17154296, "qsc_code_frac_chars_top_2grams": 0.01706679, "qsc_code_frac_chars_top_3grams": 0.02090682, "qsc_code_frac_chars_top_4grams": 0.01792013, "qsc_code_frac_chars_dupe_5grams": 0.26359654, "qsc_code_frac_chars_dupe_6grams": 0.24294573, "qsc_code_frac_chars_dupe_7grams": 0.22570827, "qsc_code_frac_chars_dupe_8grams": 0.2069348, "qsc_code_frac_chars_dupe_9grams": 0.18944135, "qsc_code_frac_chars_dupe_10grams": 0.15553533, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00249088, "qsc_code_frac_chars_whitespace": 0.13529477, "qsc_code_size_file_byte": 45035.0, "qsc_code_num_lines": 1441.0, "qsc_code_num_chars_line_max": 135.0, "qsc_code_num_chars_line_mean": 31.25260236, "qsc_code_frac_chars_alphabet": 0.90026193, "qsc_code_frac_chars_comments": 0.99766848, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
package com.ruoyi.common.utils; import java.lang.management.ManagementFactory; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.lang3.time.DateFormatUtils; /** * 时间工具类 * * @author ruoyi */ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { public static String YYYY = "yyyy"; public static String YYYY_MM = "yyyy-MM"; public static String YYYY_MM_DD = "yyyy-MM-dd"; public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; private static String[] parsePatterns = { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; /** * 获取当前Date型日期 * * @return Date() 当前日期 */ public static Date getNowDate() { return new Date(); } /** * 获取当前日期, 默认格式为yyyy-MM-dd * * @return String */ public static String getDate() { return dateTimeNow(YYYY_MM_DD); } public static final String getTime() { return dateTimeNow(YYYY_MM_DD_HH_MM_SS); } public static final String dateTimeNow() { return dateTimeNow(YYYYMMDDHHMMSS); } public static final String dateTimeNow(final String format) { return parseDateToStr(format, new Date()); } public static final String dateTime(final Date date) { return parseDateToStr(YYYY_MM_DD, date); } public static final String parseDateToStr(final String format, final Date date) { return new SimpleDateFormat(format).format(date); } public static final Date dateTime(final String format, final String ts) { try { return new SimpleDateFormat(format).parse(ts); } catch (ParseException e) { throw new RuntimeException(e); } } /** * 日期路径 即年/月/日 如2018/08/08 */ public static final String datePath() { Date now = new Date(); return DateFormatUtils.format(now, "yyyy/MM/dd"); } /** * 日期路径 即年/月/日 如20180808 */ public static final String dateTime() { Date now = new Date(); return DateFormatUtils.format(now, "yyyyMMdd"); } /** * 日期型字符串转化为日期 格式 */ public static Date parseDate(Object str) { if (str == null) { return null; } try { return parseDate(str.toString(), parsePatterns); } catch (ParseException e) { return null; } } /** * 获取服务器启动时间 */ public static Date getServerStartDate() { long time = ManagementFactory.getRuntimeMXBean().getStartTime(); return new Date(time); } /** * 计算两个时间差 */ public static String getDatePoor(Date endDate, Date nowDate) { long nd = 1000 * 24 * 60 * 60; long nh = 1000 * 60 * 60; long nm = 1000 * 60; // long ns = 1000; // 获得两个时间的毫秒时间差异 long diff = endDate.getTime() - nowDate.getTime(); // 计算差多少天 long day = diff / nd; // 计算差多少小时 long hour = diff % nd / nh; // 计算差多少分钟 long min = diff % nd % nh / nm; // 计算差多少秒//输出结果 // long sec = diff % nd % nh % nm / ns; return day + "天" + hour + "小时" + min + "分钟"; } }
3,620
DateUtils
java
en
java
code
{"qsc_code_num_words": 399, "qsc_code_num_chars": 3620.0, "qsc_code_mean_word_length": 5.03759398, "qsc_code_frac_words_unique": 0.26566416, "qsc_code_frac_chars_top_2grams": 0.06567164, "qsc_code_frac_chars_top_3grams": 0.06766169, "qsc_code_frac_chars_top_4grams": 0.04477612, "qsc_code_frac_chars_dupe_5grams": 0.3, "qsc_code_frac_chars_dupe_6grams": 0.15024876, "qsc_code_frac_chars_dupe_7grams": 0.11641791, "qsc_code_frac_chars_dupe_8grams": 0.11641791, "qsc_code_frac_chars_dupe_9grams": 0.07263682, "qsc_code_frac_chars_dupe_10grams": 0.07263682, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01880621, "qsc_code_frac_chars_whitespace": 0.32430939, "qsc_code_size_file_byte": 3620.0, "qsc_code_num_lines": 155.0, "qsc_code_num_chars_line_max": 84.0, "qsc_code_num_chars_line_mean": 23.35483871, "qsc_code_frac_chars_alphabet": 0.80294358, "qsc_code_frac_chars_comments": 0.12707182, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.08163265, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07373418, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.1122449, "qsc_codejava_score_lines_no_logic": 0.19387755, "qsc_codejava_frac_words_no_modifier": 0.41666667, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1wheel/swoopy-drag
lib/data.tsv
sepalLength sepalWidth petalLength petalWidth species 5.1 3.5 1.4 0.2 setosa 4.9 3.0 1.4 0.2 setosa 4.7 3.2 1.3 0.2 setosa 4.6 3.1 1.5 0.2 setosa 5.0 3.6 1.4 0.2 setosa 5.4 3.9 1.7 0.4 setosa 4.6 3.4 1.4 0.3 setosa 5.0 3.4 1.5 0.2 setosa 4.4 2.9 1.4 0.2 setosa 4.9 3.1 1.5 0.1 setosa 5.4 3.7 1.5 0.2 setosa 4.8 3.4 1.6 0.2 setosa 4.8 3.0 1.4 0.1 setosa 4.3 3.0 1.1 0.1 setosa 5.8 4.0 1.2 0.2 setosa 5.7 4.4 1.5 0.4 setosa 5.4 3.9 1.3 0.4 setosa 5.1 3.5 1.4 0.3 setosa 5.7 3.8 1.7 0.3 setosa 5.1 3.8 1.5 0.3 setosa 5.4 3.4 1.7 0.2 setosa 5.1 3.7 1.5 0.4 setosa 4.6 3.6 1.0 0.2 setosa 5.1 3.3 1.7 0.5 setosa 4.8 3.4 1.9 0.2 setosa 5.0 3.0 1.6 0.2 setosa 5.0 3.4 1.6 0.4 setosa 5.2 3.5 1.5 0.2 setosa 5.2 3.4 1.4 0.2 setosa 4.7 3.2 1.6 0.2 setosa 4.8 3.1 1.6 0.2 setosa 5.4 3.4 1.5 0.4 setosa 5.2 4.1 1.5 0.1 setosa 5.5 4.2 1.4 0.2 setosa 4.9 3.1 1.5 0.2 setosa 5.0 3.2 1.2 0.2 setosa 5.5 3.5 1.3 0.2 setosa 4.9 3.6 1.4 0.1 setosa 4.4 3.0 1.3 0.2 setosa 5.1 3.4 1.5 0.2 setosa 5.0 3.5 1.3 0.3 setosa 4.5 2.3 1.3 0.3 setosa 4.4 3.2 1.3 0.2 setosa 5.0 3.5 1.6 0.6 setosa 5.1 3.8 1.9 0.4 setosa 4.8 3.0 1.4 0.3 setosa 5.1 3.8 1.6 0.2 setosa 4.6 3.2 1.4 0.2 setosa 5.3 3.7 1.5 0.2 setosa 5.0 3.3 1.4 0.2 setosa 7.0 3.2 4.7 1.4 versicolor 6.4 3.2 4.5 1.5 versicolor 6.9 3.1 4.9 1.5 versicolor 5.5 2.3 4.0 1.3 versicolor 6.5 2.8 4.6 1.5 versicolor 5.7 2.8 4.5 1.3 versicolor 6.3 3.3 4.7 1.6 versicolor 4.9 2.4 3.3 1.0 versicolor 6.6 2.9 4.6 1.3 versicolor 5.2 2.7 3.9 1.4 versicolor 5.0 2.0 3.5 1.0 versicolor 5.9 3.0 4.2 1.5 versicolor 6.0 2.2 4.0 1.0 versicolor 6.1 2.9 4.7 1.4 versicolor 5.6 2.9 3.6 1.3 versicolor 6.7 3.1 4.4 1.4 versicolor 5.6 3.0 4.5 1.5 versicolor 5.8 2.7 4.1 1.0 versicolor 6.2 2.2 4.5 1.5 versicolor 5.6 2.5 3.9 1.1 versicolor 5.9 3.2 4.8 1.8 versicolor 6.1 2.8 4.0 1.3 versicolor 6.3 2.5 4.9 1.5 versicolor 6.1 2.8 4.7 1.2 versicolor 6.4 2.9 4.3 1.3 versicolor 6.6 3.0 4.4 1.4 versicolor 6.8 2.8 4.8 1.4 versicolor 6.7 3.0 5.0 1.7 versicolor 6.0 2.9 4.5 1.5 versicolor 5.7 2.6 3.5 1.0 versicolor 5.5 2.4 3.8 1.1 versicolor 5.5 2.4 3.7 1.0 versicolor 5.8 2.7 3.9 1.2 versicolor 6.0 2.7 5.1 1.6 versicolor 5.4 3.0 4.5 1.5 versicolor 6.0 3.4 4.5 1.6 versicolor 6.7 3.1 4.7 1.5 versicolor 6.3 2.3 4.4 1.3 versicolor 5.6 3.0 4.1 1.3 versicolor 5.5 2.5 4.0 1.3 versicolor 5.5 2.6 4.4 1.2 versicolor 6.1 3.0 4.6 1.4 versicolor 5.8 2.6 4.0 1.2 versicolor 5.0 2.3 3.3 1.0 versicolor 5.6 2.7 4.2 1.3 versicolor 5.7 3.0 4.2 1.2 versicolor 5.7 2.9 4.2 1.3 versicolor 6.2 2.9 4.3 1.3 versicolor 5.1 2.5 3.0 1.1 versicolor 5.7 2.8 4.1 1.3 versicolor 6.3 3.3 6.0 2.5 virginica 5.8 2.7 5.1 1.9 virginica 7.1 3.0 5.9 2.1 virginica 6.3 2.9 5.6 1.8 virginica 6.5 3.0 5.8 2.2 virginica 7.6 3.0 6.6 2.1 virginica 4.9 2.5 4.5 1.7 virginica 7.3 2.9 6.3 1.8 virginica 6.7 2.5 5.8 1.8 virginica 7.2 3.6 6.1 2.5 virginica 6.5 3.2 5.1 2.0 virginica 6.4 2.7 5.3 1.9 virginica 6.8 3.0 5.5 2.1 virginica 5.7 2.5 5.0 2.0 virginica 5.8 2.8 5.1 2.4 virginica 6.4 3.2 5.3 2.3 virginica 6.5 3.0 5.5 1.8 virginica 7.7 3.8 6.7 2.2 virginica 7.7 2.6 6.9 2.3 virginica 6.0 2.2 5.0 1.5 virginica 6.9 3.2 5.7 2.3 virginica 5.6 2.8 4.9 2.0 virginica 7.7 2.8 6.7 2.0 virginica 6.3 2.7 4.9 1.8 virginica 6.7 3.3 5.7 2.1 virginica 7.2 3.2 6.0 1.8 virginica 6.2 2.8 4.8 1.8 virginica 6.1 3.0 4.9 1.8 virginica 6.4 2.8 5.6 2.1 virginica 7.2 3.0 5.8 1.6 virginica 7.4 2.8 6.1 1.9 virginica 7.9 3.8 6.4 2.0 virginica 6.4 2.8 5.6 2.2 virginica 6.3 2.8 5.1 1.5 virginica 6.1 2.6 5.6 1.4 virginica 7.7 3.0 6.1 2.3 virginica 6.3 3.4 5.6 2.4 virginica 6.4 3.1 5.5 1.8 virginica 6.0 3.0 4.8 1.8 virginica 6.9 3.1 5.4 2.1 virginica 6.7 3.1 5.6 2.4 virginica 6.9 3.1 5.1 2.3 virginica 5.8 2.7 5.1 1.9 virginica 6.8 3.2 5.9 2.3 virginica 6.7 3.3 5.7 2.5 virginica 6.7 3.0 5.2 2.3 virginica 6.3 2.5 5.0 1.9 virginica 6.5 3.0 5.2 2.0 virginica 6.2 3.4 5.4 2.3 virginica 5.9 3.0 5.1 1.8 virginica
3,854
data
tsv
en
tsv
excluded
{}
0
{}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/utils/CacheUtils.java
package com.ruoyi.common.utils; import java.util.Iterator; import java.util.Set; import org.apache.shiro.cache.Cache; import org.apache.shiro.cache.CacheManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.utils.spring.SpringUtils; /** * Cache工具类 * * @author ruoyi */ public class CacheUtils { private static Logger logger = LoggerFactory.getLogger(CacheUtils.class); private static CacheManager cacheManager = SpringUtils.getBean(CacheManager.class); private static final String SYS_CACHE = "sys-cache"; /** * 获取SYS_CACHE缓存 * * @param key * @return */ public static Object get(String key) { return get(SYS_CACHE, key); } /** * 获取SYS_CACHE缓存 * * @param key * @param defaultValue * @return */ public static Object get(String key, Object defaultValue) { Object value = get(key); return value != null ? value : defaultValue; } /** * 写入SYS_CACHE缓存 * * @param key * @return */ public static void put(String key, Object value) { put(SYS_CACHE, key, value); } /** * 从SYS_CACHE缓存中移除 * * @param key * @return */ public static void remove(String key) { remove(SYS_CACHE, key); } /** * 获取缓存 * * @param cacheName * @param key * @return */ public static Object get(String cacheName, String key) { return getCache(cacheName).get(getKey(key)); } /** * 获取缓存 * * @param cacheName * @param key * @param defaultValue * @return */ public static Object get(String cacheName, String key, Object defaultValue) { Object value = get(cacheName, getKey(key)); return value != null ? value : defaultValue; } /** * 写入缓存 * * @param cacheName * @param key * @param value */ public static void put(String cacheName, String key, Object value) { getCache(cacheName).put(getKey(key), value); } /** * 从缓存中移除 * * @param cacheName * @param key */ public static void remove(String cacheName, String key) { getCache(cacheName).remove(getKey(key)); } /** * 从缓存中移除所有 * * @param cacheName */ public static void removeAll(String cacheName) { Cache<String, Object> cache = getCache(cacheName); Set<String> keys = cache.keys(); for (Iterator<String> it = keys.iterator(); it.hasNext();) { cache.remove(it.next()); } logger.info("清理缓存: {} => {}", cacheName, keys); } /** * 从缓存中移除指定key * * @param keys */ public static void removeByKeys(Set<String> keys) { removeByKeys(SYS_CACHE, keys); } /** * 从缓存中移除指定key * * @param cacheName * @param keys */ public static void removeByKeys(String cacheName, Set<String> keys) { for (Iterator<String> it = keys.iterator(); it.hasNext();) { remove(it.next()); } logger.info("清理缓存: {} => {}", cacheName, keys); } /** * 获取缓存键名 * * @param key * @return */ private static String getKey(String key) { return key; } /** * 获得一个Cache,没有则显示日志。 * * @param cacheName * @return */ private static Cache<String, Object> getCache(String cacheName) { Cache<String, Object> cache = cacheManager.getCache(cacheName); if (cache == null) { throw new RuntimeException("当前系统中没有定义“" + cacheName + "”这个缓存。"); } return cache; } }
3,778
CacheUtils
java
en
java
code
{"qsc_code_num_words": 357, "qsc_code_num_chars": 3778.0, "qsc_code_mean_word_length": 5.77310924, "qsc_code_frac_words_unique": 0.20728291, "qsc_code_frac_chars_top_2grams": 0.06404658, "qsc_code_frac_chars_top_3grams": 0.05434255, "qsc_code_frac_chars_top_4grams": 0.03881611, "qsc_code_frac_chars_dupe_5grams": 0.47501213, "qsc_code_frac_chars_dupe_6grams": 0.39010189, "qsc_code_frac_chars_dupe_7grams": 0.22804464, "qsc_code_frac_chars_dupe_8grams": 0.19408054, "qsc_code_frac_chars_dupe_9grams": 0.13245997, "qsc_code_frac_chars_dupe_10grams": 0.05628336, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00079145, "qsc_code_frac_chars_whitespace": 0.33112758, "qsc_code_size_file_byte": 3778.0, "qsc_code_num_lines": 187.0, "qsc_code_num_chars_line_max": 88.0, "qsc_code_num_chars_line_mean": 20.20320856, "qsc_code_frac_chars_alphabet": 0.81480016, "qsc_code_frac_chars_comments": 0.28560085, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.07228916, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0196369, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.1686747, "qsc_codejava_score_lines_no_logic": 0.28915663, "qsc_codejava_frac_words_no_modifier": 0.8, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
package com.ruoyi.common.utils; import java.util.Collection; import java.util.Map; import com.ruoyi.common.core.text.StrFormatter; /** * 字符串工具类 * * @author ruoyi */ public class StringUtils extends org.apache.commons.lang3.StringUtils { /** 空字符串 */ private static final String NULLSTR = ""; /** 下划线 */ private static final char SEPARATOR = '_'; /** * 获取参数不为空值 * * @param value defaultValue 要判断的value * @return value 返回值 */ public static <T> T nvl(T value, T defaultValue) { return value != null ? value : defaultValue; } /** * * 判断一个Collection是否为空, 包含List,Set,Queue * * @param coll 要判断的Collection * @return true:为空 false:非空 */ public static boolean isEmpty(Collection<?> coll) { return isNull(coll) || coll.isEmpty(); } /** * * 判断一个Collection是否非空,包含List,Set,Queue * * @param coll 要判断的Collection * @return true:非空 false:空 */ public static boolean isNotEmpty(Collection<?> coll) { return !isEmpty(coll); } /** * * 判断一个对象数组是否为空 * * @param objects 要判断的对象数组 ** @return true:为空 false:非空 */ public static boolean isEmpty(Object[] objects) { return isNull(objects) || (objects.length == 0); } /** * * 判断一个对象数组是否非空 * * @param objects 要判断的对象数组 * @return true:非空 false:空 */ public static boolean isNotEmpty(Object[] objects) { return !isEmpty(objects); } /** * * 判断一个Map是否为空 * * @param map 要判断的Map * @return true:为空 false:非空 */ public static boolean isEmpty(Map<?, ?> map) { return isNull(map) || map.isEmpty(); } /** * * 判断一个Map是否为空 * * @param map 要判断的Map * @return true:非空 false:空 */ public static boolean isNotEmpty(Map<?, ?> map) { return !isEmpty(map); } /** * * 判断一个字符串是否为空串 * * @param str String * @return true:为空 false:非空 */ public static boolean isEmpty(String str) { return isNull(str) || NULLSTR.equals(str.trim()); } /** * * 判断一个字符串是否为非空串 * * @param str String * @return true:非空串 false:空串 */ public static boolean isNotEmpty(String str) { return !isEmpty(str); } /** * * 判断一个对象是否为空 * * @param object Object * @return true:为空 false:非空 */ public static boolean isNull(Object object) { return object == null; } /** * * 判断一个对象是否非空 * * @param object Object * @return true:非空 false:空 */ public static boolean isNotNull(Object object) { return !isNull(object); } /** * * 判断一个对象是否是数组类型(Java基本型别的数组) * * @param object 对象 * @return true:是数组 false:不是数组 */ public static boolean isArray(Object object) { return isNotNull(object) && object.getClass().isArray(); } /** * 去空格 */ public static String trim(String str) { return (str == null ? "" : str.trim()); } /** * 截取字符串 * * @param str 字符串 * @param start 开始 * @return 结果 */ public static String substring(final String str, int start) { if (str == null) { return NULLSTR; } if (start < 0) { start = str.length() + start; } if (start < 0) { start = 0; } if (start > str.length()) { return NULLSTR; } return str.substring(start); } /** * 截取字符串 * * @param str 字符串 * @param start 开始 * @param end 结束 * @return 结果 */ public static String substring(final String str, int start, int end) { if (str == null) { return NULLSTR; } if (end < 0) { end = str.length() + end; } if (start < 0) { start = str.length() + start; } if (end > str.length()) { end = str.length(); } if (start > end) { return NULLSTR; } if (start < 0) { start = 0; } if (end < 0) { end = 0; } return str.substring(start, end); } /** * 格式化文本, {} 表示占位符<br> * 此方法只是简单将占位符 {} 按照顺序替换为参数<br> * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br> * 例:<br> * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br> * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> * * @param template 文本模板,被替换的部分用 {} 表示 * @param params 参数值 * @return 格式化后的文本 */ public static String format(String template, Object... params) { if (isEmpty(params) || isEmpty(template)) { return template; } return StrFormatter.format(template, params); } /** * 下划线转驼峰命名 */ public static String toUnderScoreCase(String str) { if (str == null) { return null; } StringBuilder sb = new StringBuilder(); // 前置字符是否大写 boolean preCharIsUpperCase = true; // 当前字符是否大写 boolean curreCharIsUpperCase = true; // 下一字符是否大写 boolean nexteCharIsUpperCase = true; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (i > 0) { preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); } else { preCharIsUpperCase = false; } curreCharIsUpperCase = Character.isUpperCase(c); if (i < (str.length() - 1)) { nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); } if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) { sb.append(SEPARATOR); } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) { sb.append(SEPARATOR); } sb.append(Character.toLowerCase(c)); } return sb.toString(); } /** * 是否包含字符串 * * @param str 验证字符串 * @param strs 字符串组 * @return 包含返回true */ public static boolean inStringIgnoreCase(String str, String... strs) { if (str != null && strs != null) { for (String s : strs) { if (str.equalsIgnoreCase(trim(s))) { return true; } } } return false; } /** * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld * * @param name 转换前的下划线大写方式命名的字符串 * @return 转换后的驼峰式命名的字符串 */ public static String convertToCamelCase(String name) { StringBuilder result = new StringBuilder(); // 快速检查 if (name == null || name.isEmpty()) { // 没必要转换 return ""; } else if (!name.contains("_")) { // 不含下划线,仅将首字母大写 return name.substring(0, 1).toUpperCase() + name.substring(1); } // 用下划线将原始字符串分割 String[] camels = name.split("_"); for (String camel : camels) { // 跳过原始字符串中开头、结尾的下换线或双重下划线 if (camel.isEmpty()) { continue; } // 首字母大写 result.append(camel.substring(0, 1).toUpperCase()); result.append(camel.substring(1).toLowerCase()); } return result.toString(); } /** * 驼峰式命名法 例如:user_name->userName */ public static String toCamelCase(String s) { if (s == null) { return null; } s = s.toLowerCase(); StringBuilder sb = new StringBuilder(s.length()); boolean upperCase = false; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == SEPARATOR) { upperCase = true; } else if (upperCase) { sb.append(Character.toUpperCase(c)); upperCase = false; } else { sb.append(c); } } return sb.toString(); } @SuppressWarnings("unchecked") public static <T> T cast(Object obj) { return (T) obj; } }
8,792
StringUtils
java
zh
java
code
{"qsc_code_num_words": 981, "qsc_code_num_chars": 8792.0, "qsc_code_mean_word_length": 4.25178389, "qsc_code_frac_words_unique": 0.21406728, "qsc_code_frac_chars_top_2grams": 0.06041717, "qsc_code_frac_chars_top_3grams": 0.05466315, "qsc_code_frac_chars_top_4grams": 0.02037881, "qsc_code_frac_chars_dupe_5grams": 0.29033805, "qsc_code_frac_chars_dupe_6grams": 0.26828099, "qsc_code_frac_chars_dupe_7grams": 0.21889235, "qsc_code_frac_chars_dupe_8grams": 0.21889235, "qsc_code_frac_chars_dupe_9grams": 0.17357948, "qsc_code_frac_chars_dupe_10grams": 0.08846799, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00456621, "qsc_code_frac_chars_whitespace": 0.4021838, "qsc_code_size_file_byte": 8792.0, "qsc_code_num_lines": 404.0, "qsc_code_num_chars_line_max": 86.0, "qsc_code_num_chars_line_mean": 21.76237624, "qsc_code_frac_chars_alphabet": 0.78900304, "qsc_code_frac_chars_comments": 0.28548681, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.10917031, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00190992, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.11353712, "qsc_codejava_score_lines_no_logic": 0.17467249, "qsc_codejava_frac_words_no_modifier": 0.77777778, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
package com.ruoyi.common.utils; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import com.ruoyi.common.core.text.Convert; /** * 客户端工具类 * * @author ruoyi */ public class ServletUtils { /** * 获取String参数 */ public static String getParameter(String name) { return getRequest().getParameter(name); } /** * 获取String参数 */ public static String getParameter(String name, String defaultValue) { return Convert.toStr(getRequest().getParameter(name), defaultValue); } /** * 获取Integer参数 */ public static Integer getParameterToInt(String name) { return Convert.toInt(getRequest().getParameter(name)); } /** * 获取Integer参数 */ public static Integer getParameterToInt(String name, Integer defaultValue) { return Convert.toInt(getRequest().getParameter(name), defaultValue); } /** * 获取request */ public static HttpServletRequest getRequest() { return getRequestAttributes().getRequest(); } /** * 获取response */ public static HttpServletResponse getResponse() { return getRequestAttributes().getResponse(); } /** * 获取session */ public static HttpSession getSession() { return getRequest().getSession(); } public static ServletRequestAttributes getRequestAttributes() { RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); return (ServletRequestAttributes) attributes; } /** * 将字符串渲染到客户端 * * @param response 渲染对象 * @param string 待渲染的字符串 * @return null */ public static String renderString(HttpServletResponse response, String string) { try { response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.getWriter().print(string); } catch (IOException e) { e.printStackTrace(); } return null; } /** * 是否是Ajax异步请求 * * @param request */ public static boolean isAjaxRequest(HttpServletRequest request) { String accept = request.getHeader("accept"); if (accept != null && accept.indexOf("application/json") != -1) { return true; } String xRequestedWith = request.getHeader("X-Requested-With"); if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) { return true; } String uri = request.getRequestURI(); if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) { return true; } String ajax = request.getParameter("__ajax"); if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) { return true; } return false; } }
3,247
ServletUtils
java
ru
java
code
{"qsc_code_num_words": 253, "qsc_code_num_chars": 3247.0, "qsc_code_mean_word_length": 7.86561265, "qsc_code_frac_words_unique": 0.35968379, "qsc_code_frac_chars_top_2grams": 0.06030151, "qsc_code_frac_chars_top_3grams": 0.05226131, "qsc_code_frac_chars_top_4grams": 0.03316583, "qsc_code_frac_chars_dupe_5grams": 0.21356784, "qsc_code_frac_chars_dupe_6grams": 0.21356784, "qsc_code_frac_chars_dupe_7grams": 0.10753769, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00128205, "qsc_code_frac_chars_whitespace": 0.27933477, "qsc_code_size_file_byte": 3247.0, "qsc_code_num_lines": 135.0, "qsc_code_num_chars_line_max": 86.0, "qsc_code_num_chars_line_mean": 24.05185185, "qsc_code_frac_chars_alphabet": 0.8491453, "qsc_code_frac_chars_comments": 0.12781029, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.04819277, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0335452, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejava_cate_var_zero": 0.0, "qsc_codejava_frac_lines_func_ratio": 0.1686747, "qsc_codejava_score_lines_no_logic": 0.34939759, "qsc_codejava_frac_words_no_modifier": 0.66666667, "qsc_codejava_frac_words_legal_var_name": 1.0, "qsc_codejava_frac_words_legal_func_name": 1.0, "qsc_codejava_frac_words_legal_class_name": 1.0, "qsc_codejava_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejava_cate_var_zero": 0, "qsc_codejava_frac_lines_func_ratio": 0, "qsc_codejava_score_lines_no_logic": 0, "qsc_codejava_frac_lines_print": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/ext/kiero/minhook/src/hde/hde64.h
/* * Hacker Disassembler Engine 64 * Copyright (c) 2008-2009, Vyacheslav Patkov. * All rights reserved. * * hde64.h: C/C++ header file * */ #ifndef _HDE64_H_ #define _HDE64_H_ /* stdint.h - C99 standard header * http://en.wikipedia.org/wiki/stdint.h * * if your compiler doesn't contain "stdint.h" header (for * example, Microsoft Visual C++), you can download file: * http://www.azillionmonkeys.com/qed/pstdint.h * and change next line to: * #include "pstdint.h" */ #include "pstdint.h" #define F_MODRM 0x00000001 #define F_SIB 0x00000002 #define F_IMM8 0x00000004 #define F_IMM16 0x00000008 #define F_IMM32 0x00000010 #define F_IMM64 0x00000020 #define F_DISP8 0x00000040 #define F_DISP16 0x00000080 #define F_DISP32 0x00000100 #define F_RELATIVE 0x00000200 #define F_ERROR 0x00001000 #define F_ERROR_OPCODE 0x00002000 #define F_ERROR_LENGTH 0x00004000 #define F_ERROR_LOCK 0x00008000 #define F_ERROR_OPERAND 0x00010000 #define F_PREFIX_REPNZ 0x01000000 #define F_PREFIX_REPX 0x02000000 #define F_PREFIX_REP 0x03000000 #define F_PREFIX_66 0x04000000 #define F_PREFIX_67 0x08000000 #define F_PREFIX_LOCK 0x10000000 #define F_PREFIX_SEG 0x20000000 #define F_PREFIX_REX 0x40000000 #define F_PREFIX_ANY 0x7f000000 #define PREFIX_SEGMENT_CS 0x2e #define PREFIX_SEGMENT_SS 0x36 #define PREFIX_SEGMENT_DS 0x3e #define PREFIX_SEGMENT_ES 0x26 #define PREFIX_SEGMENT_FS 0x64 #define PREFIX_SEGMENT_GS 0x65 #define PREFIX_LOCK 0xf0 #define PREFIX_REPNZ 0xf2 #define PREFIX_REPX 0xf3 #define PREFIX_OPERAND_SIZE 0x66 #define PREFIX_ADDRESS_SIZE 0x67 #pragma pack(push,1) typedef struct { uint8_t len; uint8_t p_rep; uint8_t p_lock; uint8_t p_seg; uint8_t p_66; uint8_t p_67; uint8_t rex; uint8_t rex_w; uint8_t rex_r; uint8_t rex_x; uint8_t rex_b; uint8_t opcode; uint8_t opcode2; uint8_t modrm; uint8_t modrm_mod; uint8_t modrm_reg; uint8_t modrm_rm; uint8_t sib; uint8_t sib_scale; uint8_t sib_index; uint8_t sib_base; union { uint8_t imm8; uint16_t imm16; uint32_t imm32; uint64_t imm64; } imm; union { uint8_t disp8; uint16_t disp16; uint32_t disp32; } disp; uint32_t flags; } hde64s; #pragma pack(pop) #ifdef __cplusplus extern "C" { #endif /* __cdecl */ unsigned int hde64_disasm(const void *code, hde64s *hs); #ifdef __cplusplus } #endif #endif /* _HDE64_H_ */
2,600
hde64
h
en
c
code
{"qsc_code_num_words": 372, "qsc_code_num_chars": 2600.0, "qsc_code_mean_word_length": 4.55645161, "qsc_code_frac_words_unique": 0.43548387, "qsc_code_frac_chars_top_2grams": 0.09911504, "qsc_code_frac_chars_top_3grams": 0.06902655, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.17019134, "qsc_code_frac_chars_whitespace": 0.23615385, "qsc_code_size_file_byte": 2600.0, "qsc_code_num_lines": 112.0, "qsc_code_num_chars_line_max": 59.0, "qsc_code_num_chars_line_mean": 23.21428571, "qsc_code_frac_chars_alphabet": 0.68277946, "qsc_code_frac_chars_comments": 0.18307692, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.08433735, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00471032, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.13377296, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.03614458, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.04819277, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/ext/kiero/minhook/src/hde/table32.h
/* * Hacker Disassembler Engine 32 C * Copyright (c) 2008-2009, Vyacheslav Patkov. * All rights reserved. * */ #define C_NONE 0x00 #define C_MODRM 0x01 #define C_IMM8 0x02 #define C_IMM16 0x04 #define C_IMM_P66 0x10 #define C_REL8 0x20 #define C_REL32 0x40 #define C_GROUP 0x80 #define C_ERROR 0xff #define PRE_ANY 0x00 #define PRE_NONE 0x01 #define PRE_F2 0x02 #define PRE_F3 0x04 #define PRE_66 0x08 #define PRE_67 0x10 #define PRE_LOCK 0x20 #define PRE_SEG 0x40 #define PRE_ALL 0xff #define DELTA_OPCODES 0x4a #define DELTA_FPU_REG 0xf1 #define DELTA_FPU_MODRM 0xf8 #define DELTA_PREFIXES 0x130 #define DELTA_OP_LOCK_OK 0x1a1 #define DELTA_OP2_LOCK_OK 0x1b9 #define DELTA_OP_ONLY_MEM 0x1cb #define DELTA_OP2_ONLY_MEM 0x1da unsigned char hde32_table[] = { 0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3, 0xa8,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xaa,0xb2,0xaa,0x9f,0x9f, 0x9f,0x9f,0xb5,0xa3,0xa3,0xa4,0xaa,0xaa,0xba,0xaa,0x96,0xaa,0xa8,0xaa,0xc3, 0xc3,0x96,0x96,0xb7,0xae,0xd6,0xbd,0xa3,0xc5,0xa3,0xa3,0x9f,0xc3,0x9c,0xaa, 0xaa,0xac,0xaa,0xbf,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0x90, 0x82,0x7d,0x97,0x59,0x59,0x59,0x59,0x59,0x7f,0x59,0x59,0x60,0x7d,0x7f,0x7f, 0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x9a,0x88,0x7d, 0x59,0x50,0x50,0x50,0x50,0x59,0x59,0x59,0x59,0x61,0x94,0x61,0x9e,0x59,0x59, 0x85,0x59,0x92,0xa3,0x60,0x60,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59, 0x59,0x59,0x9f,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xcc,0x01,0xbc,0x03,0xf0, 0x10,0x10,0x10,0x10,0x50,0x50,0x50,0x50,0x14,0x20,0x20,0x20,0x20,0x01,0x01, 0x01,0x01,0xc4,0x02,0x10,0x00,0x00,0x00,0x00,0x01,0x01,0xc0,0xc2,0x10,0x11, 0x02,0x03,0x11,0x03,0x03,0x04,0x00,0x00,0x14,0x00,0x02,0x00,0x00,0xc6,0xc8, 0x02,0x02,0x02,0x02,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xca, 0x01,0x01,0x01,0x00,0x06,0x00,0x04,0x00,0xc0,0xc2,0x01,0x01,0x03,0x01,0xff, 0xff,0x01,0x00,0x03,0xc4,0xc4,0xc6,0x03,0x01,0x01,0x01,0xff,0x03,0x03,0x03, 0xc8,0x40,0x00,0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00, 0x00,0x00,0x00,0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00, 0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xff,0xff,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x7f,0x00,0x00,0xff,0x4a,0x4a,0x4a,0x4a,0x4b,0x52,0x4a,0x4a,0x4a,0x4a,0x4f, 0x4c,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x55,0x45,0x40,0x4a,0x4a,0x4a, 0x45,0x59,0x4d,0x46,0x4a,0x5d,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a, 0x4a,0x4a,0x4a,0x4a,0x4a,0x61,0x63,0x67,0x4e,0x4a,0x4a,0x6b,0x6d,0x4a,0x4a, 0x45,0x6d,0x4a,0x4a,0x44,0x45,0x4a,0x4a,0x00,0x00,0x00,0x02,0x0d,0x06,0x06, 0x06,0x06,0x0e,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x06,0x06,0x02,0x06, 0x00,0x0a,0x0a,0x07,0x07,0x06,0x02,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04, 0x04,0x04,0x00,0x00,0x00,0x0e,0x05,0x06,0x06,0x06,0x01,0x06,0x00,0x00,0x08, 0x00,0x10,0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01, 0x86,0x00,0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba, 0xf8,0xbb,0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00, 0xc4,0xff,0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00, 0x13,0x09,0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07, 0xb2,0xff,0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf, 0xe7,0x08,0x00,0xf0,0x02,0x00 };
3,506
table32
h
en
c
code
{"qsc_code_num_words": 650, "qsc_code_num_chars": 3506.0, "qsc_code_mean_word_length": 4.06, "qsc_code_frac_words_unique": 0.24461538, "qsc_code_frac_chars_top_2grams": 0.15763547, "qsc_code_frac_chars_top_3grams": 0.15460402, "qsc_code_frac_chars_top_4grams": 0.13944676, "qsc_code_frac_chars_dupe_5grams": 0.19401288, "qsc_code_frac_chars_dupe_6grams": 0.16218264, "qsc_code_frac_chars_dupe_7grams": 0.15005684, "qsc_code_frac_chars_dupe_8grams": 0.12580523, "qsc_code_frac_chars_dupe_9grams": 0.10155362, "qsc_code_frac_chars_dupe_10grams": 0.10155362, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.42371834, "qsc_code_frac_chars_whitespace": 0.07644039, "qsc_code_size_file_byte": 3506.0, "qsc_code_num_lines": 73.0, "qsc_code_num_chars_line_max": 78.0, "qsc_code_num_chars_line_mean": 48.02739726, "qsc_code_frac_chars_alphabet": 0.39098209, "qsc_code_frac_chars_comments": 0.03280091, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 1.0, "qsc_code_frac_chars_hex_words": 0.64100295, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.0, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.0, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 1, "qsc_code_frac_chars_digital": 1, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 1, "qsc_code_frac_chars_hex_words": 1, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1sters/material_design_zh_2
material-design/patterns/settings.md
# 设置 ## 设置 应用设置允许用户选择他们对应用行为的偏好。它们授予用户真实的控制感,并且避免用户被同样的问题反复打扰。 ### 访问设置 由于用户并不需要经常使用设置,所以它们在 UI 中并不显眼。应用中访问设置时:在任何情况下,进入“设置”的按钮都应简单命名为“设置”。如果当前的页面支持左导航栏,那么把设置放在导航栏中除“帮助及反馈”外的所有按钮的下方。另外,如果当前页面里有工具栏,把设置放在工具栏的更多操作(action overflow)中除“帮助及反馈”外的所有按钮的下方。 ### 合理使用设置 当用户访问设置时,尽管这不太频繁,但他们对这个页面抱有与其他页面一样的期待。这个页面应该是组织良好且符合常规的。需要特别指出的是,它应该避免用过多的选项淹没用户。遇到产品上简单的决定时,避免向“就把它作为一个设置吧”的诱惑所屈服。对于每个你考虑放入设置里的控制,通过下列问题来确保它合适: - 这确实是一个用户偏好吗?信息和操作不是一个用户偏好。如果不是用户偏好,就不要把它当做一个设置。如果它是应用的静态信息(比如版本号、服务条款、开源证书),将它组织到一个帮助页面里。如果它是一个操作(比如刷新、切换账号),在你的应用的主要流程中为它找一个合适的位置。 - 这个选项经常被用户更改吗?用户每次访问这个选项要多次操作会觉得负担重吗?如果是这样,不要把它作为一个设置。可以通过把它放在工具栏或者更多操作(action overflow)中,让这个控制更容易使用。 - 只有少于 20% 的用户改变这个设置的值吗?如果是这样,不要将它作为一个设置。不管是新的还是本来就有的设置,都应该问这些同样的问题。 - 对于已经存在的设置,最后一个问题应该多考虑一些:如果这个设置项被移除了,这会对那些不再能改变这一设置项的少数用户造成危害吗?如果会,或者你不清楚,那么合适的做法是将它作为一个设置项保留。 ### 分组的设置 当你有很多设置项时,最好通过分组来把一个长列表变成几个短一些的列表。设置项的数量决定了分组的策略。 #### 7 个或更少的设置项 不需要分组。 #### 8 至 10 个设置项 试着用 1 到 2 个分隔符分隔相关的设置项。如果存在“独立设置”(与其他设置项无关并且不能放进已有的分组中),如下处理: - 如果是一些你最重要的设置项,把它们放在最顶上,但不用分隔符分隔。 - 否则,将它们按重要程度的顺序排序,放进末尾的“其他”分组。 #### 11 至 15 个设置项 建议同上,不过试着用 2 到 4 个分隔符。 如果存在“独立双选项”(两个互相相关的设置项,但与其他设置项无关)。试着将它们合并成一个设置项。比如你可以把两个相关的复选框重新设计成一个多选设置项。 #### 16 或更多的设置项 如果你有四个以上的相关的设置项,把它们分在一个子屏里。对于每个子屏使用上面这些建议。 ### 默认选项 用户通常期望每个设置项都有合理的默认值。以下问题可以帮助你做决定: - 在没有默认选项时,大多数用户最有可能选择的是哪个? - 哪个选项最中立或最中庸? - 哪个选项风险、争议或言过其实的可能性最小? - 哪个选项用的电量和移动数据最少? - 哪个选项最尊重用户的注意力,只在最重要的时候打断用户? > 原文:[Settings](http://www.google.com/design/spec/patterns/settings.html) 翻译:[ZeroLu](https://github.com/ZeroLu) 校对:[PoppinLp](https://github.com/poppinlp)
1,563
settings
md
zh
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": null, "qsc_doc_num_sentences": 48.0, "qsc_doc_num_words": 696, "qsc_doc_num_chars": 1563.0, "qsc_doc_num_lines": 58.0, "qsc_doc_mean_word_length": 1.8045977, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.42528736, "qsc_doc_entropy_unigram": 5.11269458, "qsc_doc_frac_words_all_caps": 0.00115607, "qsc_doc_frac_lines_dupe_lines": 0.0, "qsc_doc_frac_chars_dupe_lines": 0.0, "qsc_doc_frac_chars_top_2grams": 0.0406051, "qsc_doc_frac_chars_top_3grams": 0.01910828, "qsc_doc_frac_chars_top_4grams": 0.02229299, "qsc_doc_frac_chars_dupe_5grams": 0.11305732, "qsc_doc_frac_chars_dupe_6grams": 0.02229299, "qsc_doc_frac_chars_dupe_7grams": 0.02229299, "qsc_doc_frac_chars_dupe_8grams": 0.02229299, "qsc_doc_frac_chars_dupe_9grams": 0.02229299, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 23.4375, "qsc_doc_frac_chars_hyperlink_html_tag": 0.07293666, "qsc_doc_frac_chars_alphabet": null, "qsc_doc_frac_chars_digital": 0.01105736, "qsc_doc_frac_chars_whitespace": 0.07421625, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_full_bracket": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1sters/material_design_zh_2
material-design/patterns/selection.md
# 内容选取 ## 项目选取 虽然强烈建议对列表和网格容器支持多项选择功能,但在下列情况时这并不是必须的: - 唯一的操作仅仅是针对单个选项(例如电话号码列表中,拨号就是唯一的操作,且只针对一个号码) - 在执行环境中很明显的表现为单项操作(例如在 Android 的主屏上移动图标) 在初始化选择时,可以通过拖拽手势来选择多个项目,从而代替长按和双指点击。在拖拽起止点间的项目也会被选中。在桌面系统中,一个始发与所有项目边界之外的拖动也经常被用来初始化多选(例如,从一个列表的左边开始拖动,向下延伸到右边以从列表中选择项目)。 初始化选择完成后,可以通过以下方式进行修改: - 点击未选中项加入选择或者点击已选中项来取消选择 - Shift + 点击项目来将其和中间的项目加入已选项 ## 文本选取 文本选取表现为高亮所选文字范围。 在移动平台上,所选文本的前后两端各会添加一个选择操作钮。对于文字相关操作的弹出菜单,所选文本的上方是理想的位置(但最好不要重叠)。 ![](../images/patterns-selection-selection-textfields_select_03a_large_mdpi.png) ![](../images/patterns-selection-selection-textfields_select_03b_large_mdpi.png) 文本选择操作钮 ![](../images/patterns-selection-selection-textfields_select_06_large_mdpi.png) 文本选择-明亮主题 ![](../images/patterns-selection-selection-textfields_select_08_large_mdpi.png) 文本选择-深邃主题 包含“剪切”、“复制”、“粘贴”和“更多”操作的弹出菜单显示在所选区域的上方。当用户选择“更多”按钮时,弹出菜单先收缩到“更多”图标,然后以该图标为中心展开更多菜单项。文本选择菜单的字体用 Roboto Medium 14 sp,一律大写。 ![](../images/patterns-selection-selection-textfields_select_11a_large_mdpi.png) ![](../images/patterns-selection-selection-textfields_select_11b_large_mdpi.png) ![](../images/patterns-selection-selection-textfields_select_11c_large_mdpi.png) ![](../images/patterns-selection-selection-textfields_select_11d_large_mdpi.png) ![](../images/patterns-selection-selection-textfields_select_12_large_mdpi.png) 因为选择必须是连续的文本块,所以文本选择事实上是单选操作。不过选区可以通过以下几种用户行为改变: - 初始化选择的过程中拖动来增加选区 - 拖动选区两端的选择操作钮来增加或者减少选区 - 在选区内多次点击来增加选区(单词 > 段落 > 全文) - 键盘快捷键: - Shift + 左/右方向键 => 逐字符的更改选区 - Shift + 上/下方向键 => 逐行的更改选区 - Ctrl/Command + A => 全选 > 原文:[Selection](http://www.google.com/design/spec/patterns/selection.html) 翻译:[lhyqy5](https://github.com/lhyqy5) 校对:[PoppinLp](https://github.com/poppinlp)
1,720
selection
md
zh
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": null, "qsc_doc_num_sentences": 32.0, "qsc_doc_num_words": 472, "qsc_doc_num_chars": 1720.0, "qsc_doc_num_lines": 54.0, "qsc_doc_mean_word_length": 2.81779661, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.48305085, "qsc_doc_entropy_unigram": 4.96687737, "qsc_doc_frac_words_all_caps": 0.0013587, "qsc_doc_frac_lines_dupe_lines": 0.0, "qsc_doc_frac_chars_dupe_lines": 0.0, "qsc_doc_frac_chars_top_2grams": 0.12781955, "qsc_doc_frac_chars_top_3grams": 0.1556391, "qsc_doc_frac_chars_top_4grams": 0.21654135, "qsc_doc_frac_chars_dupe_5grams": 0.40601504, "qsc_doc_frac_chars_dupe_6grams": 0.36992481, "qsc_doc_frac_chars_dupe_7grams": 0.22556391, "qsc_doc_frac_chars_dupe_8grams": 0.22556391, "qsc_doc_frac_chars_dupe_9grams": 0.22556391, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 16.92708333, "qsc_doc_frac_chars_hyperlink_html_tag": 0.06686047, "qsc_doc_frac_chars_alphabet": null, "qsc_doc_frac_chars_digital": 0.01370717, "qsc_doc_frac_chars_whitespace": 0.06686047, "qsc_doc_frac_chars_hex_words": 0.0}
0
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 1, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_full_bracket": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/ext/kiero/minhook/src/hde/hde64.c
/* * Hacker Disassembler Engine 64 C * Copyright (c) 2008-2009, Vyacheslav Patkov. * All rights reserved. * */ #if defined(_M_X64) || defined(__x86_64__) #include "hde64.h" #include "table64.h" unsigned int hde64_disasm(const void *code, hde64s *hs) { uint8_t x, c, *p = (uint8_t *)code, cflags, opcode, pref = 0; uint8_t *ht = hde64_table, m_mod, m_reg, m_rm, disp_size = 0; uint8_t op64 = 0; // Avoid using memset to reduce the footprint. #ifndef _MSC_VER memset((LPBYTE)hs, 0, sizeof(hde64s)); #else __stosb((LPBYTE)hs, 0, sizeof(hde64s)); #endif for (x = 16; x; x--) switch (c = *p++) { case 0xf3: hs->p_rep = c; pref |= PRE_F3; break; case 0xf2: hs->p_rep = c; pref |= PRE_F2; break; case 0xf0: hs->p_lock = c; pref |= PRE_LOCK; break; case 0x26: case 0x2e: case 0x36: case 0x3e: case 0x64: case 0x65: hs->p_seg = c; pref |= PRE_SEG; break; case 0x66: hs->p_66 = c; pref |= PRE_66; break; case 0x67: hs->p_67 = c; pref |= PRE_67; break; default: goto pref_done; } pref_done: hs->flags = (uint32_t)pref << 23; if (!pref) pref |= PRE_NONE; if ((c & 0xf0) == 0x40) { hs->flags |= F_PREFIX_REX; if ((hs->rex_w = (c & 0xf) >> 3) && (*p & 0xf8) == 0xb8) op64++; hs->rex_r = (c & 7) >> 2; hs->rex_x = (c & 3) >> 1; hs->rex_b = c & 1; if (((c = *p++) & 0xf0) == 0x40) { opcode = c; goto error_opcode; } } if ((hs->opcode = c) == 0x0f) { hs->opcode2 = c = *p++; ht += DELTA_OPCODES; } else if (c >= 0xa0 && c <= 0xa3) { op64++; if (pref & PRE_67) pref |= PRE_66; else pref &= ~PRE_66; } opcode = c; cflags = ht[ht[opcode / 4] + (opcode % 4)]; if (cflags == C_ERROR) { error_opcode: hs->flags |= F_ERROR | F_ERROR_OPCODE; cflags = 0; if ((opcode & -3) == 0x24) cflags++; } x = 0; if (cflags & C_GROUP) { uint16_t t; t = *(uint16_t *)(ht + (cflags & 0x7f)); cflags = (uint8_t)t; x = (uint8_t)(t >> 8); } if (hs->opcode2) { ht = hde64_table + DELTA_PREFIXES; if (ht[ht[opcode / 4] + (opcode % 4)] & pref) hs->flags |= F_ERROR | F_ERROR_OPCODE; } if (cflags & C_MODRM) { hs->flags |= F_MODRM; hs->modrm = c = *p++; hs->modrm_mod = m_mod = c >> 6; hs->modrm_rm = m_rm = c & 7; hs->modrm_reg = m_reg = (c & 0x3f) >> 3; if (x && ((x << m_reg) & 0x80)) hs->flags |= F_ERROR | F_ERROR_OPCODE; if (!hs->opcode2 && opcode >= 0xd9 && opcode <= 0xdf) { uint8_t t = opcode - 0xd9; if (m_mod == 3) { ht = hde64_table + DELTA_FPU_MODRM + t*8; t = ht[m_reg] << m_rm; } else { ht = hde64_table + DELTA_FPU_REG; t = ht[t] << m_reg; } if (t & 0x80) hs->flags |= F_ERROR | F_ERROR_OPCODE; } if (pref & PRE_LOCK) { if (m_mod == 3) { hs->flags |= F_ERROR | F_ERROR_LOCK; } else { uint8_t *table_end, op = opcode; if (hs->opcode2) { ht = hde64_table + DELTA_OP2_LOCK_OK; table_end = ht + DELTA_OP_ONLY_MEM - DELTA_OP2_LOCK_OK; } else { ht = hde64_table + DELTA_OP_LOCK_OK; table_end = ht + DELTA_OP2_LOCK_OK - DELTA_OP_LOCK_OK; op &= -2; } for (; ht != table_end; ht++) if (*ht++ == op) { if (!((*ht << m_reg) & 0x80)) goto no_lock_error; else break; } hs->flags |= F_ERROR | F_ERROR_LOCK; no_lock_error: ; } } if (hs->opcode2) { switch (opcode) { case 0x20: case 0x22: m_mod = 3; if (m_reg > 4 || m_reg == 1) goto error_operand; else goto no_error_operand; case 0x21: case 0x23: m_mod = 3; if (m_reg == 4 || m_reg == 5) goto error_operand; else goto no_error_operand; } } else { switch (opcode) { case 0x8c: if (m_reg > 5) goto error_operand; else goto no_error_operand; case 0x8e: if (m_reg == 1 || m_reg > 5) goto error_operand; else goto no_error_operand; } } if (m_mod == 3) { uint8_t *table_end; if (hs->opcode2) { ht = hde64_table + DELTA_OP2_ONLY_MEM; table_end = ht + sizeof(hde64_table) - DELTA_OP2_ONLY_MEM; } else { ht = hde64_table + DELTA_OP_ONLY_MEM; table_end = ht + DELTA_OP2_ONLY_MEM - DELTA_OP_ONLY_MEM; } for (; ht != table_end; ht += 2) if (*ht++ == opcode) { if (*ht++ & pref && !((*ht << m_reg) & 0x80)) goto error_operand; else break; } goto no_error_operand; } else if (hs->opcode2) { switch (opcode) { case 0x50: case 0xd7: case 0xf7: if (pref & (PRE_NONE | PRE_66)) goto error_operand; break; case 0xd6: if (pref & (PRE_F2 | PRE_F3)) goto error_operand; break; case 0xc5: goto error_operand; } goto no_error_operand; } else goto no_error_operand; error_operand: hs->flags |= F_ERROR | F_ERROR_OPERAND; no_error_operand: c = *p++; if (m_reg <= 1) { if (opcode == 0xf6) cflags |= C_IMM8; else if (opcode == 0xf7) cflags |= C_IMM_P66; } switch (m_mod) { case 0: if (pref & PRE_67) { if (m_rm == 6) disp_size = 2; } else if (m_rm == 5) disp_size = 4; break; case 1: disp_size = 1; break; case 2: disp_size = 2; if (!(pref & PRE_67)) disp_size <<= 1; } if (m_mod != 3 && m_rm == 4) { hs->flags |= F_SIB; p++; hs->sib = c; hs->sib_scale = c >> 6; hs->sib_index = (c & 0x3f) >> 3; if ((hs->sib_base = c & 7) == 5 && !(m_mod & 1)) disp_size = 4; } p--; switch (disp_size) { case 1: hs->flags |= F_DISP8; hs->disp.disp8 = *p; break; case 2: hs->flags |= F_DISP16; hs->disp.disp16 = *(uint16_t *)p; break; case 4: hs->flags |= F_DISP32; hs->disp.disp32 = *(uint32_t *)p; } p += disp_size; } else if (pref & PRE_LOCK) hs->flags |= F_ERROR | F_ERROR_LOCK; if (cflags & C_IMM_P66) { if (cflags & C_REL32) { if (pref & PRE_66) { hs->flags |= F_IMM16 | F_RELATIVE; hs->imm.imm16 = *(uint16_t *)p; p += 2; goto disasm_done; } goto rel32_ok; } if (op64) { hs->flags |= F_IMM64; hs->imm.imm64 = *(uint64_t *)p; p += 8; } else if (!(pref & PRE_66)) { hs->flags |= F_IMM32; hs->imm.imm32 = *(uint32_t *)p; p += 4; } else goto imm16_ok; } if (cflags & C_IMM16) { imm16_ok: hs->flags |= F_IMM16; hs->imm.imm16 = *(uint16_t *)p; p += 2; } if (cflags & C_IMM8) { hs->flags |= F_IMM8; hs->imm.imm8 = *p++; } if (cflags & C_REL32) { rel32_ok: hs->flags |= F_IMM32 | F_RELATIVE; hs->imm.imm32 = *(uint32_t *)p; p += 4; } else if (cflags & C_REL8) { hs->flags |= F_IMM8 | F_RELATIVE; hs->imm.imm8 = *p++; } disasm_done: if ((hs->len = (uint8_t)(p-(uint8_t *)code)) > 15) { hs->flags |= F_ERROR | F_ERROR_LENGTH; hs->len = 15; } return (unsigned int)hs->len; } #endif // defined(_M_X64) || defined(__x86_64__)
9,570
hde64
c
en
c
code
{"qsc_code_num_words": 1070, "qsc_code_num_chars": 9570.0, "qsc_code_mean_word_length": 3.26074766, "qsc_code_frac_words_unique": 0.1588785, "qsc_code_frac_chars_top_2grams": 0.04614503, "qsc_code_frac_chars_top_3grams": 0.05044425, "qsc_code_frac_chars_top_4grams": 0.03353396, "qsc_code_frac_chars_dupe_5grams": 0.35024362, "qsc_code_frac_chars_dupe_6grams": 0.27457724, "qsc_code_frac_chars_dupe_7grams": 0.18228719, "qsc_code_frac_chars_dupe_8grams": 0.12668386, "qsc_code_frac_chars_dupe_9grams": 0.08971052, "qsc_code_frac_chars_dupe_10grams": 0.03697334, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.07429269, "qsc_code_frac_chars_whitespace": 0.48662487, "qsc_code_size_file_byte": 9570.0, "qsc_code_num_lines": 337.0, "qsc_code_num_chars_line_max": 76.0, "qsc_code_num_chars_line_mean": 28.39762611, "qsc_code_frac_chars_alphabet": 0.63566049, "qsc_code_frac_chars_comments": 0.02131661, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.31208054, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00170849, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.01911372, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.01342282, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0704698, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.02013423, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": 0.02348993}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/ext/kiero/minhook/src/hde/hde32.c
/* * Hacker Disassembler Engine 32 C * Copyright (c) 2008-2009, Vyacheslav Patkov. * All rights reserved. * */ #if defined(_M_IX86) || defined(__i386__) #include "hde32.h" #include "table32.h" unsigned int hde32_disasm(const void *code, hde32s *hs) { uint8_t x, c, *p = (uint8_t *)code, cflags, opcode, pref = 0; uint8_t *ht = hde32_table, m_mod, m_reg, m_rm, disp_size = 0; // Avoid using memset to reduce the footprint. #ifndef _MSC_VER memset((LPBYTE)hs, 0, sizeof(hde32s)); #else __stosb((LPBYTE)hs, 0, sizeof(hde32s)); #endif for (x = 16; x; x--) switch (c = *p++) { case 0xf3: hs->p_rep = c; pref |= PRE_F3; break; case 0xf2: hs->p_rep = c; pref |= PRE_F2; break; case 0xf0: hs->p_lock = c; pref |= PRE_LOCK; break; case 0x26: case 0x2e: case 0x36: case 0x3e: case 0x64: case 0x65: hs->p_seg = c; pref |= PRE_SEG; break; case 0x66: hs->p_66 = c; pref |= PRE_66; break; case 0x67: hs->p_67 = c; pref |= PRE_67; break; default: goto pref_done; } pref_done: hs->flags = (uint32_t)pref << 23; if (!pref) pref |= PRE_NONE; if ((hs->opcode = c) == 0x0f) { hs->opcode2 = c = *p++; ht += DELTA_OPCODES; } else if (c >= 0xa0 && c <= 0xa3) { if (pref & PRE_67) pref |= PRE_66; else pref &= ~PRE_66; } opcode = c; cflags = ht[ht[opcode / 4] + (opcode % 4)]; if (cflags == C_ERROR) { hs->flags |= F_ERROR | F_ERROR_OPCODE; cflags = 0; if ((opcode & -3) == 0x24) cflags++; } x = 0; if (cflags & C_GROUP) { uint16_t t; t = *(uint16_t *)(ht + (cflags & 0x7f)); cflags = (uint8_t)t; x = (uint8_t)(t >> 8); } if (hs->opcode2) { ht = hde32_table + DELTA_PREFIXES; if (ht[ht[opcode / 4] + (opcode % 4)] & pref) hs->flags |= F_ERROR | F_ERROR_OPCODE; } if (cflags & C_MODRM) { hs->flags |= F_MODRM; hs->modrm = c = *p++; hs->modrm_mod = m_mod = c >> 6; hs->modrm_rm = m_rm = c & 7; hs->modrm_reg = m_reg = (c & 0x3f) >> 3; if (x && ((x << m_reg) & 0x80)) hs->flags |= F_ERROR | F_ERROR_OPCODE; if (!hs->opcode2 && opcode >= 0xd9 && opcode <= 0xdf) { uint8_t t = opcode - 0xd9; if (m_mod == 3) { ht = hde32_table + DELTA_FPU_MODRM + t*8; t = ht[m_reg] << m_rm; } else { ht = hde32_table + DELTA_FPU_REG; t = ht[t] << m_reg; } if (t & 0x80) hs->flags |= F_ERROR | F_ERROR_OPCODE; } if (pref & PRE_LOCK) { if (m_mod == 3) { hs->flags |= F_ERROR | F_ERROR_LOCK; } else { uint8_t *table_end, op = opcode; if (hs->opcode2) { ht = hde32_table + DELTA_OP2_LOCK_OK; table_end = ht + DELTA_OP_ONLY_MEM - DELTA_OP2_LOCK_OK; } else { ht = hde32_table + DELTA_OP_LOCK_OK; table_end = ht + DELTA_OP2_LOCK_OK - DELTA_OP_LOCK_OK; op &= -2; } for (; ht != table_end; ht++) if (*ht++ == op) { if (!((*ht << m_reg) & 0x80)) goto no_lock_error; else break; } hs->flags |= F_ERROR | F_ERROR_LOCK; no_lock_error: ; } } if (hs->opcode2) { switch (opcode) { case 0x20: case 0x22: m_mod = 3; if (m_reg > 4 || m_reg == 1) goto error_operand; else goto no_error_operand; case 0x21: case 0x23: m_mod = 3; if (m_reg == 4 || m_reg == 5) goto error_operand; else goto no_error_operand; } } else { switch (opcode) { case 0x8c: if (m_reg > 5) goto error_operand; else goto no_error_operand; case 0x8e: if (m_reg == 1 || m_reg > 5) goto error_operand; else goto no_error_operand; } } if (m_mod == 3) { uint8_t *table_end; if (hs->opcode2) { ht = hde32_table + DELTA_OP2_ONLY_MEM; table_end = ht + sizeof(hde32_table) - DELTA_OP2_ONLY_MEM; } else { ht = hde32_table + DELTA_OP_ONLY_MEM; table_end = ht + DELTA_OP2_ONLY_MEM - DELTA_OP_ONLY_MEM; } for (; ht != table_end; ht += 2) if (*ht++ == opcode) { if (*ht++ & pref && !((*ht << m_reg) & 0x80)) goto error_operand; else break; } goto no_error_operand; } else if (hs->opcode2) { switch (opcode) { case 0x50: case 0xd7: case 0xf7: if (pref & (PRE_NONE | PRE_66)) goto error_operand; break; case 0xd6: if (pref & (PRE_F2 | PRE_F3)) goto error_operand; break; case 0xc5: goto error_operand; } goto no_error_operand; } else goto no_error_operand; error_operand: hs->flags |= F_ERROR | F_ERROR_OPERAND; no_error_operand: c = *p++; if (m_reg <= 1) { if (opcode == 0xf6) cflags |= C_IMM8; else if (opcode == 0xf7) cflags |= C_IMM_P66; } switch (m_mod) { case 0: if (pref & PRE_67) { if (m_rm == 6) disp_size = 2; } else if (m_rm == 5) disp_size = 4; break; case 1: disp_size = 1; break; case 2: disp_size = 2; if (!(pref & PRE_67)) disp_size <<= 1; } if (m_mod != 3 && m_rm == 4 && !(pref & PRE_67)) { hs->flags |= F_SIB; p++; hs->sib = c; hs->sib_scale = c >> 6; hs->sib_index = (c & 0x3f) >> 3; if ((hs->sib_base = c & 7) == 5 && !(m_mod & 1)) disp_size = 4; } p--; switch (disp_size) { case 1: hs->flags |= F_DISP8; hs->disp.disp8 = *p; break; case 2: hs->flags |= F_DISP16; hs->disp.disp16 = *(uint16_t *)p; break; case 4: hs->flags |= F_DISP32; hs->disp.disp32 = *(uint32_t *)p; } p += disp_size; } else if (pref & PRE_LOCK) hs->flags |= F_ERROR | F_ERROR_LOCK; if (cflags & C_IMM_P66) { if (cflags & C_REL32) { if (pref & PRE_66) { hs->flags |= F_IMM16 | F_RELATIVE; hs->imm.imm16 = *(uint16_t *)p; p += 2; goto disasm_done; } goto rel32_ok; } if (pref & PRE_66) { hs->flags |= F_IMM16; hs->imm.imm16 = *(uint16_t *)p; p += 2; } else { hs->flags |= F_IMM32; hs->imm.imm32 = *(uint32_t *)p; p += 4; } } if (cflags & C_IMM16) { if (hs->flags & F_IMM32) { hs->flags |= F_IMM16; hs->disp.disp16 = *(uint16_t *)p; } else if (hs->flags & F_IMM16) { hs->flags |= F_2IMM16; hs->disp.disp16 = *(uint16_t *)p; } else { hs->flags |= F_IMM16; hs->imm.imm16 = *(uint16_t *)p; } p += 2; } if (cflags & C_IMM8) { hs->flags |= F_IMM8; hs->imm.imm8 = *p++; } if (cflags & C_REL32) { rel32_ok: hs->flags |= F_IMM32 | F_RELATIVE; hs->imm.imm32 = *(uint32_t *)p; p += 4; } else if (cflags & C_REL8) { hs->flags |= F_IMM8 | F_RELATIVE; hs->imm.imm8 = *p++; } disasm_done: if ((hs->len = (uint8_t)(p-(uint8_t *)code)) > 15) { hs->flags |= F_ERROR | F_ERROR_LENGTH; hs->len = 15; } return (unsigned int)hs->len; } #endif // defined(_M_IX86) || defined(__i386__)
9,381
hde32
c
en
c
code
{"qsc_code_num_words": 1041, "qsc_code_num_chars": 9381.0, "qsc_code_mean_word_length": 3.29971182, "qsc_code_frac_words_unique": 0.15273775, "qsc_code_frac_chars_top_2grams": 0.05298399, "qsc_code_frac_chars_top_3grams": 0.05822416, "qsc_code_frac_chars_top_4grams": 0.03406114, "qsc_code_frac_chars_dupe_5grams": 0.4014556, "qsc_code_frac_chars_dupe_6grams": 0.29548763, "qsc_code_frac_chars_dupe_7grams": 0.20931587, "qsc_code_frac_chars_dupe_8grams": 0.14992722, "qsc_code_frac_chars_dupe_9grams": 0.09636099, "qsc_code_frac_chars_dupe_10grams": 0.05676856, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.07211139, "qsc_code_frac_chars_whitespace": 0.48704829, "qsc_code_size_file_byte": 9381.0, "qsc_code_num_lines": 326.0, "qsc_code_num_chars_line_max": 76.0, "qsc_code_num_chars_line_mean": 28.77607362, "qsc_code_frac_chars_alphabet": 0.6415212, "qsc_code_frac_chars_comments": 0.02163948, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.34602076, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00174349, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.01656315, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.01384083, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.06574394, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.02076125, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": 0.02422145}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1sters/material_design_zh_2
material-design/patterns/empty-states.md
# 空状态 空状态发生于一个常规内容页面不能显示时。可能是一个没有条目的列表,或者一个没有返回结果的搜索。虽然这些情况不是典型的,但也是展示良好设计以避免用户失望或者困惑的好机会。 如果因为一个系统错误不能显示内容,参见 [app errors](https://www.google.com/design/spec/patterns/errors.html#errors-app-errors)。 > 显示空状态 > 避免完全空的内容 ## 显示空状态 最基本的空状态显示一个非交互的图片和文本标语。 使用一个图片: - 相对于背景来说,显得巧妙和素净。 - 以一个生动的方式传达应用的目的和意图,就像你的应用图标 包含一个标语: - 有积极的语气 - 与你的品牌一致 - 传达应用的意图,而不需要可操作 ![](../images/11_1.png) <p> <font color="green">(上图)可取:图片素净并且明显是背景的一部分。标语传达了应用的意图,并且没有需要操作的意思。</font></p> ![](../images/11_2.png) <p> <font color="red">(上图)不可取:图片明亮并且标语像是需要操作,让用户以为可以点击或者将会开始一段闲逛。</font></p> ## 避免完全空的内容 有好几种情况,你可以提供给用户完全空的内容之外的选项。 ### 启动内容页面 让新用户学习和着迷于你的应用最有吸引力的方式是通过使用它的过程。考虑提供一个启动页面内容,会让用户立即开始探索你的应用。 建议: - 使用具有广泛诉求的内容,显示最主要的功能。 - 给予用户删除或者替代这个内容的能力。 - 如果可能的话,为用户提供个性化的内容。 ![](../images/11_3.png) 一个书本阅读应用可以提供一些免费流行的书籍,让用户立马开始探索应用。 ### 指导内容 如果页面的意图并不能够通过一个图片和一个标语传达,考虑使用指导内容来取代。 建议: - 一旦有了内容,帮助用户理解他们可以做什么。 - 可以取消或者跳过内容。 - 保持简洁。 ![](../images/11_4.png) 一个用户在一个电影应用里看视频之前,一个可以取消的卡片显示出来解释服务的特征和好处。 ### 最佳匹配 如果没有东西匹配用户的查询,是否存在一些稍微有点区别的查询词的结果?如果有,显示结果,因为它们可能会帮助用户找到想要的。 通过这个方法,在结果的顶部清楚地传达这个内容与真实查询结果的匹配,以确保不会被拼错。 ![](../images/11_5.png) ![](../images/11_6.png) 提供“最佳匹配”是处理错拼查询的很好方法,而不至于让用户承担责任。
1,235
empty-states
md
zh
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": null, "qsc_doc_num_sentences": 37.0, "qsc_doc_num_words": 467, "qsc_doc_num_chars": 1235.0, "qsc_doc_num_lines": 79.0, "qsc_doc_mean_word_length": 1.92719486, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.46466809, "qsc_doc_entropy_unigram": 4.90711701, "qsc_doc_frac_words_all_caps": 0.0, "qsc_doc_frac_lines_dupe_lines": 0.04761905, "qsc_doc_frac_chars_dupe_lines": 0.00535714, "qsc_doc_frac_chars_top_2grams": 0.05333333, "qsc_doc_frac_chars_top_3grams": 0.01333333, "qsc_doc_frac_chars_top_4grams": 0.02, "qsc_doc_frac_chars_dupe_5grams": 0.01777778, "qsc_doc_frac_chars_dupe_6grams": 0.0, "qsc_doc_frac_chars_dupe_7grams": 0.0, "qsc_doc_frac_chars_dupe_8grams": 0.0, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 10.55140187, "qsc_doc_frac_chars_hyperlink_html_tag": 0.11417004, "qsc_doc_frac_chars_alphabet": null, "qsc_doc_frac_chars_digital": 0.01643836, "qsc_doc_frac_chars_whitespace": 0.11336032, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_full_bracket": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
/** * 通用js方法封装处理 * Copyright (c) 2019 ruoyi */ // 当前table相关信息 var table = { config: {}, // 当前实例配置 options: {}, // 设置实例配置 set: function(id) { if($.common.getLength(table.config) > 1) { var tableId = $.common.isEmpty(id) ? $(event.currentTarget).parents(".bootstrap-table").find(".table").attr("id") : id; if ($.common.isNotEmpty(tableId)) { table.options = table.get(tableId); } } }, // 获取实例配置 get: function(id) { return table.config[id]; }, // 记住选择实例组 rememberSelecteds: {}, // 记住选择ID组 rememberSelectedIds: {} }; (function ($) { $.extend({ _tree: {}, bttTable: {}, // 表格封装处理 table: { // 初始化表格参数 init: function(options) { var defaults = { id: "bootstrap-table", type: 0, // 0 代表bootstrapTable 1代表bootstrapTreeTable height: undefined, sidePagination: "server", sortName: "", sortOrder: "asc", pagination: true, pageSize: 10, pageList: [10, 25, 50], toolbar: "toolbar", striped: false, escape: false, firstLoad: true, showFooter: false, search: false, showSearch: true, showPageGo: false, showRefresh: true, showColumns: true, showToggle: true, showExport: false, clickToSelect: false, singleSelect: false, mobileResponsive: true, rememberSelected: false, fixedColumns: false, fixedNumber: 0, rightFixedColumns: false, rightFixedNumber: 0, queryParams: $.table.queryParams, rowStyle: {}, }; var options = $.extend(defaults, options); table.options = options; table.config[options.id] = options; $.table.initEvent(); $('#' + options.id).bootstrapTable({ id: options.id, url: options.url, // 请求后台的URL(*) contentType: "application/x-www-form-urlencoded", // 编码类型 method: 'post', // 请求方式(*) cache: false, // 是否使用缓存 height: options.height, // 表格的高度 striped: options.striped, // 是否显示行间隔色 sortable: true, // 是否启用排序 sortStable: true, // 设置为 true 将获得稳定的排序 sortName: options.sortName, // 排序列名称 sortOrder: options.sortOrder, // 排序方式 asc 或者 desc pagination: options.pagination, // 是否显示分页(*) pageNumber: 1, // 初始化加载第一页,默认第一页 pageSize: options.pageSize, // 每页的记录行数(*) pageList: options.pageList, // 可供选择的每页的行数(*) firstLoad: options.firstLoad, // 是否首次请求加载数据,对于数据较大可以配置false escape: options.escape, // 转义HTML字符串 showFooter: options.showFooter, // 是否显示表尾 iconSize: 'outline', // 图标大小:undefined默认的按钮尺寸 xs超小按钮sm小按钮lg大按钮 toolbar: '#' + options.toolbar, // 指定工作栏 sidePagination: options.sidePagination, // server启用服务端分页client客户端分页 search: options.search, // 是否显示搜索框功能 searchText: options.searchText, // 搜索框初始显示的内容,默认为空 showSearch: options.showSearch, // 是否显示检索信息 showPageGo: options.showPageGo, // 是否显示跳转页 showRefresh: options.showRefresh, // 是否显示刷新按钮 showColumns: options.showColumns, // 是否显示隐藏某列下拉框 showToggle: options.showToggle, // 是否显示详细视图和列表视图的切换按钮 showExport: options.showExport, // 是否支持导出文件 uniqueId: options.uniqueId, // 唯 一的标识符 clickToSelect: options.clickToSelect, // 是否启用点击选中行 singleSelect: options.singleSelect, // 是否单选checkbox mobileResponsive: options.mobileResponsive, // 是否支持移动端适配 detailView: options.detailView, // 是否启用显示细节视图 onClickRow: options.onClickRow, // 点击某行触发的事件 onDblClickRow: options.onDblClickRow, // 双击某行触发的事件 onClickCell: options.onClickCell, // 单击某格触发的事件 onDblClickCell: options.onDblClickCell, // 双击某格触发的事件 onEditableSave: options.onEditableSave, // 行内编辑保存的事件 onExpandRow: options.onExpandRow, // 点击详细视图的事件 rememberSelected: options.rememberSelected, // 启用翻页记住前面的选择 fixedColumns: options.fixedColumns, // 是否启用冻结列(左侧) fixedNumber: options.fixedNumber, // 列冻结的个数(左侧) rightFixedColumns: options.rightFixedColumns, // 是否启用冻结列(右侧) rightFixedNumber: options.rightFixedNumber, // 列冻结的个数(右侧) onReorderRow: options.onReorderRow, // 当拖拽结束后处理函数 queryParams: options.queryParams, // 传递参数(*) rowStyle: options.rowStyle, // 通过自定义函数设置行样式 columns: options.columns, // 显示列信息(*) responseHandler: $.table.responseHandler, // 在加载服务器发送来的数据之前处理函数 onLoadSuccess: $.table.onLoadSuccess, // 当所有数据被加载时触发处理函数 exportOptions: options.exportOptions, // 前端导出忽略列索引 detailFormatter: options.detailFormatter, // 在行下面展示其他数据列表 }); }, // 获取实例ID,如存在多个返回#id1,#id2 delimeter分隔符 getOptionsIds: function(separator) { var _separator = $.common.isEmpty(separator) ? "," : separator; var optionsIds = ""; $.each(table.config, function(key, value){ optionsIds += "#" + key + _separator; }); return optionsIds.substring(0, optionsIds.length - 1); }, // 查询条件 queryParams: function(params) { var curParams = { // 传递参数查询参数 pageSize: params.limit, pageNum: params.offset / params.limit + 1, searchValue: params.search, orderByColumn: params.sort, isAsc: params.order }; var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId; return $.extend(curParams, $.common.formToJSON(currentId)); }, // 请求获取数据后处理回调函数 responseHandler: function(res) { if (typeof table.options.responseHandler == "function") { table.options.responseHandler(res); } if (res.code == 0) { if ($.common.isNotEmpty(table.options.sidePagination) && table.options.sidePagination == 'client') { return res.rows; } else { if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) { var column = $.common.isEmpty(table.options.uniqueId) ? table.options.columns[1].field : table.options.uniqueId; $.each(res.rows, function(i, row) { row.state = $.inArray(row[column], table.rememberSelectedIds[table.options.id]) !== -1; }) } return { rows: res.rows, total: res.total }; } } else { $.modal.alertWarning(res.msg); return { rows: [], total: 0 }; } }, // 初始化事件 initEvent: function() { // 实例ID信息 var optionsIds = $.table.getOptionsIds(); // 监听事件处理 $(optionsIds).on(TABLE_EVENTS, function () { table.set($(this).attr("id")); }); // 选中、取消、全部选中、全部取消(事件) $(optionsIds).on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table", function (e, rows) { // 复选框分页保留保存选中数组 var rowIds = $.table.affectedRowIds(rows); if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) { func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference'; var selectedIds = table.rememberSelectedIds[table.options.id]; if($.common.isNotEmpty(selectedIds)) { table.rememberSelectedIds[table.options.id] = _[func](selectedIds, rowIds); } else { table.rememberSelectedIds[table.options.id] = _[func]([], rowIds); } var selectedRows = table.rememberSelecteds[table.options.id]; if($.common.isNotEmpty(selectedRows)) { table.rememberSelecteds[table.options.id] = _[func](selectedRows, rows); } else { table.rememberSelecteds[table.options.id] = _[func]([], rows); } } }); // 加载成功、选中、取消、全部选中、全部取消(事件) $(optionsIds).on("check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table load-success.bs.table", function () { var toolbar = table.options.toolbar; var uniqueId = table.options.uniqueId; // 工具栏按钮控制 var rows = $.common.isEmpty(uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(uniqueId); // 非多个禁用 $('#' + toolbar + ' .multiple').toggleClass('disabled', !rows.length); // 非单个禁用 $('#' + toolbar + ' .single').toggleClass('disabled', rows.length!=1); }); // 图片预览事件 $(optionsIds).off("click").on("click", '.img-circle', function() { var src = $(this).attr('src'); var target = $(this).data('target'); var height = $(this).data('height'); var width = $(this).data('width'); if($.common.equals("self", target)) { layer.open({ title: false, type: 1, closeBtn: true, shadeClose: true, area: ['auto', 'auto'], content: "<img src='" + src + "' height='" + height + "' width='" + width + "'/>" }); } else if ($.common.equals("blank", target)) { window.open(src); } }); // 单击tooltip事件 $(optionsIds).on("click", '.tooltip-show', function() { var target = $(this).data('target'); var input = $(this).prev(); if ($.common.equals("copy", target)) { input.select(); document.execCommand("copy"); } else if ($.common.equals("open", target)) { parent.layer.alert(input.val(), { title: "信息内容", shadeClose: true, btn: ['确认'], btnclass: ['btn btn-primary'], }); } }); }, // 当所有数据被加载时触发 onLoadSuccess: function(data) { if (typeof table.options.onLoadSuccess == "function") { table.options.onLoadSuccess(data); } // 浮动提示框特效 $(".table [data-toggle='tooltip']").tooltip(); // 气泡弹出框特效 $('.table [data-toggle="popover"]').each(function() { $(this).popover({ trigger: "manual", html: true, animation: false, container: "body", placement: "left" }).on("mouseenter", function() { var _this = this; $(this).popover("show"); $(".popover").on("mouseleave", function() { $(_this).popover('hide'); }); }).on("mouseleave", function() { var _this = this; setTimeout(function() { if (!$(".popover:hover").length) $(_this).popover("hide"); }, 100); }); }); }, // 表格销毁 destroy: function (tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('destroy'); }, // 序列号生成 serialNumber: function (index, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; var tableParams = $("#" + currentId).bootstrapTable('getOptions'); var pageSize = tableParams.pageSize; var pageNumber = tableParams.pageNumber; return pageSize * (pageNumber - 1) + index + 1; }, // 列超出指定长度浮动提示 target(copy单击复制文本 open弹窗打开文本) tooltip: function (value, length, target) { var _length = $.common.isEmpty(length) ? 20 : length; var _text = ""; var _value = $.common.nullToStr(value); var _target = $.common.isEmpty(target) ? 'copy' : target; if (_value.length > _length) { _text = _value.substr(0, _length) + "..."; _value = _value.replace(/\'/g,"&apos;"); _value = _value.replace(/\"/g,"&quot;"); var actions = []; actions.push($.common.sprintf('<input id="tooltip-show" style="opacity: 0;position: absolute;z-index:-1" type="text" value="%s"/>', _value)); actions.push($.common.sprintf('<a href="###" class="tooltip-show" data-toggle="tooltip" data-target="%s" title="%s">%s</a>', _target, _value, _text)); return actions.join(''); } else { _text = _value; return _text; } }, // 下拉按钮切换 dropdownToggle: function (value) { var actions = []; actions.push('<div class="btn-group">'); actions.push('<button type="button" class="btn btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false">'); actions.push('<i class="fa fa-cog"></i>&nbsp;<span class="fa fa-chevron-down"></span></button>'); actions.push('<ul class="dropdown-menu">'); actions.push(value.replace(/<a/g,"<li><a").replace(/<\/a>/g,"</a></li>")); actions.push('</ul>'); actions.push('</div>'); return actions.join(''); }, // 图片预览 imageView: function (value, height, width, target) { if ($.common.isEmpty(width)) { width = 'auto'; } if ($.common.isEmpty(height)) { height = 'auto'; } // blank or self var _target = $.common.isEmpty(target) ? 'self' : target; if ($.common.isNotEmpty(value)) { return $.common.sprintf("<img class='img-circle img-xs' data-height='%s' data-width='%s' data-target='%s' src='%s'/>", height, width, _target, value); } else { return $.common.nullToStr(value); } }, // 搜索-默认第一个form search: function(formId, tableId, data) { table.set(tableId); var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var params = $.common.isEmpty(tableId) ? $("#" + table.options.id).bootstrapTable('getOptions') : $("#" + tableId).bootstrapTable('getOptions'); params.queryParams = function(params) { var search = $.common.formToJSON(currentId); if($.common.isNotEmpty(data)){ $.each(data, function(key) { search[key] = data[key]; }); } search.pageSize = params.limit; search.pageNum = params.offset / params.limit + 1; search.searchValue = params.search; search.orderByColumn = params.sort; search.isAsc = params.order; return search; } if($.common.isNotEmpty(tableId)){ $("#" + tableId).bootstrapTable('refresh', params); } else{ $("#" + table.options.id).bootstrapTable('refresh', params); } }, // 导出数据 exportExcel: function(formId) { table.set(); $.modal.confirm("确定导出所有" + table.options.modalName + "吗?", function() { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var params = $("#" + table.options.id).bootstrapTable('getOptions'); var dataParam = $("#" + currentId).serializeArray(); dataParam.push({ "name": "orderByColumn", "value": params.sortName }); dataParam.push({ "name": "isAsc", "value": params.sortOrder }); $.modal.loading("正在导出数据,请稍后..."); $.post(table.options.exportUrl, dataParam, function(result) { if (result.code == web_status.SUCCESS) { window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; } else if (result.code == web_status.WARNING) { $.modal.alertWarning(result.msg) } else { $.modal.alertError(result.msg); } $.modal.closeLoading(); }); }); }, // 下载模板 importTemplate: function() { table.set(); $.get(table.options.importTemplateUrl, function(result) { if (result.code == web_status.SUCCESS) { window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; } else if (result.code == web_status.WARNING) { $.modal.alertWarning(result.msg) } else { $.modal.alertError(result.msg); } }); }, // 导入数据 importExcel: function(formId) { table.set(); var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId; layer.open({ type: 1, area: ['400px', '230px'], fix: false, //不固定 maxmin: true, shade: 0.3, title: '导入' + table.options.modalName + '数据', content: $('#' + currentId).html(), btn: ['<i class="fa fa-check"></i> 导入', '<i class="fa fa-remove"></i> 取消'], // 弹层外区域关闭 shadeClose: true, btn1: function(index, layero){ var file = layero.find('#file').val(); if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))){ $.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。"); return false; } var index = layer.load(2, {shade: false}); $.modal.disable(); var formData = new FormData(layero.find('form')[0]); $.ajax({ url: table.options.importUrl, data: formData, cache: false, contentType: false, processData: false, type: 'POST', success: function (result) { if (result.code == web_status.SUCCESS) { $.modal.closeAll(); $.modal.alertSuccess(result.msg); $.table.refresh(); } else if (result.code == web_status.WARNING) { layer.close(index); $.modal.enable(); $.modal.alertWarning(result.msg) } else { layer.close(index); $.modal.enable(); $.modal.alertError(result.msg); } } }); } }); }, // 刷新表格 refresh: function(tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('refresh', { silent: true }); }, // 查询表格指定列值 selectColumns: function(column) { var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) { return row[column]; }); if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) { var selectedRows = table.rememberSelecteds[table.options.id]; if($.common.isNotEmpty(selectedRows)) { rows = $.map(table.rememberSelecteds[table.options.id], function (row) { return row[column]; }); } } return $.common.uniqueFn(rows); }, // 获取当前页选中或者取消的行ID affectedRowIds: function(rows) { var column = $.common.isEmpty(table.options.uniqueId) ? table.options.columns[1].field : table.options.uniqueId; var rowIds; if ($.isArray(rows)) { rowIds = $.map(rows, function(row) { return row[column]; }); } else { rowIds = [rows[column]]; } return rowIds; }, // 查询表格首列值 selectFirstColumns: function() { var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) { return row[table.options.columns[1].field]; }); if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) { var selectedRows = table.rememberSelecteds[table.options.id]; if($.common.isNotEmpty(selectedRows)) { rows = $.map(selectedRows, function (row) { return row[table.options.columns[1].field]; }); } } return $.common.uniqueFn(rows); }, // 回显数据字典 selectDictLabel: function(datas, value) { var actions = []; $.each(datas, function(index, dict) { if (dict.dictValue == ('' + value)) { var listClass = $.common.equals("default", dict.listClass) || $.common.isEmpty(dict.listClass) ? "" : "badge badge-" + dict.listClass; actions.push($.common.sprintf("<span class='%s'>%s</span>", listClass, dict.dictLabel)); return false; } }); return actions.join(''); }, // 显示表格指定列 showColumn: function(column, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('showColumn', column); }, // 隐藏表格指定列 hideColumn: function(column, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('hideColumn', column); } }, // 表格树封装处理 treeTable: { // 初始化表格 init: function(options) { var defaults = { id: "bootstrap-tree-table", type: 1, // 0 代表bootstrapTable 1代表bootstrapTreeTable height: 0, rootIdValue: null, ajaxParams: {}, toolbar: "toolbar", striped: false, expandColumn: 1, showSearch: true, showRefresh: true, showColumns: true, expandAll: true, expandFirst: true }; var options = $.extend(defaults, options); table.options = options; table.config[options.id] = options; $.bttTable = $('#' + options.id).bootstrapTreeTable({ code: options.code, // 用于设置父子关系 parentCode: options.parentCode, // 用于设置父子关系 type: 'post', // 请求方式(*) url: options.url, // 请求后台的URL(*) data: options.data, // 无url时用于渲染的数据 ajaxParams: options.ajaxParams, // 请求数据的ajax的data属性 rootIdValue: options.rootIdValue, // 设置指定根节点id值 height: options.height, // 表格树的高度 expandColumn: options.expandColumn, // 在哪一列上面显示展开按钮 striped: options.striped, // 是否显示行间隔色 bordered: false, // 是否显示边框 toolbar: '#' + options.toolbar, // 指定工作栏 showSearch: options.showSearch, // 是否显示检索信息 showRefresh: options.showRefresh, // 是否显示刷新按钮 showColumns: options.showColumns, // 是否显示隐藏某列下拉框 expandAll: options.expandAll, // 是否全部展开 expandFirst: options.expandFirst, // 是否默认第一级展开--expandAll为false时生效 columns: options.columns, // 显示列信息(*) responseHandler: $.treeTable.responseHandler // 当所有数据被加载时触发处理函数 }); }, // 条件查询 search: function(formId) { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var params = $.common.formToJSON(currentId); $.bttTable.bootstrapTreeTable('refresh', params); }, // 刷新 refresh: function() { $.bttTable.bootstrapTreeTable('refresh'); }, // 查询表格树指定列值 selectColumns: function(column) { var rows = $.map($.bttTable.bootstrapTreeTable('getSelections'), function (row) { return row[column]; }); return $.common.uniqueFn(rows); }, // 请求获取数据后处理回调函数,校验异常状态提醒 responseHandler: function(res) { if (typeof table.options.responseHandler == "function") { table.options.responseHandler(res); } if (res.code != undefined && res.code != 0) { $.modal.alertWarning(res.msg); return []; } else { return res; } }, }, // 表单封装处理 form: { // 表单重置 reset: function(formId, tableId) { table.set(tableId); var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; $("#" + currentId)[0].reset(); if (table.options.type == table_type.bootstrapTable) { if($.common.isEmpty(tableId)){ $("#" + table.options.id).bootstrapTable('refresh'); } else{ $("#" + tableId).bootstrapTable('refresh'); } } else if (table.options.type == table_type.bootstrapTreeTable) { if($.common.isEmpty(tableId)){ $("#" + table.options.id).bootstrapTreeTable('refresh', []); } else{ $("#" + tableId).bootstrapTreeTable('refresh', []); } } }, // 获取选中复选框项 selectCheckeds: function(name) { var checkeds = ""; $('input:checkbox[name="' + name + '"]:checked').each(function(i) { if (0 == i) { checkeds = $(this).val(); } else { checkeds += ("," + $(this).val()); } }); return checkeds; }, // 获取选中下拉框项 selectSelects: function(name) { var selects = ""; $('#' + name + ' option:selected').each(function (i) { if (0 == i) { selects = $(this).val(); } else { selects += ("," + $(this).val()); } }); return selects; } }, // 弹出层封装处理 modal: { // 显示图标 icon: function(type) { var icon = ""; if (type == modal_status.WARNING) { icon = 0; } else if (type == modal_status.SUCCESS) { icon = 1; } else if (type == modal_status.FAIL) { icon = 2; } else { icon = 3; } return icon; }, // 消息提示 msg: function(content, type) { if (type != undefined) { layer.msg(content, { icon: $.modal.icon(type), time: 1000, shift: 5 }); } else { layer.msg(content); } }, // 错误消息 msgError: function(content) { $.modal.msg(content, modal_status.FAIL); }, // 成功消息 msgSuccess: function(content) { $.modal.msg(content, modal_status.SUCCESS); }, // 警告消息 msgWarning: function(content) { $.modal.msg(content, modal_status.WARNING); }, // 弹出提示 alert: function(content, type) { layer.alert(content, { icon: $.modal.icon(type), title: "系统提示", btn: ['确认'], btnclass: ['btn btn-primary'], }); }, // 消息提示并刷新父窗体 msgReload: function(msg, type) { layer.msg(msg, { icon: $.modal.icon(type), time: 500, shade: [0.1, '#8F8F8F'] }, function() { $.modal.reload(); }); }, // 错误提示 alertError: function(content) { $.modal.alert(content, modal_status.FAIL); }, // 成功提示 alertSuccess: function(content) { $.modal.alert(content, modal_status.SUCCESS); }, // 警告提示 alertWarning: function(content) { $.modal.alert(content, modal_status.WARNING); }, // 关闭窗体 close: function () { var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); }, // 关闭全部窗体 closeAll: function () { layer.closeAll(); }, // 确认窗体 confirm: function (content, callBack) { layer.confirm(content, { icon: 3, title: "系统提示", btn: ['确认', '取消'] }, function (index) { layer.close(index); callBack(true); }); }, // 弹出层指定宽度 open: function (title, url, width, height, callback) { //如果是移动端,就使用自适应大小弹窗 if ($.common.isMobile()) { width = 'auto'; height = 'auto'; } if ($.common.isEmpty(title)) { title = false; } if ($.common.isEmpty(url)) { url = "/404.html"; } if ($.common.isEmpty(width)) { width = 800; } if ($.common.isEmpty(height)) { height = ($(window).height() - 50); } if ($.common.isEmpty(callback)) { callback = function(index, layero) { var iframeWin = layero.find('iframe')[0]; iframeWin.contentWindow.submitHandler(index, layero); } } layer.open({ type: 2, area: [width + 'px', height + 'px'], fix: false, //不固定 maxmin: true, shade: 0.3, title: title, content: url, btn: ['确定', '关闭'], // 弹层外区域关闭 shadeClose: true, yes: callback, cancel: function(index) { return true; } }); }, // 弹出层指定参数选项 openOptions: function (options) { var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url; var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title; var _width = $.common.isEmpty(options.width) ? "800" : options.width; var _height = $.common.isEmpty(options.height) ? ($(window).height() - 50) : options.height; var _btn = ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-close"></i> 关闭']; if ($.common.isEmpty(options.yes)) { options.yes = function(index, layero) { options.callBack(index, layero); } } layer.open({ type: 2, maxmin: true, shade: 0.3, title: _title, fix: false, area: [_width + 'px', _height + 'px'], content: _url, shadeClose: $.common.isEmpty(options.shadeClose) ? true : options.shadeClose, skin: options.skin, btn: $.common.isEmpty(options.btn) ? _btn : options.btn, yes: options.yes, cancel: function () { return true; } }); }, // 弹出层全屏 openFull: function (title, url, width, height) { //如果是移动端,就使用自适应大小弹窗 if ($.common.isMobile()) { width = 'auto'; height = 'auto'; } if ($.common.isEmpty(title)) { title = false; } if ($.common.isEmpty(url)) { url = "/404.html"; } if ($.common.isEmpty(width)) { width = 800; } if ($.common.isEmpty(height)) { height = ($(window).height() - 50); } var index = layer.open({ type: 2, area: [width + 'px', height + 'px'], fix: false, //不固定 maxmin: true, shade: 0.3, title: title, content: url, btn: ['确定', '关闭'], // 弹层外区域关闭 shadeClose: true, yes: function(index, layero) { var iframeWin = layero.find('iframe')[0]; iframeWin.contentWindow.submitHandler(index, layero); }, cancel: function(index) { return true; } }); layer.full(index); }, // 选卡页方式打开 openTab: function (title, url) { createMenuItem(url, title); }, // 选卡页同一页签打开 parentTab: function (title, url) { var dataId = window.frameElement.getAttribute('data-id'); createMenuItem(url, title); closeItem(dataId); }, // 关闭选项卡 closeTab: function (dataId) { closeItem(dataId); }, // 禁用按钮 disable: function() { var doc = window.top == window.parent ? window.document : window.parent.document; $("a[class*=layui-layer-btn]", doc).addClass("layer-disabled"); }, // 启用按钮 enable: function() { var doc = window.top == window.parent ? window.document : window.parent.document; $("a[class*=layui-layer-btn]", doc).removeClass("layer-disabled"); }, // 打开遮罩层 loading: function (message) { $.blockUI({ message: '<div class="loaderbox"><div class="loading-activity"></div> ' + message + '</div>' }); }, // 关闭遮罩层 closeLoading: function () { setTimeout(function(){ $.unblockUI(); }, 50); }, // 重新加载 reload: function () { parent.location.reload(); } }, // 操作封装处理 operate: { // 提交数据 submit: function(url, type, dataType, data, callback) { var config = { url: url, type: type, dataType: dataType, data: data, beforeSend: function () { $.modal.loading("正在处理中,请稍后..."); }, success: function(result) { if (typeof callback == "function") { callback(result); } $.operate.ajaxSuccess(result); } }; $.ajax(config) }, // post请求传输 post: function(url, data, callback) { $.operate.submit(url, "post", "json", data, callback); }, // get请求传输 get: function(url, callback) { $.operate.submit(url, "get", "json", "", callback); }, // 详细信息 detail: function(id, width, height) { table.set(); var _url = $.operate.detailUrl(id); var _width = $.common.isEmpty(width) ? "800" : width; var _height = $.common.isEmpty(height) ? ($(window).height() - 50) : height; //如果是移动端,就使用自适应大小弹窗 if ($.common.isMobile()) { _width = 'auto'; _height = 'auto'; } var options = { title: table.options.modalName + "详细", width: _width, height: _height, url: _url, skin: 'layui-layer-gray', btn: ['关闭'], yes: function (index, layero) { layer.close(index); } }; $.modal.openOptions(options); }, // 详细访问地址 detailUrl: function(id) { var url = "/404.html"; if ($.common.isNotEmpty(id)) { url = table.options.detailUrl.replace("{id}", id); } else { var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); if (id.length == 0) { $.modal.alertWarning("请至少选择一条记录"); return; } url = table.options.detailUrl.replace("{id}", id); } return url; }, // 删除信息 remove: function(id) { table.set(); $.modal.confirm("确定删除该条" + table.options.modalName + "信息吗?", function() { var url = $.common.isEmpty(id) ? table.options.removeUrl : table.options.removeUrl.replace("{id}", id); if(table.options.type == table_type.bootstrapTreeTable) { $.operate.get(url); } else { var data = { "ids": id }; $.operate.submit(url, "post", "json", data); } }); }, // 批量删除信息 removeAll: function() { table.set(); var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); if (rows.length == 0) { $.modal.alertWarning("请至少选择一条记录"); return; } $.modal.confirm("确认要删除选中的" + rows.length + "条数据吗?", function() { var url = table.options.removeUrl; var data = { "ids": rows.join() }; $.operate.submit(url, "post", "json", data); }); }, // 清空信息 clean: function() { table.set(); $.modal.confirm("确定清空所有" + table.options.modalName + "吗?", function() { var url = table.options.cleanUrl; $.operate.submit(url, "post", "json", ""); }); }, // 添加信息 add: function(id) { table.set(); $.modal.open("添加" + table.options.modalName, $.operate.addUrl(id)); }, // 添加信息,以tab页展现 addTab: function (id) { table.set(); $.modal.openTab("添加" + table.options.modalName, $.operate.addUrl(id)); }, // 添加信息 全屏 addFull: function(id) { table.set(); var url = $.common.isEmpty(id) ? table.options.createUrl : table.options.createUrl.replace("{id}", id); $.modal.openFull("添加" + table.options.modalName, url); }, // 添加访问地址 addUrl: function(id) { var url = $.common.isEmpty(id) ? table.options.createUrl.replace("{id}", "") : table.options.createUrl.replace("{id}", id); return url; }, // 修改信息 edit: function(id) { table.set(); if($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) { var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0]; if ($.common.isEmpty(row)) { $.modal.alertWarning("请至少选择一条记录"); return; } var url = table.options.updateUrl.replace("{id}", row[table.options.uniqueId]); $.modal.open("修改" + table.options.modalName, url); } else { $.modal.open("修改" + table.options.modalName, $.operate.editUrl(id)); } }, // 修改信息,以tab页展现 editTab: function(id) { table.set(); $.modal.openTab("修改" + table.options.modalName, $.operate.editUrl(id)); }, // 修改信息 全屏 editFull: function(id) { table.set(); var url = "/404.html"; if ($.common.isNotEmpty(id)) { url = table.options.updateUrl.replace("{id}", id); } else { var row = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); url = table.options.updateUrl.replace("{id}", row); } $.modal.openFull("修改" + table.options.modalName, url); }, // 修改访问地址 editUrl: function(id) { var url = "/404.html"; if ($.common.isNotEmpty(id)) { url = table.options.updateUrl.replace("{id}", id); } else { var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); if (id.length == 0) { $.modal.alertWarning("请至少选择一条记录"); return; } url = table.options.updateUrl.replace("{id}", id); } return url; }, // 保存信息 刷新表格 save: function(url, data, callback) { var config = { url: url, type: "post", dataType: "json", data: data, beforeSend: function () { $.modal.loading("正在处理中,请稍后..."); $.modal.disable(); }, success: function(result) { if (typeof callback == "function") { callback(result); } $.operate.successCallback(result); } }; $.ajax(config) }, // 保存信息 弹出提示框 saveModal: function(url, data, callback) { var config = { url: url, type: "post", dataType: "json", data: data, beforeSend: function () { $.modal.loading("正在处理中,请稍后..."); }, success: function(result) { if (typeof callback == "function") { callback(result); } if (result.code == web_status.SUCCESS) { $.modal.alertSuccess(result.msg) } else if (result.code == web_status.WARNING) { $.modal.alertWarning(result.msg) } else { $.modal.alertError(result.msg); } $.modal.closeLoading(); } }; $.ajax(config) }, // 保存选项卡信息 saveTab: function(url, data, callback) { var config = { url: url, type: "post", dataType: "json", data: data, beforeSend: function () { $.modal.loading("正在处理中,请稍后..."); }, success: function(result) { if (typeof callback == "function") { callback(result); } $.operate.successTabCallback(result); } }; $.ajax(config) }, // 保存结果弹出msg刷新table表格 ajaxSuccess: function (result) { if (result.code == web_status.SUCCESS && table.options.type == table_type.bootstrapTable) { $.modal.msgSuccess(result.msg); $.table.refresh(); } else if (result.code == web_status.SUCCESS && table.options.type == table_type.bootstrapTreeTable) { $.modal.msgSuccess(result.msg); $.treeTable.refresh(); } else if (result.code == web_status.SUCCESS && table.option.type == undefined) { $.modal.msgSuccess(result.msg) } else if (result.code == web_status.WARNING) { $.modal.alertWarning(result.msg) } else { $.modal.alertError(result.msg); } $.modal.closeLoading(); }, // 成功结果提示msg(父窗体全局更新) saveSuccess: function (result) { if (result.code == web_status.SUCCESS) { $.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS); } else if (result.code == web_status.WARNING) { $.modal.alertWarning(result.msg) } else { $.modal.alertError(result.msg); } $.modal.closeLoading(); }, // 成功回调执行事件(父窗体静默更新) successCallback: function(result) { if (result.code == web_status.SUCCESS) { var parent = window.parent; if (parent.table.options.type == table_type.bootstrapTable) { $.modal.close(); parent.$.modal.msgSuccess(result.msg); parent.$.table.refresh(); } else if (parent.table.options.type == table_type.bootstrapTreeTable) { $.modal.close(); parent.$.modal.msgSuccess(result.msg); parent.$.treeTable.refresh(); } else { $.modal.msgReload("保存成功,正在刷新数据请稍后……", modal_status.SUCCESS); } } else if (result.code == web_status.WARNING) { $.modal.alertWarning(result.msg) } else { $.modal.alertError(result.msg); } $.modal.closeLoading(); $.modal.enable(); }, // 选项卡成功回调执行事件(父窗体静默更新) successTabCallback: function(result) { if (result.code == web_status.SUCCESS) { var topWindow = $(window.parent.document); var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-panel'); var $contentWindow = $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow; $.modal.close(); $contentWindow.$.modal.msgSuccess(result.msg); $contentWindow.$(".layui-layer-padding").removeAttr("style"); if ($contentWindow.table.options.type == table_type.bootstrapTable) { $contentWindow.$.table.refresh(); } else if ($contentWindow.table.options.type == table_type.bootstrapTreeTable) { $contentWindow.$.treeTable.refresh(); } $.modal.closeTab(); } else if (result.code == web_status.WARNING) { $.modal.alertWarning(result.msg) } else { $.modal.alertError(result.msg); } $.modal.closeLoading(); } }, // 校验封装处理 validate: { // 判断返回标识是否唯一 false 不存在 true 存在 unique: function (value) { if (value == "0") { return true; } return false; }, // 表单验证 form: function (formId) { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; return $("#" + currentId).validate().form(); }, // 重置表单验证(清除提示信息) reset: function (formId) { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; return $("#" + currentId).validate().resetForm(); } }, // 树插件封装处理 tree: { _option: {}, _lastValue: {}, // 初始化树结构 init: function(options) { var defaults = { id: "tree", // 属性ID expandLevel: 0, // 展开等级节点 view: { selectedMulti: false, // 设置是否允许同时选中多个节点 nameIsHTML: true // 设置 name 属性是否支持 HTML 脚本 }, check: { enable: false, // 置 zTree 的节点上是否显示 checkbox / radio nocheckInherit: true, // 设置子节点是否自动继承 }, data: { key: { title: "title" // 节点数据保存节点提示信息的属性名称 }, simpleData: { enable: true // true / false 分别表示 使用 / 不使用 简单数据模式 } }, }; var options = $.extend(defaults, options); $.tree._option = options; // 树结构初始化加载 var setting = { callback: { onClick: options.onClick, // 用于捕获节点被点击的事件回调函数 onCheck: options.onCheck, // 用于捕获 checkbox / radio 被勾选 或 取消勾选的事件回调函数 onDblClick: options.onDblClick // 用于捕获鼠标双击之后的事件回调函数 }, check: options.check, view: options.view, data: options.data }; $.get(options.url, function(data) { var treeId = $("#treeId").val(); tree = $.fn.zTree.init($("#" + options.id), setting, data); $._tree = tree; var nodes = tree.getNodesByParam("level", options.expandLevel - 1); for (var i = 0; i < nodes.length; i++) { tree.expandNode(nodes[i], true, false, false); } var node = tree.getNodesByParam("id", treeId, null)[0]; $.tree.selectByIdName(treeId, node); }); }, // 搜索节点 searchNode: function() { // 取得输入的关键字的值 var value = $.common.trim($("#keyword").val()); if ($.tree._lastValue == value) { return; } // 保存最后一次搜索名称 $.tree._lastValue = value; var nodes = $._tree.getNodes(); // 如果要查空字串,就退出不查了。 if (value == "") { $.tree.showAllNode(nodes); return; } $.tree.hideAllNode(nodes); // 根据搜索值模糊匹配 $.tree.updateNodes($._tree.getNodesByParamFuzzy("name", value)); }, // 根据Id和Name选中指定节点 selectByIdName: function(treeId, node) { if ($.common.isNotEmpty(treeId) && treeId == node.id) { $._tree.selectNode(node, true); } }, // 显示所有节点 showAllNode: function(nodes) { nodes = $._tree.transformToArray(nodes); for (var i = nodes.length - 1; i >= 0; i--) { if (nodes[i].getParentNode() != null) { $._tree.expandNode(nodes[i], true, false, false, false); } else { $._tree.expandNode(nodes[i], true, true, false, false); } $._tree.showNode(nodes[i]); $.tree.showAllNode(nodes[i].children); } }, // 隐藏所有节点 hideAllNode: function(nodes) { var tree = $.fn.zTree.getZTreeObj("tree"); var nodes = $._tree.transformToArray(nodes); for (var i = nodes.length - 1; i >= 0; i--) { $._tree.hideNode(nodes[i]); } }, // 显示所有父节点 showParent: function(treeNode) { var parentNode; while ((parentNode = treeNode.getParentNode()) != null) { $._tree.showNode(parentNode); $._tree.expandNode(parentNode, true, false, false); treeNode = parentNode; } }, // 显示所有孩子节点 showChildren: function(treeNode) { if (treeNode.isParent) { for (var idx in treeNode.children) { var node = treeNode.children[idx]; $._tree.showNode(node); $.tree.showChildren(node); } } }, // 更新节点状态 updateNodes: function(nodeList) { $._tree.showNodes(nodeList); for (var i = 0, l = nodeList.length; i < l; i++) { var treeNode = nodeList[i]; $.tree.showChildren(treeNode); $.tree.showParent(treeNode) } }, // 获取当前被勾选集合 getCheckedNodes: function(column) { var _column = $.common.isEmpty(column) ? "id" : column; var nodes = $._tree.getCheckedNodes(true); return $.map(nodes, function (row) { return row[_column]; }).join(); }, // 不允许根父节点选择 notAllowParents: function(_tree) { var nodes = _tree.getSelectedNodes(); if(nodes.length == 0){ $.modal.msgError("请选择节点后提交"); return false; } for (var i = 0; i < nodes.length; i++) { if (nodes[i].level == 0) { $.modal.msgError("不能选择根节点(" + nodes[i].name + ")"); return false; } if (nodes[i].isParent) { $.modal.msgError("不能选择父节点(" + nodes[i].name + ")"); return false; } } return true; }, // 不允许最后层级节点选择 notAllowLastLevel: function(_tree) { var nodes = _tree.getSelectedNodes(); for (var i = 0; i < nodes.length; i++) { if (!nodes[i].isParent) { $.modal.msgError("不能选择最后层级节点(" + nodes[i].name + ")"); return false; } } return true; }, // 隐藏/显示搜索栏 toggleSearch: function() { $('#search').slideToggle(200); $('#btnShow').toggle(); $('#btnHide').toggle(); $('#keyword').focus(); }, // 折叠 collapse: function() { $._tree.expandAll(false); }, // 展开 expand: function() { $._tree.expandAll(true); } }, // 通用方法封装处理 common: { // 判断字符串是否为空 isEmpty: function (value) { if (value == null || this.trim(value) == "") { return true; } return false; }, // 判断一个字符串是否为非空串 isNotEmpty: function (value) { return !$.common.isEmpty(value); }, // 空对象转字符串 nullToStr: function(value) { if ($.common.isEmpty(value)) { return "-"; } return value; }, // 是否显示数据 为空默认为显示 visible: function (value) { if ($.common.isEmpty(value) || value == true) { return true; } return false; }, // 空格截取 trim: function (value) { if (value == null) { return ""; } return value.toString().replace(/(^\s*)|(\s*$)|\r|\n/g, ""); }, // 比较两个字符串(大小写敏感) equals: function (str, that) { return str == that; }, // 比较两个字符串(大小写不敏感) equalsIgnoreCase: function (str, that) { return String(str).toUpperCase() === String(that).toUpperCase(); }, // 将字符串按指定字符分割 split: function (str, sep, maxLen) { if ($.common.isEmpty(str)) { return null; } var value = String(str).split(sep); return maxLen ? value.slice(0, maxLen - 1) : value; }, // 字符串格式化(%s ) sprintf: function (str) { var args = arguments, flag = true, i = 1; str = str.replace(/%s/g, function () { var arg = args[i++]; if (typeof arg === 'undefined') { flag = false; return ''; } return arg; }); return flag ? str : ''; }, // 指定随机数返回 random: function (min, max) { return Math.floor((Math.random() * max) + min); }, // 判断字符串是否是以start开头 startWith: function(value, start) { var reg = new RegExp("^" + start); return reg.test(value) }, // 判断字符串是否是以end结尾 endWith: function(value, end) { var reg = new RegExp(end + "$"); return reg.test(value) }, // 数组去重 uniqueFn: function(array) { var result = []; var hashObj = {}; for (var i = 0; i < array.length; i++) { if (!hashObj[array[i]]) { hashObj[array[i]] = true; result.push(array[i]); } } return result; }, // 数组中的所有元素放入一个字符串 join: function(array, separator) { if ($.common.isEmpty(array)) { return null; } return array.join(separator); }, // 获取form下所有的字段并转换为json对象 formToJSON: function(formId) { var json = {}; $.each($("#" + formId).serializeArray(), function(i, field) { if(json[field.name]) { json[field.name] += ("," + field.value); } else { json[field.name] = field.value; } }); return json; }, // 获取obj对象长度 getLength: function(obj) { var count = 0;   for (var i in obj) { if (obj.hasOwnProperty(i)) { count++; }   } return count; }, // 判断移动端 isMobile: function () { return navigator.userAgent.match(/(Android|iPhone|SymbianOS|Windows Phone|iPad|iPod)/i); }, } }); })(jQuery); /** 表格类型 */ table_type = { bootstrapTable: 0, bootstrapTreeTable: 1 }; /** 消息状态码 */ web_status = { SUCCESS: 0, FAIL: 500, WARNING: 301 }; /** 弹窗状态码 */ modal_status = { SUCCESS: "success", FAIL: "error", WARNING: "warning" };
62,600
ry-ui
js
zh
javascript
code
{"qsc_code_num_words": 5450, "qsc_code_num_chars": 62600.0, "qsc_code_mean_word_length": 4.97302752, "qsc_code_frac_words_unique": 0.16458716, "qsc_code_frac_chars_top_2grams": 0.04560381, "qsc_code_frac_chars_top_3grams": 0.0118806, "qsc_code_frac_chars_top_4grams": 0.009962, "qsc_code_frac_chars_dupe_5grams": 0.42117109, "qsc_code_frac_chars_dupe_6grams": 0.37405453, "qsc_code_frac_chars_dupe_7grams": 0.32579419, "qsc_code_frac_chars_dupe_8grams": 0.2701546, "qsc_code_frac_chars_dupe_9grams": 0.24845958, "qsc_code_frac_chars_dupe_10grams": 0.22495665, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00482574, "qsc_code_frac_chars_whitespace": 0.43394569, "qsc_code_size_file_byte": 62600.0, "qsc_code_num_lines": 1536.0, "qsc_code_num_chars_line_max": 168.0, "qsc_code_num_chars_line_mean": 40.75520833, "qsc_code_frac_chars_alphabet": 0.75970086, "qsc_code_frac_chars_comments": 0.05025559, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.33016801, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.04455807, "qsc_code_frac_chars_string_length": 0.04647212, "qsc_code_frac_chars_long_word_length": 0.00740056, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 1.0, "qsc_codejavascript_cate_var_zero": 0.0, "qsc_codejavascript_frac_lines_func_ratio": 0.0, "qsc_codejavascript_num_statement_line": 0.0036523, "qsc_codejavascript_score_lines_no_logic": 0.04747991, "qsc_codejavascript_frac_words_legal_var_name": 0.88356164, "qsc_codejavascript_frac_words_legal_func_name": null, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 0, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}