/
popup.html
287 lines (254 loc) · 11.8 KB
/
popup.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
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!doctype html>
<html ng-app="datebot">
<head>
<title>Datebot - Online Dating Assistant</title>
<!-- build:css css/site.min.css -->
<link href="bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<link href="temp/popup.css" rel="stylesheet">
<!-- endbuild -->
</head>
<body>
<div ng-controller="ProfileController as profileCtrl" class="container">
<p class="lead title">Datebot - Online Dating Assistant</p>
<div class="alert alert-success" role="alert" ng-show="profileCtrl.copied">
Copied to clipboard. Now go send that message!
</div>
<!--Begin new user view-->
<div ng-show="!profileCtrl.foundKeywords">
<div style="float: right;">
<img src="img/Thomas-Hello128.png" alt="Welcome!" /></div><br />
<p class="lead">Welcome to Datebot, the online dating assistant. Seems
like you're a new user.<br /><br />To get started, visit the Options page or
read the <a href="https://docs.google.com/document/d/1EQIzJzchrmPx05tBrfrFsu3J58TQyW5z7I-imuz7XFc/edit?usp=sharing"
target="_blank">Datebot Guide</a><br />
<button class="btn btn-primary" ng-click="profileCtrl.goToOptions()">
Go to the Options Page</button>
</p>
<span class="import_note">Note: If you're an existing user, your data
might've been wiped from Chrome. If you exported your data, you can go
import it on the options page! (See link above.)</span>
</div>
<!--End new user view-->
<div ng-show="profileCtrl.foundKeywords">
<!--This div appears if Datebot was unable to find a profile on the page-->
<div class="alert"
ng-show="!profileCtrl.profiles.length && !profileCtrl.loading">
Nothing found. Are you sure you're on an OKCupid profile? If so,
refreshing the page should do the trick.
</div>
<!--This is where Datebot will give you a recommendation based on how
important the matched keywords are to you-->
<div class="recommendation" ng-show="profileCtrl.recommendation">
<p class="lead">
Datebot says: <br />
<strong>"{{profileCtrl.recommendation}}"</strong>
</p>
</div>
<!--This area contains checkboxes for different options while analyzing a
match, including debugging-->
<div id="toggle-options" ng-hide="!profileCtrl.profiles.length">
<input style="margin-bottom: 4px;"
type="checkbox"
ng-model="profileCtrl.hidePicture" />
<small class="toggle_label">Hide Picture?</small>
<input style="margin-bottom: 4px;"
type="checkbox"
ng-model="profileCtrl.hideContext" />
<small class="toggle_label">Hide Context?</small>
<!-- <input style="margin-bottom: 4px;"
type="checkbox"
ng-model="profileCtrl.debug" />
<small class="toggle_label">Debug mode?</small> -->
<!-- <input style="margin-bottom: 4px;"
type="checkbox"
ng-model="profileCtrl.noTracking" />
<small class="toggle_label">Don't record messages?</small> -->
</div>
<!--This contains match info (where most of the workflow takes place)-->
<table class="table table-bordered" ng-show="profileCtrl.profiles.length">
<thead>
<tr>
<th ng-hide="profileCtrl.hidePicture" class="columntitle">Match</th>
<th class="columntitle">Similarities</th>
<th ng-hide="profileCtrl.hideContext" class="columntitle">Context</th>
<th class="columntitle">The Message</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="profile in profileCtrl.profiles">
<td ng-hide="profileCtrl.hidePicture" id="matchinfo">
<a href="http://www.okcupid.com/profile/{{profile.okcUsername}}"
target="_blank">{{profile.okcUsername}}</a>
<img ng-src="{{profile.okcPicture}}" class="profile-image" /><br />
<p class="score lead">
Score:<br />
<strong>{{profileCtrl.calculateScore(profile)}}</strong>
</p>
</td>
<td id="similarities">
<div ng-repeat="match in profile.matches.matched"
ng-hide="profile.messaged"
class="match-entry">
<input type="checkbox"
ng-model="match.checked"
ng-checked="match.checked"
ng-click="profileCtrl.keywordClick()"/> {{match.keyword}}
<div class="moveit-container"
ng-hide="profile.matches.matched.length === 1">
<span class="moveit glyphicon glyphicon-arrow-up"
ng-click="profileCtrl.raiseKeywordPosition(
match, profile.matches.matched, 'top')"
ng-hide="$first"></span>
<span class="moveit glyphicon glyphicon-arrow-down"
ng-click="profileCtrl.lowerKeywordPosition(
match, profile.matches.matched, 'last')"
ng-hide="$last"></span>
<!-- <span class="moveit glyphicon glyphicon-arrow-up"
ng-click="profileCtrl.raiseKeywordPosition(
match, profile.matches.matched)"
ng-hide="$first">
<small>1</small></span> -->
<!-- <span class="moveit"
ng-click="lowerKeywordPosition(
match, profile.matches.matched)"
ng-hide="$last">D</span> -->
</div>
<hr ng-hide="profile.matches.matched.length === 1" />
</div>
</td>
<td ng-hide="profileCtrl.hideContext" id="match_context">
<p ng-repeat="match in profile.matches.matched"
ng-bind-html="match.context | unsafe"
ng-hide="profile.messaged"></p>
</td>
<td id="full_profile" ng-show="false">
<div ng-repeat="section in profile.okcContext">
<p><strong>{{section.name}}</strong></p>
<p>{{section.essay}}</p>
</div>
</td>
<!--Holds the processed message and in-place editing functionality-->
<td id="the_message" style="min-width: 225px;">
<div class="alert alert-warning" ng-hide="profile.matches.matched.length || profileCtrl.saveCustomized">
Bummer, couldn't find anything in common here. Add more keywords or try another profile.
</div>
<div class="finalmessage"
copy-to-clipboard on-copy="profileCtrl.confirmCopied()"
custom-override="profileCtrl.saveCustomized && profileCtrl.customMessage"
ng-hide="profile.customEditorActive || profileCtrl.saveCustomized || !profile.matches.matched.length">
<!--Open the message with the chosen opener-->
<p ng-bind-html="profile.matches.opener"></p>
<!--Loop through the profile.matches.matched array to display the
message associated with the keywords-->
<!--Also contains transition text span, which is determined in your
options area. Only part of DOM when $index > 0-->
<p ng-hide="!((profile.matches.matched | filter:{checked: true}).length)"
ng-repeat="match in profile.matches.matched | filter:{checked: true}">
<span ng-if="$index != 0" class="transition_text">
{{ $index === 1
? profileCtrl.keywords.first_transition + ' '
: profileCtrl.keywords.second_transition + ' ' }}
</span>{{match.message | adjustCapitalLetters : $index : profileCtrl.keywords}}
</p>
<!--If there are no matches after all filters are applied,
replace body text with a generic question-->
<p ng-if="!((profile.matches.matched | filter:{checked: true}).length)">
{{genericQuestion}}
</p>
<!--Close the message with the closing text-->
<p ng-bind-html="profile.matches.closer"></p>
</div>
<!-- Custom message result goes here -->
<div class="customized_finalmessage"
ng-show="profileCtrl.saveCustomized && !profile.customEditorActive"
ng-bind-html="profileCtrl.customMessage | replaceLineBreaks | unsafe">
</div>
<button id="{{profile.okcUsername}}"
class="btn btn-primary sendmessage"
ng-hide="profile.customEditorActive || (!profile.matches.matched.length && !profileCtrl.saveCustomized)"
ng-click="profileCtrl.copyToClipboard(profile)">
Copy to Clipboard
</button>
<!--Custom Editor functionality-->
<textarea class="custom_editor"
ng-model="profileCtrl.customMessage"
ng-show="profile.customEditorActive"
ng-change="profileCtrl.markAsCustomized(profile)"></textarea>
<button id="{{profile.okcUsername}}_customize"
class="btn"
ng-hide="profile.customEditorActive"
ng-click="profileCtrl.showCustomEditor(profile)">
Customize
</button>
<button id="{{profile.okcUsername}}_customsave"
class="btn" ng-show="profile.customEditorActive"
ng-click="profileCtrl.saveCustomEdit(profile)">Save</button>
<hr />
<div class="alert alert-info"
ng-show="profileCtrl.saveCustomized">
Note: This is a customized message. Adjusting your keyword choices
will reset the message to your defaults!
</div>
<!--End Custom Edtior functionality-->
<hr />
<button class="btn btn-small" ng-click="profileCtrl.goToOptions()">
Options Page
</button>
<!--This div preps the data for the database if we choose to send the
msg, and is viewable in debug mode-->
<!-- <div id="{{profile.okcUsername}}_data" ng-show="profileCtrl.debug">
<hr />
<strong>Database Object:</strong><br />
{{ profileCtrl.updateDatabaseObj(profile.matches, saveCustomized, profile.okcUsername, profile.matchScore) }}
<br /><hr />
</div> -->
<!--Debug feature for previewing the plain text message to ensure no
HTML stuck around after processing-->
<div ng-if="debug">
<input type="checkbox"ng-model="profileCtrl.testingMode" />
Preview processed, plain-text message?
<br />
<div id="html_preview"
ng-if="profileCtrl.testingMode"
ng-bind-html="profileCtrl.testMessage()">
</div>
</div>
</td>
</tr>
</tbody>
</table>
<!--Show the Datebot logo if no matches were found, as a placeholder-->
<div ng-show="!profileCtrl.profiles.length && !profileCtrl.loading">
<img class="centered" src="img/Thomas-Hello128.png">
<div class="imagecredit">
<p>Image Credit:
<a href="http://www.iconarchive.com/show/daft-punks-icons-by-tsukasa-tux.html"
target="_blank">Tsukasa-Tux</a>.</p>
</div>
<br />
<div style="margin: 0px auto;width: 12%;display: block;">
<button class="btn btn-small"
ng-click="profileCtrl.goToOptions()">
Options Page
</button>
</div>
</div>
</div>
</div>
<!-- build:js js/vendor.min.js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<!-- endbuild -->
<!-- build:js js/app.min.js -->
<script src="js/app.js"></script>
<script src="js/common/copy_to_clipboard.js"></script>
<script src="js/ScraperService.js"></script>
<script src="js/StorageService.js"></script>
<script src="js/TextProcessorService.js"></script>
<script src="js/ProfileController.js"></script>
<script src="js/filters.js"></script>
<!-- endbuild -->
</body>
</html>