mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05:10 +01:00
Removed jQuery code, replaced with pure JavaScript
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
color: {{ theme.TEXTHEX }};
|
color: {{ theme.TEXTHEX }};
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<link href="{{ url_for('static', filename='css/digimarks.css') }}?20170728" type="text/css" rel="stylesheet" media="screen,projection"/>
|
<link href="{{ url_for('static', filename='css/digimarks.css') }}?20171225" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||||
</head>
|
</head>
|
||||||
<body class="{{ theme.BODY }} {{ theme.TEXT }}">
|
<body class="{{ theme.BODY }} {{ theme.TEXT }}">
|
||||||
<nav class="{{ theme.NAV }}" role="navigation">
|
<nav class="{{ theme.NAV }}" role="navigation">
|
||||||
|
|||||||
@@ -38,9 +38,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if formaction and formaction == 'edit' %}
|
{% if formaction and formaction == 'edit' %}
|
||||||
<form class="digimark" action="{{ url_for('editingbookmark', userkey=userkey, urlhash=bookmark.url_hash) }}" method="POST">
|
<form class="digimark" id="digimark" action="{{ url_for('editingbookmark', userkey=userkey, urlhash=bookmark.url_hash) }}" method="POST" onsubmit="return onSubmitForm();">
|
||||||
{% else %}
|
{% else %}
|
||||||
<form class="digimark" action="{{ url_for('addingbookmark', userkey=userkey) }}" method="POST">
|
<form class="digimark" id="digimark" action="{{ url_for('addingbookmark', userkey=userkey) }}" method="POST" onsubmit="return onSubmitForm();">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
<i class="material-icons prefix">description</i>
|
<i class="material-icons prefix">description</i>
|
||||||
<input placeholder="title (leave empty for autofetch)" type="text" name="title" id="title" value="{{ bookmark.title }}" class="validate" />
|
<input placeholder="title (leave empty for autofetch)" type="text" name="title" id="title" value="{{ bookmark.title }}" class="validate" />
|
||||||
<label for="title">Title</label>
|
<label for="title">Title</label>
|
||||||
|
{# <span class="helper-text">Leave title empty for autofetching from the page</span>#}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
@@ -89,7 +90,7 @@
|
|||||||
<div class="collapsible-header"><i class="material-icons">label</i>Existing tags</div>
|
<div class="collapsible-header"><i class="material-icons">label</i>Existing tags</div>
|
||||||
<div class="collapsible-body" style="padding: 10px;">
|
<div class="collapsible-body" style="padding: 10px;">
|
||||||
{% for tag in tags %}
|
{% for tag in tags %}
|
||||||
<div class="chip clickable" id="tag_{{ tag }}">
|
<div class="chip clickable" id="chip_{{ tag }}" onclick="addTag('{{ tag }}');">
|
||||||
{{ tag }}
|
{{ tag }}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -97,16 +98,6 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% for tag in tags %}
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function () {
|
|
||||||
$('#tag_{{ tag }}').on('click', function () {
|
|
||||||
var text = $('#tags');
|
|
||||||
text.val(text.val() + ', {{ tag }}');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -170,8 +161,17 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
function onSubmitForm()
|
||||||
$('form.digimark').on('submit',function(){$("#submit").prop("disabled", true); return true;})
|
{
|
||||||
});
|
var theForm = document.getElementById('digimark');
|
||||||
|
var submitButton = document.getElementById('submit');
|
||||||
|
theForm.onsubmit = submitButton.setAttribute("disabled", true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function addTag(tagText)
|
||||||
|
{
|
||||||
|
var text = document.getElementById('tags');
|
||||||
|
text.value = text.value + ', ' + tagText;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user