Skip to content

Commit

Permalink
remove swfobject
Browse files Browse the repository at this point in the history
  • Loading branch information
geta6 committed May 8, 2014
1 parent 2cde74d commit 52dccae
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 16 deletions.
37 changes: 35 additions & 2 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
coffeelint = require 'coffeelint'
{reporter} = require 'coffeelint-stylish'

module.exports = (grunt) ->

grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-jade'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-stylus'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-compress'
grunt.loadNpmTasks 'grunt-node-webkit-builder'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-notify'

grunt.registerMultiTask 'coffeelint', 'CoffeeLint', ->
count = e: 0, w: 0
options = @options()
(files = @filesSrc).forEach (file) ->
grunt.verbose.writeln "Linting #{file}..."
errors = coffeelint.lint (grunt.file.read file), options, !!/\.(litcoffee|coffee\.md)$/i.test file
unless errors.length
return grunt.verbose.ok()
reporter file, errors
errors.forEach (err) ->
switch err.level
when 'error' then count.e++
when 'warn' then count.w++
else return
message = "#{file}:#{err.lineNumber} #{err.message} (#{err.rule})"
grunt.event.emit "coffeelint:#{err.level}", err.level, message
grunt.event.emit 'coffeelint:any', err.level, message
return no if count.e and !options.force
if !count.w and !count.e
grunt.log.ok "#{files.length} file#{if 1 < files.length then 's'} lint free."

grunt.registerTask 'default', [
'copy', 'jade', 'stylus', 'coffeelint', 'coffee', 'uglify', 'nodewebkit'
'clean', 'copy', 'jade', 'stylus', 'coffeelint', 'coffee', 'uglify', 'nodewebkit'
]

pkg = grunt.file.readJSON 'package.json'
Expand All @@ -22,6 +46,10 @@ module.exports = (grunt) ->

# static

clean:
compile:
src: [ 'lib' ]

copy:
compile:
files: [{
Expand Down Expand Up @@ -73,12 +101,15 @@ module.exports = (grunt) ->
spacing: left: 0, right: 1
level: 'error'
cyclomatic_complexity:
value: 15
level: 'warn'
empty_constructor_needs_parens:
level: 'error'
indentation:
level: 'error'
value: 2
max_line_length:
level: 'error'
value: 79
newlines_after_classes:
level: 'error'
Expand All @@ -88,6 +119,8 @@ module.exports = (grunt) ->
level: 'error'
no_interpolation_in_single_quotes:
level: 'warn'
no_stand_alone_at:
level: 'warn'
no_unnecessary_double_quotes:
level: 'warn'
no_unnecessary_fat_arrows:
Expand Down
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "Teitoku",
"private": true,
"dependencies": {
"jquery": "~2.1.0",
"swfobject": "*"
"jquery": "~2.1.0"
}
}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Teitoku",
"version": "0.3.1",
"version": "0.3.2",
"nwversion": "0.9.2",
"description": "kancolle browser",
"main": "app.html",
Expand All @@ -17,16 +17,19 @@
"page-cache": true
},
"dependencies": {
"coffeelint": "^1.3.0",
"coffeelint-stylish": "0.0.1",
"grunt": "^0.4.4",
"grunt-coffeelint": "0.0.10",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-coffee": "^0.10.1",
"grunt-contrib-compress": "^0.8.0",
"grunt-contrib-copy": "^0.5.0",
"grunt-contrib-jade": "^0.11.0",
"grunt-contrib-stylus": "^0.13.2",
"grunt-contrib-stylus": "^0.15.1",
"grunt-contrib-uglify": "^0.4.0",
"grunt-node-webkit-builder": "^0.1.20",
"grunt-notify": "^0.2.20"
"grunt-node-webkit-builder": "^0.1.21",
"grunt-notify": "^0.3.0"
},
"devDependencies": {},
"scripts": {
Expand Down
9 changes: 4 additions & 5 deletions src/app.coffee
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use strict'


fs = require 'fs'
path = require 'path'
gui = require 'nw.gui'

# gui.Window.get().showDevTools()
#gui.Window.get().showDevTools()

$win = $ window
$doc = $ document
Expand Down Expand Up @@ -95,7 +94,7 @@ $win.on 'app:start', ->
else if /Adobe Flash Player/.test $contents.find('#flashWrap').text()
clearInterval loading
#$frame.remove()
embed = ($ embed).attr 'src', 'lib/expressInstall.swf'
# embed = ($ embed).attr 'src', 'lib/expressInstall.swf'
$win.trigger 'app:run', embed
, 200

Expand All @@ -105,7 +104,7 @@ $win.on 'app:run', (event, embed) ->
$frame.attr('src', $(embed).attr 'src').one 'load', ->
$ $frame.show().get(0).contentWindow
.on 'blur', ->
($ @).focus()
($ this).focus()
.on 'keyup', (event) ->
$win.trigger 'app:keyup', event.keyCode
.focus()
Expand Down Expand Up @@ -148,7 +147,7 @@ $win.on 'app:keyup', (event, keyCode) ->
alert 'キャプチャの保存場所を設定します(初回のみ)'
($ '#shots')
.one 'change', ->
localStorage.setItem 'savepath', savepath = ($ @).val()
localStorage.setItem 'savepath', savepath = ($ this).val()
alert "設定しました、次回より自動的に'#{savepath}'へ保存されます"
$win.trigger 'app:capture', savepath: savepath, data: data
.trigger 'click'
Expand Down
1 change: 0 additions & 1 deletion src/app.jade
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ html
span &nbsp;#{pkg.nwversion}

script(src='lib/jquery.js')
script(src='lib/swfobject.js')
script(src='app.js')

1 change: 0 additions & 1 deletion src/lib/expressInstall.swf

This file was deleted.

1 change: 0 additions & 1 deletion src/lib/swfobject.js

This file was deleted.

0 comments on commit 52dccae

Please sign in to comment.