Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-images-generator
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
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
ygopro-images-generator
Commits
6e66b9a2
Commit
6e66b9a2
authored
Apr 14, 2013
by
Jingqin Lynn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change Attribute editing method.
parent
29d818b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
29 deletions
+12
-29
js/main.coffee
js/main.coffee
+5
-12
js/main.js
js/main.js
+7
-17
No files found.
js/main.coffee
View file @
6e66b9a2
...
@@ -27,20 +27,13 @@ $(document).ready ->
...
@@ -27,20 +27,13 @@ $(document).ready ->
$
(
element
).
removeClass
'editable'
$
(
element
).
removeClass
'editable'
@
document
.
value
=
$
(
'.card'
)[
0
].
outerHTML
@
document
.
value
=
$
(
'.card'
)[
0
].
outerHTML
#editable
$
(
'.attribute'
).
editable
(
value
,
settings
)
->
$
(
this
).
attr
'data-attribute'
,
value
,
{
placeholder
:
""
data
:
JSON
.
stringify
{
'dark'
:
'暗'
,
'divine'
:
'神'
,
'earth'
:
'地'
,
'fire'
:
'炎'
,
'light'
:
'光'
,
'water'
:
'水'
,
'wind'
:
'风'
}
type
:
'select'
submit
:
'OK'
}
$
(
'.editable'
).
each
(
_
,
element
)
->
$
(
'.editable'
).
each
(
_
,
element
)
->
if
element
.
classList
.
contains
(
'attribute'
)
if
element
.
classList
.
contains
(
'attribute'
)
# TODO(lynn): Improve Attribute editing.
$
(
element
).
click
(
e
)
->
attrs
=
[
'dark'
,
'divine'
,
'earth'
,
'fire'
,
'light'
,
'water'
,
'wind'
]
old_attr
=
element
.
dataset
[
'attribute'
]
new_attr
=
attrs
[(
attrs
.
indexOf
(
old_attr
)
+
1
)
%
attrs
.
length
]
element
.
dataset
[
'attribute'
]
=
new_attr
else
if
element
.
classList
.
contains
(
'level'
)
else
if
element
.
classList
.
contains
(
'level'
)
$
(
element
).
click
(
e
)
->
$
(
element
).
click
(
e
)
->
delta
=
0
delta
=
0
...
...
js/main.js
View file @
6e66b9a2
...
@@ -28,25 +28,15 @@
...
@@ -28,25 +28,15 @@
});
});
return
this
.
document
.
value
=
$
(
'
.card
'
)[
0
].
outerHTML
;
return
this
.
document
.
value
=
$
(
'
.card
'
)[
0
].
outerHTML
;
});
});
$
(
'
.attribute
'
).
editable
(
function
(
value
,
settings
)
{
return
$
(
this
).
attr
(
'
data-attribute
'
,
value
);
},
{
placeholder
:
""
,
data
:
JSON
.
stringify
({
'
dark
'
:
'
暗
'
,
'
divine
'
:
'
神
'
,
'
earth
'
:
'
地
'
,
'
fire
'
:
'
炎
'
,
'
light
'
:
'
光
'
,
'
water
'
:
'
水
'
,
'
wind
'
:
'
风
'
}),
type
:
'
select
'
,
submit
:
'
OK
'
});
$
(
'
.editable
'
).
each
(
function
(
_
,
element
)
{
$
(
'
.editable
'
).
each
(
function
(
_
,
element
)
{
if
(
element
.
classList
.
contains
(
'
attribute
'
))
{
if
(
element
.
classList
.
contains
(
'
attribute
'
))
{
return
$
(
element
).
click
(
function
(
e
)
{
var
attrs
,
new_attr
,
old_attr
;
attrs
=
[
'
dark
'
,
'
divine
'
,
'
earth
'
,
'
fire
'
,
'
light
'
,
'
water
'
,
'
wind
'
];
old_attr
=
element
.
dataset
[
'
attribute
'
];
new_attr
=
attrs
[(
attrs
.
indexOf
(
old_attr
)
+
1
)
%
attrs
.
length
];
return
element
.
dataset
[
'
attribute
'
]
=
new_attr
;
});
}
else
if
(
element
.
classList
.
contains
(
'
level
'
))
{
}
else
if
(
element
.
classList
.
contains
(
'
level
'
))
{
return
$
(
element
).
click
(
function
(
e
)
{
return
$
(
element
).
click
(
function
(
e
)
{
var
delta
,
new_level
,
old_level
;
var
delta
,
new_level
,
old_level
;
...
...
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