-
Notifications
You must be signed in to change notification settings - Fork 0
/
Translator.aspx
245 lines (225 loc) · 12.7 KB
/
Translator.aspx
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<%@ Page Title="Translator | RojakJelah" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Translator.aspx.cs" Inherits="RojakJelah.Translator" %>
<asp:Content ID="PageStylesheet" ContentPlaceHolderID="PageStylesheet" runat="server">
<link rel="stylesheet" type="text/css" href="<%= Page.ResolveUrl("~/Content/css/translator.css")%>" />
</asp:Content>
<asp:Content ID="PageJavaScript" ContentPlaceHolderID="PageJavaScript" runat="server">
<script src="Content/js/translator.js"></script>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<!-- Translate Section -->
<section class="translate-content">
<!-- Banner -->
<div class="banner-container">
<div class="banner-left">
<img src="Content/image/textual_col_whitebg.svg" alt="Logo">
</div>
<div class="banner-right">
<div class="title">
<h1>Be a <span>True</span> Malaysian</h1>
</div>
<div class="info">
<p>No need to pilih language anymore lah, become the CEO of Bahasa Rojak</p>
</div>
</div>
</div>
<!-- Source Message -->
<div class="translate">
<div class="translate-input">
<div class="title">
<h5>Source message</h5>
<button id="btnHelp" class="button-secondary" type="button">
<i class="fa-solid fa-question fa-xs"></i>
<span class="help-message">
Enter text here for translation.
<br /><br />
<b>Translatable</b> words/phrases may have different, <u>random</u> outputs.
<br /> <br />
<b>Translated</b> Rojak words/phrases are <u>underlined</u>, and their corresponding synonyms are displayed when hovered.
</span>
</button>
</div>
<div class="translate-container">
<!-- Translation Input Field -->
<grammarly-editor-plugin class="translate-textinput">
<textarea id="txtInput" runat="server" rows="3" maxlength="5000" placeholder="Enter message here" spellcheck="true"></textarea>
</grammarly-editor-plugin>
<!-- Translate Buttons -->
<div class="translate-button">
<asp:Button ID="btnTranslate" class="btnTranslate" runat="server" OnClick="BtnTranslate_Click" Text="Translate" />
<!-- Sub-feature Buttons -->
<div class="translate-user">
<!-- Saved Translations -->
<div class="button saved">
<asp:LinkButton ID="lnkViewSavedTranslations" CssClass="button-small" runat="server" ClientIDMode="Static" OnClick="LnkViewSavedTranslations_Click">
<i class="fa-solid fa-star"></i>
<span id="tooltipSavedTranslations" class="tool-tip">Saved translations</span>
</asp:LinkButton>
</div>
<!-- Translation History -->
<div class="button history">
<asp:LinkButton ID="lnkViewTranslationHistory" CssClass="button-small" runat="server" ClientIDMode="Static" OnClick="LnkViewTranslationHistory_Click">
<i class="fa-solid fa-clock-rotate-left"></i>
<span id="tooltipTranslationHistory" class="tool-tip">Translation history</span>
</asp:LinkButton>
</div>
<!-- Make Report -->
<div class="button report">
<asp:LinkButton ID="lnkMakeReport" CssClass="button-small" runat="server" ClientIDMode="Static" OnClick="LnkReport_Click">
<i class="fa-solid fa-circle-exclamation"></i>
<span id="tooltipReport" class="tool-tip">Report</span>
</asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
<!-- Translate Output -->
<div class="translate-output">
<asp:HiddenField ID="hfDuplicateTranslation" runat="server" ClientIDMode="Static"/>
<div class="translate-output-title">
<h5>Translation</h5>
<asp:LinkButton ID="lnkSaveTranslation" CssClass="translate-btn-save" runat="server" OnClick="LnkSaveTranslation_Click" OnClientClick="confirmSave(event, this.id);" ClientIDMode="Static">
<i id="iconSave" class="fa-regular fa-bookmark" runat="server"></i>
<span id="tooltipSave" class="tool-tip">Save translation</span>
</asp:LinkButton>
</div>
<div class="output-container">
<div class="output-text">
<div id="txtOutput" runat="server"></div>
</div>
<img id="startQuote" src="Content/image/translatorOutput_startQuote.svg" />
<img id="endQuote" src="Content/image/translatorOutput_endQuote.svg" />
</div>
</div>
</div>
</section>
<!-- User Generate -->
<section class="user-generate">
<!-- User Generate Info -->
<div class="generate-container">
<div class="generate-items">
<div class="item">
<h4>More than</h4>
<h1>100</h1>
<p>Rojak terms documented</p>
</div>
<div class="item">
<h4>At least</h4>
<h1>10</h1>
<p>Different translation variations</p>
</div>
<div class="item">
<h4>Estimated</h4>
<h1>1M</h1>
<p>Users will laugh die themselves</p>
</div>
</div>
</div>
<!-- Learn More -->
<div class="learn-more">
<h1>Click here and check us out!</h1>
<div class="button">
<a target="_blank" href="About.aspx">Learn more</a>
</div>
</div>
</section>
<!-- Modals -->
<!-- Saved Translations Modal -->
<div id="mdlSavedTranslations" class="modal-window" ClientIDMode="Static" runat="server">
<div id="dlgSavedTranslation" class="modal-dialog" runat="server">
<div class="modal-content">
<div class="modal-header">
<i class="modal-icon fa-solid fa-star"></i>
<h2 class="modal-title">Saved translations</h2>
<button type="button" class="modal-btn-close" onclick="closeModal($('#mdlSavedTranslations'))">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div id="divSavedTranslationsModalBody" class="modal-body" CientIDMode="Static" runat="server">
</div>
<div id="divSavedTranslationsModalFooter" class="modal-footer">
<asp:LinkButton ID="lnkDownloadSavedTranslations" class="button-primary" runat="server" ClientIDMode="Static" OnClick="LnkDownloadSavedTranslations_Click">
<i class="fa-solid fa-download"></i>
Download
</asp:LinkButton>
<p id="savedTranslationFooterText" runat="server"></p>
</div>
</div>
</div>
</div>
<!-- Translation History Modal -->
<div id="mdlTranslationHistory" class="modal-window" ClientIDMode="Static" runat="server">
<div id="dlgHistory" class="modal-dialog" runat="server">
<div class="modal-content">
<div class="modal-header">
<i class="modal-icon fa-solid fa-clock-rotate-left"></i>
<h2 class="modal-title">Translation history</h2>
<button type="button" class="modal-btn-close" onclick="closeModal($('#mdlTranslationHistory'))">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div id="divTranslationHistoryModalBody" class="modal-body" CientIDMode="Static" runat="server">
</div>
<div id="divTranslationHistoryModalFooter" class="modal-footer">
<div class="modal-footer-controls">
<asp:LinkButton ID="lnkDownloadTranslationHistory" class="button-primary" runat="server" ClientIDMode="Static" OnClick="LnkDownloadTranslationHistory_Click">
<i class="fa-solid fa-download"></i>
Download
</asp:LinkButton>
<asp:LinkButton ID="lnkClearTranslationHistory" class="button-secondary" runat="server" ClientIDMode="Static" OnClick="LnkClearTranslationHistory_Click">
Clear History
</asp:LinkButton>
</div>
<p id="translationHistoryFooterText" runat="server"></p>
</div>
</div>
</div>
</div>
<!-- Report Modal -->
<div id="mdlReport" class="modal-window" ClientIDMode="Static" runat="server">
<div id="dlgReport" ClientIDMode="Static" class="modal-dialog" runat="server">
<div class="modal-content">
<div class="modal-header">
<i class="modal-icon fa-solid fa-circle-exclamation"></i>
<h2 class="modal-title">Report</h2>
<button type="button" class="modal-btn-close" onclick="closeModal($('#mdlReport'))">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div id="divReportModalBody" class="modal-body">
<div class="modal-inputfield">
<label class="modal-inputlabel">Issue Category *</label>
<asp:DropDownList ID="ddlReportCategory" ClientIDMode="static" runat="server" class="modal-dropdown" AutoPostback="true" OnSelectedIndexChanged="DdlReportCategory_SelectedIndexChanged"></asp:DropDownList>
</div>
<div id="divEntryInput" class="mdlReport-topInputRow" runat="server">
<div class="modal-inputfield">
<label class="modal-inputlabel">Problem slang *</label>
<asp:TextBox ID="txtReportSlang" runat="server" class="modal-textinput" placeholder="e.g. hello world" AutoPostback="true" OnTextChanged="TxtReportSlang_TextChanged"></asp:TextBox>
</div>
<div class="modal-inputfield">
<label class="modal-inputlabel">Problem translation *</label>
<asp:DropDownList ID="ddlReportTranslation" ClientIDMode="static" runat="server" class="modal-dropdown" Enabled="false"></asp:DropDownList>
</div>
</div>
<div class="modal-inputfield">
<label class="modal-inputlabel">Description</label>
<textarea ID="txtReportDescription" runat="server" class="modal-textinput" rows="5" maxlength="500" placeholder="Describe your issue"></textarea>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="btnSubmitReport" runat="server" class="button-primary" Text="Submit" OnClick="BtnSubmitReport_Click" />
<asp:Button ID="btnCancelReport" runat="server" class="button-secondary" Text="Cancel" OnClick="BtnCancelReport_Click" />
</div>
</div>
</div>
</div>
<!-- Notification Popup -->
<div id="notification" class="notification" runat="server" onclick="closeNotification($(this));">
<div class="notification-title">
<i id="notificationIcon" runat="server"></i>
<h4 id="notificationTitle" runat="server"></h4>
</div>
<p id="notificationMessage" class="notification-message" runat="server"></p>
<small class="notification-tip">CLICK TO CLOSE</small>
</div>
</asp:Content>