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
b10cddb0
Commit
b10cddb0
authored
Feb 17, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
284f7cae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
27 deletions
+31
-27
assets/javascripts/rooms.coffee
assets/javascripts/rooms.coffee
+22
-11
assets/javascripts/rooms.js
assets/javascripts/rooms.js
+9
-16
No files found.
assets/javascripts/rooms.coffee
View file @
b10cddb0
#window.oldSetInterval = window.setInterval;
#window.setInterval = (func, interval)->
# interval = oldSetInterval(func, interval);
# console.log "setInteval called", func, interval
#window.oldClearInterval = window.setInterval;
#window.ClearInterval = (func, interval)->
# interval = oldClearInterval(func, interval);
# console.log "clearInteval called", func, interval
class
Server
extends
Spine
.
Model
@
configure
"Server"
,
"name"
,
"ip"
,
"port"
,
"index"
@
extend
Spine
.
Model
.
Ajax
...
...
@@ -160,13 +170,13 @@ announcement_scroll = (obj)->
marginTop
:
"-25px"
,
500
,
->
$
(
this
).
css
({
marginTop
:
"0px"
}).
find
(
"li:first"
).
appendTo
(
this
)
announcement_scrolling
=
null
#console.log this
@
announcement_scrolling
=
null
setRosterHeight
=
->
pageHight
=
(
document
.
documentElement
.
clientHeight
)
-
430
$
(
"#roster"
).
height
(
pageHight
)
$
(
document
).
ready
->
$
(
document
).
ready
=>
if
Candy
.
Util
.
getCookie
(
'jid'
)
login
()
after_login
()
...
...
@@ -256,24 +266,25 @@ $(document).ready ->
$
(
'#logout_button'
).
click
->
logout
()
$
(
'#announcements li'
).
hover
(
e
)
->
if
e
.
type
==
'mouseenter'
clearInterval
announcement_scrolling
if
announcement_scrolling
else
announcement_scrolling
=
setInterval
(
announcement_scroll
,
5000
)
if
!
announcement_scrolling
announcement_scrolling
=
null
$
(
'#announcements li'
).
mouseover
=>
console
.
log
'mouseover'
#clearInterval(@announcement_scrolling) if @announcement_scrolling
#@announcement_scrolling = null
$
(
'#announcements li'
).
mouseleave
=>
#@announcement_scrolling = setInterval(announcement_scroll, 5000) if !@announcement_scrolling
setRosterHeight
();
$
(
window
).
resize
(
setRosterHeight
);
$
.
getJSON
'/announcements.json'
,
(
data
)
-
>
$
.
getJSON
'/announcements.json'
,
(
data
)
=
>
for
announcement
in
data
$
(
'<li />'
).
append
(
$
(
'<a />'
,
href
:
announcement
.
url
target
:
'_blank'
text
:
announcement
.
title
)).
appendTo
$
(
'#announcements'
)
announcement_scrolling
=
setInterval
(
announcement_scroll
,
5000
)
if
!
announcement_scrolling
and
data
.
length
@
announcement_scrolling
=
setInterval
(
announcement_scroll
,
5000
)
if
!
@
announcement_scrolling
and
data
.
length
rooms
=
new
Rooms
(
el
:
$
(
'#rooms'
))
servers
=
new
Servers
(
el
:
$
(
'#servers'
))
...
...
assets/javascripts/rooms.js
View file @
b10cddb0
// Generated by CoffeeScript 1.4.0
(
function
()
{
var
Room
,
Rooms
,
Server
,
Servers
,
announcement_scroll
,
announcement_scrolling
,
login
,
logout
,
setRosterHeight
,
var
Room
,
Rooms
,
Server
,
Servers
,
announcement_scroll
,
login
,
logout
,
setRosterHeight
,
__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
;
},
__bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
};
__bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
_this
=
this
;
Server
=
(
function
(
_super
)
{
...
...
@@ -268,7 +269,7 @@
});
};
announcement_scrolling
=
null
;
this
.
announcement_scrolling
=
null
;
setRosterHeight
=
function
()
{
var
pageHight
;
...
...
@@ -374,18 +375,10 @@
$
(
'
#logout_button
'
).
click
(
function
()
{
return
logout
();
});
$
(
'
#announcements li
'
).
hover
(
function
(
e
)
{
if
(
e
.
type
===
'
mouseenter
'
)
{
if
(
announcement_scrolling
)
{
return
clearInterval
(
announcement_scrolling
);
}
}
else
{
if
(
!
announcement_scrolling
)
{
announcement_scrolling
=
setInterval
(
announcement_scroll
,
5000
);
}
return
announcement_scrolling
=
null
;
}
$
(
'
#announcements li
'
).
mouseover
(
function
()
{
return
console
.
log
(
'
mouseover
'
);
});
$
(
'
#announcements li
'
).
mouseleave
(
function
()
{});
setRosterHeight
();
$
(
window
).
resize
(
setRosterHeight
);
$
.
getJSON
(
'
/announcements.json
'
,
function
(
data
)
{
...
...
@@ -398,8 +391,8 @@
text
:
announcement
.
title
})).
appendTo
(
$
(
'
#announcements
'
));
}
if
(
!
announcement_scrolling
&&
data
.
length
)
{
return
announcement_scrolling
=
setInterval
(
announcement_scroll
,
5000
);
if
(
!
_this
.
announcement_scrolling
&&
data
.
length
)
{
return
_this
.
announcement_scrolling
=
setInterval
(
announcement_scroll
,
5000
);
}
});
rooms
=
new
Rooms
({
...
...
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