You are here

function theme_uptolike_javascript in Uptolike share buttons 7

Return main javascript code for Uptolike share buttons.

3 theme calls to theme_uptolike_javascript()
uptolike_block_view in ./uptolike.module
Implements hook_block_view().
uptolike_entity_view in ./uptolike.module
Implements hook_entity_view().
uptolike_page_alter in ./uptolike.module
Implements hook_page_alter().

File

./uptolike.module, line 773
Main file for Uptolike module.

Code

function theme_uptolike_javascript() {
  $script = "(function(w,doc) {";
  $script .= "if (!w.__utlWdgt ) {";
  $script .= "w.__utlWdgt = true;";
  $script .= "var d = doc, s = d.createElement('script'), g = 'getElementsByTagName';";
  $script .= "s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;";
  $script .= "s.src = ('https:' == w.location.protocol ? 'https' : 'http')  + '://w.uptolike.com/widgets/v1/uptolike.js';";
  $script .= "var h=d[g]('body')[0];";
  $script .= "h.appendChild(s);";
  $script .= "}})(window,document);";
  return $script;
}