Active
Project:
AddToAny Share Buttons
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2011 at 07:05 UTC
Updated:
5 Aug 2011 at 03:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
jcisio commentedCan you check again with the latest snapshot of LABjs (31 Jul)?
Comment #2
kurtzhong commentedBut my I am using drupal 7.4, and the version you mentioned it for Drupal 6.
Because the AddToAny module has two inline scripts, one in the header and one in the footer respectively. If the Labjs could exclude them from the chain, I think things will be ok.
Comment #3
jcisio commentedI push the changes yesterday but I don't know why there is no new developement snapshot in 7.x branch yet. The changes are in http://drupalcode.org/project/labjs.git/commit/4c5e58a and http://drupalcode.org/project/labjs.git/commit/e4544d4
Comment #4
jcisio commentedI've found the problem. 7.x-1.x-dev was tracking in the master branch that I stopped on it for a while and switch to 7.x-1.x branch. I fixed it. Hope a new snapsnot will be available soon.
Comment #5
kurtzhong commentedThank you jciso. I've checked the latest snapshot, but still not working. There's a inline js code output from AddToAny module which is not captured by Labjs, and it shouldn't executes before other two inline javascripts on which it depends.
Comment #6
jcisio commentedThe following patch for addtoany will have inline script wrapped by LABjs. Well, it also a more D7-way to insert inline script.
But the way that AddToAny use async to do several attempts to load the script make it difficult for LABjs to intervene. I'll debug a little bit further.
Comment #7
jcisio commentedThe problem is that when inline script is wrapped by LABjs, variable scope change.
After that block, a2a_config and da2a is no longer available. There are two solutions:
- Wrap them into Drupal (like Drupal.a2a.config = ..., Drupal.a2a.d = ...)
- Put them into a JS file (like the case "Drupal" variable is put into misc/drupal.js).
I'm sorry to pass this issue into a2a. But it's a more "Drupal way" to do ;-)
Comment #8
kurtzhong commentedSo appreciated to see your patch on a2a and two constructive solutions. Although it's not working yet, I don't see the 'da2a not defined' error anymore. I am not good at javascript and know little about drupal's js mechanism, but you really help me with understanding this issue a lot. Thank you very much :)
Comment #8.0
kurtzhong commentedUpdated issue summary.