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:
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>
My Sencha markup is as follows:
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();
}
});
The app thru up the following errors in debug mode:
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
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.
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.