Global Variables

Last Updated on October 27, 2024 by Neil Murray

JavaScript Global Variables #

  • Questions
    • Should we consolidate all CF7 Skins variables under cf7s global
    • Can we replace some global variables with wp.data
    • Is each existing global variable still necessary
    • Can we use consistent naming for all global variables
    • How can we identify where each global variable is created & used
    • Can we combine or group global variables within each plugin

Global variable naming & grouping #

  • cf7s
    • cf7s-skins – replaces current cf7sAdmin
    • cf7s-pro extra
    • cf7s-multi – replaces current cf7skinsmulti
      • cf7s-multi_init – replaces current cf7skinsmulti_init
      • cf7s-multi_save – replaces current cf7skinsmulti_save_visual
    • cf7s-ready styles
    • cf7s-logic – replaces current cf7slogic
    • cf7s-logic_admin – replaces current CF7S_Logic_Admin
    • cf7s-visual – replaces current cf7svisual
      • cf7s-visual_gen – replaces current cf7svisual?
      • cf7s-visual_form
      • cf7s-visual_mail
      • cf7s-visual_save – replaces current cf7svisual_save_multi
      • cf7s-payment
      • cf7s-valid

back to top

CF7 Skins #

back to top

window.cf7s

[add description]

  • window.cf7s
  • l10n: {loading: “Loading template…”, emptyfilter: “Empty filter, please select a filter.”, select: “Select”, selected: “Selected”, deselect: “Deselect”, …}
  • load: “load_template”
  • nonce: “004d05e997”
  • sort: “cf7s_sort_skin”
  • textarea: textarea.multi

back to top

window.cf7sAdmin

[add description]

  • window.cf7sAdmin
  • addFilter: ƒ ()
  • applyFilters: ƒ ( event )
  • backToFilters: ƒ ( event )
  • clearFilters: ƒ ( event )
  • close: ƒ (e)
  • deselect: ƒ (e)
  • details: ƒ (e)
  • filters: ƒ (e)
  • filtersChecked: ƒ ()
  • getTextarea: ƒ ()
  • init: ƒ ( url )
  • orderSkin: ƒ (e)
  • post_id: “3726”
  • select: ƒ (e)
  • selectHover: ƒ (m,e)
  • skinsSearch: ƒ (e)
  • sort: ƒ (e)
  • tab: ƒ (e)
  • updateMailtags: ƒ ()
  • view: ƒ (e)

back to top

window.cf7skinsmulti

[add description]

  • window.cf7skinsmulti
  • meta: {show_dialog: false, show_navlinks: true, show_progressbar: true, show_pagination: true, use_start_tab: “”, …}
  • nonce: “9608e7559b”
  • strings: {{{Form Tabs}}: “Form Tabs”, show_navlinks: “Show navigation links”, show_pagination: “Show pagination”, show_progressbar: “Show progress bar”, use_start_tab: “Use start tab”, …}

back to top

window.cf7skinsmulti_init()

[add description]

  • window.cf7skinsmulti_init()
  • arguments: (…)
  • caller: (…)
  • length: 0
  • name:

back to top

window.cf7skinsmulti_save_visual()

[add description]

  • window.cf7skinsmulti_save_visual()
  • arguments: null
  • caller: null
  • length: 0
  • name: “”

back to top

window.cf7slogic

[add description]

  • window.cf7slogic
  • ajaxurl: “http://cf7skinsdev.local/wp-admin/admin-ajax.php”
  • messages: {select_field: “Please select a field from the list.”, select_another: “The field has been added below, please select another field.”, select_criteria: “Please select one criteria from the dropdown list.”, missing_field: “%1$s is missing or deleted, this field will be removed.”, missing_criteria: “%1$s is missing or deleted, please choose another.”}
  • nonce: “b82eabd050”

back to top

window.CF7S_Logic_Admin

[add description]

  • window.CF7S_Logic_Admin
  • addItem: ƒ (event, e)
  • addStatement: ƒ (event, e)
  • criterias: 0
  • form: “”
  • init: ƒ ( url )
  • logic_fields: s.fn.init [div#logic-fields]
  • post_ID: “3726”
  • postdata: {nonce: “b82eabd050”, post_ID: “3726”, form: “↵↵ Your Deta…am pellentesque mi non scelerisque placerat.↵”}
  • removeField: ƒ (event, e)
  • removeStatement: ƒ (event, e)
  • removeTipsy: ƒ ()
  • restoreSpinner: ƒ ()
  • selectCriteria: ƒ (event, e)
  • spinner: s.fn.init [span.spinner, prevObject: S.fn.init(1)]
  • statements: 0
  • update_logic_field: ƒ ()

back to top

CF7 Skins Visual #

back to top

window.cf7svisual

JSON object used to transfer data between React & WordPress.

  • window.cf7svisual
  • addons: – Add-ons functions
    • get: ƒ (hook)- [ Why is this not done on wp.data? ]
    • register: ƒ register(hook,callback)
  • ajaxurl: URL for AJAX post request
  • environment:  – development or production
  • id: –
  • integration: [] –
  • items: – current form field items with user settings
  • multi: – used to transfer data between between Visual Multi & CF7 Area Multi
    • input_name: “cf7s-visual-multi-options”}
    • options – CF7 Skins Multi options settings of form
  • nonce: – WordPress generated nonce for security checking
  • options: – CF7 Skins options settings (general)
  • title: – form title
  • treeData: – RST tree data
  • update: – refer Working with CF7 Skins AJAX API
  • util: – shared Utilities functions
    • cf7sRequest – AJAX request to update CF7 textarea
  • versions: – WP & CF7 versions installed

back to top

window.cf7svisual_save_multi()

[add description]

  • window.cf7svisual_save_multi()
  • arguments: (…)
  • caller: (…)
  • length: 0
  • name: “”
  • prototype: {constructor: ƒ}

back to top

Contact Form 7 #

back to top

WordPress Core #

  • wp-a11y – accessibility utilities for WordPress
  • wp-hooks – WordPress hooks API for JavaScript
  • wp-annotations – annotate content in the Gutenberg editor
  • wp-api-fetch – utility to make WordPress REST API requests (wrapper around window.fetch).

back to top

Learning

back to top

Further reading

  • Item

back to top


Notes

Add notes here

Save all Images to Sync – use ..\Sync\..\Development\Development Guidelines\CF7 Skins Code\CF7 Skins Visual Tools\Components Hooks etc\Global Variables\