Can we add swfobject.js from googleapis into curlypage module? and modifying a curlypage.module ? and adding that with drupal_add_js ?

Because, i had some timed out connection problem with "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" in header. (FYI, Mobile connection providers in my country is s**** :( )

Specially for mobile browser like opera, wap browser, etc. they (some mobile browser) said "Script not supported" and the web totally can't displayed. but, that's fixed if i disabling curlypage module. i don't know why.. but, i assumed, the problem because swfobject.js in HTML head section in first line or the timed out connection problem with the googleapis.com.

Sorry for my bad english and thank you..

Comments

manfer’s picture

There is no problem to use swfobject.js within the module, in previous versions (< 2.3) it was so. I decided to use the google hosted version because drupal does not permit non GPL code in CVS.

But swfobject.js is MIT license, and that license permits you to use it anywhere you want (for personal or commercial use it is free). If you want to use a version of swfobject.js hosted on your own server there is no problem at all.

Drupal curlypage is GPL so you can make any modification you want too. I suppose you know how to do the change, anyway here is a tutorial:

  1. Copy swfobject.js in the inner curlypage folder (the folder that contains, big.jpg, curlypage.css, curlypage.js...).
  2. Change this lines in curlypage.module file:
        // load external swfobject.js library
        $swfobjectjs = '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>';
        drupal_set_html_head($swfobjectjs);
    
        $path = drupal_get_path('module', 'curlypage');
        drupal_add_js($path .'/curlypage/curlypage.js', 'module', 'header', FALSE, FALSE, TRUE);
        drupal_add_css($path .'/curlypage/curlypage.css', 'module', 'all', TRUE);
    

    to:

        $path = drupal_get_path('module', 'curlypage');
        drupal_add_js($path .'/curlypage/swfobject.js', 'module', 'header', FALSE, FALSE, TRUE);
        drupal_add_js($path .'/curlypage/curlypage.js', 'module', 'header', FALSE, FALSE, TRUE);
        drupal_add_css($path .'/curlypage/curlypage.css', 'module', 'all', TRUE);
    

If you prefer to do it with a different code you can do it too. And you can do any other modification you want.

Hope this helps. Regards,
manfer

wismoyo’s picture

Status: Active » Closed (fixed)

Thank you .. I've done ..
best regards,
wismoyo