From 2305ced85888a23f86ecfcdfb64a3b69c4997a4c Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 21 Jul 2019 12:14:09 +0400 Subject: =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8=D1=81=D0=B0=D0=BD?= =?UTF-8?q?=20=D0=B1=D0=B5=D0=BA=D0=B5=D0=BD=D0=B4.=20=D0=94=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B4=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B8=20=D0=BE?= =?UTF-8?q?=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=B7?= =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B2=20=D1=80?= =?UTF-8?q?=D1=8F=D0=B4=D1=83.=20=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=B5=D0=B4=D1=8B=D0=B4=D1=83=D1=89=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8F=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B1=D0=B5?= =?UTF-8?q?=D0=B7=20vue.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day9/task5/static/js/editForm.js | 142 --------------------------------------- 1 file changed, 142 deletions(-) delete mode 100644 day9/task5/static/js/editForm.js (limited to 'day9/task5/static/js/editForm.js') diff --git a/day9/task5/static/js/editForm.js b/day9/task5/static/js/editForm.js deleted file mode 100644 index f371664..0000000 --- a/day9/task5/static/js/editForm.js +++ /dev/null @@ -1,142 +0,0 @@ -const baseFormFields = `
-
-
service_id
-
-
- -
-
servtype
-
- -
-
- -
-
subtype
-
- -
-
- -
-
user_id
-
- -
-
- -
-
referrer_user_id
-
- -
-
- -
-
state
-
- -
-
- -
-
creation_date
-
- -
-
-
-
creation_time
-
- -
-
- -
-
creation_request_sent_date
-
- - -
-
- -
-
notified_about_expiration
-
- -
-
-
`; - -const formCreateButtons = `
- - -
`; - -const formEditButtons = `
- - -
`; - -function showContentBox() { - let elem = document.getElementById('backgroundTint'); - elem.classList.remove('hidden'); - elem.classList.add('shown'); - - elem = document.getElementById('contentBox'); - elem.classList.remove('hidden'); - elem.classList.add('shown'); -} - -function hideContentBox() { - let elem = document.getElementById('backgroundTint'); - elem.classList.remove('shown'); - elem.classList.add('hidden'); - - elem = document.getElementById('contentBox'); - elem.classList.remove('shown'); - elem.classList.add('hidden'); -} - -function showForm() { - let newEntryBtn = document.getElementById('newEntryBtn'); - newEntryBtn.style.display = 'none'; - - showContentBox(); - let contentBox = document.getElementById('contentBox'); - while (contentBox.firstChild) - contentBox.removeChild(contentBox.firstChild); - - contentBox.appendChild(elementFromHTML(baseFormFields)); - return contentBox; -} - -function hideForm() { - let newEntryBtn = document.getElementById('newEntryBtn'); - newEntryBtn.style.display = 'inline'; - - let contentBox = document.getElementById('contentBox'); - while (contentBox.firstChild) - contentBox.removeChild(contentBox.firstChild); - - hideContentBox(); -} - -function showEditForm() { - let contentBox = showForm(); - contentBox.firstChild.appendChild(elementFromHTML(formEditButtons)); - contentBox.firstChild.action = '/api/update'; -} - -function showCreateForm() { - let contentBox = showForm(); - contentBox.firstChild.appendChild(elementFromHTML(formCreateButtons)); - contentBox.firstChild.action = '/api/add'; - document.getElementById('formServiceId').disabled = false; -} -- cgit v1.2.3