Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Moecube Store
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Moecube Store
Commits
332846fc
Commit
332846fc
authored
Jan 23, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
link
parent
5a330d56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
25 deletions
+38
-25
assets/javascripts/mycard.coffee
assets/javascripts/mycard.coffee
+18
-10
assets/javascripts/mycard.js
assets/javascripts/mycard.js
+20
-15
No files found.
assets/javascripts/mycard.coffee
View file @
332846fc
...
...
@@ -6,14 +6,22 @@ $(document).ready ->
timeout
:
7200
random
:
1
$
.
getJSON
'https://api.github.com/repos/zh99998/mycard/downloads?callback=?'
,
(
data
)
->
for
download
in
data
.
data
if
v
=
download
.
name
.
match
(
/mycard-(.*)-win32\.7z/
)
if
!
version
or
v
[
1
]
>
version
version
=
v
[
1
]
url
=
download
.
html_url
if
version
$
(
'#download_url'
).
attr
'href'
,
url
$
(
'#download_version'
).
html
version
#version
$
.
get
'/mycard/download.url'
,
(
data
)
->
if
matched
=
data
.
match
(
/mycard-(.*)-win32\.7z/
)
$
(
'#download_version'
).
html
matched
[
1
]
else
$
(
'#download_version'
).
html
'读取失败'
\ No newline at end of file
$
(
'#download_version'
).
html
'读取失败'
#link
$
.
getJSON
'/links.json'
,
(
data
)
->
for
link
in
data
$
(
'<a />'
,
href
:
link
.
url
rel
:
"nofollow"
).
append
(
$
(
'<img />'
,
title
:
link
.
name
alt
:
link
.
name
src
:
link
.
logo
)).
appendTo
(
'#links'
)
\ No newline at end of file
assets/javascripts/mycard.js
View file @
332846fc
...
...
@@ -7,25 +7,30 @@
timeout
:
7200
,
random
:
1
});
return
$
.
getJSON
(
'
https://api.github.com/repos/zh99998/mycard/downloads?callback=?
'
,
function
(
data
)
{
var
download
,
url
,
v
,
version
,
_i
,
_len
,
_ref
;
_ref
=
data
.
data
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
download
=
_ref
[
_i
];
if
(
v
=
download
.
name
.
match
(
/mycard-
(
.*
)
-win32
\.
7z/
))
{
if
(
!
version
||
v
[
1
]
>
version
)
{
version
=
v
[
1
];
url
=
download
.
html_url
;
}
}
}
if
(
version
)
{
$
(
'
#download_url
'
).
attr
(
'
href
'
,
url
);
return
$
(
'
#download_version
'
).
html
(
version
);
$
.
get
(
'
/mycard/download.url
'
,
function
(
data
)
{
var
matched
;
if
(
matched
=
data
.
match
(
/mycard-
(
.*
)
-win32
\.
7z/
))
{
return
$
(
'
#download_version
'
).
html
(
matched
[
1
]);
}
else
{
return
$
(
'
#download_version
'
).
html
(
'
读取失败
'
);
}
});
return
$
.
getJSON
(
'
/links.json
'
,
function
(
data
)
{
var
link
,
_i
,
_len
,
_results
;
_results
=
[];
for
(
_i
=
0
,
_len
=
data
.
length
;
_i
<
_len
;
_i
++
)
{
link
=
data
[
_i
];
_results
.
push
(
$
(
'
<a />
'
,
{
href
:
link
.
url
,
rel
:
"
nofollow
"
}).
append
(
$
(
'
<img />
'
,
{
title
:
link
.
name
,
alt
:
link
.
name
,
src
:
link
.
logo
})).
appendTo
(
'
#links
'
));
}
return
_results
;
});
});
}).
call
(
this
);
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