array( 'wpml-tm-progressbar' ), ); foreach ( $scripts as $script ) { wp_register_script( $script, WPML_TM_URL . '/res/js/translation-editor/' . $script . '.js', array_merge( array( 'wpml-tm-editor-job' ), isset( $additional_requirements[ $script ] ) ? $additional_requirements[ $script ] : array() ), WPML_TM_VERSION, true ); } wp_register_script( 'wpml-tm-editor-scripts', WPML_TM_URL . '/res/js/translation-editor/translation-editor.js', array_merge( array( 'jquery', 'jquery-ui-dialog', 'wpml-tm-editor-templates', 'wpml-tm-editor-job' ), $scripts ), WPML_TM_VERSION, true ); wp_register_script( 'wpml-tp-polling-box-populate', WPML_TM_URL . '/res/js/tp-polling/box-populate.js', array( 'jquery' ), WPML_TM_VERSION, true ); wp_register_script( 'wpml-tp-polling', WPML_TM_URL . '/res/js/tp-polling/poll-for-translations.js', array( 'wpml-tp-polling-box-populate' ), WPML_TM_VERSION, true ); wp_register_script( 'wpml-tm-mcs', WPML_TM_URL . '/res/js/mcs/wpml-tm-mcs.js', array( 'wpml-tp-polling' ), WPML_TM_VERSION, true ); wp_register_script( 'wpml-tm-mcs-translate-link-targets', WPML_TM_URL . '/res/js/mcs/wpml-tm-mcs-translate-link-targets.js', array(), WPML_TM_VERSION, true ); } if ( is_admin() ) { add_action( 'admin_enqueue_scripts', 'wpml_tm_register_js_scripts' ); } else { add_action( 'wp_enqueue_scripts', 'wpml_tm_register_js_scripts' ); }