Changeset 4929
- Timestamp:
- 02/18/2017 09:57:45 PM (8 years ago)
- Location:
- sites/trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/js/rosetta-roles.js
r2650 r4929 255 255 $( '#project-loading' ).remove(); 256 256 257 // Mark the first item as active. 258 var $firstActive = view.$el.find( 'li.active' ); 259 if ( ! $firstActive.length ) { 260 $firstActive = view.$el.find( 'li input[type=radio]' ); 261 } 262 if ( ! $firstActive.length ) { 263 $firstActive = view.$el.find( 'li:first-child' ); 264 } 265 $firstActive.closest( 'li' ).addClass( 'active' ); 266 257 267 this.views.ready(); 258 268 -
sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php
r4347 r4929 12 12 } 13 13 14 require __DIR__ . '/cross-locale-pte.php'; 15 14 16 class Rosetta_Roles { 15 17 /** … … 68 70 $this->gp_locale = $gp_locale; 69 71 70 add_action( 'admin_menu', array( $this, 'register_translation_editors_page' ) ); 71 add_filter( 'set-screen-option', array( $this, 'save_custom_screen_options' ), 10, 3 ); 72 73 add_action( 'translation_editor_added', array( $this, 'update_wporg_profile_badge' ) ); 74 add_action( 'translation_editor_removed', array( $this, 'update_wporg_profile_badge' ) ); 72 if ( ! is_main_site() ) { 73 add_action( 'admin_menu', array( $this, 'register_translation_editors_page' ) ); 74 add_filter( 'set-screen-option', array( $this, 'save_custom_screen_options' ), 10, 3 ); 75 76 add_action( 'translation_editor_added', array( $this, 'update_wporg_profile_badge' ) ); 77 add_action( 'translation_editor_removed', array( $this, 'update_wporg_profile_badge' ) ); 78 } 75 79 76 80 add_action( 'wp_ajax_rosetta-get-projects', array( $this, 'ajax_rosetta_get_projects' ) ); 81 82 Cross_Locale_PTE::init_admin(); 77 83 } 78 84 … … 93 99 add_action( 'load-' . $this->translation_editors_page, array( $this, 'load_translation_editors_page' ) ); 94 100 add_action( 'load-' . $this->translation_editors_page, array( $this, 'register_screen_options' ) ); 95 add_action( 'admin_print_scripts-' . $this->translation_editors_page, array( $this, 'enqueue_scripts' ) );96 add_action( 'admin_footer-' . $this->translation_editors_page, array( $this, 'print_js_templates' ) );97 add_action( 'admin_print_styles-' . $this->translation_editors_page, array( $this, 'enqueue_styles' ) );101 add_action( 'admin_print_scripts-' . $this->translation_editors_page, array( __CLASS__, 'enqueue_scripts' ) ); 102 add_action( 'admin_footer-' . $this->translation_editors_page, array( __CLASS__, 'print_js_templates' ) ); 103 add_action( 'admin_print_styles-' . $this->translation_editors_page, array( __CLASS__, 'enqueue_styles' ) ); 98 104 } 99 105 … … 101 107 * Enqueues scripts. 102 108 */ 103 public function enqueue_scripts() {109 public static function enqueue_scripts() { 104 110 wp_enqueue_script( 'string_score', plugins_url( '/js/string_score.min.js', __FILE__ ), array(), '0.1.22', true ); 105 wp_enqueue_script( 'rosetta-roles', plugins_url( '/js/rosetta-roles.js', __FILE__ ), array( 'jquery', 'wp-backbone', 'string_score' ), ' 9', true );111 wp_enqueue_script( 'rosetta-roles', plugins_url( '/js/rosetta-roles.js', __FILE__ ), array( 'jquery', 'wp-backbone', 'string_score' ), '10', true ); 106 112 } 107 113 … … 109 115 * Enqueues styles. 110 116 */ 111 public function enqueue_styles() {117 public static function enqueue_styles() { 112 118 $suffix = is_rtl() ? '-rtl' : ''; 113 119 wp_enqueue_style( 'rosetta-roles', plugins_url( "/css/rosetta-roles$suffix.css", __FILE__ ), array(), '4' ); … … 117 123 * Prints JavaScript templates. 118 124 */ 119 public function print_js_templates() {125 public static function print_js_templates() { 120 126 ?> 121 127 <script id="tmpl-project-checkbox" type="text/html"> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-rosetta-roles/inc/class-plugin.php
r4510 r4929 5 5 use GP; 6 6 use GP_Locales; 7 use Cross_Locale_PTE; 8 9 require_once WPMU_PLUGIN_DIR . '/rosetta-network/roles/cross-locale-pte.php'; 7 10 8 11 class Plugin { … … 68 71 add_action( 'gp_project_created', array( $this, 'project_created' ) ); 69 72 add_action( 'gp_project_saved', array( $this, 'project_saved' ) ); 73 add_filter( 'gp_translation_set_import_status', array( 'Cross_Locale_PTE', 'gp_translation_set_import_status' ), 9, 3 ); 70 74 71 75 if ( is_admin() ) { … … 97 101 if ( $this->is_global_administrator( $args['user_id'] ) ) { 98 102 return true; 103 } 104 105 // Grant permissions to Cross-Locale PTEs. 106 $cross_locale_pte_verdict = Cross_Locale_PTE::gp_pre_can_user( $verdict, $args ); 107 # var_dump($cross_locale_pte_verdict); 108 if ( is_bool( $cross_locale_pte_verdict ) ) { 109 return $cross_locale_pte_verdict; 99 110 } 100 111
Note: See TracChangeset
for help on using the changeset viewer.