| Total Complexity | 10 |
| Complexity/F | 2 |
| Lines of Code | 37 |
| Function Count | 5 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | // Copyright Zikula Foundation, licensed MIT. |
||
| 3 | jQuery.noConflict(); |
||
| 4 | /* |
||
| 5 | Fix provided by http://softec.lu/site/DevelopersCorner/BootstrapPrototypeConflict |
||
| 6 | */ |
||
| 7 | if (typeof Prototype !== 'undefined' && Prototype.BrowserFeatures.ElementExtensions) { |
||
|
|
|||
| 8 | var disablePrototypeJS = function (method, pluginsToDisable) { |
||
| 9 | var handler = function (event) { |
||
| 10 | event.target[method] = undefined; |
||
| 11 | setTimeout(function () { |
||
| 12 | delete event.target[method]; |
||
| 13 | }, 0); |
||
| 14 | }; |
||
| 15 | pluginsToDisable.each(function (plugin) { |
||
| 16 | jQuery(window).on(method + '.bs.' + plugin, handler); |
||
| 17 | }); |
||
| 18 | }, |
||
| 19 | pluginsToDisable = ['collapse', 'dropdown', 'modal', 'tooltip', 'popover', 'tab']; |
||
| 20 | disablePrototypeJS('show', pluginsToDisable); |
||
| 21 | disablePrototypeJS('hide', pluginsToDisable); |
||
| 22 | } |
||
| 23 | |||
| 24 | // setup ajax for jQuery |
||
| 25 | (function($) { |
||
| 26 | var defaultOptions = { |
||
| 27 | type: 'POST', |
||
| 28 | timeout: Zikula.Config.ajaxtimeout || 5000 |
||
| 29 | }; |
||
| 30 | if (Zikula.Config.sessionName) { |
||
| 31 | var sessionId = new RegExp(Zikula.Config.sessionName + '=(.*?)(;|$)').exec(document.cookie); |
||
| 32 | if (sessionId && sessionId[1]) { |
||
| 33 | defaultOptions.headers = { |
||
| 34 | 'X-ZIKULA-AJAX-TOKEN': sessionId[1] |
||
| 35 | }; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | $.ajaxSetup(defaultOptions); |
||
| 39 | })(jQuery); |
||
| 40 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.