mirror of
https://gitlab.com/octtspacc/sitoctt
synced 2025-04-13 17:52:08 +02:00
Agg. pagina Percent-Encoding
This commit is contained in:
parent
da82f8441f
commit
e249817c94
@ -5,8 +5,12 @@ cd "${swd}/.."
|
|||||||
mkdir -p ./static/res/lib
|
mkdir -p ./static/res/lib
|
||||||
cd ./static/res/lib
|
cd ./static/res/lib
|
||||||
|
|
||||||
wget --continue "https://spaccinc.gitlab.io/SpaccDotWeb/SpaccDotWeb.Alt.min.js"
|
downloadfile(){
|
||||||
wget --continue "https://uicdn.toast.com/editor/latest/toastui-editor-all.min.js"
|
wget -O "./$2" "https://$1/$2"
|
||||||
wget --continue "https://uicdn.toast.com/editor/latest/toastui-editor.min.css"
|
}
|
||||||
|
|
||||||
|
downloadfile spaccinc.gitlab.io/SpaccDotWeb SpaccDotWeb.Alt.min.js
|
||||||
|
downloadfile uicdn.toast.com/editor/latest toastui-editor-all.min.js
|
||||||
|
downloadfile uicdn.toast.com/editor/latest toastui-editor.min.css
|
||||||
|
|
||||||
cd "${owd}"
|
cd "${owd}"
|
||||||
|
14
content/it/miscellanea/Percent-Encoding.md
Normal file
14
content/it/miscellanea/Percent-Encoding.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
+++
|
||||||
|
Title = "Codifica URL"
|
||||||
|
+++
|
||||||
|
<div class="Percent-Encoding">
|
||||||
|
<label>Plain</label>
|
||||||
|
<textarea name="plain"></textarea>
|
||||||
|
<label>URL-encoded</label>
|
||||||
|
<textarea name="coded"></textarea>
|
||||||
|
<p>
|
||||||
|
<label>Passaggi: <input name="steps" type="number" value="1" min="1" /></label>
|
||||||
|
</p>
|
||||||
|
<link rel="stylesheet" href="/res/Percent-Encoding.css" />
|
||||||
|
<script src="/res/Percent-Encoding.js"></script>
|
||||||
|
</div>
|
6
static/res/Percent-Encoding.css
Normal file
6
static/res/Percent-Encoding.css
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.Percent-Encoding > div {
|
||||||
|
/* display: grid;
|
||||||
|
grid-template-columns: auto auto; */
|
||||||
|
}
|
||||||
|
.Percent-Encoding textarea { width: 100%; min-height: 10em; }
|
||||||
|
|
19
static/res/Percent-Encoding.js
Normal file
19
static/res/Percent-Encoding.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
(function(stepsEl){
|
||||||
|
|
||||||
|
function convertText (sourceEl, destinationEl, handler) {
|
||||||
|
var text = sourceEl.value;
|
||||||
|
for (var i=0; i<stepsEl.value; i++) {
|
||||||
|
text = handler(text);
|
||||||
|
}
|
||||||
|
destinationEl.value = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeConvertHandler(sourceEl, destinationEl, handler) {
|
||||||
|
return (function(){
|
||||||
|
convertText(sourceEl, destinationEl, handler);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
sitoctt.utils.setTextConvertEvents(document.querySelector('textarea[name="plain"]'), document.querySelector('textarea[name="coded"]'), encodeURIComponent, decodeURIComponent, makeConvertHandler);
|
||||||
|
|
||||||
|
})(document.querySelector('input[name="steps"]'));
|
@ -41,7 +41,8 @@ input.onkeyup = function (event) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function documentOnKeyDown (event) {
|
function documentOnKeyDown (event) {
|
||||||
if (event.key == "/") {
|
|
||||||
|
if (event.key == '/' && event.ctrlKey) {
|
||||||
if (!searchVisible) {
|
if (!searchVisible) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
displaySearch();
|
displaySearch();
|
||||||
@ -50,7 +51,7 @@ function documentOnKeyDown (event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.key == "Escape") {
|
if (event.key == 'Escape') {
|
||||||
hideSearch();
|
hideSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
static/res/sitoctt-utils.js
Normal file
14
static/res/sitoctt-utils.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
(function(self){
|
||||||
|
|
||||||
|
self.setTextFieldEvents = (function (el, handler) {
|
||||||
|
['click', 'change', 'input', 'paste'].forEach(function(event){
|
||||||
|
el.addEventListener(event, handler);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
self.setTextConvertEvents = (function (el0, el1, convertHandler, unconvertHandler, constructor) {
|
||||||
|
self.setTextFieldEvents(el0, constructor(el0, el1, convertHandler));
|
||||||
|
self.setTextFieldEvents(el1, constructor(el1, el0, unconvertHandler));
|
||||||
|
});
|
||||||
|
|
||||||
|
})(sitoctt.utils);
|
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
window.sitoctt = {};
|
window.sitoctt = { utils: {} };
|
||||||
window.Void = (function Void(){});
|
window.Void = (function Void(){});
|
||||||
{{- with resources.Get "SiteProps.toml" -}}
|
{{- with resources.Get "SiteProps.toml" -}}
|
||||||
{{- with . | transform.Unmarshal -}}
|
{{- with . | transform.Unmarshal -}}
|
||||||
@ -8,6 +8,7 @@ window.Void = (function Void(){});
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
window.sitoctt.localStorage = (function localStorage(key, value){ return SpaccDotWeb.LocalStorage('org.eu.octt.sitoctt', key, value); });
|
window.sitoctt.localStorage = (function localStorage(key, value){ return SpaccDotWeb.LocalStorage('org.eu.octt.sitoctt', key, value); });
|
||||||
</script>
|
</script>
|
||||||
|
<script src="/res/sitoctt-utils.js"></script>
|
||||||
<script src="/res/ajax-navigation.js"></script>
|
<script src="/res/ajax-navigation.js"></script>
|
||||||
<script src="/res/local-file-tweaks.js"></script>
|
<script src="/res/local-file-tweaks.js"></script>
|
||||||
<script src="/{{ .Lang }}/searchindex.js"></script>
|
<script src="/{{ .Lang }}/searchindex.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user