Skip to content

Commit 0b8eff5

Browse files
committed
jQuery widget update
-- allows putting j2sSlider.js, j2sMenu.js, j2sComboBox.js into _j2sclasslist.txt for compression.
1 parent 8eca540 commit 0b8eff5

File tree

12 files changed

+1002
-72
lines changed

12 files changed

+1002
-72
lines changed
-144 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200124055240
1+
20200125072913
-144 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200124055240
1+
20200125072913
-144 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/swingjs/jquery/JQueryUI.java

Lines changed: 78 additions & 22 deletions
Large diffs are not rendered by default.

sources/net.sf.j2s.java.core/src/swingjs/jquery/j2sComboBox.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
* A relatively simple ComboBox that supports actual objects, not just strings
77
*
88
*/
9-
// BH 2019.08.26 text area set to <button> to manage vertical centering.
109

1110
// NOTE: If you change this file, then you need to touch and save JQueryUI.java, as only then
1211
// will the transpiler copy this file to site/swingjs/j2s/swingjs/jquery/
1312

14-
$( function() {
13+
14+
J2S.__makeComboBox = function() {
15+
J2S.__makeComboBox = function(){};
16+
;(function($) {
17+
18+
$( function() {
1519
$('head').append('<style>.j2scb-sel {background-color:#B8CFE5;}'
1620
+'\n.j2scb-unsel {background-color:white;}'
1721
+'\n.j2scb-hov {background-color:lightblue;}'
@@ -298,6 +302,8 @@ $( function() {
298302

299303
});
300304

301-
} );
302-
303-
305+
});
306+
307+
})(J2S.__$);
308+
309+
};

sources/net.sf.j2s.java.core/src/swingjs/jquery/j2sMenu.js

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,25 @@
1-
// J2SMenu.js from JSmolMenu.js
2-
// Original version for JSmol Bob Hanson 2/17/2014
3-
// author: Bob Hanson, hansonr@stolaf.edu
4-
// last edited 1/24/2020 = fix for <u> in text
1+
// based on jQuery UI - v1.9.2 - 2012-12-17
52
// NOTE: If you change this file, then you need to touch and save JQueryUI.java, as only then
63
// will the transpiler copy this file to site/swingjs/j2s/swingjs/jquery/
74

8-
/*! jQuery UI - v1.9.2 - 2012-12-17
9-
* http://jqueryui.com
10-
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.menu.js
11-
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
5+
J2S.__makeMenu = function() {
126

13-
;(function(Swing) {
14-
15-
if (J2S.isResourceLoaded("swingjs/jquery/j2sMenu.js", true))return;
7+
J2S.__makeMenu = function(){};
168

9+
;(function(Swing) {
1710

18-
var outActive;
19-
var vart;
11+
var outActive;
12+
var vart;
2013

21-
;(function($) {
14+
;(function($) {
2215

2316

24-
var n=!1, e = $;
25-
/*
26-
* ! jQuery UI - v1.9.2 - 2012-12-17 http://jqueryui.com Includes:
27-
* jquery.ui.core.css, jquery.ui.menu.css To view and modify this theme, visit
28-
* http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande%2CLucida%20Sans%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=03_highlight_soft.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
29-
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT
30-
*/
17+
var n=!1, e = $;
3118

32-
if (!$.ui.j2smenu)
33-
try{
34-
35-
// local methods here for help with debugging
19+
// local methods here for help with debugging
3620

3721

38-
// BH note that swingjs.plaf.JSButton will set and clear ui-state-disabled
39-
// on its own
22+
// BH note that swingjs.plaf.JSButton will set and clear ui-state-disabled on its own
4023

4124

4225
var delayMe = function(element, f, ms) {
@@ -526,9 +509,6 @@ $.widget("ui.j2smenu",{
526509
_move:function(a,b,t){ doCmd("_move", this, t, [a,b]);},
527510
_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")}
528511
})
529-
}catch (e) {
530-
System.err.println("JSmolMenu failed to load jQuery.ui.j2smenu. jQuery version conflict? should be at least 1.9.2 " + e.ui.version);
531-
}
532512

533513
Swing.menuCounter = 0;
534514
Swing.menuInitialized = 0;
@@ -580,7 +560,7 @@ Swing.setMenu = function(menu) {
580560
menu._visible = false;
581561
menu._j2sname = menu.id = menu.ui.id + '_' + (++Swing.menuCounter);
582562
menu.$ulTop = J2S.__$(); // empty jQuery selector
583-
var proto = menu.$init$.exClazz.prototype;
563+
var proto = menu.$init$.exClazz["prototype"];
584564
proto._hideJSMenu = function(){Swing.hideMenu(this)};
585565
proto.dragBind || ( proto.dragBind = function(isBind){} );
586566
proto.setContainer || ( proto.setContainer = function(c){ this.$ulTop = c } );
@@ -674,3 +654,4 @@ Swing.disposeMenu = function(menu) {
674654

675655
})(J2S.Swing);
676656

657+
}

0 commit comments

Comments
 (0)