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
72e2aa46
Commit
72e2aa46
authored
Apr 02, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
share, fix
parent
759301b2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
15 deletions
+33
-15
assets/javascripts/decks.coffee
assets/javascripts/decks.coffee
+10
-5
assets/javascripts/decks.js
assets/javascripts/decks.js
+17
-5
assets/stylesheets/decks.less
assets/stylesheets/decks.less
+3
-3
decks/new/index.html
decks/new/index.html
+3
-2
No files found.
assets/javascripts/decks.coffee
View file @
72e2aa46
...
@@ -83,7 +83,7 @@ class Deck extends Spine.Model
...
@@ -83,7 +83,7 @@ class Deck extends Spine.Model
@
configure
'Deck'
,
'name'
@
configure
'Deck'
,
'name'
@
hasMany
'card_usages'
,
CardUsage
@
hasMany
'card_usages'
,
CardUsage
@
key
:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
*-
="
@
key
:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
-_
="
encode
:
->
encode
:
->
result
=
''
result
=
''
for
card_usage
in
@
card_usages
().
all
()
for
card_usage
in
@
card_usages
().
all
()
...
@@ -207,7 +207,6 @@ class Deck extends Spine.Model
...
@@ -207,7 +207,6 @@ class Deck extends Spine.Model
card_usage
.
save
()
card_usage
.
save
()
else
else
card_usage
.
destroy
()
card_usage
.
destroy
()
class
DecksController
extends
Spine
.
Controller
class
DecksController
extends
Spine
.
Controller
events
:
events
:
'mouseover .card_usage'
:
'show'
,
'mouseover .card_usage'
:
'show'
,
...
@@ -369,6 +368,11 @@ class CardsController extends Spine.Controller
...
@@ -369,6 +368,11 @@ class CardsController extends Spine.Controller
decks
=
new
DecksController
(
el
:
$
(
"#deck"
))
decks
=
new
DecksController
(
el
:
$
(
"#deck"
))
cards
=
new
CardsController
(
el
:
$
(
"#search_cards"
))
cards
=
new
CardsController
(
el
:
$
(
"#search_cards"
))
#there is a bug in old version deck editor.
competition_convert
=
{
'*'
:
'-'
,
'-'
:
'_'
}
if
document
.
location
.
href
.
indexOf
(
'*'
)
>=
0
location
.
href
=
document
.
location
.
href
.
replace
/[\*\-]/g
,
(
char
)
->
competition_convert
[
char
]
$
(
document
).
ready
->
$
(
document
).
ready
->
decks
.
load_from_url
()
decks
.
load_from_url
()
...
@@ -379,11 +383,12 @@ $(document).ready ->
...
@@ -379,11 +383,12 @@ $(document).ready ->
#dialog
#dialog
$
(
"#deck_share_dialog"
).
dialog
$
(
"#deck_share_dialog"
).
dialog
modal
:
true
modal
:
true
autoOpen
:
false
autoOpen
:
$
.
url
().
attr
(
'fragment'
)
==
'share'
width
:
600
open
:
->
open
:
->
$
(
"#deck_url"
).
val
decks
.
deck
().
url
()
$
(
"#deck_url"
).
val
decks
.
deck
().
url
()
$
(
"#deck_url"
)[
0
].
select
()
$
(
"#deck_url"
)[
0
].
select
()
$
(
"#deck_url_qrcode"
).
attr
'src'
,
'https://chart.googleapis.com/chart?chs=
200x200
&cht=qr&chld=|0&chl='
+
encodeURIComponent
(
decks
.
deck
().
url
())
$
(
"#deck_url_qrcode"
).
attr
'src'
,
'https://chart.googleapis.com/chart?chs=
171x171
&cht=qr&chld=|0&chl='
+
encodeURIComponent
(
decks
.
deck
().
url
())
$
(
"#drop_upload_dialog"
).
dialog
$
(
"#drop_upload_dialog"
).
dialog
dialogClass
:
'drop_upload'
dialogClass
:
'drop_upload'
...
@@ -425,7 +430,7 @@ $(document).ready ->
...
@@ -425,7 +430,7 @@ $(document).ready ->
$
(
"#drop_upload_dialog"
).
dialog
(
'close'
)
$
(
"#drop_upload_dialog"
).
dialog
(
'close'
)
decks
.
upload
event
.
dataTransfer
.
files
decks
.
upload
event
.
dataTransfer
.
files
$
(
".
rename_ope
"
).
click
->
$
(
".
switch
"
).
click
->
$
(
".text,.graphic"
).
toggleClass
(
"graphic text"
)
$
(
".text,.graphic"
).
toggleClass
(
"graphic text"
)
decks
.
render
()
decks
.
render
()
...
...
assets/javascripts/decks.js
View file @
72e2aa46
// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.2
(
function
()
{
(
function
()
{
var
Card
,
CardUsage
,
CardsController
,
Deck
,
DecksController
,
cards
,
decks
,
locale
,
_ref
,
_ref1
,
_ref2
,
_ref3
,
_ref4
,
var
Card
,
CardUsage
,
CardsController
,
Deck
,
DecksController
,
cards
,
competition_convert
,
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
;
},
...
@@ -219,7 +219,7 @@
...
@@ -219,7 +219,7 @@
Deck
.
hasMany
(
'
card_usages
'
,
CardUsage
);
Deck
.
hasMany
(
'
card_usages
'
,
CardUsage
);
Deck
.
key
=
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
*-
=
"
;
Deck
.
key
=
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
-_
=
"
;
Deck
.
prototype
.
encode
=
function
()
{
Deck
.
prototype
.
encode
=
function
()
{
var
c
,
card_usage
,
i
,
result
,
_i
,
_j
,
_len
,
_ref3
;
var
c
,
card_usage
,
i
,
result
,
_i
,
_j
,
_len
,
_ref3
;
...
@@ -852,6 +852,17 @@
...
@@ -852,6 +852,17 @@
el
:
$
(
"
#search_cards
"
)
el
:
$
(
"
#search_cards
"
)
});
});
competition_convert
=
{
'
*
'
:
'
-
'
,
'
-
'
:
'
_
'
};
if
(
document
.
location
.
href
.
indexOf
(
'
*
'
)
>=
0
)
{
location
.
href
=
document
.
location
.
href
.
replace
(
/
[\*\-]
/g
,
function
(
char
)
{
return
competition_convert
[
char
];
});
}
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
decks
.
load_from_url
();
decks
.
load_from_url
();
$
(
'
#search
'
).
submit
(
function
()
{
$
(
'
#search
'
).
submit
(
function
()
{
...
@@ -860,11 +871,12 @@
...
@@ -860,11 +871,12 @@
});
});
$
(
"
#deck_share_dialog
"
).
dialog
({
$
(
"
#deck_share_dialog
"
).
dialog
({
modal
:
true
,
modal
:
true
,
autoOpen
:
false
,
autoOpen
:
$
.
url
().
attr
(
'
fragment
'
)
===
'
share
'
,
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
();
return
$
(
"
#deck_url_qrcode
"
).
attr
(
'
src
'
,
'
https://chart.googleapis.com/chart?chs=
200x200
&cht=qr&chld=|0&chl=
'
+
encodeURIComponent
(
decks
.
deck
().
url
()));
return
$
(
"
#deck_url_qrcode
"
).
attr
(
'
src
'
,
'
https://chart.googleapis.com/chart?chs=
171x171
&cht=qr&chld=|0&chl=
'
+
encodeURIComponent
(
decks
.
deck
().
url
()));
}
}
});
});
$
(
"
#drop_upload_dialog
"
).
dialog
({
$
(
"
#drop_upload_dialog
"
).
dialog
({
...
@@ -909,7 +921,7 @@
...
@@ -909,7 +921,7 @@
$
(
"
#drop_upload_dialog
"
).
dialog
(
'
close
'
);
$
(
"
#drop_upload_dialog
"
).
dialog
(
'
close
'
);
return
decks
.
upload
(
event
.
dataTransfer
.
files
);
return
decks
.
upload
(
event
.
dataTransfer
.
files
);
});
});
$
(
"
.
rename_ope
"
).
click
(
function
()
{
$
(
"
.
switch
"
).
click
(
function
()
{
$
(
"
.text,.graphic
"
).
toggleClass
(
"
graphic text
"
);
$
(
"
.text,.graphic
"
).
toggleClass
(
"
graphic text
"
);
return
decks
.
render
();
return
decks
.
render
();
});
});
...
...
assets/stylesheets/decks.less
View file @
72e2aa46
...
@@ -137,7 +137,7 @@ body{margin:0;padding:0;background:#eee;}
...
@@ -137,7 +137,7 @@ body{margin:0;padding:0;background:#eee;}
}
}
}
}
.swith{display:block;height:12px;width:14px;float:left;background:url(/assets/images/decks/switch.png) -25px 0 no-repeat;margin:5px 0 0 5px;cursor:pointer;}
.swit
c
h{display:block;height:12px;width:14px;float:left;background:url(/assets/images/decks/switch.png) -25px 0 no-repeat;margin:5px 0 0 5px;cursor:pointer;}
}
}
.select_card{
.select_card{
...
@@ -188,7 +188,7 @@ body{margin:0;padding:0;background:#eee;}
...
@@ -188,7 +188,7 @@ body{margin:0;padding:0;background:#eee;}
/* 一个很神奇的现象,float: left不加的话,Jquery-UI的拖拽不好用,加上去之后没法拖到另一个卡组里... */
/* 一个很神奇的现象,float: left不加的话,Jquery-UI的拖拽不好用,加上去之后没法拖到另一个卡组里... */
}
}
.swith{display:block;height:12px;width:12px;float:left;background:url(/assets/images/decks/switch.png);margin:5px 0 0 5px;cursor:pointer;}
.swit
c
h{display:block;height:12px;width:12px;float:left;background:url(/assets/images/decks/switch.png);margin:5px 0 0 5px;cursor:pointer;}
.select_card{
.select_card{
width:498px;height:35px;padding:5px;border:1px solid #cccccc;background:#F9F9F9;border-radius:6px;margin:10px 0 0 8px;
width:498px;height:35px;padding:5px;border:1px solid #cccccc;background:#F9F9F9;border-radius:6px;margin:10px 0 0 8px;
select{width:100px;float:left;border:1px solid #ccc;padding:1px;}
select{width:100px;float:left;border:1px solid #ccc;padding:1px;}
...
@@ -274,7 +274,7 @@ body{margin:0;padding:0;background:#eee;}
...
@@ -274,7 +274,7 @@ body{margin:0;padding:0;background:#eee;}
height:72px;border-top:1px solid #dddddd;padding:25px 0 0 0;
height:72px;border-top:1px solid #dddddd;padding:25px 0 0 0;
legend{text-align:center;padding:0 15px;margin:-3px 0 0 0;}
legend{text-align:center;padding:0 15px;margin:-3px 0 0 0;}
}
}
img{margin:-10px 0 0 50px;
width:150px;height:150px;
}
img{margin:-10px 0 0 50px;}
}
}
...
...
decks/new/index.html
View file @
72e2aa46
...
@@ -460,7 +460,7 @@
...
@@ -460,7 +460,7 @@
</select>
</select>
<img
class=
"add_ope"
src=
"/assets/images/decks/add.png"
alt=
""
title=
"新建"
/>
<img
class=
"add_ope"
src=
"/assets/images/decks/add.png"
alt=
""
title=
"新建"
/>
<!-- <img class="rename_ope" src="/assets/images/decks/rename.png" alt="" title="重命名"/> -->
<!-- <img class="rename_ope" src="/assets/images/decks/rename.png" alt="" title="重命名"/> -->
<div
class=
"swith"
style=
""
></div>
<div
class=
"swit
c
h"
style=
""
></div>
</div>
</div>
<div
class=
"select_cardUnder"
>
<div
class=
"select_cardUnder"
>
<div
class=
"donwload_out"
title=
"上传"
>
<div
class=
"donwload_out"
title=
"上传"
>
...
@@ -488,7 +488,8 @@
...
@@ -488,7 +488,8 @@
<fieldset>
<fieldset>
<legend
align=
"center"
>
URL
</legend>
<legend
align=
"center"
>
URL
</legend>
<input
id=
"deck_url"
readonly=
"readonly"
/>
<input
id=
"deck_url"
readonly=
"readonly"
/>
<button
id=
"deck_url_shorten"
style=
"margin:0 0 0 5px;"
>
shorten
</button>
<button
id=
"deck_url_shorten"
style=
"margin:0 0 0 5px;"
>
获取短地址
</button>
<p>
复制地址发送给你的好友
</p>
</fieldset>
</fieldset>
<fieldset>
<fieldset>
<legend
align=
"center"
>
share
</legend>
<legend
align=
"center"
>
share
</legend>
...
...
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