Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
syntax_j
mycard
Commits
c7cf5dd5
Commit
c7cf5dd5
authored
Apr 02, 2014
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thbh
parent
2937f290
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
135 additions
and
22 deletions
+135
-22
app/js/controllers.coffee
app/js/controllers.coffee
+20
-14
app/js/controllers.js
app/js/controllers.js
+15
-5
app/js/controllers.map
app/js/controllers.map
+1
-1
app/js/maotama.coffee
app/js/maotama.coffee
+3
-1
app/js/maotama.js
app/js/maotama.js
+5
-0
app/js/maotama.map
app/js/maotama.map
+1
-1
app/partials/app_show.html
app/partials/app_show.html
+90
-0
No files found.
app/js/controllers.coffee
View file @
c7cf5dd5
...
...
@@ -163,16 +163,16 @@ angular.module('maotama.controllers', [])
$scope
.
runtime
.
running
=
true
$scope
.
candy
.
contentWindow
.
postMessage
(
type
:
'status'
,
status
:
"正在玩
#{
$scope
.
app
.
name
}
"
,
show
:
"dnd"
,
$scope
.
candy
.
src
)
game
=
child_process
.
spawn
$scope
.
app
.
main
,
[
"--maotama-username=
#{
$rootScope
.
current_user
.
name
}
"
,
"--maotama-ranking-
0=0
"
,
"--maotama-ranking-
1=1
"
,
"--maotama-ranking-
2=2
"
,
"--maotama-ranking-
3=3
"
,
"--maotama-ranking-
4=4
"
,
"--maotama-ranking-
5=5
"
,
"--maotama-ranking-
6=6
"
,
"--maotama-ranking-
7=7
"
,
"--maotama-ranking-
8=8
"
,
"--maotama-ranking-
HJ=9
"
,
"--maotama-ranking-
#{
$rootScope
.
current_user
.
name
}
=
#{
$scope
.
profile
.
score
}
"
,
"--maotama-ranking-
博丽灵梦=6500
"
,
"--maotama-ranking-
♂Van♂=5800
"
,
"--maotama-ranking-
比利♂海灵顿=5600
"
,
"--maotama-ranking-
德国Boy=5430
"
,
"--maotama-ranking-
麦当劳叔叔=5400
"
,
"--maotama-ranking-
村口王师傅=5200
"
,
"--maotama-ranking-
帝国元首=4800
"
,
"--maotama-ranking-
葛老师=3600
"
,
"--maotama-ranking-
五道杠大队长=3300
"
,
],
cwd
:
$scope
.
local
.
installation
game
.
stdout
.
setEncoding
(
'utf8'
);
...
...
@@ -200,10 +200,16 @@ angular.module('maotama.controllers', [])
$scope
.
$digest
();
when
'SCORE'
score
=
parseInt
$
(
command
).
text
()
window
.
LOCAL_NW
.
desktopNotifications
.
notify
$scope
.
app
.
icon
,
"得分"
,
score
else
window
.
LOCAL_NW
.
desktopNotifications
.
notify
$scope
.
app
.
icon
,
"unknown command"
,
matches
[
1
]
if
!
$scope
.
profile
.
score
or
score
>
$scope
.
profile
.
score
window
.
LOCAL_NW
.
desktopNotifications
.
notify
$scope
.
app
.
icon
,
"最高得分"
,
score
$scope
.
profile
.
score
=
score
db
.
profile
.
update
{
id
:
$scope
.
app
.
id
},
$scope
.
profile
,
(
err
,
numReplaced
,
newDoc
)
->
throw
err
if
err
$scope
.
$digest
();
else
window
.
LOCAL_NW
.
desktopNotifications
.
notify
$scope
.
app
.
icon
,
"unknown command"
,
matches
[
1
]
game
.
on
'close'
,
(
code
)
->
$scope
.
runtime
.
running
=
false
$scope
.
candy
.
contentWindow
.
postMessage
(
type
:
'status'
,
$scope
.
candy
.
src
)
...
...
app/js/controllers.js
View file @
c7cf5dd5
...
...
@@ -263,7 +263,7 @@
status
:
"
正在玩
"
+
$scope
.
app
.
name
,
show
:
"
dnd
"
},
$scope
.
candy
.
src
);
game
=
child_process
.
spawn
(
$scope
.
app
.
main
,
[
"
--maotama-username=
"
+
$rootScope
.
current_user
.
name
,
"
--maotama-ranking-
0=0
"
,
"
--maotama-ranking-1=1
"
,
"
--maotama-ranking-2=2
"
,
"
--maotama-ranking-3=3
"
,
"
--maotama-ranking-4=4
"
,
"
--maotama-ranking-5=5
"
,
"
--maotama-ranking-6=6
"
,
"
--maotama-ranking-7=7
"
,
"
--maotama-ranking-8=8
"
,
"
--maotama-ranking-HJ=9
"
],
{
game
=
child_process
.
spawn
(
$scope
.
app
.
main
,
[
"
--maotama-username=
"
+
$rootScope
.
current_user
.
name
,
"
--maotama-ranking-
"
+
$rootScope
.
current_user
.
name
+
"
=
"
+
$scope
.
profile
.
score
,
"
--maotama-ranking-博丽灵梦=6500
"
,
"
--maotama-ranking-♂Van♂=5800
"
,
"
--maotama-ranking-比利♂海灵顿=5600
"
,
"
--maotama-ranking-德国Boy=5430
"
,
"
--maotama-ranking-麦当劳叔叔=5400
"
,
"
--maotama-ranking-村口王师傅=5200
"
,
"
--maotama-ranking-帝国元首=4800
"
,
"
--maotama-ranking-葛老师=3600
"
,
"
--maotama-ranking-五道杠大队长=3300
"
],
{
cwd
:
$scope
.
local
.
installation
});
game
.
stdout
.
setEncoding
(
'
utf8
'
);
...
...
@@ -301,10 +301,20 @@
break
;
case
'
SCORE
'
:
score
=
parseInt
(
$
(
command
).
text
());
window
.
LOCAL_NW
.
desktopNotifications
.
notify
(
$scope
.
app
.
icon
,
"
得分
"
,
score
);
break
;
default
:
window
.
LOCAL_NW
.
desktopNotifications
.
notify
(
$scope
.
app
.
icon
,
"
unknown command
"
,
matches
[
1
]);
if
(
!
$scope
.
profile
.
score
||
score
>
$scope
.
profile
.
score
)
{
window
.
LOCAL_NW
.
desktopNotifications
.
notify
(
$scope
.
app
.
icon
,
"
最高得分
"
,
score
);
$scope
.
profile
.
score
=
score
;
db
.
profile
.
update
({
id
:
$scope
.
app
.
id
},
$scope
.
profile
,
function
(
err
,
numReplaced
,
newDoc
)
{
if
(
err
)
{
throw
err
;
}
return
$scope
.
$digest
();
});
}
else
{
window
.
LOCAL_NW
.
desktopNotifications
.
notify
(
$scope
.
app
.
icon
,
"
unknown command
"
,
matches
[
1
]);
}
}
}
}
...
...
app/js/controllers.map
View file @
c7cf5dd5
This diff is collapsed.
Click to expand it.
app/js/maotama.coffee
View file @
c7cf5dd5
...
...
@@ -64,7 +64,9 @@ win.on 'new-win-policy', (frame, url, policy)->
gui
.
Shell
.
openExternal
(
url
);
policy
.
ignore
()
$
(
'body'
).
on
'click'
,
'a[data-toggle="tab"]'
,
(
e
)
->
e
.
preventDefault
()
$
(
this
).
tab
(
'show'
)
#用户
pre_load_photo
=
(
jid
,
name
,
domain
)
->
...
...
app/js/maotama.js
View file @
c7cf5dd5
...
...
@@ -101,6 +101,11 @@
return
policy
.
ignore
();
});
$
(
'
body
'
).
on
(
'
click
'
,
'
a[data-toggle="tab"]
'
,
function
(
e
)
{
e
.
preventDefault
();
return
$
(
this
).
tab
(
'
show
'
);
});
pre_load_photo
=
function
(
jid
,
name
,
domain
)
{
var
hash
;
switch
(
domain
)
{
...
...
app/js/maotama.map
View file @
c7cf5dd5
This diff is collapsed.
Click to expand it.
app/partials/app_show.html
View file @
c7cf5dd5
...
...
@@ -112,6 +112,96 @@
<img
class=
"friend img-thumbnail"
src=
"https://lh5.googleusercontent.com/-crYEtoQ-4Ho/AAAAAAAAAAI/AAAAAAAAAZE/OVA-78yQjU8/s46-c-k-no/photo.jpg"
>
<img
class=
"friend img-thumbnail"
src=
"https://lh5.googleusercontent.com/-crYEtoQ-4Ho/AAAAAAAAAAI/AAAAAAAAAZE/OVA-78yQjU8/s46-c-k-no/photo.jpg"
>
<h2
class=
"sub-header"
ng-if=
"profile.score"
>
排行榜
</h2>
<!-- Nav tabs -->
<ul
class=
"nav nav-tabs"
ng-if=
"profile.score"
>
<li><a
href=
"#ranking_global"
data-toggle=
"tab"
>
所有人
</a></li>
<li
class=
"active"
><a
href=
"#ranking_friends"
data-toggle=
"tab"
>
好友
</a></li>
</ul>
<div
class=
"tab-content"
ng-if=
"profile.score"
>
<div
class=
"tab-pane fade"
id=
"ranking_global"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
#
</th>
<th>
昵称
</th>
<th>
得分
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
1
</td>
<td>
博丽灵梦
</td>
<td>
6500
</td>
</tr>
<tr>
<td>
2
</td>
<td>
♂Van♂
</td>
<td>
5800
</td>
</tr>
<tr>
<td>
3
</td>
<td>
比利♂海灵顿
</td>
<td>
5430
</td>
</tr>
<tr>
<td>
4
</td>
<td>
麦当劳叔叔
</td>
<td>
5600
</td>
</tr>
<tr>
<td>
5
</td>
<td>
德国Boy
</td>
<td>
5400
</td>
</tr>
<tr>
<td>
6
</td>
<td>
村口王师傅
</td>
<td>
5200
</td>
</tr>
<tr>
<td>
7
</td>
<td>
帝国元首
</td>
<td>
4800
</td>
</tr>
<tr>
<td>
8
</td>
<td>
葛老师
</td>
<td>
3600
</td>
</tr>
<tr>
<td>
9
</td>
<td>
五道杠大队长
</td>
<td>
3300
</td>
</tr>
<tr>
<td>
10
</td>
<td>
游泳教练
</td>
<td>
0
</td>
</tr>
</tbody>
</table>
</div>
<div
class=
"tab-pane fade in active"
id=
"ranking_friends"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
#
</th>
<th>
昵称
</th>
<th>
得分
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
1
</td>
<td>
{{current_user.name}}
</td>
<td>
{{profile.score}}
</td>
</tr>
</tr>
</tbody>
</table>
</div>
</div>
<h2
class=
"sub-header"
ng-repeat-start=
"achievement in app.achievements"
>
{{achievement.name}}
</h2>
<div
class=
"clearfix"
ng-if=
"achievement_unlocked_count($index) > 0"
>
...
...
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