;__;
This commit is contained in:
parent
fca2645787
commit
5785f9cda3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -252,7 +252,7 @@ Main =
|
|||||||
<%= grunt.file.read('src/General/css/tomorrow.css').replace(/\s+/g, ' ').trim() %>
|
<%= grunt.file.read('src/General/css/tomorrow.css').replace(/\s+/g, ' ').trim() %>
|
||||||
<%= grunt.file.read('src/General/css/photon.css').replace(/\s+/g, ' ').trim() %>
|
<%= grunt.file.read('src/General/css/photon.css').replace(/\s+/g, ' ').trim() %>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
features: [
|
features: [
|
||||||
['Polyfill', Polyfill]
|
['Polyfill', Polyfill]
|
||||||
['Redirect', Redirect]
|
['Redirect', Redirect]
|
||||||
@ -315,14 +315,11 @@ Main =
|
|||||||
['Show Dice Roll', Dice]
|
['Show Dice Roll', Dice]
|
||||||
['Banner', Banner]
|
['Banner', Banner]
|
||||||
]
|
]
|
||||||
|
|
||||||
clean: ->
|
clean: ->
|
||||||
{posts, threads} = g
|
{posts, threads} = g
|
||||||
delete posts[id] for id of posts when posts.hasOwnProperty id
|
delete posts[id] for id of posts when posts.hasOwnProperty id
|
||||||
delete threads[id] for id of threads when threads.hasOwnProperty id
|
delete threads[id] for id of threads when threads.hasOwnProperty id
|
||||||
|
|
||||||
g.threads = threads
|
|
||||||
g.posts = posts
|
|
||||||
|
|
||||||
disconnect: (view) ->
|
disconnect: (view) ->
|
||||||
if g.VIEW is 'thread'
|
if g.VIEW is 'thread'
|
||||||
@ -349,7 +346,7 @@ Main =
|
|||||||
|
|
||||||
# Clean the board, as we'll be dumping shit here
|
# Clean the board, as we'll be dumping shit here
|
||||||
# $.rmAll $ '.board'
|
# $.rmAll $ '.board'
|
||||||
|
|
||||||
g.VIEW = view
|
g.VIEW = view
|
||||||
|
|
||||||
navigate: (e) ->
|
navigate: (e) ->
|
||||||
@ -360,7 +357,7 @@ Main =
|
|||||||
[boardID, view, threadID] = path
|
[boardID, view, threadID] = path
|
||||||
|
|
||||||
return if view is 'catalog'
|
return if view is 'catalog'
|
||||||
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
history.pushState null, '', @pathname
|
history.pushState null, '', @pathname
|
||||||
|
|
||||||
@ -377,7 +374,7 @@ Main =
|
|||||||
Main.updateBoard boardID
|
Main.updateBoard boardID
|
||||||
|
|
||||||
Index.update()
|
Index.update()
|
||||||
|
|
||||||
else
|
else
|
||||||
Main.refresh {boardID, view, threadID}
|
Main.refresh {boardID, view, threadID}
|
||||||
|
|
||||||
@ -390,7 +387,7 @@ Main =
|
|||||||
|
|
||||||
else
|
else
|
||||||
Main.refresh {boardID, view, threadID}
|
Main.refresh {boardID, view, threadID}
|
||||||
|
|
||||||
Header.setBoardList()
|
Header.setBoardList()
|
||||||
|
|
||||||
updateBoard: (boardID) ->
|
updateBoard: (boardID) ->
|
||||||
|
|||||||
@ -1,20 +1,28 @@
|
|||||||
class Callbacks
|
class Callbacks
|
||||||
push: ({name, cb}) -> @[name] = cb
|
constructor: (@type) ->
|
||||||
|
@keys = []
|
||||||
|
|
||||||
clean: ->
|
push: ({name, cb}) ->
|
||||||
@rm name for name of @ when @hasOwnProperty name
|
@[name] = cb
|
||||||
|
@keys.push name
|
||||||
|
|
||||||
|
clean: ->
|
||||||
|
@rm name for name in @keys
|
||||||
return
|
return
|
||||||
|
|
||||||
rm: (name) -> delete @[name]
|
rm: (name) ->
|
||||||
|
return unless @[name]
|
||||||
|
delete @[name]
|
||||||
|
@keys.splice @keys.indexOf(name), 1 # Didn't I make this structure to avoid this? ;__;
|
||||||
|
|
||||||
execute: (node) ->
|
execute: (node) ->
|
||||||
for name of @ when @hasOwnProperty name
|
for name in @keys
|
||||||
try
|
try
|
||||||
@[name].call node
|
@[name].call node
|
||||||
catch err
|
catch err
|
||||||
errors = [] unless errors
|
errors = [] unless errors
|
||||||
errors.push
|
errors.push
|
||||||
message: ['"', name, '" crashed on node No.', node, ' (', node.board, ').'].join('')
|
message: ['"', name, '" crashed on node ', @type, ' No.', node, ' (', node.board, ').'].join('')
|
||||||
error: err
|
error: err
|
||||||
|
|
||||||
Main.handleErrors errors if errors
|
Main.handleErrors errors if errors
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
class Post
|
class Post
|
||||||
@callbacks = new Callbacks()
|
@callbacks = new Callbacks 'Post'
|
||||||
toString: -> @ID
|
toString: -> @ID
|
||||||
|
|
||||||
constructor: (root, @thread, @board, that={}) ->
|
constructor: (root, @thread, @board, that={}) ->
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
class Thread
|
class Thread
|
||||||
@callbacks = new Callbacks()
|
@callbacks = new Callbacks 'Thread'
|
||||||
toString: -> @ID
|
toString: -> @ID
|
||||||
|
|
||||||
constructor: (@ID, @board) ->
|
constructor: (@ID, @board) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user