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
466af215
Commit
466af215
authored
Mar 05, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code Cosmetics
parent
6269a83c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
26 deletions
+27
-26
main.js
cps/static/js/main.js
+3
-2
table.js
cps/static/js/table.js
+6
-6
uploadprogress.js
cps/static/js/uploadprogress.js
+18
-18
No files found.
cps/static/js/main.js
View file @
466af215
...
@@ -86,7 +86,7 @@ $(function() {
...
@@ -86,7 +86,7 @@ $(function() {
//animate : true, # ToDo: Reenable function
//animate : true, # ToDo: Reenable function
//extraScrollPx: 300
//extraScrollPx: 300
});
});
$loadMore
.
on
(
'append.infiniteScroll'
,
function
(
event
,
response
,
path
,
data
)
{
$loadMore
.
on
(
"append.infiniteScroll"
,
function
(
event
,
response
,
path
,
data
)
{
$
(
".pagination"
).
addClass
(
"hidden"
);
$
(
".pagination"
).
addClass
(
"hidden"
);
$
(
".load-more .row"
).
isotope
(
"appended"
,
$
(
data
),
null
);
$
(
".load-more .row"
).
isotope
(
"appended"
,
$
(
data
),
null
);
});
});
...
@@ -117,7 +117,7 @@ $(function() {
...
@@ -117,7 +117,7 @@ $(function() {
var
buttonText
=
$this
.
html
();
var
buttonText
=
$this
.
html
();
$this
.
html
(
"..."
);
$this
.
html
(
"..."
);
$
(
"#update_error"
).
addClass
(
"hidden"
);
$
(
"#update_error"
).
addClass
(
"hidden"
);
if
(
$
(
"#message"
).
length
){
if
(
$
(
"#message"
).
length
)
{
$
(
"#message"
).
alert
(
"close"
);
$
(
"#message"
).
alert
(
"close"
);
}
}
$
.
ajax
({
$
.
ajax
({
...
@@ -179,6 +179,7 @@ $(function() {
...
@@ -179,6 +179,7 @@ $(function() {
});
});
});
});
// Init all data control handlers to default
$
(
"input[data-control]"
).
trigger
(
"change"
);
$
(
"input[data-control]"
).
trigger
(
"change"
);
$
(
"#bookDetailsModal"
)
$
(
"#bookDetailsModal"
)
...
...
cps/static/js/table.js
View file @
466af215
...
@@ -27,7 +27,7 @@ $(function() {
...
@@ -27,7 +27,7 @@ $(function() {
async
:
true
,
async
:
true
,
timeout
:
900
,
timeout
:
900
,
success
:
function
(
data
){
success
:
function
(
data
){
$
(
'#domain-table'
).
bootstrapTable
(
"load"
,
data
);
$
(
"#domain-table"
).
bootstrapTable
(
"load"
,
data
);
}
}
});
});
});
});
...
@@ -51,7 +51,7 @@ $(function() {
...
@@ -51,7 +51,7 @@ $(function() {
url
:
window
.
location
.
pathname
+
"/../../ajax/domainlist"
,
url
:
window
.
location
.
pathname
+
"/../../ajax/domainlist"
,
async
:
true
,
async
:
true
,
timeout
:
900
,
timeout
:
900
,
success
:
function
(
data
){
success
:
function
(
data
)
{
$
(
"#domain-table"
).
bootstrapTable
(
"load"
,
data
);
$
(
"#domain-table"
).
bootstrapTable
(
"load"
,
data
);
}
}
});
});
...
@@ -65,11 +65,11 @@ $(function() {
...
@@ -65,11 +65,11 @@ $(function() {
});
});
});
});
function
TableActions
(
value
,
row
,
index
)
{
/*
function TableActions (value, row, index) {
return [
return [
"<a class=\"danger remove\" data-toggle=\"modal\" data-target=\"#DeleteDomain\" data-domain-id=\"" + row.id
"<a class=\"danger remove\" data-toggle=\"modal\" data-target=\"#DeleteDomain\" data-domain-id=\"" + row.id
+ "\" title=\"Remove\">",
+ "\" title=\"Remove\">",
"<i class=\"glyphicon glyphicon-trash\"></i>",
"<i class=\"glyphicon glyphicon-trash\"></i>",
"</a>"
"</a>"
].join("");
].join("");
}
}
*/
cps/static/js/uploadprogress.js
View file @
466af215
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
* Version 1.0.0
* Version 1.0.0
* Licensed under the MIT license.
* Licensed under the MIT license.
*/
*/
(
function
(
$
)
{
(
function
(
$
)
{
"use strict"
;
"use strict"
;
...
@@ -57,13 +58,13 @@
...
@@ -57,13 +58,13 @@
// Translate texts
// Translate texts
this
.
$modalTitle
.
text
(
this
.
options
.
modalTitle
)
this
.
$modalTitle
.
text
(
this
.
options
.
modalTitle
)
this
.
$modalFooter
.
children
(
"button"
).
text
(
this
.
options
.
modalFooter
)
this
.
$modalFooter
.
children
(
"button"
).
text
(
this
.
options
.
modalFooter
)
;
this
.
$modal
.
on
(
"hidden.bs.modal"
,
$
.
proxy
(
this
.
reset
,
this
));
this
.
$modal
.
on
(
"hidden.bs.modal"
,
$
.
proxy
(
this
.
reset
,
this
));
},
},
reset
:
function
()
{
reset
:
function
()
{
this
.
$modalTitle
.
text
(
this
.
options
.
modalTitle
)
this
.
$modalTitle
.
text
(
this
.
options
.
modalTitle
)
;
this
.
$modalFooter
.
hide
();
this
.
$modalFooter
.
hide
();
this
.
$modalBar
.
addClass
(
"progress-bar-success"
);
this
.
$modalBar
.
addClass
(
"progress-bar-success"
);
this
.
$modalBar
.
removeClass
(
"progress-bar-danger"
);
this
.
$modalBar
.
removeClass
(
"progress-bar-danger"
);
...
@@ -132,25 +133,25 @@
...
@@ -132,25 +133,25 @@
// Replace the contents of the form, with the returned html
// Replace the contents of the form, with the returned html
if
(
xhr
.
status
===
422
)
{
if
(
xhr
.
status
===
422
)
{
var
newHtml
=
$
.
parseHTML
(
xhr
.
responseText
);
var
newHtml
=
$
.
parseHTML
(
xhr
.
responseText
);
this
.
$modalBar
.
text
(
newHtml
[
0
].
data
);
this
.
replaceForm
(
newHtml
);
//
this.$modal.modal("hide");
this
.
$modal
.
modal
(
"hide"
);
}
}
// Write the error response to the document.
// Write the error response to the document.
else
{
else
{
var
responseText
=
xhr
.
responseText
;
// Handle no response error
// Handle no response error
if
(
contentType
)
{
if
(
contentType
)
{
var
responseText
=
xhr
.
responseText
;
if
(
contentType
.
indexOf
(
"text/plain"
)
!==
-
1
)
{
if
(
contentType
.
indexOf
(
"text/plain"
)
!==
-
1
)
{
responseText
=
"<pre>"
+
responseText
+
"</pre>"
;
responseText
=
"<pre>"
+
responseText
+
"</pre>"
;
}
}
document
.
write
(
xhr
.
responseText
);
document
.
write
(
responseText
);
}
}
}
}
},
},
set
_progress
:
function
(
percent
)
{
set
Progress
:
function
(
percent
)
{
var
txt
=
percent
+
"%"
;
var
txt
=
percent
+
"%"
;
if
(
percent
==
100
)
{
if
(
percent
==
=
100
)
{
txt
=
this
.
options
.
uploadedMsg
;
txt
=
this
.
options
.
uploadedMsg
;
}
}
this
.
$modalBar
.
attr
(
"aria-valuenow"
,
percent
);
this
.
$modalBar
.
attr
(
"aria-valuenow"
,
percent
);
...
@@ -158,21 +159,20 @@
...
@@ -158,21 +159,20 @@
this
.
$modalBar
.
css
(
"width"
,
percent
+
"%"
);
this
.
$modalBar
.
css
(
"width"
,
percent
+
"%"
);
},
},
progress
:
function
(
/*ProgressEvent*/
e
){
progress
:
function
(
/*ProgressEvent*/
e
)
{
var
percent
=
Math
.
round
((
e
.
loaded
/
e
.
total
)
*
100
);
var
percent
=
Math
.
round
((
e
.
loaded
/
e
.
total
)
*
100
);
this
.
set
_p
rogress
(
percent
);
this
.
set
P
rogress
(
percent
);
},
},
// replace
_f
orm replaces the contents of the current form
// replace
F
orm replaces the contents of the current form
// with the form in the html argument.
// with the form in the html argument.
// We use the id of the current form to find the new form in the html
// We use the id of the current form to find the new form in the html
replace
_f
orm
:
function
(
html
)
{
replace
F
orm
:
function
(
html
)
{
var
newForm
;
var
newForm
;
var
formId
=
this
.
$form
.
attr
(
"id"
);
var
formId
=
this
.
$form
.
attr
(
"id"
);
if
(
formId
!==
undefined
)
{
if
(
typeof
(
formId
)
!==
"undefined"
)
{
newForm
=
$
(
html
).
find
(
"#"
+
formId
);
newForm
=
$
(
html
).
find
(
"#"
+
formId
);
}
}
else
{
else
{
newForm
=
$
(
html
).
find
(
"form"
);
newForm
=
$
(
html
).
find
(
"form"
);
}
}
// add the filestyle again
// add the filestyle again
...
@@ -181,11 +181,11 @@
...
@@ -181,11 +181,11 @@
}
}
};
};
$
.
fn
.
uploadprogress
=
function
(
options
,
value
)
{
$
.
fn
.
uploadprogress
=
function
(
options
)
{
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
var
_options
=
$
.
extend
({},
$
.
fn
.
uploadprogress
.
defaults
,
options
);
var
_options
=
$
.
extend
({},
$
.
fn
.
uploadprogress
.
defaults
,
options
);
var
file
_p
rogress
=
new
UploadProgress
(
this
,
_options
);
var
file
P
rogress
=
new
UploadProgress
(
this
,
_options
);
file
_p
rogress
.
constructor
();
file
P
rogress
.
constructor
();
});
});
};
};
...
...
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