Bladeren bron

1、WebIDE交互重构;

xueli.xue 8 jaren geleden
bovenliggende
commit
54dc233738

+ 5 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java Bestand weergeven

@@ -31,6 +31,11 @@ public class JobCodeController {
31 31
 	public String index(Model model, int jobId) {
32 32
 		XxlJobInfo jobInfo = xxlJobInfoDao.loadById(jobId);
33 33
 		List<XxlJobLogGlue> jobLogGlues = xxlJobLogGlueDao.findByJobId(jobId);
34
+
35
+		if (jobInfo == null) {
36
+			throw new RuntimeException("抱歉,任务不存在.");
37
+		}
38
+
34 39
 		model.addAttribute("jobInfo", jobInfo);
35 40
 		model.addAttribute("jobLogGlues", jobLogGlues);
36 41
 		return "jobcode/jobcode.index";

+ 8 - 10
xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl Bestand weergeven

@@ -23,9 +23,7 @@
23 23
     <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
24 24
     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
25 25
     <![endif]-->
26
-  
27
-	<!-- scrollup -->
28
-	<link rel="stylesheet" href="${request.contextPath}/static/plugins/scrollup/image.css">
26
+
29 27
 	<!-- pace -->
30 28
 	<link rel="stylesheet" href="${request.contextPath}/static/plugins/pace/themes/pace-theme-flash.css">
31 29
 </#macro>
@@ -39,9 +37,9 @@
39 37
 	<script src="${request.contextPath}/static/adminlte/plugins/fastclick/fastclick.js"></script>
40 38
 	<!-- AdminLTE App -->
41 39
 	<script src="${request.contextPath}/static/adminlte/dist/js/app.min.js"></script>
40
+	<#-- jquery.slimscroll -->
41
+	<script src="${request.contextPath}/static/adminlte/plugins/slimScroll/jquery.slimscroll.min.js"></script>
42 42
 
43
-    <!-- scrollup -->
44
-    <script src="${request.contextPath}/static/plugins/scrollup/jquery.scrollUp.min.js"></script>
45 43
     <!-- pace -->
46 44
     <script src="${request.contextPath}/static/plugins/pace/pace.min.js"></script>
47 45
     <#-- jquery cookie -->
@@ -75,7 +73,7 @@
75 73
 	</header>
76 74
 </#macro>
77 75
 
78
-<#macro commonLeft>
76
+<#macro commonLeft pageName >
79 77
 	<!-- Left side column. contains the logo and sidebar -->
80 78
 	<aside class="main-sidebar">
81 79
 		<!-- sidebar: style can be found in sidebar.less -->
@@ -83,10 +81,10 @@
83 81
 			<!-- sidebar menu: : style can be found in sidebar.less -->
84 82
 			<ul class="sidebar-menu">
85 83
 				<li class="header">常用模块</li>
86
-				<li class="nav-click" ><a href="${request.contextPath}/jobinfo"><i class="fa fa-circle-o text-red"></i> <span>调度管理</span></a></li>
87
-				<li class="nav-click" ><a href="${request.contextPath}/joblog"><i class="fa fa-circle-o text-yellow"></i><span>调度日志</span></a></li>
88
-                <li class="nav-click" ><a href="${request.contextPath}/jobgroup"><i class="fa fa-circle-o text-aqua"></i> <span>执行器管理</span></a></li>
89
-				<li class="nav-click" ><a href="${request.contextPath}/help"><i class="fa fa-circle-o text-red"></i><span>使用教程</span></a></li>
84
+				<li class="nav-click <#if pageName == "jobinfo">active</#if>" ><a href="${request.contextPath}/jobinfo"><i class="fa fa-circle-o text-red"></i> <span>调度管理</span></a></li>
85
+				<li class="nav-click <#if pageName == "joblog">active</#if>" ><a href="${request.contextPath}/joblog"><i class="fa fa-circle-o text-yellow"></i><span>调度日志</span></a></li>
86
+                <li class="nav-click <#if pageName == "jobgroup">active</#if>" ><a href="${request.contextPath}/jobgroup"><i class="fa fa-circle-o text-aqua"></i> <span>执行器管理</span></a></li>
87
+				<li class="nav-click <#if pageName == "help">active</#if>" ><a href="${request.contextPath}/help"><i class="fa fa-circle-o text-red"></i><span>使用教程</span></a></li>
90 88
 			</ul>
91 89
 		</section>
92 90
 		<!-- /.sidebar -->

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl Bestand weergeven

@@ -10,7 +10,7 @@
10 10
 	<!-- header -->
11 11
 	<@netCommon.commonHeader />
12 12
 	<!-- left -->
13
-	<@netCommon.commonLeft />
13
+	<@netCommon.commonLeft "help" />
14 14
 	
15 15
 	<!-- Content Wrapper. Contains page content -->
16 16
 	<div class="content-wrapper">

+ 81 - 70
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl Bestand weergeven

@@ -8,85 +8,97 @@
8 8
 	<link rel="stylesheet" href="${request.contextPath}/static/plugins/codemirror/addon/hint/show-hint.css">
9 9
 	<style type="text/css">
10 10
 		.CodeMirror {
11
-      		border: 0px solid black;
12 11
       		font-size:16px;
12
+            width: 100%;
13 13
       		height: 100%;
14
+            /*bottom: 0;
15
+            top: 0px;*/
16
+            position: absolute;
14 17
 		}
15 18
     </style>
16 19
 </head>
17
-<body class=" layout-top-nav">
20
+<body class="skin-blue fixed layout-top-nav">
18 21
 
19
-<#if !jobInfo?exists>
20 22
 	<div class="wrapper">
21
-		<div class="content-wrapper">
22
-			<section class="content-header">
23
-				<h1>抱歉,任务不存在.</small></h1>
24
-			</section>
25
-		</div>
26
-	</div>
27
-<#else>
28
-	<div class="wrapper">
29
-		
30
-		<div class="content-wrapper">
31
-			<!-- Content Header (Page header) -->
32
-			<#--<section class="content-header">
33
-				<h1>任务调度中心<small>任务GLUE管理</small></h1>
34
-			</section>-->
35
-			<!-- Main content -->
36
-		    <section class="content">
37
-		    	<div class="row">
38
-		    		<div class="col-xs-4">
39
-						<div class="input-group margin">
40
-	                    	<div class="input-group-btn">
41
-	                      		<button type="button" class="btn btn-info">版本回溯</button>
42
-	                    	</div>
43
-	                    	<select class="form-control" id="glue_version" >
44
-	            				<option value="glue_now" >${jobInfo.glueRemark}【线上】</option>
45
-	            				<#if jobLogGlues?exists && jobLogGlues?size gt 0 >
46
-			                  	<#list jobLogGlues as glue>
47
-			                  		<option value="glue_log_${glue.id}" >${glue.glueRemark}</option>
48
-			                  	</#list>
49
-			                  	</#if>
50
-		                  	</select>
51
-		                  	
52
-		                  	<textarea id="glue_now" style="display:none;" >${jobInfo.glueSource}</textarea>
53
-		                  	<#if jobLogGlues?exists && jobLogGlues?size gt 0 >
54
-		                  	<#list jobLogGlues as glue>
55
-		                  		<textarea id="glue_log_${glue.id}" style="display:none;" >${glue.glueSource}</textarea>
56
-		                  	</#list>
57
-		                  	</#if>
58
-		                  	
59
-						</div>
60
-		            </div>
61
-		            <div class="col-xs-4">
62
-		            	<div class="input-group margin">
63
-	                    	<div class="input-group-btn">
64
-	                      		<button type="button" class="btn btn-info">备注</button>
65
-	                    	</div>
66
-	                    	<input type="text" class="form-control" id="glueRemark" value="" autocomplete="on" >
67
-	                  	</div>
68
-		            </div>
69
-		            <div class="col-xs-2">
70
-		            	<div class="input-group margin">
71
-	                    	<div class="input-group-btn">
72
-	                      		<button type="button" class="btn btn-primary" id="save" >保存</button>
73
-	                    	</div>
74
-	                  	</div>
75
-		            </div>
76
-	          	</div>
77
-		    	
78
-				<div class="row" id="glueSource" >
79
-					<#--<div class="col-xs-12">
80
-						<div class="box callout callout-info">
81
-							<textarea id="glueSource" ></textarea>
82
-						</div>
83
-					</div>-->
84
-				</div>
85
-		    </section>
86
-		</div>
23
+
24
+        <header class="main-header">
25
+            <nav class="navbar navbar-static-top">
26
+                <div class="container">
27
+					<#-- icon -->
28
+                    <div class="navbar-header">
29
+                        <a href="../../index2.html" class="navbar-brand"><b>Web</b>IDE</a>
30
+                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
31
+                            <i class="fa fa-bars"></i>
32
+                        </button>
33
+                    </div>
34
+
35
+                    <#-- left nav -->
36
+                    <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
37
+                        <ul class="nav navbar-nav">
38
+                            <li class="active" ><a href="#">任务:${jobInfo.jobDesc}<span class="sr-only">(current)</span></a></li>
39
+                        </ul>
40
+                    </div>
41
+
42
+					<#-- right nav -->
43
+                    <div class="navbar-custom-menu">
44
+                        <ul class="nav navbar-nav">
45
+                            <li class="dropdown">
46
+                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">版本回溯 <span class="caret"></span></a>
47
+                                <ul class="dropdown-menu" role="menu">
48
+                                    <li><a href="javascript:;" class="source_version" version="version_now" >${jobInfo.glueRemark}【OnLine】</a></li>
49
+                                    <textarea id="version_now" style="display:none;" >${jobInfo.glueSource}</textarea>
50
+									<#if jobLogGlues?exists && jobLogGlues?size gt 0 >
51
+										<#list jobLogGlues as glue>
52
+                                            <li><a href="javascript:;" class="source_version" version="version_${glue.id}" >${glue.glueRemark}</a></li>
53
+                                            <textarea id="version_${glue.id}" style="display:none;" >${glue.glueSource}</textarea>
54
+										</#list>
55
+									</#if>
56
+                                </ul>
57
+                            </li>
58
+                            <li id="save" >
59
+								<a href="javascript:;" >
60
+									<i class="fa fa-fw fa-save" ></i>
61
+                                    保存
62
+								</a>
63
+							</li>
64
+                        </ul>
65
+                    </div>
66
+
67
+                </div>
68
+            </nav>
69
+        </header>
70
+
71
+		<div class="content-wrapper" id="ideWindow" ></div>
72
+
87 73
 		<!-- footer -->
88 74
 		<#--<@netCommon.commonFooter />-->
89 75
 	</div>
76
+
77
+    <!-- 保存.模态框 -->
78
+    <div class="modal fade" id="saveModal" tabindex="-1" role="dialog"  aria-hidden="true">
79
+        <div class="modal-dialog ">
80
+            <div class="modal-content">
81
+                <div class="modal-header">
82
+                    <h4 class="modal-title" ><i class="fa fa-bars"></i>保存</h4>
83
+                </div>
84
+                <div class="modal-body">
85
+                    <form class="form-horizontal form" role="form" >
86
+                        <div class="form-group">
87
+                            <label for="lastname" class="col-sm-2 control-label">源码备注<font color="red">*</font></label>
88
+                            <div class="col-sm-10"><input type="text" class="form-control" id="glueRemark" placeholder="请输入备注信息" maxlength="64" ></div>
89
+                        </div>
90
+                        <hr>
91
+                        <div class="form-group">
92
+                            <div class="col-sm-offset-3 col-sm-6">
93
+                                <button type="button" class="btn btn-primary ok" >保存</button>
94
+                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
95
+                            </div>
96
+                        </div>
97
+                    </form>
98
+                </div>
99
+            </div>
100
+        </div>
101
+    </div>
90 102
 	
91 103
 <@netCommon.commonScript />
92 104
 <script src="${request.contextPath}/static/plugins/codemirror/lib/codemirror.js"></script>
@@ -98,6 +110,5 @@ var id = '${jobInfo.id}';
98 110
 </script>
99 111
 <script src="${request.contextPath}/static/js/jobcode.index.1.js"></script>
100 112
 
101
-</#if>
102 113
 </body>
103 114
 </html>

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/jobgroup/jobgroup.index.ftl Bestand weergeven

@@ -14,7 +14,7 @@
14 14
 	<!-- header -->
15 15
 	<@netCommon.commonHeader />
16 16
 	<!-- left -->
17
-	<@netCommon.commonLeft />
17
+	<@netCommon.commonLeft "jobgroup" />
18 18
 	
19 19
 	<!-- Content Wrapper. Contains page content -->
20 20
 	<div class="content-wrapper">

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl Bestand weergeven

@@ -19,7 +19,7 @@
19 19
 	<!-- header -->
20 20
 	<@netCommon.commonHeader />
21 21
 	<!-- left -->
22
-	<@netCommon.commonLeft />
22
+	<@netCommon.commonLeft "jobinfo" />
23 23
 	
24 24
 	<!-- Content Wrapper. Contains page content -->
25 25
 	<div class="content-wrapper">

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl Bestand weergeven

@@ -14,7 +14,7 @@
14 14
 	<!-- header -->
15 15
 	<@netCommon.commonHeader />
16 16
 	<!-- left -->
17
-	<@netCommon.commonLeft />
17
+	<@netCommon.commonLeft "joblog" />
18 18
 	
19 19
 	<!-- Content Wrapper. Contains page content -->
20 20
 	<div class="content-wrapper">

+ 16 - 0
xxl-job-admin/src/main/webapp/static/adminlte/plugins/slimScroll/jquery.slimscroll.min.js Bestand weergeven

@@ -0,0 +1,16 @@
1
+/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
2
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
3
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
4
+ *
5
+ * Version: 1.3.8
6
+ *
7
+ */
8
+(function(e){e.fn.extend({slimScroll:function(f){var a=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},f);this.each(function(){function v(d){if(r){d=d||window.event;
9
+var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);e(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&n(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function n(d,g,e){k=!1;var f=b.outerHeight()-c.outerHeight();g&&(g=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),g=Math.min(Math.max(g,0),f),g=0<d?Math.ceil(g):Math.floor(g),c.css({top:g+"px"}));l=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());g=
10
+l*(b[0].scrollHeight-b.outerHeight());e&&(g=d,d=g/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),f),c.css({top:d+"px"}));b.scrollTop(g);b.trigger("slimscrolling",~~g);w();p()}function x(){u=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),30);c.css({height:u+"px"});var a=u==b.outerHeight()?"none":"block";c.css({display:a})}function w(){x();clearTimeout(B);l==~~l?(k=a.allowPageScroll,C!=l&&b.trigger("slimscroll",0==~~l?"top":"bottom")):k=!1;C=l;u>=b.outerHeight()?k=!0:(c.stop(!0,
11
+!0).fadeIn("fast"),a.railVisible&&m.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(B=setTimeout(function(){a.disableFadeOut&&r||y||z||(c.fadeOut("slow"),m.fadeOut("slow"))},1E3))}var r,y,z,B,A,u,l,C,k=!1,b=e(this);if(b.parent().hasClass(a.wrapperClass)){var q=b.scrollTop(),c=b.siblings("."+a.barClass),m=b.siblings("."+a.railClass);x();if(e.isPlainObject(f)){if("height"in f&&"auto"==f.height){b.parent().css("height","auto");b.css("height","auto");var h=b.parent().parent().height();b.parent().css("height",
12
+h);b.css("height",h)}else"height"in f&&(h=f.height,b.parent().css("height",h),b.css("height",h));if("scrollTo"in f)q=parseInt(a.scrollTo);else if("scrollBy"in f)q+=parseInt(a.scrollBy);else if("destroy"in f){c.remove();m.remove();b.unwrap();return}n(q,!1,!0)}}else if(!(e.isPlainObject(f)&&"destroy"in f)){a.height="auto"==a.height?b.parent().height():a.height;q=e("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",
13
+width:a.width,height:a.height});var m=e("<div></div>").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=e("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,
14
+WebkitBorderRadius:a.borderRadius,zIndex:99}),h="right"==a.position?{right:a.distance}:{left:a.distance};m.css(h);c.css(h);b.wrap(q);b.parent().append(c);b.parent().append(m);a.railDraggable&&c.bind("mousedown",function(a){var b=e(document);z=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);n(0,c.position().top,!1)});b.bind("mouseup.slimscroll",function(a){z=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",
15
+function(a){a.stopPropagation();a.preventDefault();return!1});m.hover(function(){w()},function(){p()});c.hover(function(){y=!0},function(){y=!1});b.hover(function(){r=!0;w();p()},function(){r=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(A=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&(n((A-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),A=b.originalEvent.touches[0].pageY)});
16
+x();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),n(0,!0)):"top"!==a.start&&(n(e(a.start).position().top,null,!0),a.alwaysVisible||c.hide());window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)}});return this}});e.fn.extend({slimscroll:e.fn.slimScroll})})(jQuery);

+ 49 - 22
xxl-job-admin/src/main/webapp/static/js/common.1.js Bestand weergeven

@@ -1,20 +1,5 @@
1 1
 $(function(){
2
-	
3
-	// 导航栏,选中样式处理,js遍历匹配url(遗弃)
4
-	$(".nav-click").removeClass("active");
5
-	$(".nav-click").each(function(){
6
-		if( window.location.href.indexOf( $(this).find("a").attr("href") ) > -1){
7
-			$(this).addClass("active");
8
-			$(this).parents(".nav-click").addClass("active");
9
-		}
10
-	});
11
-	
12
-	// scrollup
13
-	$.scrollUp({
14
-		animation: 'fade',	// fade/slide/none
15
-		scrollImg: true
16
-	});
17
-	
2
+
18 3
 	// logout
19 4
 	$("#logoutBtn").click(function(){
20 5
 		ComConfirm.show("确认注销登录?", function(){
@@ -29,7 +14,49 @@ $(function(){
29 14
 			});
30 15
 		});
31 16
 	});
32
-	
17
+
18
+	// slideToTop
19
+	var slideToTop = $("<div />");
20
+	slideToTop.html('<i class="fa fa-chevron-up"></i>');
21
+	slideToTop.css({
22
+		position: 'fixed',
23
+		bottom: '20px',
24
+		right: '25px',
25
+		width: '40px',
26
+		height: '40px',
27
+		color: '#eee',
28
+		'font-size': '',
29
+		'line-height': '40px',
30
+		'text-align': 'center',
31
+		'background-color': '#222d32',
32
+		cursor: 'pointer',
33
+		'border-radius': '5px',
34
+		'z-index': '99999',
35
+		opacity: '.7',
36
+		'display': 'none'
37
+	});
38
+	slideToTop.on('mouseenter', function () {
39
+		$(this).css('opacity', '1');
40
+	});
41
+	slideToTop.on('mouseout', function () {
42
+		$(this).css('opacity', '.7');
43
+	});
44
+	$('.wrapper').append(slideToTop);
45
+	$(window).scroll(function () {
46
+		if ($(window).scrollTop() >= 150) {
47
+			if (!$(slideToTop).is(':visible')) {
48
+				$(slideToTop).fadeIn(500);
49
+			}
50
+		} else {
51
+			$(slideToTop).fadeOut(500);
52
+		}
53
+	});
54
+	$(slideToTop).click(function () {
55
+		$("body").animate({
56
+			scrollTop: 0
57
+		}, 100);
58
+	});
59
+
33 60
 	// 左侧菜单状态,js + 后端 + cookie方式(新)
34 61
 	$('.sidebar-toggle').click(function(){
35 62
 		var adminlte_settings = $.cookie('adminlte_settings');	// 左侧菜单展开状态[adminlte_settings]:on=展开,off=折叠
@@ -42,10 +69,10 @@ $(function(){
42 69
 	});
43 70
 	// 左侧菜单状态,js + cookie方式(遗弃)
44 71
 	/*
45
-	var adminlte_settings = $.cookie('adminlte_settings');
46
-	if (adminlte_settings == 'off') {
47
-		$('body').addClass('sidebar-collapse');
48
-	}
49
-	*/
72
+	 var adminlte_settings = $.cookie('adminlte_settings');
73
+	 if (adminlte_settings == 'off') {
74
+	 $('body').addClass('sidebar-collapse');
75
+	 }
76
+	 */
50 77
 	
51 78
 });

+ 13 - 11
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js Bestand weergeven

@@ -6,25 +6,27 @@ $(function() {
6 6
 		lineNumbers : true,
7 7
 		matchBrackets : true
8 8
 	});*/
9
-	var codeEditor = CodeMirror(document.getElementById("glueSource"), {
9
+	var codeEditor = CodeMirror(document.getElementById("ideWindow"), {
10 10
 		mode : "text/x-java",
11 11
 		lineNumbers : true,
12
-		matchBrackets : true
12
+		matchBrackets : true,
13
+		value: $("#version_now").val()
13 14
 	});
14
-	codeEditor.setValue( $("#glue_now").val() );
15
-	
15
+
16 16
 	// code change
17
-	$("#glue_version").change(function(){
18
-		var temp = $( "#" + $(this).val() ).val();
17
+	$(".source_version").click(function(){
18
+		var sourceId = $(this).attr('version');
19
+		var temp = $( "#" + sourceId ).val();
19 20
 		codeEditor.setValue( temp );
20 21
 	});
21
-	
22
-	// editor height
23
-	var height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight);
24
-	$(".CodeMirror").attr('style', 'height:'+ height +'px');
25
-	
22
+
26 23
 	// code source save
27 24
 	$("#save").click(function() {
25
+		$('#saveModal').modal({backdrop: false, keyboard: false}).modal('show');
26
+	});
27
+
28
+	$("#saveModal .ok").click(function() {
29
+
28 30
 		var glueSource = codeEditor.getValue();
29 31
 		var glueRemark = $("#glueRemark").val();
30 32
 		

+ 0 - 8
xxl-job-admin/src/main/webapp/static/plugins/scrollup/image.css Bestand weergeven

@@ -1,8 +0,0 @@
1
-/* Image style */
2
-#scrollUp {
3
-    background-image: url('top.png');
4
-    bottom: 20px;
5
-    right: 20px;
6
-    width: 38px;    /* Width of image */
7
-    height: 38px;   /* Height of image */
8
-}

+ 0 - 7
xxl-job-admin/src/main/webapp/static/plugins/scrollup/jquery.scrollUp.min.js Bestand weergeven

@@ -1,7 +0,0 @@
1
-/*!
2
- * scrollup v2.4.1
3
- * Url: http://markgoodyear.com/labs/scrollup/
4
- * Copyright (c) Mark Goodyear — @markgdyr — http://markgoodyear.com
5
- * License: MIT
6
- */
7
-!function(l,o,e){"use strict";l.fn.scrollUp=function(o){l.data(e.body,"scrollUp")||(l.data(e.body,"scrollUp",!0),l.fn.scrollUp.init(o))},l.fn.scrollUp.init=function(r){var s,t,c,i,n,a,d,p=l.fn.scrollUp.settings=l.extend({},l.fn.scrollUp.defaults,r),f=!1;switch(d=p.scrollTrigger?l(p.scrollTrigger):l("<a/>",{id:p.scrollName,href:"#top"}),p.scrollTitle&&d.attr("title",p.scrollTitle),d.appendTo("body"),p.scrollImg||p.scrollTrigger||d.html(p.scrollText),d.css({display:"none",position:"fixed",zIndex:p.zIndex}),p.activeOverlay&&l("<div/>",{id:p.scrollName+"-active"}).css({position:"absolute",top:p.scrollDistance+"px",width:"100%",borderTop:"1px dotted"+p.activeOverlay,zIndex:p.zIndex}).appendTo("body"),p.animation){case"fade":s="fadeIn",t="fadeOut",c=p.animationSpeed;break;case"slide":s="slideDown",t="slideUp",c=p.animationSpeed;break;default:s="show",t="hide",c=0}i="top"===p.scrollFrom?p.scrollDistance:l(e).height()-l(o).height()-p.scrollDistance,n=l(o).scroll(function(){l(o).scrollTop()>i?f||(d[s](c),f=!0):f&&(d[t](c),f=!1)}),p.scrollTarget?"number"==typeof p.scrollTarget?a=p.scrollTarget:"string"==typeof p.scrollTarget&&(a=Math.floor(l(p.scrollTarget).offset().top)):a=0,d.click(function(o){o.preventDefault(),l("html, body").animate({scrollTop:a},p.scrollSpeed,p.easingType)})},l.fn.scrollUp.defaults={scrollName:"scrollUp",scrollDistance:300,scrollFrom:"top",scrollSpeed:300,easingType:"linear",animation:"fade",animationSpeed:200,scrollTrigger:!1,scrollTarget:!1,scrollText:"Scroll to top",scrollTitle:!1,scrollImg:!1,activeOverlay:!1,zIndex:2147483647},l.fn.scrollUp.destroy=function(r){l.removeData(e.body,"scrollUp"),l("#"+l.fn.scrollUp.settings.scrollName).remove(),l("#"+l.fn.scrollUp.settings.scrollName+"-active").remove(),l.fn.jquery.split(".")[1]>=7?l(o).off("scroll",r):l(o).unbind("scroll",r)},l.scrollUp=l.fn.scrollUp}(jQuery,window,document);

BIN
xxl-job-admin/src/main/webapp/static/plugins/scrollup/top.png Bestand weergeven