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
759301b2
Commit
759301b2
authored
Apr 02, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
easypignate
parent
12cc9ad8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
302 additions
and
118 deletions
+302
-118
assets/javascripts/decks.coffee
assets/javascripts/decks.coffee
+9
-0
assets/javascripts/decks.js
assets/javascripts/decks.js
+160
-95
assets/stylesheets/decks.less
assets/stylesheets/decks.less
+9
-11
decks/new/index.html
decks/new/index.html
+4
-12
vendor/javascripts/easypaginate.js
vendor/javascripts/easypaginate.js
+120
-0
No files found.
assets/javascripts/decks.coffee
View file @
759301b2
...
@@ -354,7 +354,16 @@ class CardsController extends Spine.Controller
...
@@ -354,7 +354,16 @@ class CardsController extends Spine.Controller
$
(
'#search_cards_'
+
(
if
$
(
'.operate_area'
).
hasClass
(
'text'
)
then
'text'
else
'graphic'
)
+
'_template'
)
$
(
'#search_cards_'
+
(
if
$
(
'.operate_area'
).
hasClass
(
'text'
)
then
'text'
else
'graphic'
)
+
'_template'
)
search
:
(
name
)
->
search
:
(
name
)
->
Card
.
fetch_by_name
name
,
(
cards
)
=>
Card
.
fetch_by_name
name
,
(
cards
)
=>
category_count
=
{}
for
category
in
Card
.
categories
category_count
[
category
]
=
0
for
card
in
cards
category_count
[(
category
for
category
in
card
.
card_type
when
category
in
Card
.
categories
).
pop
()]
++
$
(
"#search_cards_spells_count"
).
html
category_count
.
Spell
$
(
"#search_cards_traps_count"
).
html
category_count
.
Trap
$
(
"#search_cards_monsters_count"
).
html
category_count
.
Monster
@
html
@
template
().
tmpl
cards
@
html
@
template
().
tmpl
cards
@
el
.
easyPaginate
(
step
:
7
,
delay
:
30
)
decks
=
new
DecksController
(
el
:
$
(
"#deck"
))
decks
=
new
DecksController
(
el
:
$
(
"#deck"
))
...
...
assets/javascripts/decks.js
View file @
759301b2
// Generated by CoffeeScript 1.
4.0
// Generated by CoffeeScript 1.
6.2
(
function
()
{
(
function
()
{
var
Card
,
CardUsage
,
CardsController
,
Deck
,
DecksController
,
cards
,
decks
,
locale
,
var
Card
,
CardUsage
,
CardsController
,
Deck
,
DecksController
,
cards
,
decks
,
locale
,
_ref
,
_ref1
,
_ref2
,
_ref3
,
_ref4
,
__hasProp
=
{}.
hasOwnProperty
,
__hasProp
=
{}.
hasOwnProperty
,
__extends
=
function
(
child
,
parent
)
{
for
(
var
key
in
parent
)
{
if
(
__hasProp
.
call
(
parent
,
key
))
child
[
key
]
=
parent
[
key
];
}
function
ctor
()
{
this
.
constructor
=
child
;
}
ctor
.
prototype
=
parent
.
prototype
;
child
.
prototype
=
new
ctor
();
child
.
__super__
=
parent
.
prototype
;
return
child
;
},
__extends
=
function
(
child
,
parent
)
{
for
(
var
key
in
parent
)
{
if
(
__hasProp
.
call
(
parent
,
key
))
child
[
key
]
=
parent
[
key
];
}
function
ctor
()
{
this
.
constructor
=
child
;
}
ctor
.
prototype
=
parent
.
prototype
;
child
.
prototype
=
new
ctor
();
child
.
__super__
=
parent
.
prototype
;
return
child
;
},
__indexOf
=
[].
indexOf
||
function
(
item
)
{
for
(
var
i
=
0
,
l
=
this
.
length
;
i
<
l
;
i
++
)
{
if
(
i
in
this
&&
this
[
i
]
===
item
)
return
i
;
}
return
-
1
;
},
__indexOf
=
[].
indexOf
||
function
(
item
)
{
for
(
var
i
=
0
,
l
=
this
.
length
;
i
<
l
;
i
++
)
{
if
(
i
in
this
&&
this
[
i
]
===
item
)
return
i
;
}
return
-
1
;
},
...
@@ -9,11 +9,11 @@
...
@@ -9,11 +9,11 @@
locale
=
'
zh
'
;
locale
=
'
zh
'
;
Card
=
(
function
(
_super
)
{
Card
=
(
function
(
_super
)
{
__extends
(
Card
,
_super
);
__extends
(
Card
,
_super
);
function
Card
()
{
function
Card
()
{
return
Card
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
_ref
=
Card
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
return
_ref
;
}
}
Card
.
types
=
[
'
Warrior
'
,
'
Spellcaster
'
,
'
Fairy
'
,
'
Fiend
'
,
'
Zombie
'
,
'
Machine
'
,
'
Aqua
'
,
'
Pyro
'
,
'
Rock
'
,
'
Winged_Beast
'
,
'
Plant
'
,
'
Insect
'
,
'
Thunder
'
,
'
Dragon
'
,
'
Beast
'
,
'
Beast-Warrior
'
,
'
Dinosaur
'
,
'
Fish
'
,
'
Sea_Serpent
'
,
'
Reptile
'
,
'
Psychic
'
,
'
Divine-Beast
'
,
'
Creator_God
'
];
Card
.
types
=
[
'
Warrior
'
,
'
Spellcaster
'
,
'
Fairy
'
,
'
Fiend
'
,
'
Zombie
'
,
'
Machine
'
,
'
Aqua
'
,
'
Pyro
'
,
'
Rock
'
,
'
Winged_Beast
'
,
'
Plant
'
,
'
Insect
'
,
'
Thunder
'
,
'
Dragon
'
,
'
Beast
'
,
'
Beast-Warrior
'
,
'
Dinosaur
'
,
'
Fish
'
,
'
Sea_Serpent
'
,
'
Reptile
'
,
'
Psychic
'
,
'
Divine-Beast
'
,
'
Creator_God
'
];
...
@@ -46,8 +46,10 @@
...
@@ -46,8 +46,10 @@
Card
.
load
=
function
(
cards
,
langs
)
{
Card
.
load
=
function
(
cards
,
langs
)
{
var
card
,
card_type
,
i
,
lang
;
var
card
,
card_type
,
i
,
lang
;
return
this
.
refresh
((
function
()
{
return
this
.
refresh
((
function
()
{
var
_i
,
_j
,
_len
,
_len1
,
_results
;
var
_i
,
_j
,
_len
,
_len1
,
_results
;
_results
=
[];
_results
=
[];
for
(
_i
=
0
,
_len
=
langs
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
langs
.
length
;
_i
<
_len
;
_i
++
)
{
lang
=
langs
[
_i
];
lang
=
langs
[
_i
];
...
@@ -74,6 +76,7 @@
...
@@ -74,6 +76,7 @@
card_type
:
card_type
,
card_type
:
card_type
,
type
:
lang
.
race
?
(
i
=
0
,
(
function
()
{
type
:
lang
.
race
?
(
i
=
0
,
(
function
()
{
var
_results1
;
var
_results1
;
_results1
=
[];
_results1
=
[];
while
(
!
(
lang
.
race
>>
i
&
1
))
{
while
(
!
(
lang
.
race
>>
i
&
1
))
{
_results1
.
push
(
i
++
);
_results1
.
push
(
i
++
);
...
@@ -82,6 +85,7 @@
...
@@ -82,6 +85,7 @@
})(),
this
.
types
[
i
])
:
void
0
,
})(),
this
.
types
[
i
])
:
void
0
,
attribute
:
lang
.
attribute
?
(
i
=
0
,
(
function
()
{
attribute
:
lang
.
attribute
?
(
i
=
0
,
(
function
()
{
var
_results1
;
var
_results1
;
_results1
=
[];
_results1
=
[];
while
(
!
(
lang
.
attribute
>>
i
&
1
))
{
while
(
!
(
lang
.
attribute
>>
i
&
1
))
{
_results1
.
push
(
i
++
);
_results1
.
push
(
i
++
);
...
@@ -100,20 +104,23 @@
...
@@ -100,20 +104,23 @@
Card
.
fetch_by_name
=
function
(
name
,
callback
)
{
Card
.
fetch_by_name
=
function
(
name
,
callback
)
{
var
_this
=
this
;
var
_this
=
this
;
return
$
.
getJSON
(
""
+
this
.
locale_url
+
"
?q=
"
+
(
JSON
.
stringify
({
return
$
.
getJSON
(
""
+
this
.
locale_url
+
"
?q=
"
+
(
JSON
.
stringify
({
name
:
{
name
:
{
$regex
:
name
.
replace
(
/
([
.?*+^$[
\]\\
(){}|-
])
/g
,
'
\\
$1
'
),
$regex
:
name
.
replace
(
/
([
.?*+^$[
\]\\
(){}|-
])
/g
,
'
\\
$1
'
),
$options
:
'
i
'
$options
:
'
i
'
}
}
})),
function
(
langs
)
{
})),
function
(
langs
)
{
var
cards_id
,
lang
,
result
,
_i
,
_len
;
var
cards_id
,
e
,
lang
,
result
,
_i
,
_len
;
result
=
[];
result
=
[];
cards_id
=
[];
cards_id
=
[];
for
(
_i
=
0
,
_len
=
langs
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
langs
.
length
;
_i
<
_len
;
_i
++
)
{
lang
=
langs
[
_i
];
lang
=
langs
[
_i
];
try
{
try
{
result
.
push
(
Card
.
find
(
lang
.
_id
));
result
.
push
(
Card
.
find
(
lang
.
_id
));
}
catch
(
e
)
{
}
catch
(
_error
)
{
e
=
_error
;
cards_id
.
push
(
lang
.
_id
);
cards_id
.
push
(
lang
.
_id
);
}
}
}
}
...
@@ -124,6 +131,7 @@
...
@@ -124,6 +131,7 @@
}
}
})),
function
(
cards
)
{
})),
function
(
cards
)
{
var
card
,
_j
,
_len1
;
var
card
,
_j
,
_len1
;
_this
.
load
(
cards
,
langs
);
_this
.
load
(
cards
,
langs
);
for
(
_j
=
0
,
_len1
=
cards
.
length
;
_j
<
_len1
;
_j
++
)
{
for
(
_j
=
0
,
_len1
=
cards
.
length
;
_j
<
_len1
;
_j
++
)
{
card
=
cards
[
_j
];
card
=
cards
[
_j
];
...
@@ -140,8 +148,10 @@
...
@@ -140,8 +148,10 @@
Card
.
fetch_by_id
=
function
(
cards_id
,
callback
,
before
,
after
)
{
Card
.
fetch_by_id
=
function
(
cards_id
,
callback
,
before
,
after
)
{
var
card_id
,
var
card_id
,
_this
=
this
;
_this
=
this
;
cards_id
=
(
function
()
{
cards_id
=
(
function
()
{
var
_i
,
_len
,
_results
;
var
_i
,
_len
,
_results
;
_results
=
[];
_results
=
[];
for
(
_i
=
0
,
_len
=
cards_id
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
cards_id
.
length
;
_i
<
_len
;
_i
++
)
{
card_id
=
cards_id
[
_i
];
card_id
=
cards_id
[
_i
];
...
@@ -180,11 +190,11 @@
...
@@ -180,11 +190,11 @@
})(
Spine
.
Model
);
})(
Spine
.
Model
);
CardUsage
=
(
function
(
_super
)
{
CardUsage
=
(
function
(
_super
)
{
__extends
(
CardUsage
,
_super
);
__extends
(
CardUsage
,
_super
);
function
CardUsage
()
{
function
CardUsage
()
{
return
CardUsage
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
_ref1
=
CardUsage
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
return
_ref1
;
}
}
CardUsage
.
configure
(
'
CardUsage
'
,
'
count
'
,
'
side
'
);
CardUsage
.
configure
(
'
CardUsage
'
,
'
count
'
,
'
side
'
);
...
@@ -198,11 +208,11 @@
...
@@ -198,11 +208,11 @@
})(
Spine
.
Model
);
})(
Spine
.
Model
);
Deck
=
(
function
(
_super
)
{
Deck
=
(
function
(
_super
)
{
__extends
(
Deck
,
_super
);
__extends
(
Deck
,
_super
);
function
Deck
()
{
function
Deck
()
{
return
Deck
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
_ref2
=
Deck
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
return
_ref2
;
}
}
Deck
.
configure
(
'
Deck
'
,
'
name
'
);
Deck
.
configure
(
'
Deck
'
,
'
name
'
);
...
@@ -212,11 +222,12 @@
...
@@ -212,11 +222,12 @@
Deck
.
key
=
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789*-=
"
;
Deck
.
key
=
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789*-=
"
;
Deck
.
prototype
.
encode
=
function
()
{
Deck
.
prototype
.
encode
=
function
()
{
var
c
,
card_usage
,
i
,
result
,
_i
,
_j
,
_len
,
_ref
;
var
c
,
card_usage
,
i
,
result
,
_i
,
_j
,
_len
,
_ref3
;
result
=
''
;
result
=
''
;
_ref
=
this
.
card_usages
().
all
();
_ref
3
=
this
.
card_usages
().
all
();
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
3
.
length
;
_i
<
_len
;
_i
++
)
{
card_usage
=
_ref
[
_i
];
card_usage
=
_ref
3
[
_i
];
c
=
card_usage
.
side
<<
29
|
card_usage
.
count
<<
27
|
card_usage
.
card_id
;
c
=
card_usage
.
side
<<
29
|
card_usage
.
count
<<
27
|
card_usage
.
card_id
;
for
(
i
=
_j
=
4
;
_j
>=
0
;
i
=
--
_j
)
{
for
(
i
=
_j
=
4
;
_j
>=
0
;
i
=
--
_j
)
{
result
+=
Deck
.
key
.
charAt
((
c
>>
i
*
6
)
&
0x3F
);
result
+=
Deck
.
key
.
charAt
((
c
>>
i
*
6
)
&
0x3F
);
...
@@ -226,7 +237,8 @@
...
@@ -226,7 +237,8 @@
};
};
Deck
.
prototype
.
sort
=
function
()
{
Deck
.
prototype
.
sort
=
function
()
{
var
card
,
card_type
,
card_usage
,
category
,
_i
,
_j
,
_len
,
_len1
,
_ref
,
_ref1
,
_results
;
var
card
,
card_type
,
card_usage
,
category
,
_i
,
_j
,
_len
,
_len1
,
_ref3
,
_ref4
,
_results
;
this
.
_main
=
[];
this
.
_main
=
[];
this
.
_side
=
[];
this
.
_side
=
[];
this
.
_extra
=
[];
this
.
_extra
=
[];
...
@@ -234,25 +246,26 @@
...
@@ -234,25 +246,26 @@
this
.
_side_count
=
0
;
this
.
_side_count
=
0
;
this
.
_extra_count
=
0
;
this
.
_extra_count
=
0
;
this
.
_category_count
=
{};
this
.
_category_count
=
{};
_ref
=
Card
.
categories
;
_ref
3
=
Card
.
categories
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
3
.
length
;
_i
<
_len
;
_i
++
)
{
category
=
_ref
[
_i
];
category
=
_ref
3
[
_i
];
this
.
_category_count
[
category
]
=
0
;
this
.
_category_count
[
category
]
=
0
;
}
}
_ref
1
=
this
.
card_usages
().
all
();
_ref
4
=
this
.
card_usages
().
all
();
_results
=
[];
_results
=
[];
for
(
_j
=
0
,
_len1
=
_ref
1
.
length
;
_j
<
_len1
;
_j
++
)
{
for
(
_j
=
0
,
_len1
=
_ref
4
.
length
;
_j
<
_len1
;
_j
++
)
{
card_usage
=
_ref
1
[
_j
];
card_usage
=
_ref
4
[
_j
];
card
=
card_usage
.
card
();
card
=
card_usage
.
card
();
if
(
card_usage
.
side
)
{
if
(
card_usage
.
side
)
{
this
.
_side
.
push
(
card_usage
);
this
.
_side
.
push
(
card_usage
);
_results
.
push
(
this
.
_side_count
+=
card_usage
.
count
);
_results
.
push
(
this
.
_side_count
+=
card_usage
.
count
);
}
else
if
(((
function
()
{
}
else
if
(((
function
()
{
var
_k
,
_len2
,
_ref2
,
_results1
;
var
_k
,
_len2
,
_ref5
,
_results1
;
_ref2
=
card
.
card_type
;
_ref5
=
card
.
card_type
;
_results1
=
[];
_results1
=
[];
for
(
_k
=
0
,
_len2
=
_ref
2
.
length
;
_k
<
_len2
;
_k
++
)
{
for
(
_k
=
0
,
_len2
=
_ref
5
.
length
;
_k
<
_len2
;
_k
++
)
{
card_type
=
_ref
2
[
_k
];
card_type
=
_ref
5
[
_k
];
if
(
__indexOf
.
call
(
Card
.
card_types_extra
,
card_type
)
>=
0
)
{
if
(
__indexOf
.
call
(
Card
.
card_types_extra
,
card_type
)
>=
0
)
{
_results1
.
push
(
card_type
);
_results1
.
push
(
card_type
);
}
}
...
@@ -265,11 +278,12 @@
...
@@ -265,11 +278,12 @@
this
.
_main
.
push
(
card_usage
);
this
.
_main
.
push
(
card_usage
);
this
.
_main_count
+=
card_usage
.
count
;
this
.
_main_count
+=
card_usage
.
count
;
_results
.
push
(
this
.
_category_count
[((
function
()
{
_results
.
push
(
this
.
_category_count
[((
function
()
{
var
_k
,
_len2
,
_ref2
,
_results1
;
var
_k
,
_len2
,
_ref5
,
_results1
;
_ref2
=
card
.
card_type
;
_ref5
=
card
.
card_type
;
_results1
=
[];
_results1
=
[];
for
(
_k
=
0
,
_len2
=
_ref
2
.
length
;
_k
<
_len2
;
_k
++
)
{
for
(
_k
=
0
,
_len2
=
_ref
5
.
length
;
_k
<
_len2
;
_k
++
)
{
category
=
_ref
2
[
_k
];
category
=
_ref
5
[
_k
];
if
(
__indexOf
.
call
(
Card
.
categories
,
category
)
>=
0
)
{
if
(
__indexOf
.
call
(
Card
.
categories
,
category
)
>=
0
)
{
_results1
.
push
(
category
);
_results1
.
push
(
category
);
}
}
...
@@ -282,28 +296,28 @@
...
@@ -282,28 +296,28 @@
};
};
Deck
.
prototype
.
main
=
function
()
{
Deck
.
prototype
.
main
=
function
()
{
if
(
!
(
this
.
_main
!=
null
)
)
{
if
(
this
.
_main
==
null
)
{
this
.
sort
();
this
.
sort
();
}
}
return
this
.
_main
;
return
this
.
_main
;
};
};
Deck
.
prototype
.
side
=
function
()
{
Deck
.
prototype
.
side
=
function
()
{
if
(
!
(
this
.
_side
!=
null
)
)
{
if
(
this
.
_side
==
null
)
{
this
.
sort
();
this
.
sort
();
}
}
return
this
.
_side
;
return
this
.
_side
;
};
};
Deck
.
prototype
.
extra
=
function
()
{
Deck
.
prototype
.
extra
=
function
()
{
if
(
!
(
this
.
_extra
!=
null
)
)
{
if
(
this
.
_extra
==
null
)
{
this
.
sort
();
this
.
sort
();
}
}
return
this
.
_extra
;
return
this
.
_extra
;
};
};
Deck
.
prototype
.
main_count
=
function
()
{
Deck
.
prototype
.
main_count
=
function
()
{
if
(
!
(
this
.
_main_count
!=
null
)
)
{
if
(
this
.
_main_count
==
null
)
{
this
.
sort
();
this
.
sort
();
}
}
return
this
.
_main_count
;
return
this
.
_main_count
;
...
@@ -324,24 +338,25 @@
...
@@ -324,24 +338,25 @@
};
};
Deck
.
prototype
.
category_count
=
function
()
{
Deck
.
prototype
.
category_count
=
function
()
{
if
(
!
(
this
.
_category_count
!=
null
)
)
{
if
(
this
.
_category_count
==
null
)
{
this
.
sort
();
this
.
sort
();
}
}
return
this
.
_category_count
;
return
this
.
_category_count
;
};
};
Deck
.
decode
=
function
(
str
,
name
)
{
Deck
.
decode
=
function
(
str
,
name
)
{
var
card_id
,
card_usages
,
char
,
count
,
decoded
,
i
,
result
,
side
,
_i
,
_j
,
_len
,
_ref
,
_ref1
;
var
card_id
,
card_usages
,
char
,
count
,
decoded
,
i
,
result
,
side
,
_i
,
_j
,
_len
,
_ref3
,
_ref4
;
result
=
new
Deck
({
result
=
new
Deck
({
name
:
name
name
:
name
});
});
result
.
save
();
result
.
save
();
card_usages
=
[];
card_usages
=
[];
for
(
i
=
_i
=
0
,
_ref
=
str
.
length
;
_i
<
_ref
;
i
=
_i
+=
5
)
{
for
(
i
=
_i
=
0
,
_ref
3
=
str
.
length
;
_i
<
_ref3
;
i
=
_i
+=
5
)
{
decoded
=
0
;
decoded
=
0
;
_ref
1
=
str
.
substr
(
i
,
5
);
_ref
4
=
str
.
substr
(
i
,
5
);
for
(
_j
=
0
,
_len
=
_ref
1
.
length
;
_j
<
_len
;
_j
++
)
{
for
(
_j
=
0
,
_len
=
_ref
4
.
length
;
_j
<
_len
;
_j
++
)
{
char
=
_ref
1
[
_j
];
char
=
_ref
4
[
_j
];
decoded
=
(
decoded
<<
6
)
+
this
.
key
.
indexOf
(
char
);
decoded
=
(
decoded
<<
6
)
+
this
.
key
.
indexOf
(
char
);
}
}
side
=
decoded
>>
29
;
side
=
decoded
>>
29
;
...
@@ -360,6 +375,7 @@
...
@@ -360,6 +375,7 @@
Deck
.
load
=
function
(
str
,
name
)
{
Deck
.
load
=
function
(
str
,
name
)
{
var
card_id
,
card_usages
,
count
,
last_id
,
line
,
lines
,
result
,
side
,
_i
,
_len
;
var
card_id
,
card_usages
,
count
,
last_id
,
line
,
lines
,
result
,
side
,
_i
,
_len
;
result
=
new
Deck
({
result
=
new
Deck
({
name
:
name
name
:
name
});
});
...
@@ -438,7 +454,8 @@
...
@@ -438,7 +454,8 @@
};
};
Deck
.
prototype
.
add
=
function
(
card_usage
)
{
Deck
.
prototype
.
add
=
function
(
card_usage
)
{
var
c
,
count
,
_i
,
_len
,
_ref
;
var
c
,
count
,
_i
,
_len
,
_ref3
;
if
(
!
card_usage
.
card_id
)
{
if
(
!
card_usage
.
card_id
)
{
card_usage
=
this
.
card_usages
().
findByAttribute
(
'
card_id
'
,
card
.
id
)
||
new
CardUsage
({
card_usage
=
this
.
card_usages
().
findByAttribute
(
'
card_id
'
,
card
.
id
)
||
new
CardUsage
({
card_id
:
card_usage
.
id
,
card_id
:
card_usage
.
id
,
...
@@ -448,9 +465,9 @@
...
@@ -448,9 +465,9 @@
});
});
}
}
count
=
0
;
count
=
0
;
_ref
=
this
.
card_usages
().
findAllByAttribute
(
'
card_id
'
,
card_usage
.
card_id
);
_ref
3
=
this
.
card_usages
().
findAllByAttribute
(
'
card_id
'
,
card_usage
.
card_id
);
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
3
.
length
;
_i
<
_len
;
_i
++
)
{
c
=
_ref
[
_i
];
c
=
_ref
3
[
_i
];
count
+=
c
.
count
;
count
+=
c
.
count
;
}
}
if
(
count
<
3
)
{
if
(
count
<
3
)
{
...
@@ -479,14 +496,12 @@
...
@@ -479,14 +496,12 @@
})(
Spine
.
Model
);
})(
Spine
.
Model
);
DecksController
=
(
function
(
_super
)
{
DecksController
=
(
function
(
_super
)
{
__extends
(
DecksController
,
_super
);
__extends
(
DecksController
,
_super
);
function
DecksController
()
{
function
DecksController
()
{
this
.
render
=
__bind
(
this
.
render
,
this
);
this
.
render
=
__bind
(
this
.
render
,
this
);
this
.
refresh
=
__bind
(
this
.
refresh
,
this
);
_ref3
=
DecksController
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
this
.
refresh
=
__bind
(
this
.
refresh
,
this
);
return
_ref3
;
return
DecksController
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
}
}
DecksController
.
prototype
.
events
=
{
DecksController
.
prototype
.
events
=
{
...
@@ -508,12 +523,14 @@
...
@@ -508,12 +523,14 @@
DecksController
.
prototype
.
refresh
=
function
()
{
DecksController
.
prototype
.
refresh
=
function
()
{
var
card_usage
,
var
card_usage
,
_this
=
this
;
_this
=
this
;
return
Card
.
fetch_by_id
((
function
()
{
return
Card
.
fetch_by_id
((
function
()
{
var
_i
,
_len
,
_ref
,
_results
;
var
_i
,
_len
,
_ref4
,
_results
;
_ref
=
this
.
deck
().
card_usages
().
all
();
_ref4
=
this
.
deck
().
card_usages
().
all
();
_results
=
[];
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
4
.
length
;
_i
<
_len
;
_i
++
)
{
card_usage
=
_ref
[
_i
];
card_usage
=
_ref
4
[
_i
];
_results
.
push
(
card_usage
.
card_id
);
_results
.
push
(
card_usage
.
card_id
);
}
}
return
_results
;
return
_results
;
...
@@ -527,6 +544,7 @@
...
@@ -527,6 +544,7 @@
DecksController
.
prototype
.
render
=
function
()
{
DecksController
.
prototype
.
render
=
function
()
{
var
card_width
,
deck_width
,
extra_margin
,
main_margin
,
side_margin
;
var
card_width
,
deck_width
,
extra_margin
,
main_margin
,
side_margin
;
this
.
html
(
$
(
'
#deck_template
'
).
tmpl
({
this
.
html
(
$
(
'
#deck_template
'
).
tmpl
({
main
:
this
.
deck
().
main
(),
main
:
this
.
deck
().
main
(),
side
:
this
.
deck
().
side
(),
side
:
this
.
deck
().
side
(),
...
@@ -539,25 +557,25 @@
...
@@ -539,25 +557,25 @@
this
.
set_history
();
this
.
set_history
();
this
.
set_download
();
this
.
set_download
();
/*
/*
$( ".deck_part" ).sortable(
$( ".deck_part" ).sortable(
connectWith: ".deck_part"
connectWith: ".deck_part"
stop: =>
stop: =>
card_usages = []
card_usages = []
last_item = null
last_item = null
for el in $('.card_usage')
for el in $('.card_usage')
card_id = $(el).tmplItem().data.card_id
card_id = $(el).tmplItem().data.card_id
side = $(el).parent().hasClass('side')
side = $(el).parent().hasClass('side')
if last_item
if last_item
if last_item.card_id == card_id and last_item.side == side
if last_item.card_id == card_id and last_item.side == side
last_item.count++
last_item.count++
else
else
card_usages.push last_item
card_usages.push last_item
last_item = {card_id: card_id, side: side, count: 1}
last_item = {card_id: card_id, side: side, count: 1}
else
else
last_item = {card_id: card_id, side: side, count: 1}
last_item = {card_id: card_id, side: side, count: 1}
card_usages.push last_item
card_usages.push last_item
@deck().card_usages card_usages, clear: true
@deck().card_usages card_usages, clear: true
).disableSelection();
).disableSelection();
*/
*/
if
(
$
(
'
.operate_area
'
).
hasClass
(
'
text
'
))
{
if
(
$
(
'
.operate_area
'
).
hasClass
(
'
text
'
))
{
...
@@ -602,16 +620,20 @@
...
@@ -602,16 +620,20 @@
DecksController
.
prototype
.
upload
=
function
(
files
)
{
DecksController
.
prototype
.
upload
=
function
(
files
)
{
var
file
,
reader
;
var
file
,
reader
;
file
=
files
[
0
];
file
=
files
[
0
];
reader
=
new
FileReader
();
reader
=
new
FileReader
();
if
(
file
)
{
if
(
file
)
{
$
(
'
#deck_load
'
).
attr
(
'
disabled
'
,
true
);
$
(
'
#deck_load
'
).
attr
(
'
disabled
'
,
true
);
}
}
reader
.
onload
=
function
(
ev
)
{
reader
.
onload
=
function
(
ev
)
{
var
error
;
$
(
'
#deck_load
'
).
attr
(
'
disabled
'
,
false
);
$
(
'
#deck_load
'
).
attr
(
'
disabled
'
,
false
);
try
{
try
{
return
decks
.
deck
(
Deck
.
load
(
ev
.
target
.
result
,
file
.
name
.
split
(
'
.
'
)[
0
]));
return
decks
.
deck
(
Deck
.
load
(
ev
.
target
.
result
,
file
.
name
.
split
(
'
.
'
)[
0
]));
}
catch
(
error
)
{
}
catch
(
_error
)
{
error
=
_error
;
return
alert
(
error
);
return
alert
(
error
);
}
}
};
};
...
@@ -619,9 +641,12 @@
...
@@ -619,9 +641,12 @@
};
};
DecksController
.
prototype
.
load_from_url
=
function
(
url
)
{
DecksController
.
prototype
.
load_from_url
=
function
(
url
)
{
var
error
;
try
{
try
{
return
decks
.
deck
(
Deck
.
decode
(
$
.
url
(
url
).
param
(
'
cards
'
),
$
.
url
().
param
(
'
name
'
)));
return
decks
.
deck
(
Deck
.
decode
(
$
.
url
(
url
).
param
(
'
cards
'
),
$
.
url
().
param
(
'
name
'
)));
}
catch
(
error
)
{
}
catch
(
_error
)
{
error
=
_error
;
return
alert
(
error
);
return
alert
(
error
);
}
}
};
};
...
@@ -634,18 +659,21 @@
...
@@ -634,18 +659,21 @@
DecksController
.
prototype
.
set_download
=
function
()
{
DecksController
.
prototype
.
set_download
=
function
()
{
var
card_usage
,
i
;
var
card_usage
,
i
;
if
(
$
.
browser
.
chrome
)
{
if
(
$
.
browser
.
chrome
)
{
$
(
'
#deck_url_ydk
'
).
attr
(
'
download
'
,
this
.
deck
().
name
+
'
.ydk
'
);
$
(
'
#deck_url_ydk
'
).
attr
(
'
download
'
,
this
.
deck
().
name
+
'
.ydk
'
);
$
(
'
#deck_url_ydk
'
).
attr
(
'
href
'
,
'
data:application/x-ygopro-deck,
'
+
encodeURI
([
"
#generated by mycard/web
"
].
concat
((
function
()
{
$
(
'
#deck_url_ydk
'
).
attr
(
'
href
'
,
'
data:application/x-ygopro-deck,
'
+
encodeURI
([
"
#generated by mycard/web
"
].
concat
((
function
()
{
var
_i
,
_len
,
_ref
,
_results
;
var
_i
,
_len
,
_ref4
,
_results
;
_ref
=
this
.
deck
().
main
();
_ref4
=
this
.
deck
().
main
();
_results
=
[];
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
4
.
length
;
_i
<
_len
;
_i
++
)
{
card_usage
=
_ref
[
_i
];
card_usage
=
_ref
4
[
_i
];
_results
.
push
(((
function
()
{
_results
.
push
(((
function
()
{
var
_j
,
_ref1
,
_results1
;
var
_j
,
_ref5
,
_results1
;
_results1
=
[];
_results1
=
[];
for
(
i
=
_j
=
0
,
_ref
1
=
card_usage
.
count
;
0
<=
_ref1
?
_j
<
_ref1
:
_j
>
_ref1
;
i
=
0
<=
_ref1
?
++
_j
:
--
_j
)
{
for
(
i
=
_j
=
0
,
_ref
5
=
card_usage
.
count
;
0
<=
_ref5
?
_j
<
_ref5
:
_j
>
_ref5
;
i
=
0
<=
_ref5
?
++
_j
:
--
_j
)
{
_results1
.
push
(
card_usage
.
card_id
);
_results1
.
push
(
card_usage
.
card_id
);
}
}
return
_results1
;
return
_results1
;
...
@@ -653,15 +681,17 @@
...
@@ -653,15 +681,17 @@
}
}
return
_results
;
return
_results
;
}).
call
(
this
),
(
function
()
{
}).
call
(
this
),
(
function
()
{
var
_i
,
_len
,
_ref
,
_results
;
var
_i
,
_len
,
_ref4
,
_results
;
_ref
=
this
.
deck
().
extra
();
_ref4
=
this
.
deck
().
extra
();
_results
=
[];
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
4
.
length
;
_i
<
_len
;
_i
++
)
{
card_usage
=
_ref
[
_i
];
card_usage
=
_ref
4
[
_i
];
_results
.
push
(((
function
()
{
_results
.
push
(((
function
()
{
var
_j
,
_ref1
,
_results1
;
var
_j
,
_ref5
,
_results1
;
_results1
=
[];
_results1
=
[];
for
(
i
=
_j
=
0
,
_ref
1
=
card_usage
.
count
;
0
<=
_ref1
?
_j
<
_ref1
:
_j
>
_ref1
;
i
=
0
<=
_ref1
?
++
_j
:
--
_j
)
{
for
(
i
=
_j
=
0
,
_ref
5
=
card_usage
.
count
;
0
<=
_ref5
?
_j
<
_ref5
:
_j
>
_ref5
;
i
=
0
<=
_ref5
?
++
_j
:
--
_j
)
{
_results1
.
push
(
card_usage
.
card_id
);
_results1
.
push
(
card_usage
.
card_id
);
}
}
return
_results1
;
return
_results1
;
...
@@ -669,15 +699,17 @@
...
@@ -669,15 +699,17 @@
}
}
return
_results
;
return
_results
;
}).
call
(
this
),
[
"
!side
"
],
(
function
()
{
}).
call
(
this
),
[
"
!side
"
],
(
function
()
{
var
_i
,
_len
,
_ref
,
_results
;
var
_i
,
_len
,
_ref4
,
_results
;
_ref
=
this
.
deck
().
side
();
_ref4
=
this
.
deck
().
side
();
_results
=
[];
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
4
.
length
;
_i
<
_len
;
_i
++
)
{
card_usage
=
_ref
[
_i
];
card_usage
=
_ref
4
[
_i
];
_results
.
push
(((
function
()
{
_results
.
push
(((
function
()
{
var
_j
,
_ref1
,
_results1
;
var
_j
,
_ref5
,
_results1
;
_results1
=
[];
_results1
=
[];
for
(
i
=
_j
=
0
,
_ref
1
=
card_usage
.
count
;
0
<=
_ref1
?
_j
<
_ref1
:
_j
>
_ref1
;
i
=
0
<=
_ref1
?
++
_j
:
--
_j
)
{
for
(
i
=
_j
=
0
,
_ref
5
=
card_usage
.
count
;
0
<=
_ref5
?
_j
<
_ref5
:
_j
>
_ref5
;
i
=
0
<=
_ref5
?
++
_j
:
--
_j
)
{
_results1
.
push
(
card_usage
.
card_id
);
_results1
.
push
(
card_usage
.
card_id
);
}
}
return
_results1
;
return
_results1
;
...
@@ -694,6 +726,7 @@
...
@@ -694,6 +726,7 @@
DecksController
.
prototype
.
tab_control
=
function
()
{
DecksController
.
prototype
.
tab_control
=
function
()
{
$
(
"
.bottom_area div
"
).
click
(
function
()
{
$
(
"
.bottom_area div
"
).
click
(
function
()
{
var
$dangqian
;
var
$dangqian
;
$
(
this
).
addClass
(
"
bottom_button_active
"
).
removeClass
(
"
bottom_button
"
);
$
(
this
).
addClass
(
"
bottom_button_active
"
).
removeClass
(
"
bottom_button
"
);
$
(
this
).
siblings
().
addClass
(
"
bottom_button
"
).
removeClass
(
"
bottom_button_active
"
);
$
(
this
).
siblings
().
addClass
(
"
bottom_button
"
).
removeClass
(
"
bottom_button_active
"
);
$dangqian
=
$
(
"
.card_frame .frame_element
"
).
eq
(
$
(
"
.bottom_area div
"
).
index
(
this
));
$dangqian
=
$
(
"
.card_frame .frame_element
"
).
eq
(
$
(
"
.bottom_area div
"
).
index
(
this
));
...
@@ -710,6 +743,7 @@
...
@@ -710,6 +743,7 @@
DecksController
.
prototype
.
show
=
function
(
e
)
{
DecksController
.
prototype
.
show
=
function
(
e
)
{
var
active_page_index
,
card
;
var
active_page_index
,
card
;
card
=
$
(
e
.
target
).
tmplItem
().
data
;
card
=
$
(
e
.
target
).
tmplItem
().
data
;
if
(
card
.
card_id
)
{
if
(
card
.
card_id
)
{
card
=
card
.
card
();
card
=
card
.
card
();
...
@@ -737,11 +771,11 @@
...
@@ -737,11 +771,11 @@
})(
Spine
.
Controller
);
})(
Spine
.
Controller
);
CardsController
=
(
function
(
_super
)
{
CardsController
=
(
function
(
_super
)
{
__extends
(
CardsController
,
_super
);
__extends
(
CardsController
,
_super
);
function
CardsController
()
{
function
CardsController
()
{
return
CardsController
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
_ref4
=
CardsController
.
__super__
.
constructor
.
apply
(
this
,
arguments
);
return
_ref4
;
}
}
CardsController
.
prototype
.
events
=
{
CardsController
.
prototype
.
events
=
{
...
@@ -769,8 +803,40 @@
...
@@ -769,8 +803,40 @@
CardsController
.
prototype
.
search
=
function
(
name
)
{
CardsController
.
prototype
.
search
=
function
(
name
)
{
var
_this
=
this
;
var
_this
=
this
;
return
Card
.
fetch_by_name
(
name
,
function
(
cards
)
{
return
Card
.
fetch_by_name
(
name
,
function
(
cards
)
{
return
_this
.
html
(
_this
.
template
().
tmpl
(
cards
));
var
card
,
category
,
category_count
,
_i
,
_j
,
_len
,
_len1
,
_ref5
;
category_count
=
{};
_ref5
=
Card
.
categories
;
for
(
_i
=
0
,
_len
=
_ref5
.
length
;
_i
<
_len
;
_i
++
)
{
category
=
_ref5
[
_i
];
category_count
[
category
]
=
0
;
}
for
(
_j
=
0
,
_len1
=
cards
.
length
;
_j
<
_len1
;
_j
++
)
{
card
=
cards
[
_j
];
category_count
[((
function
()
{
var
_k
,
_len2
,
_ref6
,
_results
;
_ref6
=
card
.
card_type
;
_results
=
[];
for
(
_k
=
0
,
_len2
=
_ref6
.
length
;
_k
<
_len2
;
_k
++
)
{
category
=
_ref6
[
_k
];
if
(
__indexOf
.
call
(
Card
.
categories
,
category
)
>=
0
)
{
_results
.
push
(
category
);
}
}
return
_results
;
})()).
pop
()]
++
;
}
$
(
"
#search_cards_spells_count
"
).
html
(
category_count
.
Spell
);
$
(
"
#search_cards_traps_count
"
).
html
(
category_count
.
Trap
);
$
(
"
#search_cards_monsters_count
"
).
html
(
category_count
.
Monster
);
_this
.
html
(
_this
.
template
().
tmpl
(
cards
));
return
_this
.
el
.
easyPaginate
({
step
:
7
,
delay
:
30
});
});
});
};
};
...
@@ -795,7 +861,6 @@
...
@@ -795,7 +861,6 @@
$
(
"
#deck_share_dialog
"
).
dialog
({
$
(
"
#deck_share_dialog
"
).
dialog
({
modal
:
true
,
modal
:
true
,
autoOpen
:
false
,
autoOpen
:
false
,
width
:
600
,
open
:
function
()
{
open
:
function
()
{
$
(
"
#deck_url
"
).
val
(
decks
.
deck
().
url
());
$
(
"
#deck_url
"
).
val
(
decks
.
deck
().
url
());
$
(
"
#deck_url
"
)[
0
].
select
();
$
(
"
#deck_url
"
)[
0
].
select
();
...
@@ -844,7 +909,7 @@
...
@@ -844,7 +909,7 @@
$
(
"
#drop_upload_dialog
"
).
dialog
(
'
close
'
);
$
(
"
#drop_upload_dialog
"
).
dialog
(
'
close
'
);
return
decks
.
upload
(
event
.
dataTransfer
.
files
);
return
decks
.
upload
(
event
.
dataTransfer
.
files
);
});
});
$
(
"
.
swith
"
).
click
(
function
()
{
$
(
"
.
rename_ope
"
).
click
(
function
()
{
$
(
"
.text,.graphic
"
).
toggleClass
(
"
graphic text
"
);
$
(
"
.text,.graphic
"
).
toggleClass
(
"
graphic text
"
);
return
decks
.
render
();
return
decks
.
render
();
});
});
...
...
assets/stylesheets/decks.less
View file @
759301b2
...
@@ -104,17 +104,15 @@ body{margin:0;padding:0;background:#eee;}
...
@@ -104,17 +104,15 @@ body{margin:0;padding:0;background:#eee;}
label{float:left;}
label{float:left;}
}
}
}
}
.page
{
#pagination
{
max-width:518px;height:60px;padding:20px 15px 0 0;text-align:right;
max-width:518px;height:60px;padding:20px 15px 0 0;text-align:right;
float:right;
a{margin:0 4px;}
a{margin:0 4px;}
}
li{
.page_home{background:url('/assets/images/decks/page_arrows.gif') -26px 0 no-repeat;width:23px;height:17px;display:block;float:left;}
display:block;float:left;height:17px;line-height:17px;width:16px;font-size:14px;color:#999;text-decoration:none;text-align:center;
.page_pre{background:url('/assets/images/decks/page_arrows.gif') -1px 0 no-repeat;width:13px;height:17px;display:block;float:left;}
&:hover{text-decoration:underline;}
.page_next{background:url('/assets/images/decks/page_arrows.gif') -13px 0 no-repeat;width:13px;height:17px;display:block;float:left;}
}
.page_last{background:url('/assets/images/decks/page_arrows.gif') -47px 0 no-repeat;width:23px;height:17px;display:block;float:left;}
.next{background:url('/assets/images/decks/page_arrows.gif') -13px 0 no-repeat;width:13px;height:17px;display:block;float:left;font-size: 0px;}
.page_num{
.prev{background:url('/assets/images/decks/page_arrows.gif') -1px 0 no-repeat;width:13px;height:17px;display:block;float:left;font-size: 0px;}
display:block;float:left;height:17px;line-height:17px;width:16px;font-size:14px;color:#999;text-decoration:none;text-align:center;
&:hover{text-decoration:underline;}
}
}
.card_group{
.card_group{
height:565px;//width:150px;
height:565px;//width:150px;
...
@@ -237,7 +235,7 @@ body{margin:0;padding:0;background:#eee;}
...
@@ -237,7 +235,7 @@ body{margin:0;padding:0;background:#eee;}
}
}
span{font-size:12px;}
span{font-size:12px;}
}
}
.page
{
#pagination
{
padding:20px 5px 0 0;
padding:20px 5px 0 0;
a{margin:0 2px;}
a{margin:0 2px;}
}
}
...
...
decks/new/index.html
View file @
759301b2
...
@@ -442,22 +442,13 @@
...
@@ -442,22 +442,13 @@
<!-- 修改 -->
<!-- 修改 -->
<div
class=
"floatleft search_results"
>
<div
class=
"floatleft search_results"
>
<span
style=
"color:#3366CC;font-weight:bold;"
>
结果数
</span>
<span
style=
"color:#3366CC;font-weight:bold;"
>
结果数
</span>
魔法:
<span
style=
"color:#FFAD6E;"
>
XXX
</span>
魔法:
<span
id=
"search_cards_spells_count"
style=
"color:#FFAD6E;"
>
-
</span>
陷阱:
<span
style=
"color:#FFAD6E;"
>
XXX
</span>
陷阱:
<span
id=
"search_cards_traps_count"
style=
"color:#FFAD6E;"
>
-
</span>
怪兽:
<span
style=
"color:#FFAD6E;"
>
XXX
</span>
怪兽:
<span
id=
"search_cards_monsters_count"
style=
"color:#FFAD6E;"
>
-
</span>
</div>
</div>
</div>
</div>
<div
class=
"floatleft main_area"
id=
"search_cards"
></div>
<div
class=
"floatleft main_area"
id=
"search_cards"
></div>
<div
class=
"floatright page"
>
<a
class=
"page_home"
href=
""
></a>
<a
class=
"page_pre"
href=
""
></a>
<a
class=
"page_num"
href=
""
>
9
</a>
<a
class=
"page_num"
href=
""
>
10
</a>
<a
class=
"page_num"
href=
""
>
11
</a>
<a
class=
"page_next"
href=
""
></a>
<a
class=
"page_last"
href=
""
></a>
</div>
<!--{"archetypes":"","card_type":"\u6548\u679c\u602a\u517d","id":2067,"lore":"\u8fd9\u5f20\u5361\u653b\u51fb\u7684\u573a\u5408\uff0c\u5bf9\u65b9\u76f4\u5230\u4f24\u5bb3\u6b65\u9aa4\u7ed3\u675f\u65f6\u4e0d\u80fd\u53d1\u52a8\u9b54\u6cd5\u00b7\u9677\u9631\u5361\u3002\u7528\u4ee5\u4e0b\u7684\u602a\u517d\u4e3a\u796d\u54c1\u4f5c\u796d\u54c1\u53ec\u5524\u7684\u573a\u5408\uff0c\u8fd9\u5f20\u5361\u5f97\u5230\u5404\u81ea\u7684\u6548\u679c\u3002\u25cf\u7eff\u9f7f\u8f6e\uff1a\u8fd9\u5f20\u5361\u653b\u51fb\u5b88\u5907\u8868\u793a\u602a\u517d\u65f6\uff0c\u82e5\u8fd9\u5f20\u5361\u7684\u653b\u51fb\u529b\u8d85\u8fc7\u5b88\u5907\u8868\u793a\u602a\u517d\u7684\u5b88\u5907\u529b\uff0c\u7ed9\u4e88\u5bf9\u65b9\u57fa\u672c\u5206\u90a3\u4e2a\u6570\u503c\u7684\u6218\u6597\u4f24\u5bb3\u3002\u25cf\u7ea2\u9f7f\u8f6e\uff1a\u7ed9\u4e88\u5bf9\u65b9\u73a9\u5bb6\u6218\u6597\u4f24\u5bb3\u65f6\uff0c\u7ed9\u4e88\u5bf9\u65b9\u57fa\u672c\u5206400\u5206\u4f24\u5bb3\u3002\u25cf\u9ec4\u9f7f\u8f6e\uff1a\u6218\u6597\u7834\u574f\u5bf9\u65b9\u602a\u517d\u7684\u573a\u5408\uff0c\u7ed9\u4e88\u5bf9\u65b9\u57fa\u672c\u5206600\u5206\u4f24\u5bb3\u3002","mediums":"OCG\tTCG","monster_atk":3000,"monster_attribute":"\u5730","monster_def":2000,"monster_level":8,"monster_type":null,"name":"\u53e4\u4ee3\u7684\u673a\u68b0\u5de8\u9f99","number":50933533,"stats":"21,26,37","status":3,"tokens":0,"type":"\u673a\u68b0"} -->
<!--{"archetypes":"","card_type":"\u6548\u679c\u602a\u517d","id":2067,"lore":"\u8fd9\u5f20\u5361\u653b\u51fb\u7684\u573a\u5408\uff0c\u5bf9\u65b9\u76f4\u5230\u4f24\u5bb3\u6b65\u9aa4\u7ed3\u675f\u65f6\u4e0d\u80fd\u53d1\u52a8\u9b54\u6cd5\u00b7\u9677\u9631\u5361\u3002\u7528\u4ee5\u4e0b\u7684\u602a\u517d\u4e3a\u796d\u54c1\u4f5c\u796d\u54c1\u53ec\u5524\u7684\u573a\u5408\uff0c\u8fd9\u5f20\u5361\u5f97\u5230\u5404\u81ea\u7684\u6548\u679c\u3002\u25cf\u7eff\u9f7f\u8f6e\uff1a\u8fd9\u5f20\u5361\u653b\u51fb\u5b88\u5907\u8868\u793a\u602a\u517d\u65f6\uff0c\u82e5\u8fd9\u5f20\u5361\u7684\u653b\u51fb\u529b\u8d85\u8fc7\u5b88\u5907\u8868\u793a\u602a\u517d\u7684\u5b88\u5907\u529b\uff0c\u7ed9\u4e88\u5bf9\u65b9\u57fa\u672c\u5206\u90a3\u4e2a\u6570\u503c\u7684\u6218\u6597\u4f24\u5bb3\u3002\u25cf\u7ea2\u9f7f\u8f6e\uff1a\u7ed9\u4e88\u5bf9\u65b9\u73a9\u5bb6\u6218\u6597\u4f24\u5bb3\u65f6\uff0c\u7ed9\u4e88\u5bf9\u65b9\u57fa\u672c\u5206400\u5206\u4f24\u5bb3\u3002\u25cf\u9ec4\u9f7f\u8f6e\uff1a\u6218\u6597\u7834\u574f\u5bf9\u65b9\u602a\u517d\u7684\u573a\u5408\uff0c\u7ed9\u4e88\u5bf9\u65b9\u57fa\u672c\u5206600\u5206\u4f24\u5bb3\u3002","mediums":"OCG\tTCG","monster_atk":3000,"monster_attribute":"\u5730","monster_def":2000,"monster_level":8,"monster_type":null,"name":"\u53e4\u4ee3\u7684\u673a\u68b0\u5de8\u9f99","number":50933533,"stats":"21,26,37","status":3,"tokens":0,"type":"\u673a\u68b0"} -->
</div>
</div>
...
@@ -533,6 +524,7 @@
...
@@ -533,6 +524,7 @@
<script
src=
"/vendor/javascripts/jquery.i18n.properties-min-1.0.9.js"
></script>
<script
src=
"/vendor/javascripts/jquery.i18n.properties-min-1.0.9.js"
></script>
<script
src=
"/vendor/javascripts/jquery-ui-1.9.1.custom.min.js"
></script>
<script
src=
"/vendor/javascripts/jquery-ui-1.9.1.custom.min.js"
></script>
<script
src=
"/vendor/javascripts/jquery.base64.min.js"
></script>
<script
src=
"/vendor/javascripts/jquery.base64.min.js"
></script>
<script
src=
"/vendor/javascripts/easypaginate.js"
></script>
<script
src=
"/vendor/javascripts/hScrollPane.js"
></script>
<script
src=
"/vendor/javascripts/hScrollPane.js"
></script>
<script
src=
"/vendor/javascripts/jscroll.js"
></script>
<script
src=
"/vendor/javascripts/jscroll.js"
></script>
<script
src=
"/vendor/javascripts/json2.js"
></script>
<script
src=
"/vendor/javascripts/json2.js"
></script>
...
...
vendor/javascripts/easypaginate.js
0 → 100644
View file @
759301b2
/*
* Easy Paginate 1.0 - jQuery plugin
* written by Alen Grakalic
* http://cssglobe.com/
*
* Copyright (c) 2011 Alen Grakalic (http://cssglobe.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Built for jQuery library
* http://jquery.com
*
*/
(
function
(
$
)
{
$
.
fn
.
easyPaginate
=
function
(
options
){
var
defaults
=
{
step
:
4
,
delay
:
100
,
numeric
:
true
,
nextprev
:
true
,
auto
:
false
,
loop
:
false
,
pause
:
4000
,
clickstop
:
true
,
controls
:
'
pagination
'
,
current
:
'
current
'
,
randomstart
:
false
};
var
options
=
$
.
extend
(
defaults
,
options
);
var
step
=
options
.
step
;
var
lower
,
upper
;
var
children
=
$
(
this
).
children
();
var
count
=
children
.
length
;
var
obj
,
next
,
prev
;
var
pages
=
Math
.
floor
(
count
/
step
);
var
page
=
(
options
.
randomstart
)
?
Math
.
floor
(
Math
.
random
()
*
pages
)
+
1
:
1
;
var
timeout
;
var
clicked
=
false
;
function
show
(){
clearTimeout
(
timeout
);
lower
=
((
page
-
1
)
*
step
);
upper
=
lower
+
step
;
$
(
children
).
each
(
function
(
i
){
var
child
=
$
(
this
);
child
.
hide
();
if
(
i
>=
lower
&&
i
<
upper
){
setTimeout
(
function
(){
child
.
fadeIn
(
'
fast
'
)
},
(
i
-
(
Math
.
floor
(
i
/
step
)
*
step
)
)
*
options
.
delay
);
}
if
(
options
.
nextprev
){
if
(
upper
>=
count
)
{
next
.
fadeOut
(
'
fast
'
);
}
else
{
next
.
fadeIn
(
'
fast
'
);
};
if
(
lower
>=
1
)
{
prev
.
fadeIn
(
'
fast
'
);
}
else
{
prev
.
fadeOut
(
'
fast
'
);
};
};
});
$
(
'
li
'
,
'
#
'
+
options
.
controls
).
removeClass
(
options
.
current
);
$
(
'
li[data-index="
'
+
page
+
'
"]
'
,
'
#
'
+
options
.
controls
).
addClass
(
options
.
current
);
if
(
options
.
auto
){
if
(
options
.
clickstop
&&
clicked
){}
else
{
timeout
=
setTimeout
(
auto
,
options
.
pause
);
};
};
};
function
auto
(){
if
(
options
.
loop
)
if
(
upper
>=
count
){
page
=
0
;
show
();
}
if
(
upper
<
count
){
page
++
;
show
();
}
};
this
.
each
(
function
(){
obj
=
this
;
if
(
count
>
step
){
if
((
count
/
step
)
>
pages
)
pages
++
;
var
ol
=
$
(
'
<ol id="
'
+
options
.
controls
+
'
"></ol>
'
).
insertAfter
(
obj
);
if
(
options
.
nextprev
){
prev
=
$
(
'
<li class="prev">Previous</li>
'
)
.
hide
()
.
appendTo
(
ol
)
.
click
(
function
(){
clicked
=
true
;
page
--
;
show
();
});
};
if
(
options
.
numeric
){
for
(
var
i
=
1
;
i
<=
pages
;
i
++
){
$
(
'
<li data-index="
'
+
i
+
'
">
'
+
i
+
'
</li>
'
)
.
appendTo
(
ol
)
.
click
(
function
(){
clicked
=
true
;
page
=
$
(
this
).
attr
(
'
data-index
'
);
show
();
});
};
};
if
(
options
.
nextprev
){
next
=
$
(
'
<li class="next">Next</li>
'
)
.
hide
()
.
appendTo
(
ol
)
.
click
(
function
(){
clicked
=
true
;
page
++
;
show
();
});
};
show
();
};
});
};
})(
jQuery
);
\ No newline at end of file
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