parent
3210f14f33
commit
5985f95ce1
@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
var GdataExtension = {};
|
var GdataExtension = {};
|
||||||
|
|
||||||
GdataExtension.isAuthorized = function() {
|
GdataExtension.isAuthorized = function() {
|
||||||
return $.cookie('oauth2_token') !== null;
|
return Cookies.get('oauth2_token') !== null;
|
||||||
};
|
};
|
||||||
|
|
||||||
GdataExtension.showAuthorizationDialog = function(onAuthorized, onNotAuthorized) {
|
GdataExtension.showAuthorizationDialog = function(onAuthorized, onNotAuthorized) {
|
||||||
|
@ -344,7 +344,7 @@ function init() {
|
|||||||
|
|
||||||
"externals/jquery-1.11.1.js",
|
"externals/jquery-1.11.1.js",
|
||||||
"externals/jquery-migrate-1.2.1.js",
|
"externals/jquery-migrate-1.2.1.js",
|
||||||
"externals/jquery.cookie.js",
|
"externals/js.cookie.js",
|
||||||
"externals/jquery-ui/jquery-ui-1.10.3.custom.js",
|
"externals/jquery-ui/jquery-ui-1.10.3.custom.js",
|
||||||
"externals/date.js",
|
"externals/date.js",
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ function init() {
|
|||||||
[
|
[
|
||||||
"externals/jquery-1.11.1.js",
|
"externals/jquery-1.11.1.js",
|
||||||
"externals/jquery-migrate-1.2.1.js",
|
"externals/jquery-migrate-1.2.1.js",
|
||||||
"externals/jquery.cookie.js",
|
"externals/js.cookie.js",
|
||||||
"externals/suggest/suggest-4_3.js",
|
"externals/suggest/suggest-4_3.js",
|
||||||
"externals/jquery-ui/jquery-ui-1.10.3.custom.js",
|
"externals/jquery-ui/jquery-ui-1.10.3.custom.js",
|
||||||
"externals/imgareaselect/jquery.imgareaselect.js",
|
"externals/imgareaselect/jquery.imgareaselect.js",
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
/**
|
|
||||||
* Cookie plugin
|
|
||||||
*
|
|
||||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
|
||||||
* Dual licensed under the MIT and GPL licenses:
|
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
|
||||||
* http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a cookie with the given name and value and other optional parameters.
|
|
||||||
*
|
|
||||||
* @example $.cookie('the_cookie', 'the_value');
|
|
||||||
* @desc Set the value of a cookie.
|
|
||||||
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
|
||||||
* @desc Create a cookie with all available options.
|
|
||||||
* @example $.cookie('the_cookie', 'the_value');
|
|
||||||
* @desc Create a session cookie.
|
|
||||||
* @example $.cookie('the_cookie', null);
|
|
||||||
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
|
||||||
* used when the cookie was set.
|
|
||||||
*
|
|
||||||
* @param String name The name of the cookie.
|
|
||||||
* @param String value The value of the cookie.
|
|
||||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
|
||||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
|
||||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
|
||||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
|
||||||
* when the the browser exits.
|
|
||||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
|
||||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
|
||||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
|
||||||
* require a secure protocol (like HTTPS).
|
|
||||||
* @type undefined
|
|
||||||
*
|
|
||||||
* @name $.cookie
|
|
||||||
* @cat Plugins/Cookie
|
|
||||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the value of a cookie with the given name.
|
|
||||||
*
|
|
||||||
* @example $.cookie('the_cookie');
|
|
||||||
* @desc Get the value of a cookie.
|
|
||||||
*
|
|
||||||
* @param String name The name of the cookie.
|
|
||||||
* @return The value of the cookie.
|
|
||||||
* @type String
|
|
||||||
*
|
|
||||||
* @name $.cookie
|
|
||||||
* @cat Plugins/Cookie
|
|
||||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
|
||||||
*/
|
|
||||||
jQuery.cookie = function(name, value, options) {
|
|
||||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
|
||||||
options = options || {};
|
|
||||||
if (value === null) {
|
|
||||||
value = '';
|
|
||||||
options.expires = -1;
|
|
||||||
}
|
|
||||||
var expires = '';
|
|
||||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
|
||||||
var date;
|
|
||||||
if (typeof options.expires == 'number') {
|
|
||||||
date = new Date();
|
|
||||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
|
||||||
} else {
|
|
||||||
date = options.expires;
|
|
||||||
}
|
|
||||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
|
||||||
}
|
|
||||||
// CAUTION: Needed to parenthesize options.path and options.domain
|
|
||||||
// in the following expressions, otherwise they evaluate to undefined
|
|
||||||
// in the packed version for some reason...
|
|
||||||
var path = options.path ? '; path=' + (options.path) : '';
|
|
||||||
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
|
||||||
var secure = options.secure ? '; secure' : '';
|
|
||||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
|
||||||
} else { // only name given, get cookie
|
|
||||||
var cookieValue = null;
|
|
||||||
if (document.cookie && document.cookie != '') {
|
|
||||||
var cookies = document.cookie.split(';');
|
|
||||||
for (var i = 0; i < cookies.length; i++) {
|
|
||||||
var cookie = jQuery.trim(cookies[i]);
|
|
||||||
// Does this cookie string begin with the name we want?
|
|
||||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
|
||||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cookieValue;
|
|
||||||
}
|
|
||||||
};
|
|
163
main/webapp/modules/core/externals/js.cookie.js
vendored
Normal file
163
main/webapp/modules/core/externals/js.cookie.js
vendored
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
/*!
|
||||||
|
* JavaScript Cookie v2.2.1
|
||||||
|
* https://github.com/js-cookie/js-cookie
|
||||||
|
*
|
||||||
|
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
||||||
|
* Released under the MIT license
|
||||||
|
*/
|
||||||
|
;(function (factory) {
|
||||||
|
var registeredInModuleLoader;
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define(factory);
|
||||||
|
registeredInModuleLoader = true;
|
||||||
|
}
|
||||||
|
if (typeof exports === 'object') {
|
||||||
|
module.exports = factory();
|
||||||
|
registeredInModuleLoader = true;
|
||||||
|
}
|
||||||
|
if (!registeredInModuleLoader) {
|
||||||
|
var OldCookies = window.Cookies;
|
||||||
|
var api = window.Cookies = factory();
|
||||||
|
api.noConflict = function () {
|
||||||
|
window.Cookies = OldCookies;
|
||||||
|
return api;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}(function () {
|
||||||
|
function extend () {
|
||||||
|
var i = 0;
|
||||||
|
var result = {};
|
||||||
|
for (; i < arguments.length; i++) {
|
||||||
|
var attributes = arguments[ i ];
|
||||||
|
for (var key in attributes) {
|
||||||
|
result[key] = attributes[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function decode (s) {
|
||||||
|
return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
|
||||||
|
}
|
||||||
|
|
||||||
|
function init (converter) {
|
||||||
|
function api() {}
|
||||||
|
|
||||||
|
function set (key, value, attributes) {
|
||||||
|
if (typeof document === 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
attributes = extend({
|
||||||
|
path: '/'
|
||||||
|
}, api.defaults, attributes);
|
||||||
|
|
||||||
|
if (typeof attributes.expires === 'number') {
|
||||||
|
attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
|
||||||
|
}
|
||||||
|
|
||||||
|
// We're using "expires" because "max-age" is not supported by IE
|
||||||
|
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
|
||||||
|
|
||||||
|
try {
|
||||||
|
var result = JSON.stringify(value);
|
||||||
|
if (/^[\{\[]/.test(result)) {
|
||||||
|
value = result;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
value = converter.write ?
|
||||||
|
converter.write(value, key) :
|
||||||
|
encodeURIComponent(String(value))
|
||||||
|
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
||||||
|
|
||||||
|
key = encodeURIComponent(String(key))
|
||||||
|
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
|
||||||
|
.replace(/[\(\)]/g, escape);
|
||||||
|
|
||||||
|
var stringifiedAttributes = '';
|
||||||
|
for (var attributeName in attributes) {
|
||||||
|
if (!attributes[attributeName]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
stringifiedAttributes += '; ' + attributeName;
|
||||||
|
if (attributes[attributeName] === true) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Considers RFC 6265 section 5.2:
|
||||||
|
// ...
|
||||||
|
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
||||||
|
// character:
|
||||||
|
// Consume the characters of the unparsed-attributes up to,
|
||||||
|
// not including, the first %x3B (";") character.
|
||||||
|
// ...
|
||||||
|
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return (document.cookie = key + '=' + value + stringifiedAttributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
function get (key, json) {
|
||||||
|
if (typeof document === 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var jar = {};
|
||||||
|
// To prevent the for loop in the first place assign an empty array
|
||||||
|
// in case there are no cookies at all.
|
||||||
|
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||||
|
var i = 0;
|
||||||
|
|
||||||
|
for (; i < cookies.length; i++) {
|
||||||
|
var parts = cookies[i].split('=');
|
||||||
|
var cookie = parts.slice(1).join('=');
|
||||||
|
|
||||||
|
if (!json && cookie.charAt(0) === '"') {
|
||||||
|
cookie = cookie.slice(1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var name = decode(parts[0]);
|
||||||
|
cookie = (converter.read || converter)(cookie, name) ||
|
||||||
|
decode(cookie);
|
||||||
|
|
||||||
|
if (json) {
|
||||||
|
try {
|
||||||
|
cookie = JSON.parse(cookie);
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
jar[name] = cookie;
|
||||||
|
|
||||||
|
if (key === name) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return key ? jar[key] : jar;
|
||||||
|
}
|
||||||
|
|
||||||
|
api.set = set;
|
||||||
|
api.get = function (key) {
|
||||||
|
return get(key, false /* read as raw */);
|
||||||
|
};
|
||||||
|
api.getJSON = function (key) {
|
||||||
|
return get(key, true /* read as json */);
|
||||||
|
};
|
||||||
|
api.remove = function (key, attributes) {
|
||||||
|
set(key, '', extend(attributes, {
|
||||||
|
expires: -1
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
api.defaults = {};
|
||||||
|
|
||||||
|
api.withConverter = init;
|
||||||
|
|
||||||
|
return api;
|
||||||
|
}
|
||||||
|
|
||||||
|
return init(function () {});
|
||||||
|
}));
|
@ -87,7 +87,7 @@ ExpressionPreviewDialog.Widget = function(
|
|||||||
) {
|
) {
|
||||||
var language = "grel";
|
var language = "grel";
|
||||||
if (!(expression)) {
|
if (!(expression)) {
|
||||||
language = $.cookie("scripting.lang");
|
language = Cookies.get("scripting.lang");
|
||||||
if (language == "gel") { // backward compatible
|
if (language == "gel") { // backward compatible
|
||||||
language = "grel";
|
language = "grel";
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ ExpressionPreviewDialog.Widget = function(
|
|||||||
|
|
||||||
this._elmts.expressionPreviewLanguageSelect[0].value = language;
|
this._elmts.expressionPreviewLanguageSelect[0].value = language;
|
||||||
this._elmts.expressionPreviewLanguageSelect.bind("change", function() {
|
this._elmts.expressionPreviewLanguageSelect.bind("change", function() {
|
||||||
$.cookie("scripting.lang", this.value);
|
Cookies.set("scripting.lang", this.value, {"SameSite" : "Lax"});
|
||||||
self.update();
|
self.update();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user