Skip to content

Commit 72a4d74

Browse files
author
Musa Demir
committed
upgrade bower-abp-resources to abp 5.10.1
1 parent d49fe9f commit 72a4d74

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

Abp/Framework/scripts/abp.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,10 @@
375375
* @param {string} value
376376
* @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
377377
* @param {string} path (optional)
378+
* @param {string} domain (optional)
379+
* @param {any} attributes (optional)
378380
*/
379-
function setCookieValue(key: string, value: string, expireDate?: Date, path?: string): void;
381+
function setCookieValue(key: string, value: string, expireDate?: Date, path?: string, domain?: string, attributes?: any): void;
380382

381383
/**
382384
* Gets a cookie with given key.

Abp/Framework/scripts/abp.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function (define) {
1+
(function (define) {
22
define(['jquery'], function ($) {
33
return (function () {
44
var abp = window.abp || {};
@@ -722,8 +722,10 @@
722722
* @param {string} value
723723
* @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
724724
* @param {string} path (optional)
725+
* @param {string} domain (optional)
726+
* @param {any} attributes (optional)
725727
*/
726-
abp.utils.setCookieValue = function (key, value, expireDate, path, domain) {
728+
abp.utils.setCookieValue = function (key, value, expireDate, path, domain, attributes) {
727729
var cookieValue = encodeURIComponent(key) + '=';
728730

729731
if (value) {
@@ -742,6 +744,19 @@
742744
cookieValue = cookieValue + "; domain=" + domain;
743745
}
744746

747+
for (var name in attributes) {
748+
if (!attributes[name]) {
749+
continue;
750+
}
751+
752+
cookieValue += '; ' + name;
753+
if (attributes[name] === true) {
754+
continue;
755+
}
756+
757+
cookieValue += '=' + attributes[name].split(';')[0];
758+
}
759+
745760
document.cookie = cookieValue;
746761
};
747762

0 commit comments

Comments
 (0)