diff --git a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/bower.json b/security-admin/src/main/webapp/libs/other/jquery-cookie/js/bower.json deleted file mode 100644 index 8a5b5d04ca..0000000000 --- a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/bower.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "jquery.cookie", - "version": "1.4.0", - "main": [ - "./jquery.cookie.js" - ], - "dependencies": { - "jquery": ">=1.2" - }, - "ignore": [ - "test", - ".*", - "*.json", - "*.md", - "*.txt", - "Gruntfile.js" - ] -} diff --git a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/cookie.jquery.json b/security-admin/src/main/webapp/libs/other/jquery-cookie/js/cookie.jquery.json deleted file mode 100644 index 522d5e159e..0000000000 --- a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/cookie.jquery.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "cookie", - "version": "1.4.0", - "title": "jQuery Cookie", - "description": "A simple, lightweight jQuery plugin for reading, writing and deleting cookies.", - "author": { - "name": "Klaus Hartl", - "url": "https://github.com/carhartl" - }, - "maintainers": [ - { - "name": "Klaus Hartl", - "url": "https://github.com/carhartl" - }, - { - "name": "Fagner Martins", - "url": "https://github.com/FagnerMartinsBrack" - } - ], - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/carhartl/jquery-cookie/master/MIT-LICENSE.txt" - } - ], - "dependencies": { - "jquery": ">=1.2" - }, - "bugs": "https://github.com/carhartl/jquery-cookie/issues", - "homepage": "https://github.com/carhartl/jquery-cookie", - "docs": "https://github.com/carhartl/jquery-cookie#readme" -} diff --git a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/jquery.cookie.js b/security-admin/src/main/webapp/libs/other/jquery-cookie/js/jquery.cookie.js deleted file mode 100644 index 9271900087..0000000000 --- a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/jquery.cookie.js +++ /dev/null @@ -1,117 +0,0 @@ -/*! - * jQuery Cookie Plugin v1.4.0 - * https://github.com/carhartl/jquery-cookie - * - * Copyright 2013 Klaus Hartl - * Released under the MIT license - */ -(function (factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as anonymous module. - define(['jquery'], factory); - } else { - // Browser globals. - factory(jQuery); - } -}(function ($) { - - var pluses = /\+/g; - - function encode(s) { - return config.raw ? s : encodeURIComponent(s); - } - - function decode(s) { - return config.raw ? s : decodeURIComponent(s); - } - - function stringifyCookieValue(value) { - return encode(config.json ? JSON.stringify(value) : String(value)); - } - - function parseCookieValue(s) { - if (s.indexOf('"') === 0) { - // This is a quoted cookie as according to RFC2068, unescape... - s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); - } - - try { - // Replace server-side written pluses with spaces. - // If we can't decode the cookie, ignore it, it's unusable. - s = decodeURIComponent(s.replace(pluses, ' ')); - } catch(e) { - return; - } - - try { - // If we can't parse the cookie, ignore it, it's unusable. - return config.json ? JSON.parse(s) : s; - } catch(e) {} - } - - function read(s, converter) { - var value = config.raw ? s : parseCookieValue(s); - return $.isFunction(converter) ? converter(value) : value; - } - - var config = $.cookie = function (key, value, options) { - - // Write - if (value !== undefined && !$.isFunction(value)) { - options = $.extend({}, config.defaults, options); - - if (typeof options.expires === 'number') { - var days = options.expires, t = options.expires = new Date(); - t.setDate(t.getDate() + days); - } - - return (document.cookie = [ - encode(key), '=', stringifyCookieValue(value), - options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE - options.path ? '; path=' + options.path : '', - options.domain ? '; domain=' + options.domain : '', - options.secure ? '; secure' : '' - ].join('')); - } - - // Read - - var result = key ? undefined : {}; - - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. Also prevents odd result when - // calling $.cookie(). - var cookies = document.cookie ? document.cookie.split('; ') : []; - - for (var i = 0, l = cookies.length; i < l; i++) { - var parts = cookies[i].split('='); - var name = decode(parts.shift()); - var cookie = parts.join('='); - - if (key && key === name) { - // If second argument (value) is a function it's a converter... - result = read(cookie, value); - break; - } - - // Prevent storing a cookie that we couldn't decode. - if (!key && (cookie = read(cookie)) !== undefined) { - result[name] = cookie; - } - } - - return result; - }; - - config.defaults = {}; - - $.removeCookie = function (key, options) { - if ($.cookie(key) !== undefined) { - // Must not alter options, thus extending a fresh object... - $.cookie(key, '', $.extend({}, options, { expires: -1 })); - return true; - } - return false; - }; - -})); diff --git a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/package.json b/security-admin/src/main/webapp/libs/other/jquery-cookie/js/package.json deleted file mode 100644 index 3942d3247c..0000000000 --- a/security-admin/src/main/webapp/libs/other/jquery-cookie/js/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "jquery.cookie", - "version": "1.4.0", - "description": "A simple, lightweight jQuery plugin for reading, writing and deleting cookies.", - "main": "Gruntfile.js", - "directories": { - "test": "test" - }, - "scripts": { - "test": "grunt" - }, - "repository": { - "type": "git", - "url": "git://github.com/carhartl/jquery-cookie.git" - }, - "author": "Klaus Hartl", - "license": "MIT", - "gitHead": "bd3c9713222bace68d25fe2128c0f8633cad1269", - "readmeFilename": "README.md", - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.4.0", - "grunt-contrib-uglify": "~0.2.0", - "grunt-contrib-qunit": "~0.2.0", - "grunt-contrib-watch": "~0.3.0", - "grunt-compare-size": "~0.4.0", - "grunt-saucelabs": "~4.1.1", - "grunt-contrib-connect": "~0.5.0", - "gzip-js": "~0.3.0" - } -} diff --git a/security-admin/src/main/webapp/scripts/Init.js b/security-admin/src/main/webapp/scripts/Init.js index bff79b3c46..42f3f8deb7 100644 --- a/security-admin/src/main/webapp/scripts/Init.js +++ b/security-admin/src/main/webapp/scripts/Init.js @@ -46,9 +46,6 @@ require.config({ 'jquery-toggles': { deps: ['jquery'] }, - 'jquery.cookie': { - deps: ['jquery'] - }, 'tag-it': { deps: ['jquery', 'jquery-ui'] }, @@ -130,7 +127,6 @@ require.config({ 'momentTz': '../libs/bower/moment/js/moment-timezone-with-data.min', 'daterangepicker': '../libs/other/daterangepicker/js/daterangepicker', 'bootstrap-notify': '../libs/bower/bootstrap-notify/js/bootstrap-notify', - 'jquery.cookie': '../libs/other/jquery-cookie/js/jquery.cookie', 'jquery-toggles': '../libs/bower/jquery-toggles/js/toggles.min', 'tag-it': '../libs/bower/tag-it/js/tag-it', 'select2': '../libs/bower/select2/select2', diff --git a/security-admin/src/main/webapp/scripts/views/common/TopNav.js b/security-admin/src/main/webapp/scripts/views/common/TopNav.js index 7826ac608d..b24989a86c 100644 --- a/security-admin/src/main/webapp/scripts/views/common/TopNav.js +++ b/security-admin/src/main/webapp/scripts/views/common/TopNav.js @@ -27,7 +27,7 @@ define(function(require){ var SessionMgr = require('mgrs/SessionMgr'); var XAUtil = require('utils/XAUtils'); var App =require('App'); - require('jquery.cookie'); + var TopNav = Backbone.Marionette.ItemView.extend( /** @lends TopNav */ { @@ -80,8 +80,7 @@ define(function(require){ that.$('ul li').removeClass('active'); that.$('ul li:first').addClass('active'); }); - $.cookie('clientTimeOffset', new Date().getTimezoneOffset()); - + document.cookie = "clientTimeOffset=" + new Date().getTimezoneOffset(); //To hide top menu when user don't have access to all it's sub menu's _.each($(this.$el.find('.page-nav ul')), function(ul) { if($(ul).find('li').length <= 0){