-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathpost_article.html
108 lines (108 loc) · 2.97 KB
/
post_article.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Thunderbolt - Post Article</title>
<link rel="shortcut icon" href="./assets/images/dsc_logo.ico" />
<link rel="stylesheet" href="./assets/css/form_page.min.css" />
</head>
<body class="flx">
<div class="loading hide">
<div class="loader">Loading...</div>
</div>
<div class="left flx col al-cnt" id="formContainer">
<form action="#" method="POST" id="postArticleForm">
<fieldset>
<div class="flx col al-cnt">
<legend>Post Article</legend>
<div class="edit_image hide">
<img src="" alt="Image to be Edited" />
<button class="btn">Edit Image</button>
</div>
<input
type="text"
class="form_field"
placeholder="Title"
name="title"
required
/>
<select name="categoryId" class="form_field" required>
<option value="">Select Category</option>
</select>
<input
type="file"
class="form_field"
placeholder="Article Image"
name="image"
required
/>
<textarea
class="form_field"
id="content"
placeholder="Article Content"
></textarea>
<input type="hidden" name="content" value="" />
</div>
</fieldset>
<button class="btn1">Submit</button>
</form>
<ul class="sm-icons">
<li class="sm-icon">
<a href="" class="twitter-icon">
<img
src="./assets/images/twitter-logo-black.svg"
alt="Twitter Logo"
/>
</a>
</li>
<li class="sm-icon">
<a href="" class="github-icon">
<img
src="./assets/images/github-logo-black.svg"
alt="Github Logo"
/>
</a>
</li>
</ul>
<p>
Back to Blog? <a href="./index.html" class="link">Click Here</a>
</p>
</div>
<div class="right flx col al-cnt">
<div class="black-bg flx col">
<div class="info flx col al-c-st">
<img src="./assets/images/dsc_logo.svg" />
<h1>
Post An Article
</h1>
<div class="border"></div>
<p>
Sub mit an article for review <br />
An Admin will review and publish your article after it passes the
review
</p>
</div>
</div>
</div>
<script src="https://cdn.ckeditor.com/ckeditor5/12.4.0/classic/ckeditor.js"></script>
<script src="./assets/js/dist/bundle.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
ClassicEditor.create(document.querySelector("#content"))
.then(editor => {
const content = document.querySelector("input[name=content]");
document.addEventListener('updateDOM', () => {
editor.setData(content.value);
})
editor.model.document.on("change:data", () => {
content.value = editor.getData();
});
})
.catch(error => {
console.error(error);
});
});
</script>
</body>
</html>