-
19 Oct 2012 4:14 AM #1
installing Disqus comments in Sencha Touch /Architect
installing Disqus comments in Sencha Touch /Architect
Hi Please I am hoping the sencha guru's can help me with the following problem. I am trying to install disqus comments using its universal javascript code. I am trying to place the script inside the html section of an actionsheet, however I keep on receiving errors and it fails to load the application.
The code is
Disqus:My Sencha markup is as follows:Code:<div id="disqus_thread"></div><script type="text/javascript">var disqus_shortname = 'myafricancanvas'; function() { var dsq = document.createElement('script');dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();</script><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered byDisqus.</a></noscript><a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
The app thru up the following errors in debug mode:Code:Ext.define('MyApp.view.SocialShare', { extend: 'Ext.ActionSheet', alias: 'widget.Social', config: { height: 450, html: '<div id="disqus_thread"></div><script type="text/javascript">var disqus_shortname = 'myafricancanvas'; function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();</script><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered byDisqus.</a></noscript><a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>', style: 'background:#000;', zIndex: 90, modal: false, scrollable: 'vertical', items: [ { xtype: 'button', docked: 'right', height: 50, itemId: 'shareclose', width: 50, icon: 'addresources/close.png' } ], listeners: [ { fn: 'onMybutton4Tap', event: 'tap', delegate: '#shareclose' } ] }, onMybutton4Tap: function(button, e, options) { this.hide(); } });
Please I would be extremely grateful if someone can advise how to overcome this problem as I am under extreme pressure. It is probably just a syntax issue.HTML Code:Uncaught SyntaxError: Unexpected identifier app/view/SocialShare.js?_dc=1345723248496:22Uncaught Error: The following classes are not declared even if their files have been loaded: 'MyApp.view.SocialShare'. Please check the source code of their corresponding files for possible typos: 'app/view/SocialShare.js sencha-touch-all-debug.js:798
I am happy to send the url of the app via PM if required.
I decided to use a smiley as I dont see to many on the forum lol
Thanks in advance.
-
19 Oct 2012 7:42 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
The html is not valid, you have to escape the quotes.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
19 Oct 2012 8:12 AM #3
Disqus installation
Disqus installation
Thanks Mitchel
Here comes a silly question, not quite sure what you mean "escape the quotes" can you pls give an example with the html I provided.
Promise to add the whole solution for others in the forum.
Thanks.
-
19 Oct 2012 8:52 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
red text is an escaped single-quoteCode:html : 'some text here, isn\'t it good?'
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
19 Oct 2012 9:31 AM #5
Tried escaping quotes but still doesnt seems to be working.
Code:<div id="disqus_thread"></div> <script type="text/javascript"> var disqus_shortname = \'myafricancanvas\'; (function() { var dsq = document.createElement(\'script\'); dsq.type = \'text/javascript\'; dsq.async = true; dsq.src = \'http://\' + disqus_shortname + \'.disqus.com/embed.js\'; (document.getElementsByTagName(\'head\')[0] || document.getElementsByTagName(\'body\')[0]).appendChild(dsq);})();</script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript><a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
-
22 Oct 2012 12:12 AM #6
Disqus in Sencha
Disqus in Sencha
Can anyone in the forum please provide some help? I have tried a number of solutions none are yet to work. My javascript debugging skills are very limited.
Thanks
-
22 Oct 2012 7:29 AM #7
Why don't you start with the html set to "hello" then put the disqus HTML in piece by piece until it works or breaks? Then you know that the little segment you just added didn't work and needs escaping or formatting correctly inside the single quotes.
-
22 Oct 2012 8:50 AM #8
Hi Shepsii
Thanks I have tried that as well, the Disqus code comes in three parts and requires all the parts.
I am sure it is something trivial I am missing.
-
25 Oct 2012 11:58 AM #9
Help the needy! Disqus in Sencha
Help the needy! Disqus in Sencha
Can somebody on this forum please have the kindness of heart to help with this particular problem.
Before offering solutions please test or if posible have experienced the problem.
if I could I would happily pay for premium support.
Thanks and blessings in advance


Reply With Quote