Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
4c38b0ab
Commit
4c38b0ab
authored
Aug 23, 2020
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare for save name sort order
parent
ed8275a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
filter_list.js
cps/static/js/filter_list.js
+6
-3
main.js
cps/static/js/main.js
+9
-6
web.py
cps/web.py
+4
-2
No files found.
cps/static/js/filter_list.js
View file @
4c38b0ab
...
@@ -19,13 +19,16 @@ var direction = 0; // Descending order
...
@@ -19,13 +19,16 @@ var direction = 0; // Descending order
var
sort
=
0
;
// Show sorted entries
var
sort
=
0
;
// Show sorted entries
$
(
"#sort_name"
).
click
(
function
()
{
$
(
"#sort_name"
).
click
(
function
()
{
/*$.ajax({
var
class_name
=
$
(
"h1"
).
attr
(
'Class'
)
+
"_sort_name"
;
var
obj
=
{};
obj
[
class_name
]
=
sort
;
$
.
ajax
({
method
:
"post"
,
method
:
"post"
,
contentType
:
"application/json; charset=utf-8"
,
contentType
:
"application/json; charset=utf-8"
,
dataType
:
"json"
,
dataType
:
"json"
,
url
:
window
.
location
.
pathname
+
"/../../ajax/view"
,
url
:
window
.
location
.
pathname
+
"/../../ajax/view"
,
data:
"{" + st + "}"
,
data
:
JSON
.
stringify
({
obj
})
,
});
*/
});
var
count
=
0
;
var
count
=
0
;
var
index
=
0
;
var
index
=
0
;
...
...
cps/static/js/main.js
View file @
4c38b0ab
...
@@ -378,16 +378,19 @@ $(function() {
...
@@ -378,16 +378,19 @@ $(function() {
});
});
$
(
".update-view"
).
click
(
function
(
e
)
{
$
(
".update-view"
).
click
(
function
(
e
)
{
var
target
=
$
(
this
).
data
(
"target"
);
var
view
=
$
(
this
).
data
(
"view"
);
var
view
=
$
(
this
).
data
(
"view"
);
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
var
data
=
{};
$
.
ajax
({
data
[
target
]
=
view
;
method
:
"post"
,
console
.
debug
(
"Updating view data: "
,
data
);
contentType
:
"application/json; charset=utf-8"
,
$
.
post
(
"/ajax/view"
,
data
).
done
(
function
(
)
{
dataType
:
"json"
,
location
.
reload
();
url
:
window
.
location
.
pathname
+
"/../../ajax/view"
,
data
:
JSON
.
stringify
({
"series_view"
:
view
}),
success
:
function
success
()
{
location
.
reload
();
}
});
});
});
});
});
});
cps/web.py
View file @
4c38b0ab
...
@@ -466,7 +466,7 @@ def toggle_archived(book_id):
...
@@ -466,7 +466,7 @@ def toggle_archived(book_id):
@
web
.
route
(
"/ajax/view"
,
methods
=
[
"POST"
])
@
web
.
route
(
"/ajax/view"
,
methods
=
[
"POST"
])
@
login_required
@
login_required
def
update_view
():
def
update_view
():
to_save
=
request
.
form
.
to_dict
()
to_save
=
request
.
get_json
()
allowed_view
=
[
'grid'
,
'list'
]
allowed_view
=
[
'grid'
,
'list'
]
if
"series_view"
in
to_save
and
to_save
[
"series_view"
]
in
allowed_view
:
if
"series_view"
in
to_save
and
to_save
[
"series_view"
]
in
allowed_view
:
try
:
try
:
...
@@ -481,10 +481,12 @@ def update_view():
...
@@ -481,10 +481,12 @@ def update_view():
except
Exception
:
except
Exception
:
log
.
error
(
"Could not save series_view_settings:
%
r
%
r"
,
request
,
to_save
)
log
.
error
(
"Could not save series_view_settings:
%
r
%
r"
,
request
,
to_save
)
return
"Invalid request"
,
400
return
"Invalid request"
,
400
elif
"authorslist"
in
to_save
:
pass
else
:
else
:
log
.
error
(
"Invalid request received:
%
r
%
r"
,
request
,
to_save
)
log
.
error
(
"Invalid request received:
%
r
%
r"
,
request
,
to_save
)
return
"Invalid request"
,
400
return
"Invalid request"
,
400
return
""
,
200
return
"
1
"
,
200
'''
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment