customize-menus.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. window._wpCustomizeNavMenusSettings = {
  2. 'nonce': 'yo',
  3. 'phpIntMax': '2147483647',
  4. 'settingTransport': 'postMessage',
  5. 'allMenus': [{
  6. 'term_id': '2',
  7. 'name': 'Social Menu',
  8. 'slug': 'social-menu',
  9. 'term_group': '0',
  10. 'term_taxonomy_id': '2',
  11. 'taxonomy': 'nav_menu',
  12. 'description': '',
  13. 'parent': '0',
  14. 'count': '0'
  15. }, {
  16. 'term_id': '3',
  17. 'name': 'Primary Menu',
  18. 'slug': 'primary-menu',
  19. 'term_group': '0',
  20. 'term_taxonomy_id': '3',
  21. 'taxonomy': 'nav_menu',
  22. 'description': '',
  23. 'parent': '0',
  24. 'count': '0'
  25. }],
  26. 'defaultSettingValues': {
  27. 'nav_menu': {
  28. 'name': '',
  29. 'description': '',
  30. 'parent': 0,
  31. 'auto_add': false
  32. },
  33. 'nav_menu_item': {
  34. 'object_id': 0,
  35. 'object': '',
  36. 'menu_item_parent': 0,
  37. 'position': 0,
  38. 'type': 'custom',
  39. 'title': '',
  40. 'url': '',
  41. 'target': '',
  42. 'attr_title': '',
  43. 'description': '',
  44. 'classes': '',
  45. 'xfn': '',
  46. 'status': 'publish',
  47. 'original_title': '',
  48. 'nav_menu_term_id': 0
  49. }
  50. },
  51. 'itemTypes': [
  52. {
  53. 'title': 'Post',
  54. 'type': 'post_type',
  55. 'object': 'post'
  56. },
  57. {
  58. 'title': 'Page',
  59. 'type': 'post_type',
  60. 'object': 'page'
  61. },
  62. {
  63. 'title': 'Category',
  64. 'type': 'taxonomy',
  65. 'object': 'category'
  66. },
  67. {
  68. 'title': 'Tag',
  69. 'type': 'taxonomy',
  70. 'object': 'post_tag'
  71. },
  72. {
  73. 'title': 'Format',
  74. 'type': 'taxonomy',
  75. 'object': 'post_format'
  76. }
  77. ],
  78. 'l10n': {
  79. 'custom_label': 'Custom Link',
  80. 'customizingMenus': 'Customizing ▸ Menus',
  81. 'invalidTitleTpl': '%s (Invalid)',
  82. 'itemAdded': 'Menu item added',
  83. 'itemDeleted': 'Menu item deleted',
  84. 'itemsFound': 'Number of items found: %d',
  85. 'itemsFoundMore': 'Additional items found: %d',
  86. 'itemsLoadingMore': 'Loading more results... please wait.',
  87. 'menuAdded': 'Menu created',
  88. 'menuDeleted': 'Menu deleted',
  89. 'menuLocation': '(Currently set to: %s)',
  90. 'menuNameLabel': 'Menu Name',
  91. 'movedDown': 'Menu item moved down',
  92. 'movedLeft': 'Menu item moved out of submenu',
  93. 'movedRight': 'Menu item is now a sub-item',
  94. 'movedUp': 'Menu item moved up',
  95. 'pendingTitleTpl': '%s (Pending)',
  96. 'postTypeLabel': 'Post Type',
  97. 'reorderLabelOff': 'Close reorder mode',
  98. 'reorderLabelOn': 'Reorder menu items',
  99. 'reorderModeOff': 'Reorder mode closed',
  100. 'reorderModeOn': 'Reorder mode enabled',
  101. 'taxonomyTermLabel': 'Taxonomy',
  102. 'unnamed': '(unnamed)',
  103. 'untitled': '(no label)'
  104. },
  105. 'locationSlugMappedToName': {
  106. 'main-footer': 'Main Footer',
  107. 'main-header': 'Main Header'
  108. }
  109. };
  110. window._wpCustomizeSettings.panels.nav_menus = {
  111. 'id': 'nav_menus',
  112. 'description': '<p>This panel is used for managing navigation menus for content you have already published on your site. You can create menus and add items for existing content such as pages, posts, categories, tags, formats, or custom links.</p><p>Menus can be displayed in locations defined by your theme or in <a href="javascript:wp.customize.panel( "widgets" ).focus();">widget areas</a> by adding a &#8220;Custom Menu&#8221; widget.</p>',
  113. 'priority': 100,
  114. 'type': 'nav_menus',
  115. 'title': 'Menus',
  116. 'content': '',
  117. 'active': true,
  118. 'instanceNumber': 2
  119. };
  120. // Nav Menu Locations.
  121. window._wpCustomizeSettings.sections.menu_locations = {
  122. 'id': 'menu_locations',
  123. 'description': '<p>Your theme contains 1 menu location. Select which menu you would like to use.<\/p><p>You can also place menus in widget areas with the Custom Menu widget.<\/p>',
  124. 'priority': 5,
  125. 'panel': 'nav_menus',
  126. 'type': 'default',
  127. 'title': 'Menu Locations',
  128. 'content': '',
  129. 'active': true,
  130. 'instanceNumber': 13,
  131. 'customizeAction': 'Customizing &#9656; Menus'
  132. };
  133. window._wpCustomizeSettings.settings['nav_menu_locations[social]'] = {
  134. 'value': 2,
  135. 'transport': 'postMessage',
  136. 'dirty': false
  137. };
  138. window._wpCustomizeSettings.controls['nav_menu_locations[social]'] = {
  139. 'settings': { 'default': 'nav_menu_locations[social]' },
  140. 'type': 'nav_menu_location',
  141. 'priority': 10,
  142. 'active': true,
  143. 'section': 'menu_locations',
  144. 'content': '<li id="customize-control-nav_menu_locations-social" class="customize-control customize-control-nav_menu_location"> <label> <span class="customize-control-title">Social Links Menu</span> <select data-customize-setting-link="nav_menu_locations[social]"> <option value="0">&mdash; Select &mdash;</option><option value="59">Prim</option><option value="60" selected="selected">Social</option><option value="61">test11</option><option value="62">test222</option><option value="63">test333</option> </select> </label> </li>',
  145. 'label': 'Social Links Menu',
  146. 'description': '',
  147. 'instanceNumber': 40,
  148. 'locationId': 'social'
  149. };
  150. window._wpCustomizeSettings.settings['nav_menu_locations[primary]'] = {
  151. 'value': 3,
  152. 'transport': 'postMessage',
  153. 'dirty': false
  154. };
  155. window._wpCustomizeSettings.controls['nav_menu_locations[primary]'] = {
  156. 'active': true,
  157. 'content': '<li id="customize-control-nav_menu_locations-primary" class="customize-control customize-control-nav_menu_location"> <label> <span class="customize-control-title">Primary Menu</span> <select data-customize-setting-link="nav_menu_locations[primary]"> <option value="0">&mdash; Select &mdash;</option><option value="59" selected="selected">Prim</option><option value="60">Social</option><option value="61">test11</option><option value="62">test222</option><option value="63">test333</option> </select> </label> </li>',
  158. 'description': '',
  159. 'instanceNumber': 39,
  160. 'label': 'Primary Menu',
  161. 'locationId': 'primary',
  162. 'priority': 10,
  163. 'section': 'menu_locations',
  164. 'settings': {
  165. 'default': 'nav_menu_locations[primary]'
  166. },
  167. 'type': 'nav_menu_location'
  168. };
  169. // Nav Menus.
  170. window._wpCustomizeSettings.sections['nav_menu[3]'] = {
  171. 'id': 'nav_menu[3]',
  172. 'description': '',
  173. 'priority': 10,
  174. 'panel': 'nav_menus',
  175. 'type': 'nav_menu',
  176. 'title': 'Primary Menu',
  177. 'content': '',
  178. 'active': true,
  179. 'instanceNumber': 15,
  180. 'customizeAction': 'Customizing &#9656; Menus',
  181. 'menu_id': 3
  182. };
  183. window._wpCustomizeSettings.settings['nav_menu[3]'] = {
  184. 'value': {
  185. 'name': 'Primary menu',
  186. 'description': '',
  187. 'parent': 0,
  188. 'auto_add': false
  189. },
  190. 'transport': 'postMessage',
  191. 'dirty': false
  192. };
  193. window._wpCustomizeSettings.sections['nav_menu[2]'] = {
  194. 'id': 'nav_menu[2]',
  195. 'description': '',
  196. 'priority': 10,
  197. 'panel': 'nav_menus',
  198. 'type': 'nav_menu',
  199. 'title': 'Social menu',
  200. 'content': '',
  201. 'active': true,
  202. 'instanceNumber': 14,
  203. 'customizeAction': 'Customizing &#9656; Menus',
  204. 'menu_id': 2
  205. };
  206. window._wpCustomizeSettings.settings['nav_menu[2]'] = {
  207. 'value': {
  208. 'name': 'Social menu',
  209. 'description': '',
  210. 'parent': 0,
  211. 'auto_add': false
  212. },
  213. 'transport': 'postMessage',
  214. 'dirty': false
  215. };
  216. // Menu items.
  217. window._wpCustomizeSettings.settings['nav_menu_item[2000]'] = {
  218. 'dirty': false,
  219. 'transport': 'postMessage',
  220. 'value': {
  221. 'attr_title': '',
  222. 'classes': [
  223. ''
  224. ],
  225. 'description': '',
  226. 'menu_item_parent': 0,
  227. 'nav_menu_term_id': 3,
  228. 'object': 'page',
  229. 'object_id': 2,
  230. 'original_title': 'Sample Page',
  231. 'position': 1,
  232. 'status': 'publish',
  233. 'target': '',
  234. 'title': 'Sample Page',
  235. 'type': 'post_type',
  236. 'type_label': 'Page',
  237. 'url': 'http://src.wordpress-develop.dev/sample-page/',
  238. 'xfn': ''
  239. }
  240. };
  241. window._wpCustomizeSettings.controls['nav_menu_item[2000]'] = {
  242. 'active': true,
  243. 'attr_title': '',
  244. 'classes': '',
  245. 'content': '<li id="customize-control-nav_menu_item-2000" class="customize-control customize-control-nav_menu_item"> </li>',
  246. 'depth': 0,
  247. 'description': '',
  248. 'el_classes': 'menu-item menu-item-depth-0 menu-item-page menu-item-edit-inactive',
  249. 'instanceNumber': 42,
  250. 'item_type': 'post_type',
  251. 'item_type_label': 'Page',
  252. 'label': 'Sample Page',
  253. 'menu_item_id': 2000,
  254. 'original_title': 'Sample Page',
  255. 'parent': 0,
  256. 'priority': 1,
  257. 'section': 'nav_menu[3]',
  258. 'settings': {
  259. 'default': 'nav_menu_item[2000]'
  260. },
  261. 'target': '',
  262. 'title': 'Sample Page',
  263. 'type': 'nav_menu_item',
  264. 'url': 'http://src.wordpress-develop.dev/sample-page/',
  265. 'xfn': ''
  266. };
  267. window._wpCustomizeSettings.settings['nav_menu_item[2001]'] = {
  268. 'dirty': false,
  269. 'transport': 'postMessage',
  270. 'value': {
  271. 'attr_title': '',
  272. 'classes': [
  273. ''
  274. ],
  275. 'description': '',
  276. 'menu_item_parent': 0,
  277. 'nav_menu_term_id': 3,
  278. 'object': 'custom',
  279. 'object_id': 2001,
  280. 'original_title': '',
  281. 'position': 2,
  282. 'status': 'publish',
  283. 'target': '',
  284. 'title': 'Example',
  285. 'type': 'custom',
  286. 'type_label': 'Custom Link',
  287. 'url': 'http://example.com/',
  288. 'xfn': ''
  289. }
  290. };
  291. window._wpCustomizeSettings.controls['nav_menu_item[2001]'] = {
  292. 'active': true,
  293. 'attr_title': '',
  294. 'classes': '',
  295. 'content': '<li id="customize-control-nav_menu_item-2001" class="customize-control customize-control-nav_menu_item"> </li>',
  296. 'depth': 0,
  297. 'description': '',
  298. 'el_classes': 'menu-item menu-item-depth-0 menu-item-custom menu-item-edit-inactive',
  299. 'instanceNumber': 46,
  300. 'item_type': 'custom',
  301. 'item_type_label': 'Custom Link',
  302. 'label': 'Example',
  303. 'menu_item_id': 2001,
  304. 'original_title': '',
  305. 'parent': 0,
  306. 'priority': 2,
  307. 'section': 'nav_menu[3]',
  308. 'settings': {
  309. 'default': 'nav_menu_item[2001]'
  310. },
  311. 'target': '',
  312. 'title': 'Example',
  313. 'type': 'nav_menu_item',
  314. 'url': 'http://example.com/',
  315. 'xfn': ''
  316. };
  317. window._wpCustomizeSettings.settings['nav_menu_item[2002]'] = {
  318. 'dirty': false,
  319. 'transport': 'postMessage',
  320. 'value': {
  321. 'attr_title': '',
  322. 'classes': '',
  323. 'description': '',
  324. 'menu_item_parent': 2001,
  325. 'nav_menu_term_id': 3,
  326. 'object': '',
  327. 'object_id': 0,
  328. 'original_title': 'Sub-Example',
  329. 'position': 3,
  330. 'status': 'publish',
  331. 'target': '',
  332. 'title': 'Example',
  333. 'type': 'custom',
  334. 'type_label': 'Custom Link',
  335. 'url': 'http://sub.example.com/',
  336. 'xfn': ''
  337. }
  338. };
  339. window._wpCustomizeSettings.controls['nav_menu_item[2002]'] = {
  340. 'active': true,
  341. 'attr_title': '',
  342. 'classes': '',
  343. 'content': '<li id="customize-control-nav_menu_item-2002" class="customize-control customize-control-nav_menu_item"> </li>',
  344. 'depth': 0,
  345. 'description': '',
  346. 'el_classes': 'menu-item menu-item-depth-0 menu-item-custom menu-item-edit-inactive',
  347. 'instanceNumber': 46,
  348. 'item_type': 'custom',
  349. 'item_type_label': 'Custom Link',
  350. 'label': 'Sub-Example',
  351. 'menu_item_id': 2001,
  352. 'original_title': '',
  353. 'parent': 2001,
  354. 'priority': 3,
  355. 'section': 'nav_menu[3]',
  356. 'settings': {
  357. 'default': 'nav_menu_item[2002]'
  358. },
  359. 'target': '',
  360. 'title': 'Sub-Example',
  361. 'type': 'nav_menu_item',
  362. 'url': 'http://sub.example.com/',
  363. 'xfn': ''
  364. };
  365. // Meta controls.
  366. window._wpCustomizeSettings.sections.add_menu = {
  367. 'id': 'add_menu',
  368. 'description': '',
  369. 'priority': 999,
  370. 'panel': 'nav_menus',
  371. 'type': 'new_menu',
  372. 'title': 'Add a Menu',
  373. 'content': '<li id="accordion-section-add_menu" class="accordion-section-new-menu">\n\t\t\t<button type="button" class="button add-new-menu-item add-menu-toggle" aria-expanded="false">\n\t\t\t\tAdd a Menu\t\t\t<\/button>\n\t\t\t<ul class="new-menu-section-content"><\/ul>\n\t\t<\/li>',
  374. 'active': true,
  375. 'instanceNumber': 16,
  376. 'customizeAction': 'Customizing &#9656; Menus'
  377. };
  378. window._wpCustomizeSettings.controls.new_menu_name = {
  379. 'settings': { 'default': 'new_menu_name' },
  380. 'type': 'text',
  381. 'priority': 10,
  382. 'active': true,
  383. 'section': 'add_menu',
  384. 'content': '<li id="customize-control-new_menu_name" class="customize-control customize-control-text"> <label> <input type="text" class="menu-name-field" placeholder="New menu name" value="" data-customize-setting-link="new_menu_name" /> </label> </li>',
  385. 'label': '',
  386. 'description': '',
  387. 'instanceNumber': 46
  388. };
  389. // From nav-menu.js.
  390. window.wpNavMenu = {
  391. 'options': {
  392. 'menuItemDepthPerLevel': 30,
  393. 'globalMaxDepth': 11,
  394. 'sortableItems': '> *',
  395. 'targetTolerance': 0
  396. },
  397. 'menusChanged': false,
  398. 'isRTL': false,
  399. 'negateIfRTL': 1
  400. };