-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvkreader.csp.xml
195 lines (186 loc) · 7.45 KB
/
vkreader.csp.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<CSP name="vkreader.csp" application="/csp/vkfb/" default="1"><![CDATA[
<html>
<head>
<title>VKReader</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="custom.css">
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="custom.js"></script>
<script src="jquery.bootpag.js"></script>
<script language="JavaScript">
var posts = {}
$(document).ready(function() {
setSearch("#main-table");
$(".ec-link").click(function() {
$(this).slideUp(400, function() {
$(this).html("Calculating...").fadeIn(200, function() {
showEC();
});
});
});
});
function addSources() {
var shouldClear = $("#should-clear").is(':checked')
var query = $("#query-form").val()
var count = $("#count-form").val()
console.log([shouldClear, query, count]);
$("#add-sources-modal .progress").show(400);
$("#add-sources-button").prop('disabled', true);
#call(VKReader.UIBroker.AddMorePostsWithinContext(shouldClear, count, query))#
}
function showSourceId() {
var sourceId = $("#source-id-form").val();
$("#show-source-id-modal .progress").show(400);
$("#show-source-id-button").prop('disabled', true);
#call(VKReader.UIBroker.ShowFullSourceById(sourceId))#
}
function showEC() {
#call(VKReader.UIBroker.ShowEC())#
}
$(document).on("click", ".link-to-full-source", function () {
var sourceId = $(this).text();
$("#source-id-form").val(sourceId);
showSourceId()
});
function redrawTableByPage(pageNum, customPageSize) {
if (customPageSize === undefined) {
customPageSize = pageSize;
}
#call(VKReader.UIBroker.DrawTable("0", "['sourceId','title', 'date', 'time', 'city', 'EC']", "#main-table", pageNum, customPageSize))#
}
</script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">VKReader</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li data-toggle="modal" data-target="#add-sources-modal"><a href="#"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Sources</a></li>
<li data-toggle="modal" data-target="#show-source-id-modal"><a href="#"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Show SourceId</a></li>
<li>
<a class="ec-link" href="#">
<span class="glyphicon glyphicon-fire" aria-hidden="true"></span>
Calculate EC
</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search titles..." id="main-table-search-pane">
<span class="input-group-btn">
<button class="btn btn-default" type="button">Go!</button>
</span>
</div>
</div>
</div>
<div class="row" style="margin-top:10px">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<table class="table" id="main-table-header">
<thead>
<tr>
<th>SourceId</th>
<th>Title</th>
<th>Date</th>
<th>Time</th>
<th>City</th>
<th>EC</th>
</tr>
</thead>
</table>
<div class="table-content big-content-wrapper">
<table class="table" id="main-table">
<tbody>
<script language="JavaScript">
redrawTableByPage("1");
</script>
</tbody>
</table>
</div>
</div>
<div class="col-md-9 col-md-offset-2" id="page-selection"></div>
<script language="JavaScript">
#call(TWReader.UIBroker.RedrawTable())#
</script>
</div>
</div>
</div>
</div>
<div class="modal fade" id="add-sources-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Add more posts to domain</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group form-inline form-multiline" align="center">
<label for="query-form" class="control-label">Query:</label>
<input type="text" class="form-control" id="query-form" value="pizza">
</div>
</form>
<form class="form form-inline form-multiline" role="form" align="center">
<div class="form-group">
<label for="should-clear" class="control-label">Clear Domain:</label>
<input type="checkbox" class="form-control" id="should-clear">
</div>
<div class="form-group">
<label for="count-form" class="control-label">Count:</label>
<input type="number" class="form-control" id="count-form" min="1" max="100" value="100">
</div>
</form>
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
<span class="sr-only">100% Complete</span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="add-sources-button" onclick="addSources();">Add</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="show-source-id-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Show source with given id</h4>
</div>
<div class="modal-body">
<form class="form form-inline form-multiline" role="form" align="center">
<div class="form-group">
<label for="source-id-form" class="control-label">SourceId:</label>
<input type="number" class="form-control" id="source-id-form" value="0">
</div>
</form>
<p style="display:none;"> </p>
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
<span class="sr-only">100% Complete</span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="show-source-id-button" onclick="showSourceId();">Show</button>
</div>
</div>
</div>
</div>
</body>
</html>
]]></CSP>
</Export>