applicious_utils 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/applicious_utils/Applicious/applicious.js.coffee +4 -3
- data/app/assets/javascripts/applicious_utils/Applicious/applicious_class.js.coffee +26 -9
- data/app/assets/javascripts/applicious_utils/Applicious/facebook_class.js.coffee +16 -10
- data/lib/applicious_utils/version.rb +1 -1
- metadata +2 -2
@@ -1,16 +1,33 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
root = exports ? window
|
2
|
+
|
3
|
+
class AppliciousCore
|
4
|
+
DEBUG_FLAG: false
|
3
5
|
|
4
|
-
constructor: (@debug = false) ->
|
5
|
-
this.log('Applicious Alive')
|
6
6
|
|
7
|
+
constructor: () ->
|
8
|
+
if root.DEBUG
|
9
|
+
@debug true
|
10
|
+
else
|
11
|
+
@debug false
|
12
|
+
@log "Applicious [Core] Loaded. Debug: #{@getDebug()}"
|
13
|
+
|
14
|
+
|
15
|
+
debug: (flag) ->
|
16
|
+
AppliciousCore.DEBUG_FLAG = flag
|
17
|
+
|
18
|
+
|
19
|
+
getDebug: ->
|
20
|
+
AppliciousCore.DEBUG_FLAG
|
21
|
+
|
22
|
+
|
7
23
|
log: (debug_data...) ->
|
8
|
-
if @
|
24
|
+
if @getDebug()
|
9
25
|
try
|
10
|
-
console.log
|
26
|
+
console.log debug_data
|
11
27
|
catch error
|
12
|
-
alert
|
28
|
+
alert debug_data
|
29
|
+
|
13
30
|
# - - - #
|
14
31
|
|
15
|
-
root =
|
16
|
-
root.
|
32
|
+
root.AP = new AppliciousCore
|
33
|
+
root.AppliciousCore = AppliciousCore
|
@@ -1,21 +1,27 @@
|
|
1
1
|
#= require ./applicious_class.js.coffee
|
2
2
|
|
3
|
-
class AppliciousFacebook extends
|
4
|
-
@
|
5
|
-
constructor: (@app_id) ->
|
6
|
-
console.log('loaded FB' + @app_id)
|
3
|
+
class AppliciousFacebook extends AppliciousCore
|
4
|
+
@APP_ID = ''
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
|
7
|
+
constructor: ->
|
8
|
+
@log 'Applicious Facebook [AP::FB] Loaded'
|
9
|
+
|
10
|
+
|
11
|
+
init: (@APP_ID) ->
|
12
|
+
@log 'Initialised [AP::FB]', @APP_ID
|
13
|
+
|
14
|
+
|
15
|
+
login: (permissions, callback) ->
|
12
16
|
FB.login ((response) =>
|
13
17
|
if response.perms and response.session #TODO What if no perms requested?
|
18
|
+
this.log('Permissions accepted', response)
|
14
19
|
callback true, response
|
15
20
|
else
|
21
|
+
this.log('Permissions rejected', response)
|
16
22
|
callback false, response
|
17
23
|
), perms: permissions
|
24
|
+
|
18
25
|
# - - - #
|
19
26
|
|
20
|
-
|
21
|
-
root.AppliciousFacebook = AppliciousFacebook
|
27
|
+
AppliciousCore::FB = new AppliciousFacebook
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: applicious_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-06-
|
12
|
+
date: 2011-06-26 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Helper JS & Ruby Functions
|
15
15
|
email:
|