Changeset 349 for trunk/WordPress/plugin/transposh/transposh.php
- Timestamp:
- 01/07/2010 02:05:49 AM (2 years ago)
- File:
-
- 1 edited
-
trunk/WordPress/plugin/transposh/transposh.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/transposh.php
r348 r349 78 78 /** @var string Saved search variables*/ 79 79 private $search_s; 80 /** @var boolean If transposh.js is on the page*/81 public $js_included = false;82 80 83 81 /** … … 118 116 add_action('wp_print_styles', array(&$this,'add_transposh_css')); 119 117 add_action('wp_print_scripts', array(&$this,'add_transposh_js')); 118 add_action('wp_head', array(&$this,'add_transposh_async')); 120 119 add_action("sm_addurl",array(&$this,'add_sm_transposh_urls')); 121 120 register_activation_hook(__FILE__, array(&$this,'plugin_activate')); … … 468 467 wp_enqueue_style("transposh","{$this->transposh_plugin_url}/css/transposh.css",array(),TRANSPOSH_PLUGIN_VER); 469 468 // we have to load the jquery-ui css just in some cases 470 if ($this->edit_mode || $this->options->get_widget_progressbar())471 wp_enqueue_style("jquery","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css",array(),'1.0');469 // if ($this->edit_mode || $this->options->get_widget_progressbar()) 470 // wp_enqueue_style("jquery","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css",array(),'1.0'); 472 471 logger("Added transposh_css",4); 473 472 } … … 480 479 if (!$this->edit_mode && !$this->is_auto_translate_permitted()) { 481 480 return; 482 }483 484 $edit_param = "";485 if($this->edit_mode) {486 $edit_param = "&".EDIT_PARAM."=y";487 }488 489 if($this->edit_mode || $this->options->get_widget_progressbar()) {490 wp_enqueue_script("jqueryui","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js",array("jquery"),'1.7.2',$this->options->get_enable_footer_scripts());491 481 } 492 482 … … 497 487 // toying around - for later... 498 488 //wp_enqueue_script("jquery","http://code.jquery.com/jquery-1.4a2.min.js",array(),'1.4a2'); 499 // jQuery pushing below might cause issues 500 //wp_enqueue_script("jquery","http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",array(),'1.3.2', $this->options->get_enable_footer_scripts()); 501 wp_enqueue_script("google","http://www.google.com/jsapi",array(),'1',$this->options->get_enable_footer_scripts()); 502 // Make sure msn translate is not needlessly loaded when we are only auto translating 503 if ($this->options->get_enable_msn_translate() && $this->edit_mode) { 504 wp_enqueue_script("mstranslate","http://api.microsofttranslator.com/V1/Ajax.svc/Embed?appId=".$this->options->get_msn_key(),array(),'1',$this->options->get_enable_footer_scripts()); 505 } 506 wp_enqueue_script("transposh","{$this->transposh_plugin_url}/js/transposh.js?post_url={$this->post_url}{$edit_param}&lang={$this->target_language}&prefix=".SPAN_PREFIX,array("jquery"),TRANSPOSH_PLUGIN_VER,$this->options->get_enable_footer_scripts()); 507 $this->js_included = true; 508 } 509 } 510 489 } 490 } 491 492 493 function add_transposh_async() { 494 if (!$this->edit_mode && !$this->is_auto_translate_permitted()) { 495 return; 496 } 497 498 echo "<script type=\"text/javascript\"> 499 500 var _tr_p=_tr_p || []; 501 _tr_p.post_url='{$this->post_url}'; 502 _tr_p.plugin_url='{$this->transposh_plugin_url}'; 503 _tr_p.edit=".($this->edit_mode? 'true' : 'false')."; 504 _tr_p.lang='{$this->target_language}'; 505 _tr_p.prefix='".SPAN_PREFIX."'; 506 _tr_p.msnkey='{$this->options->get_msn_key()}'; 507 _tr_p.progress=".($this->edit_mode || $this->options->get_widget_progressbar() ? 'true' : 'false')."; 508 509 (function() { 510 var tp = document.createElement('script'); tp.type = 'text/javascript'; tp.async = true; 511 tp.src = '{$this->transposh_plugin_url}/js/transposh.js?ver=".TRANSPOSH_PLUGIN_VER."'; 512 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(tp); 513 })(); 514 515 </script>"; 516 } 511 517 512 518 /** … … 651 657 * Also - priority is reduced by 0.2 652 658 * And this requires the following line at the sitemap-core.php, add-url function (line 1509 at version 3.2.2) 653 * do_action('sm_addurl', $loc,&$page);659 * do_action('sm_addurl', &$page); 654 660 * @param GoogleSitemapGeneratorPage $sm_page Object containing the page information 655 661 */
Note: See TracChangeset
for help on using the changeset viewer.
