Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
cp2004 committed Mar 21, 2021
2 parents 801bfce + 843586a commit a1e1b21
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .versioneer-lookup
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ rc/.*
HEAD
\(detached.*

# here, maintenance is currently the branch for 2.0.1 - hash is of previous tag on this branch
maintenance 2.0.1 1b19e47fb2098bf3783cd2d41d3caf0c1a495fef pep440-dev
# here, bugfix is currently the branch for 3.0.2 - hash is of previous tag on this branch
bugfix 3.0.2 1b19e47fb2098bf3783cd2d41d3caf0c1a495fef pep440-dev

# devel is currently the branch for work towards 2.1.0
devel 3.0.0 1b19e47fb2098bf3783cd2d41d3caf0c1a495fef pep440-dev
# devel is currently the branch for work towards 3.1.0
devel 3.1.0 1b19e47fb2098bf3783cd2d41d3caf0c1a495fef pep440-dev

# Every other branch is also development, so is resolved to 2.1.0 as well for now
.* 3.0.0 1b19e47fb2098bf3783cd2d41d3caf0c1a495fef pep440-dev
# Every other branch is also development, so is resolved to 3.1.0 as well for now
.* 3.1.0 1b19e47fb2098bf3783cd2d41d3caf0c1a495fef pep440-dev
7 changes: 4 additions & 3 deletions octoprint_eeprom_marlin/static/js/eeprom_marlin.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,6 @@ $(function () {
self.backup_name = ko.observable();

self.new_backup = function () {
console.log(
self.settingsViewModel.settings.plugins.eeprom_marlin.custom_name()
);
if (
self.settingsViewModel.settings.plugins.eeprom_marlin.custom_name()
) {
Expand All @@ -912,6 +909,10 @@ $(function () {
}
};

$("#eepromBackupNameModal").on("shown", function () {
$("#eepromBackupNameInput").focus();
});

self.create_backup = function () {
$("#eepromBackupNameModal").modal("hide");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<p>Note that it will be sanitised before use, any illegal characters will be replaced.</p>
<form class="form-horizontal" onsubmit="return false;">
<div class="control-group">
<label class="control-label">{{ _('Backup Name') }}</label>
<label for="eepromBackupNameInput" class="control-label">{{ _('Backup Name') }}</label>
<div class="controls">
<input type="text" data-bind="value: backup_name" placeholder="eeprom_backup...">
<input id="eepromBackupNameInput" type="text" data-bind="value: backup_name" placeholder="eeprom_backup...">
</div>
</div>
</form>
Expand Down
17 changes: 12 additions & 5 deletions octoprint_eeprom_marlin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,23 @@ def backup_json_to_list(eeprom_data):


try:
# This is available in OP 1.6.0+
# TODO decide when to stop supporting 1.5.x and below
# OctoPrint>=1.6.0
from octoprint.util.text import sanitize
except ImportError:
# We are below this version, use backported one instead
# OctoPrint<=1.5.x
# Use back-ported version
import re

# noinspection PyPackageRequirements
from emoji import demojize
from octoprint.util import to_unicode
from octoprint.vendor.awesome_slugify import Slugify

try:
# OctoPrint>=1.4.1
from octoprint.vendor.awesome_slugify import Slugify
except ImportError:
# OctoPrint<=1.4.0
from slugify import Slugify # noqa

_UNICODE_VARIATIONS = re.compile("[\uFE00-\uFE0F]", re.U)
_SLUGIFIES = {}
Expand All @@ -69,7 +76,7 @@ def sanitize(text, safe_chars="-_.", demoji=True):
Args:
text: the text to sanitize
safe_chars: characters to consider safe and to keep after sanitization
emoji: whether to also convert emoji to text
demoji: whether to also convert emoji to text
Returns: the sanitized text
"""
slugify = _SLUGIFIES.get(safe_chars)
Expand Down

0 comments on commit a1e1b21

Please sign in to comment.