PageRenderTime 52ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 1ms

/wp-content/plugins/wp-ui/js/wp-ui-dev.js

https://gitlab.com/Blueprint-Marketing/interoccupy.net
JavaScript | 1320 lines | 864 code | 299 blank | 157 comment | 231 complexity | d9e1c8f529df89c8cd6c578ed6eb7a32 MD5 | raw file
  1. /*!
  2. * WP UI version 0.8.5
  3. *
  4. * Copyright (c) 2011, Kavin ( http://kav.in )
  5. * @license - Dual licensed under the MIT and GPL licenses.
  6. *
  7. * Below components Copyright and License as per the respective authors.
  8. *
  9. * Includes jQuery cookie plugin by Klaus Hartl.
  10. * Includes jQuery BBQ plugin by Ben Alman.
  11. * Includes Mousewheel event plugin by Brandon Aaron.
  12. *
  13. *
  14. * Requires : jQuery v1.4.2, jQuery UI v1.8 or later.
  15. */
  16. (function( $ ) {
  17. if ( ! $.wpui ) $.wpui = {};
  18. if ( ! $.wpui.ids ) $.wpui.ids = {};
  19. if ( ! $.wpui.tabsNo ) $.wpui.tabsNo = 0;
  20. var wpUIOpts = window.wpUIOpts || {}, console = window.console;
  21. /// Enable Misc options.
  22. if ( typeof( wpUIOpts.misc_options ) != 'undefined' ) {
  23. var misc_opts = wpUIOpts.misc_options.split( "\n" ), misc_opts1={};
  24. for ( var i=0; i<misc_opts.length; i++ ) {
  25. doo = misc_opts[ i ].split('=');
  26. misc_opts1[ doo[ 0 ] ] = doo[ 1 ];
  27. }
  28. wpUIOpts.misc_opts = misc_opts1;
  29. }
  30. // Return treated ID strings.
  31. if ( typeof( $.wpui.getIds ) == 'undefined' ) {
  32. $.wpui.getIds = function( str, par ) {
  33. var num = $.wpui.tabsNo, dup;
  34. if ( typeof($.wpui.ids[ par ] ) == 'undefined' )
  35. $.wpui.ids[ par ] = [];
  36. str = $.trim(str).replace(/\s{1,}/gm, '_')
  37. .replace( /[^\-A-Za-z0-9\s_]/mg, '')
  38. .toLowerCase();
  39. for ( dup in $.wpui.ids ) {
  40. if ( $.inArray( str, $.wpui.ids[ dup ] ) != '-1' || $( '#' + str ).length ) {
  41. str = str + '-' + num;
  42. }
  43. }
  44. // characters.
  45. if ( str.match( /[^\x00-\x80]+/ ) ) {
  46. str = 'tabs-' + num;
  47. }
  48. $.wpui.ids[ par ].push( str );
  49. $.wpui.tabsNo++;
  50. return str;
  51. };
  52. }
  53. ///////////////////////////////////////////////////
  54. //////////////////// WP TABS //////////////////////
  55. ///////////////////////////////////////////////////
  56. // Extend the tabs proto.
  57. $.widget( "wpui.wptabs", {
  58. options : {
  59. header : 'h3.wp-tab-title',
  60. ajaxClass : 'a.wp-tab-load',
  61. topNav : (typeof wpUIOpts != "undefined" && wpUIOpts.topNav == 'on' ) ? true : false,
  62. bottomNav : (typeof wpUIOpts != "undefined" && wpUIOpts.bottomNav == 'on' ) ? true : false,
  63. position : 'top',
  64. navStyle : (typeof wpUIOpts != "undefined") ? wpUIOpts.tabsLinkClass : '',
  65. effect : (typeof wpUIOpts != "undefined") ? wpUIOpts.tabsEffect : '',
  66. effectSpeed : (typeof wpUIOpts != "undefined") ? wpUIOpts.effectSpeed : '',
  67. alwaysRotate : (typeof wpUIOpts != "undefined") ? wpUIOpts.alwaysRotate : '', // True - will rotate inspite of clicks. False - will stop.
  68. tabsEvent : (typeof wpUIOpts != "undefined") ? wpUIOpts.tabsEvent : '',
  69. collapsibleTabs : (typeof wpUIOpts != "undefined" && wpUIOpts.collapsibleTabs == 'on' ) ? true : false,
  70. tabPrevText : (typeof wpUIOpts != "undefined" && wpUIOpts.tabPrevText != '' ) ? wpUIOpts.tabPrevText : '&laquo; Previous',
  71. tabNextText : (typeof wpUIOpts != "undefined" && wpUIOpts.tabNextText != '' ) ? wpUIOpts.tabNextText : 'Next &raquo;',
  72. cookies : (typeof wpUIOpts != "undefined" && wpUIOpts.cookies == 'on' ) ? true : false,
  73. hashChange : (typeof wpUIOpts != "undefined" && wpUIOpts.hashChange == 'on' ) ? true : false,
  74. mouseWheel : (typeof wpUIOpts != "undefined" ) ? wpUIOpts.mouseWheelTabs : '',
  75. wpuiautop : true,
  76. followNav: false
  77. },
  78. _create : function() {
  79. var self = this, $this = this.element;
  80. this.jqui = ( this.element.hasClass( 'jqui-styles' ) ) ? true : false;
  81. this.o = this.options;
  82. this.header = $this.children( this.o.header );
  83. this.isVertical = $this.hasClass( 'wpui-tabs-vertical' ) ? true : false;
  84. this.mode = this.isVertical ? 'vertical' : 'horizontal';
  85. this.id = $this.attr( 'id' );
  86. if ( typeof($.wpui.ids[ this.id ] ) == 'undefined' )
  87. $.wpui.ids[ this.id ] = [];
  88. // Add the ul.
  89. this.ul = $( '<ul class="ui-tabs-nav" />' ).prependTo( this.element );
  90. if ( this.o.wpuiautop ) {
  91. $this.children('p, br')
  92. .not( 'div.wp-tab-content > br, div.wp-tab-content > p' )
  93. .filter(function() {
  94. return( $.trim( $(this).html() ) === '' );
  95. }).remove();
  96. }
  97. this.wrap = this.header.wrap( '<div class="ui-tabs-panel" />' );
  98. this.wrap.each(function() {
  99. $( this ).parent().append( $( this ).parent().nextUntil( "div.ui-tabs-panel" ) );
  100. });
  101. // Iterate through headers and add the styles.
  102. this.header.each(function( index ) {
  103. var elId = $( this ).text(),
  104. toLoad = $( this ).find( self.o.ajaxClass ),
  105. img = $( this ).find( 'img' ),
  106. linkStr = '';
  107. // Get this tabs's ID.
  108. elId = $.wpui.getIds( elId, self.id );
  109. if ( toLoad.length ) {
  110. // IT IS an AJAX LINK
  111. linkStr = '<a href="' + toLoad.attr( 'href' ) + '">' + toLoad.text() + '</a>';
  112. } else if ( $( this ).find( 'img' ).length == 1 ) {
  113. // IT IS AN IMAGE!!!!!!!!!!!!
  114. // Unwrap it.
  115. while ( img.parent().is( 'h3' ) ) img.unwrap();
  116. // Remove styles.
  117. img.removeAttr( 'style' ).css( 'vertical-align', 'middle' );
  118. // Get the id if no header text.
  119. if ( img.attr( 'title' ) != 'undefined' && img.attr( 'title') != '' && $( this ).text() == '' )
  120. elId = $.wpui.getIds( img.attr( 'title' ), self.id );
  121. linkStr = '<a href="#' + elId + '"><img src="' + img.attr( 'src' ) + '" title="' + img.attr( 'title' ) + '" />' + $( this ).text() + '</a>';
  122. } else {
  123. linkStr = '<a href="#' + elId + '">' + $( this ).text() + '</a>';
  124. }
  125. linkStr = '<li>' + linkStr + '</li>';
  126. self.ul.append( linkStr );
  127. if ( ! toLoad.length ) {
  128. $( this ).parent().attr( 'id', elId );
  129. } else {
  130. $( this ).parent().remove();
  131. }
  132. // $.wpui.ids[ self.id ].push( elId );
  133. // Another tab added.
  134. // $.wpui.tabsNo++;
  135. }).hide();
  136. if ( ! $this.find( '.ui-tabs' ).length ) {
  137. $this.wrapInner( '<div class="ui-tabs" />' );
  138. }
  139. },
  140. _init : function() {
  141. var self = this, $this = this.element, options = {};
  142. if ( this.o.effect == 'slideDown' ) {
  143. options.fx = { height: 'toggle', speed: this.o.effectSpeed };
  144. } else if ( this.o.effect == 'fadeIn' ) {
  145. options.fx = { opacity: 'toggle', speed: this.o.effectSpeed};
  146. }
  147. if ( this.o.cookies ) {
  148. options.cookie = { expires : 30 };
  149. }
  150. if ( this.o.tabsEvent ) {
  151. options.event = this.o.tabsEvent;
  152. }
  153. if ( this.o.collapsibleTabs ) {
  154. options.collapsible = true;
  155. }
  156. this.$tabs = $this.children( '.ui-tabs' ).tabs( options );
  157. this.setClasses();
  158. this.navigation();
  159. if ( this.isVertical ) this.goVertical();
  160. if ( typeof( $.wpui.ids.children ) == 'undefined' )
  161. $.wpui.ids.children = {};
  162. $this.find( '.wp-tab-content-wrapper' ).find( '.wpui-hashable' ).each(function() {
  163. if ( this.id )
  164. $.wpui.ids.children[ this.id ] = $( this ).closest( '.ui-tabs-panel' ).attr('id');
  165. });
  166. if ( $this.hasClass( 'wpui-sortable' ) ) {
  167. this.$tabs.find( 'ul.ui-tabs-nav' ).sortable({ axis : 'x' });
  168. }
  169. this.rotate();
  170. if ( $this.hasClass( 'tabs-bottom' ) ) {
  171. this.ul.appendTo( this.ul.parent() );
  172. }
  173. },
  174. setClasses : function() {
  175. var self = this, $this = this.element;
  176. this.ul.children().eq(0).addClass( 'first-li' );
  177. this.ul.children().last().addClass( 'last-li' );
  178. },
  179. rotate : function() {
  180. var rSpeed = this.element.attr( 'class' ).match( /tab-rotate-(.*)/, "$1" ), aRot;
  181. if ( rSpeed ) {
  182. rSpeed = rSpeed[1];
  183. if ( rSpeed.match(/(\d){1,2}s/, "$1") ) rSpeed = rSpeed.replace(/s$/, '') * 1000;
  184. aRot = ( this.o.alwaysRotate == "always" ) ? true : false;
  185. this.$tabs.tabs( 'rotate', rSpeed, aRot );
  186. }
  187. },
  188. navigation : function() {
  189. var self = this, $this = this.element;
  190. // if ( this.o.topNav || this.o.bottomNav ) return false;
  191. $this.find( 'div.ui-tabs-panel' ).each( function(i) {
  192. var navClass = ' ui-button ui-widget ui-state-default ui-corner-all',
  193. navPrevSpan = '<span class="ui-icon ui-icon-circle-triangle-w"></span>',
  194. navNextSpan = '<span class="ui-icon ui-icon-circle-triangle-e"></span>',
  195. totalLength = $( this ).parent().children('.ui-tabs-panel').length -1;
  196. ! self.o.topNav || $( this )
  197. .prepend( '<div class="tab-top-nav" />');
  198. ! self.o.bottomNav || $( this )
  199. .append( '<div class="tab-bottom-nav" />' );
  200. if ( i != 0 ) {
  201. ! self.o.topNav || $( this )
  202. .children('.tab-top-nav')
  203. .prepend('<a href="#" class="backward prev-tab ' + navClass + '">' + navPrevSpan + self.o.tabPrevText + '</a>' );
  204. ! self.o.bottomNav || $( this )
  205. .children('.tab-bottom-nav')
  206. .append('<a href="#" class="backward prev-tab ' + navClass + '">' + navPrevSpan + self.o.tabPrevText + '</a>');
  207. }
  208. if ( i != totalLength ) {
  209. ! self.o.topNav || $( this )
  210. .children('.tab-top-nav')
  211. .append('<a href="#" class="forward next-tab ' + navClass + '">' + self.o.tabNextText + navNextSpan + '</a>');
  212. ! self.o.bottomNav || $( this )
  213. .children('.tab-bottom-nav')
  214. .append('<a href="#" class="forward next-tab ' + navClass + '">' + self.o.tabNextText + navNextSpan + '</a>');
  215. }
  216. });
  217. $this.find( 'a.next-tab, a.prev-tab' ).hover(function() {
  218. $( this ).addClass( 'ui-state-hover' );
  219. }, function() {
  220. $( this ).removeClass( 'ui-state-hover' );
  221. });
  222. $this.find( 'a.next-tab, a.prev-tab' ).click(function() {
  223. if ( $( this ).is('a.next-tab') )
  224. self.goTo( "forward" );
  225. else
  226. self.goTo( "backward" );
  227. return false;
  228. });
  229. },
  230. goTo : function( dir ) {
  231. var self = this, $this = this.element, mrel;
  232. dir = dir || 'forward';
  233. mrel = $this.find('.ui-tabs').tabs('option', 'selected');
  234. mrel = ( dir == 'backward' ) ? mrel - 1 : mrel + 1;
  235. if ( dir == "forward" && mrel == $this.panelength ) mrel = 0;
  236. if ( dir == "backward" && mrel < 0 ) mrel = $this.panelength - 1;
  237. this.$tabs.tabs( "select", mrel );
  238. },
  239. changeMode : function( mode ) {
  240. // mode = mode || this.mode;
  241. // if ( mode == this.mode ) return false;
  242. window._oldO = this.o;
  243. this.destroy();
  244. this.element
  245. .toggleClass( 'wpui-tabs-vertical' )
  246. .wptabs( window._oldO );
  247. },
  248. binders : function() {
  249. },
  250. // goVertical : function() {
  251. // var self = this, $this = this.element;
  252. //
  253. //
  254. //
  255. // },
  256. goVertical : function() {
  257. var self = this, $this = this.element,
  258. ulWidth, getListWidth, ulHeight, parWidth, PaneWidth, maxPane, paneCount;
  259. this.$tabs
  260. .addClass( 'ui-tabs-vertical ui-helper-clearfix' );
  261. this.adjust();
  262. },
  263. adjust : function( mode ) {
  264. var self = this, $this = this.element, listWidth;
  265. mode = mode || this.mode;
  266. if ( this.mode == 'vertical' ) {
  267. this.ul.find('li')
  268. .removeClass('ui-corner-top').addClass( 'ui-corner-left' );
  269. this.ul
  270. .css({ position : 'absolute' })
  271. .removeClass( 'ui-corner-all' )
  272. .addClass( 'ui-corner-left' )
  273. .children()
  274. .css({ 'float' : 'left', clear: 'left', position : 'relative' });
  275. listWidth = $this.attr( 'class' ).match(/listwidth-(\d{2,4})/, "$1");
  276. if ( listWidth ) {
  277. listWidth = listWidth[ 1 ];
  278. } else {
  279. listWidth = this.ul.outerWidth();
  280. }
  281. listHeight = this.$tabs.height() / this.$tabs.outerHeight() * 100;
  282. ulHeight = this.ul.height();
  283. // Set the width and height.
  284. this.ul.width( listWidth )
  285. // .height( '99%' )
  286. .height( listHeight + '%' )
  287. .css({
  288. zIndex : '100'
  289. });
  290. // Fix the outermost width ( For Fluid width themes )
  291. this.$tabs.width( this.$tabs.parent().innerWidth() );
  292. paneWidth = this.$tabs.width() - this.ul.width();
  293. this.$tabs
  294. .find( '.ui-tabs-panel' )
  295. .css({ 'float' : 'right' })
  296. .outerWidth( paneWidth );
  297. this.$tabs
  298. .css({
  299. minHeight : ulHeight
  300. });
  301. if ( $this.hasClass( 'wpui-autoheight' ) ) {
  302. maxHeight = 0;
  303. $this.find( '.ui-tabs-panel' ).each(function() {
  304. maxHeight = Math.max( $( this ).height(), maxHeight );
  305. }).height( maxHeight );
  306. }
  307. } else {
  308. this.ul.find( 'li' )
  309. .toggleClass( 'ui-corner-top ui-corner-left' );
  310. this.ul
  311. .toggleClass( 'ui-corner-all ui-corner-left' )
  312. .children()
  313. .css({
  314. 'position' : 'static',
  315. 'clear' : none,
  316. 'float' : none
  317. });
  318. this.ul.height( "auto" ).width( "auto" );
  319. }
  320. // this.$tabs.find( '.ui-tabs-panel' ).each(function() {
  321. // if ( $( this ).outerHeight() > maxPane ) {
  322. // maxPane = $( this ).outerHeight();
  323. // }
  324. // });
  325. if ( this.o.effect == 'slideDown' )
  326. $this.find('.ui-tabs').tabs({ fx : null });
  327. },
  328. resize : function() {
  329. // this.goVertical();
  330. },
  331. _setOption : function( key, value ) {
  332. switch( key ) {
  333. // Mode
  334. case "mode":
  335. if ( ( value == 'horizontal' || value == 'vertical' ) && value != this.mode )
  336. this.changeMode( value );
  337. break;
  338. case "destroy":
  339. this.destroy();
  340. break;
  341. }
  342. },
  343. destroy : function() {
  344. this.header.show();
  345. // $this
  346. // .children( 'div' )
  347. // .filter(function() {
  348. // return( $.trim( $(this).html() ) === '' );
  349. // }).remove();
  350. while ( ! this.header.parent().is( this.element ) ) {
  351. this.header.unwrap();
  352. }
  353. this.ul.remove();
  354. this.element
  355. .find( '.tab-top-nav, .tab-bottom-nav' )
  356. .remove();
  357. if ( typeof( $.wpui.ids[ this.id ] ) != 'undefined' ) {
  358. delete $.wpui.ids[ this.id ];
  359. }
  360. $.Widget.prototype.destroy.call( this );
  361. }
  362. });
  363. $.fn.wpuiScroller = function(options) {
  364. var base = this;
  365. base.$el = jQuery(this);
  366. base.opts = jQuery.extend({},
  367. jQuery.fn.wpuiScroller.defaults, options);
  368. base.startTop = parseInt(base.$el.css('top'), 10);
  369. if (base.opts.limiter) {
  370. base.limiter = jQuery(base.opts.limiter);
  371. } else {
  372. base.limiter = base.$el.parent().parent();
  373. }
  374. base.startAt = parseInt(base.limiter.offset().top, 10);
  375. jQuery(window).scroll(function() {
  376. base.endAt = parseInt((base.limiter.height() + jQuery(window).height() / 2), 10);
  377. base.moveTo = base.startTop;
  378. if (jQuery(document).scrollTop() >= base.startAt) {
  379. base.moveTo = base.startTop + (jQuery(window).scrollTop() - base.startAt);
  380. if ((jQuery(window).scrollTop() + jQuery(window).height() / 2) >= (base.limiter.height() + base.limiter.offset().top - base.startTop)) {
  381. base.moveTo = base.limiter.height() - base.startTop;
  382. }
  383. }
  384. base.$el.css('top', base.moveTo);
  385. });
  386. return this;
  387. };
  388. jQuery.fn.wpuiScroller.defaults = {
  389. limiter: false,
  390. adJust: 50
  391. };
  392. // Common hash change function.
  393. $.wpui.hasher = function() {
  394. if ( typeof( $.bbq ) == 'undefined' ) return false;
  395. if ( typeof( 'wpUIOpts' ) != 'undefined' && typeof( 'wpUIOpts.linking_history' ) != 'undefined' && wpUIOpts.linking_history == 'off' ) return false;
  396. $( window ).bind( 'hashchange', function( e ) {
  397. // this.progressed = this.progressed || false;
  398. // if ( this.progressed ) return false;
  399. var state = [],
  400. finalT = window.location.hash.replace( /#/, '' ),
  401. preT = false;
  402. if ( typeof( $.wpui.ids.children ) != 'undefined' && typeof( $.wpui.ids.children[ finalT ] ) != 'undefined'
  403. // $.inArray( finalT, $.wpui.ids.children ) != -1
  404. ) {
  405. // && ( $( '#' + e.fragment ).is( ':wpui-wpspoiler' ) ) ) {
  406. preT = finalT;
  407. finalT = $.wpui.ids.children[ finalT ];
  408. }
  409. for ( var ins in $.wpui.ids ) {
  410. if ( $.inArray( finalT, $.wpui.ids[ ins ] ) != '-1' ) {
  411. // get the index.
  412. var index = $.wpui.ids[ ins ].indexOf( finalT ), tab, acc;
  413. // Do tabs.
  414. tab = $( '#' + ins ).children( ".ui-tabs" );
  415. if ( tab.length ) {
  416. $.wpui.scrollTo( tab, function() {
  417. tab.tabs( 'select', index );
  418. });
  419. }
  420. // Do accordions
  421. acc = $( '#' + ins ).children( '.ui-accordion' );
  422. if ( acc.length ) {
  423. $.wpui.scrollTo( acc, function() {
  424. acc.accordion( 'activate', index );
  425. });
  426. }
  427. }
  428. }
  429. if ( preT ) finalT = preT;
  430. if ( $( '#' + finalT ).parent().is( '.wp-spoiler' ) ) {
  431. $( '#' + finalT ).parent().wpspoiler( 'toggle' );
  432. }
  433. if ( $( '#' + finalT ).is( '.wp-spoiler' ) ) {
  434. $( '#' + finalT ).wpspoiler( 'toggle' );
  435. }
  436. if ( typeof( finalT ) != 'undefined' && finalT != '' ) {
  437. window.location.hash = finalT;
  438. // return false;
  439. }
  440. // state[ id ] = finalT;
  441. }).trigger( 'hashchange' );
  442. };
  443. $.wpui.hasher2 = function() {
  444. if ( typeof( $.bbq ) == 'undefined' ) return false;
  445. $( window ).bind( 'hashchange', function() {
  446. var hashObj = $.bbq.getState(), el = $({}), scrollTar = false;
  447. for( kin in hashObj ) {
  448. el = $( '#' + kin );
  449. if ( kin == 'scrollto' ) {
  450. $.wpui.scrollTo( hashObj[ kin ] );
  451. }
  452. if ( el.is( '.wp-tabs' ) ) {
  453. el.children( '.ui-tabs' ).tabs( 'select', parseInt( hashObj[ kin ], 10 ) );
  454. scrollTar = el.children( '.ui-tabs' );
  455. }
  456. if ( el.is( '.wp-accordion' ) ) {
  457. el.children( '.ui-accordion' ).accordion( 'activate', parseInt( hashObj[ kin ], 10 ) );
  458. scrollTar = el.children( '.ui-accordion' );
  459. }
  460. if ( el.is( '.wp-spoiler' ) ) {
  461. el.wpspoiler( 'toggle' );
  462. scrollTar = el;
  463. }
  464. }
  465. if ( scrollTar )
  466. $.wpui.scrollTo( scrollTar );
  467. }).trigger( 'hashchange' );
  468. };
  469. $.wpui.scrollTo = function( id, callback ) {
  470. callback = callback || false;
  471. id = ( typeof( id ) == 'string' ) ? $( '#' + id ) : id;
  472. if ( ! id.length ) return false;
  473. $( 'html' ).animate({
  474. scrollTop : id.offset().top - 30
  475. }, ( typeof( wpUIOpts ) != "undefined" ? wpUIOpts.effectSpeed : 100 ), function() {
  476. if ( typeof( callback ) == 'function' ) callback();
  477. });
  478. return id;
  479. };
  480. })( jQuery );
  481. jQuery( function() {
  482. if ( typeof( wpUIOpts ) != 'undefined' &&
  483. typeof( wpUIOpts.misc_opts ) != 'undefined' &&
  484. wpUIOpts.misc_opts.hashing_method == 2 )
  485. jQuery.wpui.hasher2();
  486. else
  487. jQuery.wpui.hasher();
  488. });
  489. (function( $ ) {
  490. ////////////////////////////////////////////////////
  491. //////////////////// WP Accordion //////////////////
  492. ///////////////////////////////////////////////////
  493. $.widget( 'wpui.wpaccord', {
  494. options : {
  495. header : 'h3.wp-tab-title',
  496. content : 'div.wp-tab-content',
  497. ajaxClass : 'a.wp-tab-load',
  498. effect : (typeof wpUIOpts != "undefined") ? wpUIOpts.accordEffect : '',
  499. autoHeight : (typeof wpUIOpts != "undefined" && wpUIOpts.accordAutoHeight == 'on' ) ? true : false,
  500. collapse : (typeof wpUIOpts != "undefined" && wpUIOpts.accordCollapsible == 'on' ) ? true : false,
  501. easing : (typeof wpUIOpts != "undefined" ) ? wpUIOpts.accordEasing : '',
  502. accordEvent : ( typeof wpUIOpts != "undefined" ) ? wpUIOpts.accordEvent : '',
  503. wpuiautop : true,
  504. hashChange : true,
  505. template : '<div class="wp-tab-content"><div class="wp-tab-content-wrapper">{$content}</div></div>'
  506. },
  507. _create : function() {
  508. self = this;
  509. $this = this.element;
  510. this.o = this.options;
  511. this.header = $this.find( this.o.header );
  512. this.id = $this.attr( 'id' );
  513. if ( this.o.wpuiautop ) {
  514. $this.find('p, br')
  515. .not( this.o.content + ' > br, ' + this.o.content + '.wp-tab-content > p' )
  516. .filter(function() {
  517. return( $.trim( $(this).html() ) === '' );
  518. }).remove();
  519. }
  520. $this.find( this.o.header + ',' + this.o.content ).wrapAll( '<div class="accordion" />' );
  521. this.header.each( function() {
  522. var elId = $( this ).text(),
  523. toLoad = $( this ).children( self.o.ajaxClass ),
  524. img = $( this ).find( 'img' ),
  525. linkStr = '';
  526. elId = $.wpui.getIds( elId, self.id );
  527. $( this )
  528. // .next()
  529. .attr( 'id', elId );
  530. if ( toLoad.length ) {
  531. $( '<div />' )
  532. .load( toLoad.attr( 'href' ), function( data ) {
  533. $( this ).html( self.o.template.replace( /\{\$content\}/, data ) );
  534. })
  535. .insertAfter( this );
  536. }
  537. });
  538. },
  539. _init : function() {
  540. var options = {}, accClass;
  541. options.autoHeight = this.o.autoHeight ? true : false;
  542. if ( this.o.collapsible ) {
  543. options.collapsible = true;
  544. options.active = false;
  545. }
  546. if ( this.o.easing ) options.animated = this.o.easing;
  547. options.event = this.o.accordEvent;
  548. this.accordion = $this.children( '.accordion' ).accordion( options );
  549. accClass = $this.attr( 'class' );
  550. if ( activePanel = accClass.match(/acc-active-(\d){1}/im) ) {
  551. this.accordion.accordion( 'activate', parseInt( activePanel[ 1 ], 10 ) );
  552. }
  553. if ( $this.hasClass( 'wpui-sortable' ) ) {
  554. this.header.each(function() {
  555. $( this ).wrap( '<div class="acc-group" />' );
  556. $( this ).parent().next().insertAfter( this );
  557. });
  558. this.accordion
  559. .accordion({
  560. header: "> div.acc-group > " + self.o.header
  561. }).sortable({
  562. handle : self.o.header,
  563. axis : 'y',
  564. stop: function( event, ui ) {
  565. ui.item.children( "h3" ).triggerHandler( "focusout" );
  566. }
  567. });
  568. }
  569. // Auto rotate the accordions
  570. this.rotate();
  571. if ( typeof( $.wpui.ids.children ) == 'undefined' )
  572. $.wpui.ids.children = {};
  573. $this.find( '.wp-tab-content-wrapper' ).contents().each(function() {
  574. if ( this.id )
  575. $.wpui.ids.children[ this.id ] = $( this ).closest( '.ui-accordion-content' ).attr('id');
  576. });
  577. },
  578. _setOption : function( key, value ) {
  579. switch( key ) {
  580. case "destroy":
  581. this.destroy();
  582. break;
  583. }
  584. $.Widget.prototype._setOption.apply( this, arguments );
  585. },
  586. rotate : function() {
  587. var self = this, rSpeed = this.element.attr( 'class' ).match( /tab-rotate-(.*)/, "$1" ), aRot, rotac;
  588. if ( rSpeed ) {
  589. rSpeed = rSpeed[1];
  590. if ( rSpeed.match(/(\d){1,2}s/, "$1") ) rSpeed = rSpeed.replace(/s$/, '') * 1000;
  591. cPanel = this.accordion.accordion( 'option', 'active' );
  592. tPanel = this.accordion.children().length / 2 -1;
  593. rotac = setInterval(function() {
  594. self.accordion.accordion( 'activate', ( cPanel > tPanel ) ? 0 : cPanel++ );
  595. }, rSpeed );
  596. self.accordion.children(":nth-child(odd)").bind( 'click', function() {
  597. clearInterval( rotac );
  598. });
  599. }
  600. },
  601. destroy : function() {
  602. this.header.unwrap();
  603. this.header.attr( 'class', this.o.header.replace( /.{1,6}\./, '' ) );
  604. this.header.siblings( this.o.content ).attr( 'class', this.o.content.replace( /.{1,6}\./, '' ) ).removeAttr( 'id' ).show();
  605. $.Widget.prototype.destroy.call( this );
  606. }
  607. });
  608. })( jQuery );
  609. (function( $ ) {
  610. ////////////////////////////////////////////////////
  611. //////////////////// WP Spoilers ///////////////////
  612. ///////////////////////////////////////////////////
  613. if ( ! $.wpui ) $.wpui = {};
  614. $.wpui._spoilerHashSet = false;
  615. $.widget( 'wpui.wpspoiler', {
  616. options : {
  617. hideText : ( typeof wpUIOpts != "undefined" ) ? wpUIOpts.spoilerHideText : '',
  618. showText : ( typeof wpUIOpts != "undefined" ) ? wpUIOpts.spoilerShowText : '',
  619. fade : true,
  620. slide : true,
  621. speed : 600,
  622. spanClass: '.toggle_text',
  623. headerClass : 'h3.ui-collapsible-header',
  624. openIconClass : 'ui-icon-triangle-1-s',
  625. closeIconClass : 'ui-icon-triangle-1-e',
  626. autoOpen : false
  627. },
  628. _create : function() {
  629. var base = this;
  630. this._isOpen = false;
  631. this._trigger( 'create' );
  632. this._spoil();
  633. this._hashSet = false;
  634. // $.wpui.wpspoiler.instances.push( this.element );
  635. $.wpui.wpspoiler.instances[ this.element.attr('id') ] = this.element;
  636. },
  637. _spoil : function( init ) {
  638. var self = this;
  639. self.o = this.options;
  640. this._trigger( 'init' );
  641. self.element.addClass( 'ui-widget ui-collapsible ui-helper-reset' );
  642. this.header = this.element.children( 'h3' ).first();
  643. this.content = this.header.next( 'div' );
  644. this.header.prepend( '<span class="ui-icon ' + self.o.openIconClass + '" />' )
  645. .append( '<span class="' + this._stripPre( self.o.spanClass ) + '" />');
  646. this.header.addClass( 'ui-collapsible-header ui-state-default ui-widget-header ui-helper-reset ui-corner-top ui-state-active' )
  647. .children( self.o.spanClass )
  648. .html( self.o.showText );
  649. this.content
  650. .addClass( 'ui-helper-reset ui-state-default ui-widget-content ui-collapsible-content ui-collapsible-hide' )
  651. .wrapInner( '<div class="ui-collapsible-wrapper" />' );
  652. this.animOpts = {};
  653. if ( self.o.fade ) this.animOpts.opacity = 'toggle';
  654. if ( self.o.slide ) this.animOpts.height = 'toggle';
  655. },
  656. _init : function() {
  657. var self = this;
  658. this._isOpen = false;
  659. if ( this.header.data('showtext') )
  660. this.options.showText = this.header.data( 'showtext' );
  661. if ( this.header.data('hidetext') )
  662. this.options.hideText = this.header.data( 'hidetext' );
  663. // this.hashGo();
  664. if ( this.options.autoOpen || this.header.hasClass( 'open-true' ) ) this.toggle();
  665. self.header.bind( 'click.wpspoiler', function() {
  666. self.toggle();
  667. })
  668. .hover( function() { $( this ).toggleClass( 'ui-state-hover' ); });
  669. this.content.find( '.close-spoiler' )
  670. .wrapInner( '<span class="ui-button-text" />')
  671. .addClass('ui-state-default ui-widget ui-corner-all ui-button-text-only' )
  672. .click(function() {
  673. self.toggle(); return false;
  674. });
  675. self.toggle();
  676. },
  677. _stripPre : function( str ) {
  678. return str.replace( /^(\.|#)/, '' );
  679. },
  680. toggle : function() {
  681. var TxT = ( ! this.isOpen() ) ? this.options.showText : this.options.hideText;
  682. this.header
  683. .toggleClass( 'ui-corner-top ui-corner-all ui-state-active' )
  684. .children( '.ui-icon' )
  685. .toggleClass( this.options.openIconClass + ' ' + this.options.closeIconClass )
  686. .siblings( 'span' )
  687. .html( TxT );
  688. this.animate();
  689. if ( this.isOpen() ) {
  690. this._trigger( 'close' );
  691. this._isOpen = false;
  692. } else {
  693. this._trigger( 'open' );
  694. this._isOpen = true;
  695. }
  696. },
  697. open : function() {
  698. if ( this.isOpen() ) this.toggle();
  699. },
  700. close : function() {
  701. if ( ! this.isOpen() ) this.toggle();
  702. },
  703. animate : function() {
  704. this.content.animate( this.animOpts, this.options.speed, this.options.easing, function() {
  705. });
  706. },
  707. isOpen : function() {
  708. return this._isOpen;
  709. },
  710. destroy : function() {
  711. this.header
  712. .removeClass( 'ui-collapsible-header ui-state-default ui-corner-all ui-helper-reset' )
  713. .find( 'span' )
  714. .remove();
  715. this.header.unbind( 'click.wpspoiler' );
  716. this.content
  717. .children()
  718. .unwrap()
  719. .end()
  720. .removeClass( 'ui-collapsible-content ui-corner-bottom ui-helper-reset');
  721. this.removeClass( 'ui-collapsible ui-widget' );
  722. $.Widget.prototype.destroy.call( this );
  723. },
  724. _getOtherInstances : function( dall ) {
  725. var element = this.element,
  726. all = dall || false;
  727. if ( ! all ) {
  728. return $.grep( $.wpui.wpspoiler.instances, function( el ) {
  729. return el != element;
  730. });
  731. } else {
  732. return $.wpui.wpspoiler.instances;
  733. }
  734. },
  735. _setOption : function( key, value ) {
  736. this.options[ key ] = value;
  737. switch( key ) {
  738. case 'open':
  739. case 'close':
  740. case 'toggle':
  741. this.toggle();
  742. break;
  743. case 'destroy':
  744. this.destroy();
  745. break;
  746. case 'status':
  747. return (this._isOpen() ? 'open' : 'closed' );
  748. break;
  749. case 'goto':
  750. return this.hashGo( value );
  751. break;
  752. }
  753. }
  754. });
  755. $.extend( $.wpui.wpspoiler, {
  756. instances : {}
  757. });
  758. $.fn.wpspoilerHash = function() {
  759. if ( $.wpui._spoilerHashSet ) return this;
  760. $( window ).bind( 'hashchange', function() {
  761. var some = $.bbq.getState(),
  762. spoils = $.wpui.wpspoiler.instances;
  763. if ( typeof( some ) == 'object' && typeof( spoils ) == 'object' ) {
  764. for ( so in some ) {
  765. if ( some[ so ] instanceof Array ) {
  766. var i = some[so].length;
  767. while( i-- ) {
  768. if ( spoils[ some[ so ] ] )
  769. spoils[ some[ so ][ i ] ].wpspoiler( so );
  770. }
  771. } else {
  772. if ( spoils[ some[ so ] ] )
  773. spoils[ some[so] ].wpspoiler( so );
  774. }
  775. }
  776. return false;
  777. }
  778. });
  779. $( window ).trigger( 'hashchange' );
  780. $.wpui._spoilerHashSet = true;
  781. return this;
  782. };
  783. $.widget( 'wpui.wpuiClickReveal', {
  784. options : {
  785. spanClass : 'span.wpui-click-reveal',
  786. showText : '<b>spoiler!</b>',
  787. hideText : '<b>Hide</b>',
  788. autoShow : false
  789. },
  790. _state : 'off',
  791. instances : {},
  792. _create : function() {
  793. var self = this, el = this.element;
  794. this.handle = $( '<span class="wpui-click-handle">' + this.options.showText + '</span>' )
  795. .insertBefore( el );
  796. },
  797. _init : function() {
  798. var self = this;
  799. if ( ! this.options.autoShow ) {
  800. this.element.toggle();
  801. this._getState( 'off' );
  802. } else {
  803. this._getState('on');
  804. }
  805. this.handle.click( function() {
  806. self.element.toggle( 'fast', function() {
  807. self._getState( this._state == 'on' ? 'off' : 'on' );
  808. });
  809. });
  810. },
  811. _getState : function( stat ) {
  812. if ( ! stat ) {
  813. return this._state;
  814. } else {
  815. return this._state = stat;
  816. }
  817. },
  818. _destroy : function() {
  819. }
  820. });
  821. })( jQuery );
  822. jQuery( document ).ready(function() {
  823. jQuery( '.wpui-click-reveal' ).wpuiClickReveal();
  824. });
  825. /**
  826. * The included files and init below.
  827. */
  828. if(typeof String.prototype.trim !== 'function') {
  829. String.prototype.trim = function() {
  830. return this.replace(/^\s+|\s+$/g, '');
  831. }
  832. }
  833. if(!Array.indexOf){
  834. Array.prototype.indexOf = function(obj){
  835. for(var i=0; i<this.length; i++){
  836. if(this[i]==obj){
  837. return i;
  838. }
  839. }
  840. }
  841. }
  842. /**
  843. * jQuery Cookie plugin
  844. *
  845. * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
  846. * Dual licensed under the MIT and GPL licenses:
  847. * http://www.opensource.org/licenses/mit-license.php
  848. * http://www.gnu.org/licenses/gpl.html
  849. *
  850. */
  851. // TODO JsDoc
  852. /**
  853. * Create a cookie with the given key and value and other optional parameters.
  854. *
  855. * @example $.cookie('the_cookie', 'the_value');
  856. * @desc Set the value of a cookie.
  857. * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
  858. * @desc Create a cookie with all available options.
  859. * @example $.cookie('the_cookie', 'the_value');
  860. * @desc Create a session cookie.
  861. * @example $.cookie('the_cookie', null);
  862. * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
  863. * used when the cookie was set.
  864. *
  865. * @param String key The key of the cookie.
  866. * @param String value The value of the cookie.
  867. * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
  868. * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
  869. * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
  870. * If set to null or omitted, the cookie will be a session cookie and will not be retained
  871. * when the the browser exits.
  872. * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
  873. * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
  874. * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
  875. * require a secure protocol (like HTTPS).
  876. * @type undefined
  877. *
  878. * @name $.cookie
  879. * @cat Plugins/Cookie
  880. * @author Klaus Hartl/klaus.hartl@stilbuero.de
  881. */
  882. /**
  883. * Get the value of a cookie with the given key.
  884. *
  885. * @example $.cookie('the_cookie');
  886. * @desc Get the value of a cookie.
  887. *
  888. * @param String key The key of the cookie.
  889. * @return The value of the cookie.
  890. * @type String
  891. *
  892. * @name $.cookie
  893. * @cat Plugins/Cookie
  894. * @author Klaus Hartl/klaus.hartl@stilbuero.de
  895. */
  896. jQuery.cookie = function (key, value, options) {
  897. // key and value given, set cookie...
  898. if (arguments.length > 1 && (value === null || typeof value !== "object")) {
  899. options = jQuery.extend({}, options);
  900. if (value === null) {
  901. options.expires = -1;
  902. }
  903. if (typeof options.expires === 'number') {
  904. var days = options.expires, t = options.expires = new Date();
  905. t.setDate(t.getDate() + days);
  906. }
  907. return (document.cookie = [
  908. encodeURIComponent(key), '=',
  909. options.raw ? String(value) : encodeURIComponent(String(value)),
  910. options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
  911. options.path ? '; path=' + options.path : '',
  912. options.domain ? '; domain=' + options.domain : '',
  913. options.secure ? '; secure' : ''
  914. ].join(''));
  915. }
  916. // key and possibly options given, get cookie...
  917. options = value || {};
  918. var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
  919. return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
  920. };
  921. if ( typeof wpUIOpts == 'object' && wpUIOpts.docWriteFix == 'on' ) {
  922. var docWriteTxt = "";
  923. jQuery(function() {
  924. document.write = function( dWT ) {
  925. docWriteTxt += dWT;
  926. }
  927. // document.write("");
  928. jQuery( docWriteTxt ).appendTo( 'body' );
  929. });
  930. } // END doc write fix.
  931. /*
  932. * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
  933. * http://benalman.com/projects/jquery-bbq-plugin/
  934. *
  935. * Copyright (c) 2010 "Cowboy" Ben Alman
  936. * Dual licensed under the MIT and GPL licenses.
  937. * http://benalman.com/about/license/
  938. */
  939. (function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
  940. /*
  941. * jQuery hashchange event - v1.2 - 2/11/2010
  942. * http://benalman.com/projects/jquery-hashchange-plugin/
  943. *
  944. * Copyright (c) 2010 "Cowboy" Ben Alman
  945. * Dual licensed under the MIT and GPL licenses.
  946. * http://benalman.com/about/license/
  947. */
  948. (function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
  949. jQuery.fn.extend({
  950. hashchange : function(fn) {
  951. return fn ? this.bind("hashchange", fn) : this.trigger("hashchange");
  952. }
  953. });
  954. /*
  955. * JSON Library
  956. * https://github.com/douglascrockford/JSON-js/blob/master/json2.js
  957. */
  958. var JSON;if(!JSON){JSON={};}
  959. (function(){"use strict";function f(n){return n<10?'0'+n:n;}
  960. if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
  961. f(this.getUTCMonth()+1)+'-'+
  962. f(this.getUTCDate())+'T'+
  963. f(this.getUTCHours())+':'+
  964. f(this.getUTCMinutes())+':'+
  965. f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
  966. var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
  967. function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
  968. if(typeof rep==='function'){value=rep.call(holder,key,value);}
  969. switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
  970. gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
  971. v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
  972. if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
  973. v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
  974. if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
  975. rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
  976. return str('',{'':value});};}
  977. if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
  978. return reviver.call(holder,key,value);}
  979. text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
  980. ('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
  981. if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
  982. throw new SyntaxError('JSON.parse');};}}());
  983. /* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
  984. * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
  985. * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
  986. * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
  987. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
  988. *
  989. * Version: 3.0.2
  990. *
  991. * Requires: 1.2.2+
  992. */
  993. (function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);
  994. /**
  995. * Init the scripts.
  996. */
  997. jQuery(document).ready(function( $ ) {
  998. if ( typeof wpUIOpts == 'object' ) {
  999. if ( wpUIOpts.enablePagination == 'on' &&
  1000. typeof jQuery.fn.wpuiPager == 'function' )
  1001. jQuery( 'div.wpui-pages-holder' ).wpuiPager();
  1002. if ( wpUIOpts.enableTabs == 'on' &&
  1003. typeof jQuery.fn.wptabs == 'function')
  1004. jQuery('div.wp-tabs').wptabs();
  1005. if ( wpUIOpts.enableSpoilers == 'on' &&
  1006. typeof jQuery.fn.wpspoiler == 'function')
  1007. jQuery('.wp-spoiler').wpspoiler();
  1008. if ( wpUIOpts.enableAccordion == 'on' &&
  1009. typeof jQuery.fn.wpaccord == 'function')
  1010. jQuery('.wp-accordion').wpaccord();
  1011. }
  1012. });