efront 3.20.2 → 3.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,7 @@ var parseCookieFromText = function (cookie) {
23
23
  };
24
24
 
25
25
  function addCookie(cookie_text, originDomain = "") {
26
+ originDomain = getDomainPath(originDomain);
26
27
  if (!cookie_text) return;
27
28
  if (cookie_text instanceof Array) cookie_text = cookie_text.join(",");
28
29
  var cookies = cookie_text.replace(/(^|;|,)\s*(expires)=(\w*),([^=]*)(;|$)/ig, "$1$2=$3.$4$5")
@@ -57,6 +58,7 @@ function addCookie(cookie_text, originDomain = "") {
57
58
  }
58
59
 
59
60
  function getCookies(domainPath) {
61
+ domainPath = getDomainPath(domainPath);
60
62
  var cookieObject = {};
61
63
  var splited = domainPath.split("/");
62
64
  var domain = splited[0];
@@ -87,10 +89,16 @@ function getCookies(domainPath) {
87
89
  }
88
90
 
89
91
  function delCookies(domainPath) {
92
+ domainPath = getDomainPath(domainPath);
90
93
  var splited = domainPath.split("/");
91
94
  var domain = splited[0];
92
95
  delete cookiesMap[domain];
93
96
  }
97
+ function getDomainPath(url) {
98
+ var { host, pathname } = parseURL(url);
99
+ if (pathname) return host + pathname;
100
+ return host;
101
+ }
94
102
 
95
103
  return {
96
104
  cookiesMap,
@@ -322,6 +322,9 @@ function cross_(jsonp, digest = noop, method, url, headers) {
322
322
  xhr.nocookie = true;
323
323
  return xhr;
324
324
  };
325
+ xhr.getCookies = function () {
326
+ return getCookies(originDomain);
327
+ };
325
328
  requests.push(xhr);
326
329
  return xhr;
327
330
  }
@@ -128,6 +128,7 @@ var bindActionTarget = function (action, actionTarget) {
128
128
  };
129
129
 
130
130
  drag.on = function (target, actionTarget = target.dragTarget) {
131
+ if (getTargetIn(target, actionTarget, false)) [target, actionTarget] = [actionTarget, target];
131
132
  if (!actionTarget) {
132
133
  if (target.dragHandle) {
133
134
  actionTarget = target;
@@ -4,7 +4,7 @@
4
4
  <span class="required" ng-if="field.required">*</span>
5
5
  </div>
6
6
  <div class="body">
7
- <model _data=data _field=field></model>
7
+ <model _data=data _field=field _readonly="readonly"></model>
8
8
  <span class="error" ng-bind="error"></span>
9
9
  </div>
10
10
  <div class="foot" ng-if="field.msg">
@@ -12,5 +12,5 @@
12
12
  </div>
13
13
  </template>
14
14
  <template v-else>
15
- <model _data=data _field=field></model>
15
+ <model _data=data _field=field _readonly="readonly"></model>
16
16
  </template>
@@ -9,7 +9,8 @@ function main(elem) {
9
9
  model,
10
10
  data,
11
11
  error: null,
12
- field: f
12
+ field: f,
13
+ readonly: !!this.readonly
13
14
  });
14
15
  elem.oldValue = data[f.key];
15
16
  elem.setAttribute("field", f.key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.20.2",
3
+ "version": "3.20.3",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {