jsharmony 1.28.2 → 1.29.0

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.
package/clientjs/XExt.js CHANGED
@@ -1947,7 +1947,7 @@ exports = module.exports = function(jsh){
1947
1947
 
1948
1948
  //html - HTML or jQuery object
1949
1949
  XExt.CustomPrompt = function (sel, html, onInit, onAccept, onCancel, onClosed, options) {
1950
- options = _.extend({ backgroundClose: false, reuse: false, restoreFocus: true, onClosing: null }, options);
1950
+ options = _.extend({ backgroundClose: false, reuse: false, restoreFocus: true, onClosing: null, asyncInit: false }, options);
1951
1951
  if(options.specialKeys === false) options.specialKeys = { enter: false, escape: false };
1952
1952
  else options.specialKeys = _.extend({ enter: true, escape: true }, options.specialKeys);
1953
1953
 
@@ -1990,41 +1990,52 @@ exports = module.exports = function(jsh){
1990
1990
  if (onAccept) return onAccept(function () { acceptfunc_aftervalidate(); });
1991
1991
  else acceptfunc_aftervalidate();
1992
1992
  };
1993
- if (onInit) onInit(acceptfunc, cancelfunc);
1994
- jsh.$dialogBlock(sel + ' input.button_ok').on('click', acceptfunc);
1995
- jsh.$dialogBlock(sel + ' input.button_cancel').on('click', cancelfunc);
1993
+ XExt.execif(true,
1994
+ function(done){
1995
+ if(onInit && options.asyncInit){
1996
+ onInit(acceptfunc, cancelfunc, done);
1997
+ }
1998
+ else {
1999
+ if (onInit) onInit(acceptfunc, cancelfunc);
2000
+ return done();
2001
+ }
2002
+ },
2003
+ function(){
2004
+ jsh.$dialogBlock(sel + ' input.button_ok').on('click', acceptfunc);
2005
+ jsh.$dialogBlock(sel + ' input.button_cancel').on('click', cancelfunc);
1996
2006
 
1997
- jsh.$dialogBlock(sel).off('acceptDialog').on('acceptDialog', acceptfunc);
1998
- jsh.$dialogBlock(sel).off('cancelDialog').on('cancelDialog', cancelfunc);
2007
+ jsh.$dialogBlock(sel).off('acceptDialog').on('acceptDialog', acceptfunc);
2008
+ jsh.$dialogBlock(sel).off('cancelDialog').on('cancelDialog', cancelfunc);
1999
2009
 
2000
- jsh.$dialogBlock(sel + ' input, ' + sel + ' textarea, ' + sel + ' select').on('keydown', function (e) {
2001
- if (options.specialKeys.escape && (e.keyCode == 27)) { e.preventDefault(); e.stopImmediatePropagation(); cancelfunc(); }
2002
- });
2003
- jsh.$dialogBlock(sel + ' input:not(:checkbox):not(:button)').on('keydown', function (e) {
2004
- if (options.specialKeys.escape && (e.keyCode == 13)) { e.preventDefault(); e.stopImmediatePropagation(); acceptfunc(); }
2005
- });
2006
- if(options.backgroundClose){
2007
- jsh.dialogBlock.on('mousedown.close' + sel, function(e){
2008
- if(!$(e.target).is('.xdialogoverlay,.xdialogblock')) return;
2009
- var mouseDownTime = new Date().getTime();
2010
- jsh.dialogBlock.one('mouseup.close', function(e){
2011
- var mouseUpTime = new Date().getTime();
2012
- if((mouseUpTime - mouseDownTime) > 5000) return;
2013
- if(!$(e.target).is('.xdialogoverlay,.xdialogblock')) return;
2014
- if(jsh.xDialog.length && (jsh.xDialog[0]==sel)){ e.preventDefault(); e.stopImmediatePropagation(); cancelfunc(); }
2010
+ jsh.$dialogBlock(sel + ' input, ' + sel + ' textarea, ' + sel + ' select').on('keydown', function (e) {
2011
+ if (options.specialKeys.escape && (e.keyCode == 27)) { e.preventDefault(); e.stopImmediatePropagation(); cancelfunc(); }
2015
2012
  });
2016
- });
2017
- }
2018
- jsh.$dialogBlock(sel).show();
2019
- jsh.dialogBlock.show();
2020
- if(jsh.XPage && jsh.XPage.LayoutOneColumn) jsh.XPage.LayoutOneColumn(jsh.$dialogBlock(sel)[0], { reset: true });
2021
- jsh.XWindowResize();
2022
- setTimeout(function(){
2023
- jsh.XWindowResize();
2024
- if(jsh.$dialogBlock(sel + ' .default_focus').length) jsh.$dialogBlock(sel + ' .default_focus').focus();
2025
- else jsh.$dialogBlock(sel).$find('input:visible,textarea:visible,select:visible').first().focus();
2026
- }, 1);
2027
-
2013
+ jsh.$dialogBlock(sel + ' input:not(:checkbox):not(:button)').on('keydown', function (e) {
2014
+ if (options.specialKeys.escape && (e.keyCode == 13)) { e.preventDefault(); e.stopImmediatePropagation(); acceptfunc(); }
2015
+ });
2016
+ if(options.backgroundClose){
2017
+ jsh.dialogBlock.on('mousedown.close' + sel, function(e){
2018
+ if(!$(e.target).is('.xdialogoverlay,.xdialogblock')) return;
2019
+ var mouseDownTime = new Date().getTime();
2020
+ jsh.dialogBlock.one('mouseup.close', function(e){
2021
+ var mouseUpTime = new Date().getTime();
2022
+ if((mouseUpTime - mouseDownTime) > 5000) return;
2023
+ if(!$(e.target).is('.xdialogoverlay,.xdialogblock')) return;
2024
+ if(jsh.xDialog.length && (jsh.xDialog[0]==sel)){ e.preventDefault(); e.stopImmediatePropagation(); cancelfunc(); }
2025
+ });
2026
+ });
2027
+ }
2028
+ jsh.$dialogBlock(sel).show();
2029
+ jsh.dialogBlock.show();
2030
+ if(jsh.XPage && jsh.XPage.LayoutOneColumn) jsh.XPage.LayoutOneColumn(jsh.$dialogBlock(sel)[0], { reset: true });
2031
+ jsh.XWindowResize();
2032
+ setTimeout(function(){
2033
+ jsh.XWindowResize();
2034
+ if(jsh.$dialogBlock(sel + ' .default_focus').length) jsh.$dialogBlock(sel + ' .default_focus').focus();
2035
+ else jsh.$dialogBlock(sel).$find('input:visible,textarea:visible,select:visible').first().focus();
2036
+ }, 1);
2037
+ }
2038
+ );
2028
2039
  };
2029
2040
 
2030
2041
  XExt.AcceptDialog = function(){
package/lib/mime.js ADDED
@@ -0,0 +1,19 @@
1
+ /*
2
+ Copyright 2023 apHarmony
3
+
4
+ This file is part of jsHarmony.
5
+
6
+ jsHarmony is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ jsHarmony is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this package. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+ exports = module.exports = require('mime');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsharmony",
3
- "version": "1.28.2",
3
+ "version": "1.29.0",
4
4
  "description": "Rapid Application Development (RAD) Platform for Node.js Database Application Development",
5
5
  "main": "index.js",
6
6
  "scripts": {