applicious_utils 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  #= require ./applicious_class.js.coffee
2
2
  #= require ./facebook_class.js.coffee
3
3
 
4
- a = new Applicious(true)
5
- b = new AppliciousFacebook('1245')
6
- b.testLog 'testinglogfromA'
4
+ AP.debug true
5
+ AP.log('test1')
6
+ AP.FB.testLog('123')
7
+ AP.FB.init('123APPID456')
@@ -1,16 +1,33 @@
1
- class Applicious
2
- @debug = false
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 @debug
24
+ if @getDebug()
9
25
  try
10
- console.log(debug_data)
26
+ console.log debug_data
11
27
  catch error
12
- alert(debug_data)
28
+ alert debug_data
29
+
13
30
  # - - - #
14
31
 
15
- root = exports ? window
16
- root.Applicious = Applicious
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 Applicious
4
- @app_id = ''
5
- constructor: (@app_id) ->
6
- console.log('loaded FB' + @app_id)
3
+ class AppliciousFacebook extends AppliciousCore
4
+ @APP_ID = ''
7
5
 
8
- testLog: (logData = 'p')->
9
- this.log('Calling Log from FB ' + logData)
10
-
11
- promptLogin: (permissions, callback) ->
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
- root = exports ? window
21
- root.AppliciousFacebook = AppliciousFacebook
27
+ AppliciousCore::FB = new AppliciousFacebook
@@ -1,3 +1,3 @@
1
1
  module AppliciousUtils
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
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.12
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-25 00:00:00.000000000Z
12
+ date: 2011-06-26 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Helper JS & Ruby Functions
15
15
  email: