Skip to content

Commit

Permalink
Added functions StringUtils.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentmuller committed Nov 7, 2024
1 parent f7ff0f4 commit 4cdf618
Show file tree
Hide file tree
Showing 34 changed files with 288 additions and 368 deletions.
34 changes: 17 additions & 17 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<directory name="src" />
</errorLevel>
</PossiblyUnusedMethod>
<ReferenceConstraintViolation>
<errorLevel type="suppress">
<file name="src/Utils/StringUtils.php" />
</errorLevel>
</ReferenceConstraintViolation>
</issueHandlers>

<plugins>
Expand Down
2 changes: 1 addition & 1 deletion public/css/simple_editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@
padding-right: calc(1.5em + 0.75rem);
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
background-repeat: no-repeat;
background-position: right calc(0.375em + 0.1875rem) center;
background-position: top calc(0.375em) right calc(0.375em + 0.1875rem);
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}
2 changes: 1 addition & 1 deletion public/js/plugins/plugin-cell-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ $(function () {
'tooltipEditClass': 'tooltip-secondary',
// the error tooltip class
'tooltipErrorClass': 'tooltip-danger',
// start edit on create
// start edit automatically
'autoEdit': false,
// destroy on end edit or on cancel
'autoDispose': false,
Expand Down
2 changes: 1 addition & 1 deletion public/js/plugins/plugin-cell-highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ $(function () {
let cell = tableIndex[y][x];
// Table matrix is iterated left to right, top to bottom.
// It might be that cell has been assigned a value already
// because previous row-cell had a 'rowspan' property,
// because the previous row-cell had a 'rowspan' property,
// possibly together with 'colspan'.
if (!cell) {
cell = columns.eq(cellIndex++);
Expand Down
2 changes: 1 addition & 1 deletion public/js/plugins/plugin-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
},

/**
* Check if console is present
* Check if the console is present
*/
isConsole(method) {
return window.console && window.console[method];
Expand Down
2 changes: 1 addition & 1 deletion public/js/plugins/plugin-input-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ $(function () {
$img[0].src = event.target.result;
file.result = event.target.result;
$element.find('.file-input-filename').text(file.name);
// if parent has max-height, using `(max-)height: 100%` on
// if the parent has max-height, using `(max-)height: 100%` on
// the child doesn't take padding and border into account
if ($preview.css('max-height') !== 'none') {
const mh = parseInt($preview.css('max-height'), 10) || 0;
Expand Down
18 changes: 0 additions & 18 deletions public/js/plugins/plugin-rowlink.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
/* ============================================================
* Bootstrap: rowlink.js v3.1.3
* http://jasny.github.io/bootstrap/javascript/#rowlink
* ============================================================
* Copyright 2012-2014 Arnold Daniels
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
/**! compression tag for ftp-deployment */

/**
Expand Down
12 changes: 6 additions & 6 deletions public/js/plugins/plugin-table-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ $(function () {
* @private
*/
_isFunction(value) {
return typeof value === 'function' && value !== $.noop;
return typeof value === 'function';
}
};

Expand All @@ -211,11 +211,11 @@ $(function () {
'inputType': 'text',
'inputClass': 'form-control cell-editor',
'inputCss': {},
'onCreateInput': $.noop,
'onRemoveInput': $.noop,
'onKeyDown': $.noop,
'onInput': $.noop,
'onSave': $.noop,
'onCreateInput': null,
'onRemoveInput': null,
'onKeyDown': null,
'onInput': null,
'onSave': null,
};

/**
Expand Down
41 changes: 24 additions & 17 deletions public/js/plugins/plugin-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ $(function () {
if (data) {
const $dialog = $(data);
$dialog.appendTo($(options.targetId));
that._initDialog();
that._initDialog($dialog);
that._showDialog();
}
});
Expand Down Expand Up @@ -182,7 +182,7 @@ $(function () {
}
const theme = this._getCookieValue();
const selector = this._getInputSelector();
$dialog.data('old-theme', theme).data('new-theme', false);
$dialog.data('old-theme', theme).data('new-theme', theme);
$(selector).each(function () {
const $this = $(this);
$this.prop('checked', $this.val() === theme);
Expand Down Expand Up @@ -214,10 +214,19 @@ $(function () {
}

/**
* Handle the dialog hidden event.
* Handle the theme radio input change event.
* @param {ChangeEvent} e
* @private
*/
_onDialogHidden() {
_onInputChange(e) {
this._setTheme($(e.currentTarget).val());
}

/**
* Handle the dialog hide event.
* @private
*/
_onDialogHide() {
const $dialog = this._getDialog();
if (!$dialog) {
return;
Expand All @@ -226,10 +235,10 @@ $(function () {
this._setFocus();
const oldTheme = $dialog.data('old-theme');
const newTheme = $dialog.data('new-theme') || this._getTheme();
this._setTheme(newTheme);
if (oldTheme === newTheme) {
return;
}
this._setTheme(newTheme);
this._setCookieValue(newTheme);
const $link = $(this._getInputCheckedSelector());
if ($link.length) {
Expand Down Expand Up @@ -281,20 +290,17 @@ $(function () {

/**
* Initialize the dialog.
* @param {jQuery} $dialog the dialog to initialize.
* @private
*/
_initDialog() {
const $dialog = this._getDialog();
if (!$dialog) {
return;
}
_initDialog($dialog) {
const options = this.options;
$(`${options.dialogId} ${options.ok}`)
.on('click', () => this._onDialogAccept());
$dialog.on('show.bs.modal', () => this._onDialogShow())
.on('shown.bs.modal', () => this._onDialogVisible())
.on('hidden.bs.modal', () => this._onDialogHidden())
.on('keydown', (e) => this._onDialogKeyDown(e));
.on('hide.bs.modal', () => this._onDialogHide())
.on('keydown', (e) => this._onDialogKeyDown(e))
.on('click', options.ok, () => this._onDialogAccept())
.on('change', options.input, (e) => this._onInputChange(e));
}

/**
Expand Down Expand Up @@ -325,13 +331,14 @@ $(function () {
* @private
*/
_setTheme(theme) {
if (theme === THEME_AUTO) {
if (!theme || theme === THEME_AUTO) {
theme = this._isMediaDark() ? THEME_DARK : THEME_LIGHT;
}
document.documentElement.setAttribute(THEME_ATTRIBUTE, theme);
if (this._getTheme() !== theme) {
document.documentElement.setAttribute(THEME_ATTRIBUTE, theme);
}
}


/**
* Gets the document element theme.
* @return {string} the selected theme.
Expand Down
2 changes: 1 addition & 1 deletion public/js/plugins/plugin-treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ $(function () {
}

/**
* Remove handlers proxies.
* Remove handler proxies.
* @private
*/
_removeProxies() {
Expand Down
2 changes: 1 addition & 1 deletion public/js/plugins/plugin-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ $(function () {
}

/**
* Cancel last timer if set.
* Cancel the last timer, if set.
* @return {Typeahead} this instance for chaining.
* @private
*/
Expand Down
Loading

0 comments on commit 4cdf618

Please sign in to comment.