Hybrid View

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    9
    Vote Rating
    0
    detp is on a distinguished road

      0  

    Default 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:
    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.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The html is not valid, you have to escape the quotes.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    9
    Vote Rating
    0
    detp is on a distinguished road

      0  

    Default 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.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Code:
    html : 'some text here, isn\'t it good?'
    red text is an escaped single-quote
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    9
    Vote Rating
    0
    detp is on a distinguished road

      0  

    Default


    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>

  6. #6
    Sencha User
    Join Date
    Aug 2012
    Posts
    9
    Vote Rating
    0
    detp is on a distinguished road

      0  

    Default 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

Thread Participants: 2

Tags for this Thread