diff --git a/assets/ActionCollection/ActionCollection.js b/assets/ActionCollection/ActionCollection.js
index 45fdbd0..bd79b56 100644
--- a/assets/ActionCollection/ActionCollection.js
+++ b/assets/ActionCollection/ActionCollection.js
@@ -6,7 +6,7 @@ kit.PluginManager.register('ActionCollection', function(module, exports, require
/**
* @class ActionCollection
- * @extends {kit.Collection}
+ * @extends {Collection}
* @memberOf kit
*/
var ActionCollection = function (list = []) {
diff --git a/assets/align/align.js b/assets/align/align.js
index 12d3c38..6da0465 100644
--- a/assets/align/align.js
+++ b/assets/align/align.js
@@ -294,16 +294,16 @@ kit.PluginManager.register('align',function(module, exports, require) {
return - this.nodeMetricsLine.offset / 2 + this.offset[this.map.axisNumber()];
}.bind(this),
applicability: function () {
- return this.limiterMetricsLine.end - (this.parentMetricsLine.start + this.nodeMetricsLine.length + this.shift);
+ return this.limiterMetricsLine.end - this.limiterMetricsLine.clientEnd - (this.parentMetricsLine.start + this.nodeMetricsLine.length + this.shift);
}.bind(this),
valid: function () {
- return this.limiterMetricsLine.end >= (this.parentMetricsLine.start + this.nodeMetricsLine.length + this.shift);
+ return this.limiterMetricsLine.end - this.limiterMetricsLine.clientEnd >= (this.parentMetricsLine.start + this.nodeMetricsLine.length + this.shift);
}.bind(this),
shiftExtra: function () {
var shift = getShiftWhenHidingNodeUnderLimiterStart(this.shift);
var applicability = 0;
if(!this.valid) {
- applicability = this.limiterMetricsLine.end - (this.parentMetricsLine.start + this.nodeMetricsLine.length + shift);
+ applicability = this.limiterMetricsLine.end - this.limiterMetricsLine.clientEnd - (this.parentMetricsLine.start + this.nodeMetricsLine.length + shift);
shift = getShiftWhenHidingNodeUnderLimiterStart(shift + applicability);
}
return shift;
@@ -481,7 +481,7 @@ kit.PluginManager.register('align',function(module, exports, require) {
/**
* @param node {HTMLElement|String}
* @param parentNode {HTMLElement|String}
- * @param limiterNode {HTMLElement|String}
+ * @param limiterNode {HTMLElement|String|Window}
* @param options {AlignDefault}
* @constructor
*/
diff --git a/assets/bsToastService/bsToastService.js b/assets/bsToastService/bsToastService.js
index ddf2629..5fde465 100644
--- a/assets/bsToastService/bsToastService.js
+++ b/assets/bsToastService/bsToastService.js
@@ -64,9 +64,8 @@ kit.PluginManager.register('bsToastService', function(module, exports, require,
this.onShow.eachCall(this, toast, toastNode);
};
-
/**
- * @memberOf kit.service
+ * @namespace kit.service
* @class toast
**/
var toast = new Service();
diff --git a/assets/collection/collection.js b/assets/collection/collection.js
index 33b384b..8e2e469 100644
--- a/assets/collection/collection.js
+++ b/assets/collection/collection.js
@@ -13,7 +13,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
}
/**
* @param type
- * @return {kit.Collection}
+ * @return {Collection}
*/
function getSimilarInstance(type) {
if(type === 'object') {
@@ -25,7 +25,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
/**
* @class Collection
* @property length
- * @memberOf kit
+ * @memberOf {kit}
*/
var Collection = function (data = []) {
var self = this;
@@ -114,7 +114,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
/**
* @param key
* @param value
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.add = Collection.prototype.set = Collection.prototype.put = function (key, value) {
var index = -1;
@@ -128,7 +128,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
};
/**
* @param value
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.push = function (value) {
this.set(this.__getLastIndex() + 1, value);
@@ -151,7 +151,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
* возвращает новый экземпляр коллекции; не изменяет вызываемую коллекцию
*
* @param callback
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.map = function (callback) {
var res = getSimilarInstance(this.__type);
@@ -165,7 +165,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
};
/**
* @param callback
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.each = function (callback = true) {
var i;
@@ -179,7 +179,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
};
/**
* @param callback
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.eachReverse = function (callback = true) {
var i;
@@ -193,7 +193,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
};
/**
* @param callback
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.filter = function (callback = filter) {
var res = getSimilarInstance(this.__type);
@@ -208,7 +208,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
/**
* Метод возвращает все элементы коллекции, кроме тех у кого ключи соответствуют заданным
* @param keys
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.except = function (keys) {
var __keys = [], iKey;
@@ -227,7 +227,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
/**
* Метод возвращает элементы коллекции с заданными ключами
* @param keys
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.only = function (keys) {
var __keys = [], iKey;
@@ -294,7 +294,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
/**
* Method removes/delete an item from the collection by its key
* @param key
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.forget = function (key) {
key = valueEx(key);
@@ -311,7 +311,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
* Method removes and returns an item from the collection by its key
* @param key
* @param defValue
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.pull = function (key, defValue = undefined) {
key = valueEx(key);
@@ -356,20 +356,20 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
return value;
};
/**
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.keys = function () {
return new Collection(Object.keys(this.data));
};
/**
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.dump = function () {
console.log('Collection', this.data);
return this;
};
/**
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.dd = function () {
this.dump();
@@ -377,7 +377,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
return this;
};
/**
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.eachCall = function (context, args1, args2) {
var args = [], i;
@@ -446,7 +446,7 @@ kit.PluginManager.register('Collection', function(module, exports, require, glob
* Значения в коллекци должны быть массиво подобные
*
* @param key
- * @return {kit.Collection}
+ * @return {Collection}
*/
Collection.prototype.pluck = function (key) {
return this.map(function (value) {
diff --git a/assets/config/config.js b/assets/config/config.js
index 3e6cc2a..b4dab7a 100644
--- a/assets/config/config.js
+++ b/assets/config/config.js
@@ -1,10 +1,15 @@
/**
- * @type {kitCore}
+ * @namespace kit
+ * @module kit
*/
-window.kit = window.kit || {};
+var kit;
+kit = window.kit = window.kit || {};
/**
- * @var kit.config
- * @type {kitConfig}
+ * @typedef kit.service
+ */
+kit.service = kit.service || {};
+/**
+ * @typedef kit.config
*/
kit.config = kit.config || {};
diff --git a/assets/core/core.js b/assets/core/core.js
index 887c57e..207ef93 100644
--- a/assets/core/core.js
+++ b/assets/core/core.js
@@ -1,9 +1,8 @@
-/**
- * @class kitCore
- * @extends kitCorePlugins
- */
-window.kit = window.kit || {};
-window.kit.service = window.kit.service || {};
+
+var kit;
+kit = window.kit = window.kit || {};
+kit.service = kit.service || {};
+kit.config = kit.config || {};
(function(global){
var stateList = {
undefined: 0,
diff --git a/assets/core/core.register.js b/assets/core/core.register.js
index 9ffd42a..124bb86 100644
--- a/assets/core/core.register.js
+++ b/assets/core/core.register.js
@@ -83,12 +83,28 @@ __PluginManager__.registerPlugins({
type: 'loader',
css: '/tooltip2.css',
onInstall: function(plugin){
- var elements = [].slice.call(document.querySelectorAll('[data-kit-tooltip2="autoload"]'));
- elements.map(function (element) {
- var tooltip = new __pmGlobal__.Tooltip2(element);
+ console.log('tt2 install');
+ document.addEventListener('mouseover', function(event) {
+ // console.log(event);
+ // console.log(event.target);
+ if(!(event.target && event.target.dataset.kitTooltip2 === 'autoload')) {
+ return;
+ }
+ // console.log(1);
+ if(kit.support.getNodeData(event.target, 'tooltip2')){
+ return;
+ }
+ // console.log(2);
+ var tooltip = new __pmGlobal__.Tooltip2(event.target);
tooltip.run();
- console.log(tooltip);
+ tooltip.show();
});
+ // var elements = [].slice.call(document.querySelectorAll('[data-kit-tooltip2="autoload"]'));
+ // elements.map(function (element) {
+ // var tooltip = new __pmGlobal__.Tooltip2(element);
+ // tooltip.run();
+ // console.log(tooltip);
+ // });
},
deps: ['Viewer', 'support', 'ActionCollection', 'Action', 'userAction', 'align', 'Collection', 'animations'],
},
@@ -227,20 +243,14 @@ __PluginManager__.registerPlugins({
path: __pmConfig__.assetsPath + '/testing',
module: '/testing.js',
type: 'loader',
- deps: ['loggerService'],
+ deps: ['log'],
},
- Logger: {
- path: __pmConfig__.assetsPath + '/logger',
- module: '/logger.js',
+ log: {
+ path: __pmConfig__.assetsPath + '/log',
+ module: '/log.js',
+ css: '/log.css',
type: 'loader',
- deps: ['support', 'Collection']
- },
- loggerService: {
- path: __pmConfig__.assetsPath + '/loggerService',
- module: '/loggerService.js',
- css: '/loggerService.css',
- type: 'loader',
- deps: ['Logger', 'support', 'Collection'],
+ deps: ['support', 'Collection', 'lib']
},
fancybox: {
path: __pmConfig__.assetsPath + '/fancybox',
diff --git a/assets/core/doc.js b/assets/core/doc.js
index e9ca16d..e69de29 100644
--- a/assets/core/doc.js
+++ b/assets/core/doc.js
@@ -1,22 +0,0 @@
-/**
- * @typedef kitModuleTypeLoader
- * @param module {{exports: Object}}
- * @param exports {Object}
- * @param require {kitPluginManagerRequire}
- * @param global {kitCore}
- */
-
-/**
- * @typedef {Object} kitCorePlugins
- * @property {PluginManager} pm
- * @property {kitPluginManagerRequire} require
- * @property {kitToolkit} toolkit
- * @property {kitModal} Modal
- * @property {kitConfig} config
- * @property {kitPopover} Popover
- * @property {kitPopper} popper
- */
-
-/**
- * @namespace kit
- */
diff --git a/assets/dataStructures/dataStructures.js b/assets/dataStructures/dataStructures.js
index 6fcac56..b4e281e 100644
--- a/assets/dataStructures/dataStructures.js
+++ b/assets/dataStructures/dataStructures.js
@@ -1,9 +1,46 @@
/** @module dataStructures */
__PluginManager__.register('dataStructures', function(module, exports, require, global){
+
+
/**
+ *
+ * @param context
+ * @param callback
+ * @param interval
+ * @constructor
+ */
+ function Interval(context, callback, interval = 1000){
+ /** @private */
+ this.context = context || window;
+ /** @private */
+ this.callback = callback;
+ /** @private */
+ this.interval = interval;
+
+ }
+ Interval.prototype.start = function () {
+ /** @private */
+ this.intervalId = setInterval(function () {
+ this.callback.apply(this.context, arguments);
+ }.bind(this), this.interval)
+ };
+ Interval.prototype.stop = function () {
+ if(this.intervalId){
+ clearInterval(this.intervalId);
+ }
+ };
+
+
+
+
+ /**
+ * Stack – LIFO
+ * Queue – FIFO
+ * @type dataStructures
* @memberOf kit
*/
- var dataStructures = {
+ const dataStructures = {
+
StackExecutionLimiter: (function () {
var stack = function (context, callback, timeout = 1000) {
this.counter = 0;
@@ -59,7 +96,9 @@ __PluginManager__.register('dataStructures', function(module, exports, require,
this.counter = 0;
};
return stack;
- })()
+ })(),
+
+ Interval,
};
return module.exports = dataStructures;
diff --git a/assets/date/date.js b/assets/date/date.js
index 92f2cfa..1390d53 100644
--- a/assets/date/date.js
+++ b/assets/date/date.js
@@ -361,6 +361,21 @@ kit.PluginManager.register('date',function(module, exports, require, global) {
date.countTime = countTime;
+ date.DATA_ATOM = "Y-m-d\TH:i:sP";
+ date.DATA_COOKIE = "l, d-M-Y H:i:s T";
+ date.DATA_ISO8601 = "Y-m-d\TH:i:sO";
+ date.DATA_RFC822 = "D, d M y H:i:s O";
+ date.DATA_RFC850 = "l, d-M-y H:i:s T";
+ date.DATA_RFC1036 = "D, d M y H:i:s O";
+ date.DATA_RFC1123 = "D, d M Y H:i:s O";
+ date.DATA_RFC7231 = "D, d M Y H:i:s \G\M\T";
+ date.DATA_RFC2822 = "D, d M Y H:i:s O";
+ date.DATA_RFC3339 = "Y-m-d\TH:i:sP";
+ date.DATA_RFC3339_EXTENDED = "Y-m-d\TH:i:s.vP";
+ date.DATA_RSS = "D, d M Y H:i:s O";
+ date.DATA_W3C = "Y-m-d\TH:i:sP";
+ date.DATA_DB = "Y-m-d H:i:s";
+
return date;
}));
diff --git a/assets/flex-kit/flex-kit.css b/assets/flex-kit/flex-kit.css
index 9324521..3a1c0e2 100644
--- a/assets/flex-kit/flex-kit.css
+++ b/assets/flex-kit/flex-kit.css
@@ -10,7 +10,6 @@
--gap: 10px;
--gap-section: 30px;
--gap-wrapper: 30px;
- --col-count: 4;
--col-span: 1;
--line-clamp: 3;
--line-clamp-height: 1.3em;
@@ -92,6 +91,8 @@
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
+ --col-span: 1;
+ --col-count: 4;
}
.flex-list:not(.owl-loaded) {
margin-left: calc(var(--gap) / -2) !important;
@@ -110,12 +111,13 @@
.flex-list-item {
--gap-row: var(--gap);
--col-width: calc(100% / var(--col-count) * var(--col-span));
+ --line-height: calc(100% / var(--line-count) * var(--line-span, 1));
box-sizing: border-box;
}
.flex-list > .flex-list-item {
- width: var( --col-width) !important;
- max-width: var( --col-width) !important;
- flex-basis: var( --col-width) !important;
+ width: var(--col-width) !important;
+ max-width: var(--col-width) !important;
+ flex-basis: var(--col-width) !important;
margin-bottom: var(--gap-row) !important;
}
.flex-list-item:before,
@@ -149,8 +151,13 @@
-ms-flex-align: center;
align-items: center;
}
-
-
+.flex-list--static {
+ --line-count: 1;
+}
+.flex-list--static .flex-list-item {
+ height: var(--line-height) !important;
+ max-height: var(--line-height) !important;
+}
script, style {
display: none !important;
@@ -388,35 +395,12 @@ script, style {
-webkit-flex-basis: auto;
flex-basis: auto;
}
-.flex-col.flex-cell,
-.flex-col-wrap.flex-cell,
-.flex-line.flex-cell,
-.flex-line-wrap.flex-cell
-{
- padding: var(--flex-padding) !important;
-}
-
-.flex-direction-column {
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
- flex-direction: column;
-}
-.flex-direction-row {
- -webkit-box-orient: horizontal;
- -webkit-box-direction: normal;
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
- flex-direction: row;
-}
-
-
-
/* применяем к таблице: ПРОДОЛЬНОЕ выравнивание элементов в строке или колонке */
.flex-align-start {
-webkit-justify-content: flex-start !important;
@@ -451,6 +435,24 @@ script, style {
align-items: center;
}
+.flex-cells-v-align--start > *{
+ justify-content: start;
+}
+.flex-cells-v-align--end > *{
+ justify-content: end;
+}
+.flex-cells-v-align--stretch > *{
+ justify-content: stretch;
+}
+.flex-cells-g-align--start > *{
+ align-items: start;
+}
+.flex-cells-g-align--end > *{
+ align-items: end;
+}
+.flex-cells-g-align--stretch > *{
+ align-items: stretch;
+}
/* применяем к ячейкам: поперечное выравнивание */
.flex-cell-align--start {
@@ -909,7 +911,22 @@ script, style {
/* picture - icon */
-
+.kit-icon picture,
+.kit-icon img,
+.kit-icon svg,
+.kit-picture picture,
+.kit-picture img,
+.kit-picture svg {
+ width: 100%;
+ height: 100%;
+ max-width: 100%;
+ max-height: 100%;
+ display: block;
+ fill: currentColor;
+ transition: inherit;
+ object-fit: contain;
+ object-position: center;
+}
.kit-picture-line, .kit-icon-line {
display: inline-block;
margin-bottom: calc(-1em * var(--font-ratio-bottom, 0.2));
@@ -934,25 +951,6 @@ script, style {
}
-.kit-icon picture,
-.kit-icon img,
-.kit-icon svg,
-.kit-picture picture,
-.kit-picture img,
-.kit-picture svg {
- width: 100%;
- height: 100%;
- max-width: 100%;
- max-height: 100%;
- display: block;
- fill: currentColor;
- transition: inherit;
- object-fit: contain;
- object-position: center;
-}
-
-
-
/* flex-kit.css end */
\ No newline at end of file
diff --git a/assets/loggerService/loggerService.css b/assets/log/log.css
similarity index 90%
rename from assets/loggerService/loggerService.css
rename to assets/log/log.css
index 61a5c60..45b040f 100644
--- a/assets/loggerService/loggerService.css
+++ b/assets/log/log.css
@@ -1,8 +1,8 @@
:root {
- --logger-color-emergency: hsl(0, 100%, 55%);
- --logger-color-alert: hsl(0, 100%, 55%);
- --logger-color-critical: hsl(0, 100%, 55%);
- --logger-color-error: #f44336;
+ --logger-color-emergency: hsl(0, 100%, 25%);
+ --logger-color-alert: hsl(0, 100%, 45%);
+ --logger-color-critical: hsl(0, 100%, 40%);
+ --logger-color-error: hsl(0, 100%, 35%);
--logger-color-warning: hsl(31, 100%, 55%);
--logger-color-notice: #909090;
--logger-color-info: hsl(205, 100%, 61%);
@@ -14,7 +14,7 @@
margin: 0;
padding: 5px;
font-family: monospace;
- background: hsla(0, 0%, 11%, 1);
+ background: hsl(0, 0%, 15%);
color: #909090;
overflow-y: scroll !important;
word-break: break-all;
@@ -69,14 +69,21 @@ logger-item {
word-break: break-all;
font-size: 1em !important;
line-height: calc(1.1em) !important;
+ color: var(--logger-color-value, #c1c1c1);
+ background-color: var(--logger-color-content-value, transparent);
+}
+logger-item__options {
+ color: #606060;
}
logger-item__value * {
color: inherit;
}
logger-item__value .logger-toggler {
cursor: pointer;
- color: #2698db !important;
+ color: hsl(0, 0%, 75%) !important;
opacity: 0.6;
+ font-size: 0.8em !important;
+ padding-left: 0.5em;
}
logger-item__msg {
@@ -84,7 +91,6 @@ logger-item__msg {
logger-item__key {
min-width: 2em;
padding-right: 5px;
- background-color: var(--logger-color-content-key, transparent);
}
logger-item__key, logger-item__key > * {
color: var(--logger-color-key, #909090);
@@ -94,8 +100,6 @@ logger-item__key:empty {
}
logger-item__value {
flex: 1 0 0;
- color: var(--logger-color-value, #c1c1c1);
- background-color: var(--logger-color-content-value, transparent);
}
logger-item__value * {
font-size: inherit !important;
diff --git a/assets/log/log.js b/assets/log/log.js
new file mode 100644
index 0000000..6417ea4
--- /dev/null
+++ b/assets/log/log.js
@@ -0,0 +1,296 @@
+/** @module log */
+__PluginManager__.register('log', function(module, exports, require, /** @param {kit}*/global){
+
+ var support = require('support');
+ var Collection = require('Collection');
+ var lib = require('lib');
+
+ var LogLevel = {
+ EMERGENCY: 'emergency',
+ ALERT: 'alert',
+ CRITICAL: 'critical',
+ ERROR: 'error',
+ WARNING: 'warning',
+ NOTICE: 'notice',
+ INFO: 'info',
+ DEBUG: 'debug',
+ SUCCESS: 'success',
+ };
+
+ /**
+ * @class Logger
+ */
+ class Logger
+ {
+ constructor() {
+ this.collection = new Collection();
+ this.onLog = new Collection();
+ }
+ }
+
+
+ /**
+ * @param collection {kit.Collection}
+ */
+ Logger.prototype.setCollection = function (collection) {
+ this.collection = collection;
+ };
+
+ Logger.prototype.emergency = function (message, context) {
+ this.log(LogLevel.EMERGENCY, message, context);
+ };
+ Logger.prototype.alert = function (message, context) {
+ this.log(LogLevel.ALERT, message, context);
+ };
+ Logger.prototype.critical = function (message, context) {
+ this.log(LogLevel.CRITICAL, message, context);
+ };
+ Logger.prototype.error = function (message, context) {
+ this.log(LogLevel.ERROR, message, context);
+ };
+ Logger.prototype.warning = function (message, context) {
+ this.log(LogLevel.WARNING, message, context);
+ };
+ Logger.prototype.notice = function (message, context) {
+ this.log(LogLevel.NOTICE, message, context);
+ };
+ Logger.prototype.info = function (message, context) {
+ this.log(LogLevel.INFO, message, context);
+ };
+ Logger.prototype.debug = function (message, context) {
+ this.log(LogLevel.DEBUG, message, context);
+ };
+ Logger.prototype.success = function (message, context) {
+ this.log(LogLevel.SUCCESS, message, context);
+ };
+ Logger.prototype.log = function (level, message, context = []) {
+ var data = {
+ level: level,
+ message: message,
+ context: context,
+ };
+ this.__logData(data);
+ };
+ Logger.prototype.__logData = function (data) {
+ this.collection.push(data);
+ this.onLog.eachCall(this, data);
+ };
+
+ const HINT_DATA_KEY_LIST = ['id', 'createdAt', 'userId', 'ip'];
+ function getTooltipContent(data) {
+ var contentList = [];
+ HINT_DATA_KEY_LIST.map(function (item) {
+ if(data[item]){contentList.push(item+': ' + data[item]);}
+ });
+ return contentList.join('
');
+ }
+ function getOptionsTemplate(data) {
+ var optionsTemplate = '';
+ var content = getTooltipContent(data);
+ if(content) {
+ optionsTemplate = '