/**
  * Override this function to provide a list of scripts to be enqueued.
  * When overriding this function, be sure to call parent::scripts() to ensure the base class scripts are enqueued.
  * Following is an example of the array that is expected to be returned by this function:
  *<pre>
  * <code>
  *
  *    array(
  *        array(  "handle" => 'maskedinput',
  *                "src" => GFCommon::get_base_url() . '/js/jquery.maskedinput-1.3.min.js',
  *                "version" => GFCommon::$version,
  *                "deps" => array("jquery"),
  *                "in_footer" => false,
  *
  *                //Determines where the script will be enqueued. The script will be enqueued if any of the conditions match
  *                "enqueue" => array(
  *                                    //admin_page - Specified one or more pages (known pages) where the script is supposed to be enqueued.
  *                                    //To enqueue scripts in the front end (public website), simply don't define this setting
  *                                    array("admin_page" => array("form_settings", 'plugin_settings') ),
  *
  *                                    //tab - Specifies a form settings or plugin settings tab in which the script is supposed to be enqueued. If none is specified, the script will be enqueued in any of the form settings or plugin_settings page
  *                                    array("tab" => 'signature'),
  *
  *                                    //query - Specifies a set of query string ($_GET) values. If all specified query string values match the current requested page, the script will be enqueued
  *                                    array("query" => 'page=gf_edit_forms&view=settings&id=_notempty_')
  *
  *                                    //post - Specifies a set of post ($_POST) values. If all specified posted values match the current request, the script will be enqueued
  *                                    array("post" => 'posted_field=val')
  *
  *                                    )
  *            ),
  *        array(
  *            "handle" => 'super_signature_script',
  *            "src" => $this->get_base_url() . '/super_signature/ss.js',
  *            "version" => $this->_version,
  *            "deps" => array("jquery"),
  *            "callback" => array($this, 'localize_scripts'),
  *            "strings" => array(
  *                               // Accessible in JavaScript using the global variable "[script handle]_strings"
  *                               "stringKey1" => __("The string", 'gravityforms'),
  *                               "stringKey2" => __("Another string.", 'gravityforms')
  *                               )
  *            "enqueue" => array(
  *                                //field_types - Specifies one or more field types that requires this script. The script will only be enqueued if the current form has a field of any of the specified field types. Only applies when a current form is available.
  *                                array("field_types" => array("signature"))
  *                                )
  *        )
  *  );
  *
  * </code>
  * </pre>
  */
 public function scripts()
 {
     $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
     return array(array('handle' => 'gform_form_admin', 'enqueue' => array(array('admin_page' => array('form_settings')))), array('handle' => 'gform_gravityforms', 'enqueue' => array(array('admin_page' => array('form_settings')))), array('handle' => 'google_charts', 'src' => 'https://www.google.com/jsapi', 'version' => GFCommon::$version, 'enqueue' => array(array('admin_page' => array('results')))), array('handle' => 'gaddon_results_js', 'src' => GFAddOn::get_gfaddon_base_url() . "/js/gaddon_results{$min}.js", 'version' => GFCommon::$version, 'deps' => array('jquery', 'sack', 'jquery-ui-resizable', 'gform_datepicker_init', 'google_charts', 'gform_field_filter'), 'callback' => array('GFResults', 'localize_results_scripts'), 'enqueue' => array(array('admin_page' => array('results')))), array('handle' => 'gaddon_repeater', 'src' => GFAddOn::get_gfaddon_base_url() . "/js/repeater{$min}.js", 'version' => GFCommon::$version, 'deps' => array('jquery'), 'enqueue' => array(array('admin_page' => array('form_settings')))), array('handle' => 'gaddon_fieldmap_js', 'src' => GFAddOn::get_gfaddon_base_url() . "/js/gaddon_fieldmap{$min}.js", 'version' => GFCommon::$version, 'deps' => array('jquery', 'gaddon_repeater'), 'enqueue' => array(array('admin_page' => array('form_settings')))), array('handle' => 'gaddon_selectcustom_js', 'src' => GFAddOn::get_gfaddon_base_url() . "/js/gaddon_selectcustom{$min}.js", 'version' => GFCommon::$version, 'deps' => array('jquery'), 'enqueue' => array(array('admin_page' => array('form_settings', 'plugin_settings')))));
 }
 /**
  * Override this function to provide a list of scripts to be enqueued.
  * When overriding this function, be sure to call parent::scripts() to ensure the base class scripts are enqueued.
  * Following is an example of the array that is expected to be returned by this function:
  *<pre>
  * <code>
  *
  *    array(
  *        array(  "handle" => "maskedinput",
  *                "src" => GFCommon::get_base_url() . "/js/jquery.maskedinput-1.3.min.js",
  *                "version" => GFCommon::$version,
  *                "deps" => array("jquery"),
  *                "in_footer" => false,
  *
  *                //Determines where the script will be enqueued. The script will be enqueued if any of the conditions match
  *                "enqueue" => array(
  *                                    //admin_page - Specified one or more pages (known pages) where the script is supposed to be enqueued. When this setting is specified, scripts will only be enqueued in those pages.
  *                                    //To enqueue scripts in the front end (public website), simply don't define this setting
  *                                    array("admin_page" => array("form_settings", "plugin_settings") ),
  *
  *                                    //tab - Specifies a form settings or plugin settings tab in which the script is supposed to be enqueued. If none is specified, the script will be enqueued in any of the form settings or plugin_settings page
  *                                    array("tab" => "signature"),
  *
  *                                    //query - Specifies a set of query string ($_GET) values. If all specified query string values match the current requested page, the script will be enqueued
  *                                    array("query" => "page=gf_edit_forms&view=settings&id=_notempty_")
  *
  *                                    //post - Specifies a set of post ($_POST) values. If all specified posted values match the current request, the script will be enqueued
  *                                    array("post" => "posted_field=val")
  *
  *                                    )
  *            ),
  *        array(
  *            "handle" => "super_signature_script",
  *            "src" => $this->get_base_url() . "/super_signature/ss.js",
  *            "version" => $this->_version,
  *            "deps" => array("jquery"),
  *            "callback" => array($this, "localize_scripts"),
  *            "strings" => array(
  *                               // Accessible in JavaScript using the global variable "[script handle]_strings"
  *                               "stringKey1" => __("The string", "gravityforms"),
  *                               "stringKey2" => __("Another string.", "gravityforms")
  *                               )
  *            "enqueue" => array(
  *                                //field_types - Specifies one or more field types that requires this script. The script will only be enqueued if the current form has a field of any of the specified field types. Only applies when a current form is available.
  *                                array("field_types" => array("signature"))
  *                                )
  *        )
  *  );
  *
  * </code>
  * </pre>
  */
 protected function scripts()
 {
     return array(array('handle' => 'gform_form_admin', 'enqueue' => array(array("admin_page" => array("form_settings")))), array('handle' => 'gform_gravityforms', 'enqueue' => array(array("admin_page" => array("form_settings")))), array("handle" => "google_charts", "src" => "https://www.google.com/jsapi", "version" => GFCommon::$version, "enqueue" => array(array("admin_page" => array("results")))), array("handle" => "gaddon_results_js", "src" => GFAddOn::get_gfaddon_base_url() . "/js/gaddon_results.js", "version" => GFCommon::$version, "deps" => array('jquery', 'sack', 'jquery-ui-resizable', 'jquery-ui-datepicker', 'google_charts', 'gform_field_filter'), "callback" => array('GFResults', "localize_results_scripts"), "enqueue" => array(array("admin_page" => array("results")))), array('handle' => 'gaddon_repeater', 'src' => GFAddOn::get_gfaddon_base_url() . '/js/repeater.js', 'version' => GFCommon::$version, 'deps' => array('jquery'), 'enqueue' => array(array('admin_page' => array('form_settings')))));
 }
示例#3
0
 protected function results_page_init($results_page_config)
 {
     require_once "class-gf-results.php";
     $this->register_script("gaddon_results_js", GFAddOn::get_gfaddon_base_url() . "/js/gaddon_results.js", array("jquery", "sack"), GFCommon::$version, true);
     $this->register_script('jquery-ui-resizable', false, array('jquery'), false, false);
     $this->register_script('jquery-ui-datepicker', false, array('jquery'), false, false);
     $this->register_script('google_charts', "https://www.google.com/jsapi", array('jquery'), false, false);
     $this->register_style("gaddon_results_css", GFAddOn::get_gfaddon_base_url() . "/css/gaddon_results.css", null, GFCommon::$version);
     $gf_results = new GFResults($this->_slug, $results_page_config);
     $gf_results->init();
 }