From b4dec63ba03072245dc0c0dfc9606df89b438fe7 Mon Sep 17 00:00:00 2001 From: zhengyingying Date: Tue, 15 Apr 2014 16:19:13 +0800 Subject: [PATCH] compress bootStrap.js ,modify the font-family of the index.jsp and fix the bug in script.jsp --- Bench4Q-Web/src/main/webapp/css/editor.css | 52 +----- Bench4Q-Web/src/main/webapp/css/index.css | 6 +- .../lib/bootstrap/js/bootstrap-carousel.js | 170 +----------------- .../lib/bootstrap/js/bootstrap-collapse.js | 158 +--------------- Bench4Q-Web/src/main/webapp/login.jsp | 73 +++++--- .../src/main/webapp/script/editScript.js | 6 +- Bench4Q-Web/src/main/webapp/script/index.js | 2 +- .../src/main/webapp/script/scriptTable.js | 40 +++-- 8 files changed, 87 insertions(+), 420 deletions(-) diff --git a/Bench4Q-Web/src/main/webapp/css/editor.css b/Bench4Q-Web/src/main/webapp/css/editor.css index 376af717..29e54f42 100644 --- a/Bench4Q-Web/src/main/webapp/css/editor.css +++ b/Bench4Q-Web/src/main/webapp/css/editor.css @@ -76,7 +76,7 @@ div.convert-left,div.convert-right { a:hover{ background-color:#E5E3E9; - text-decoration:none; /*CSS下划线效果:无下划线*/ + text-decoration:none; } #box-api { @@ -92,7 +92,7 @@ a:hover{ #api-content { overflow-x: hidden; overflow-y: scroll; - height: 340px; + height: 345px; background-color: #EDF1DE; } @@ -120,7 +120,7 @@ a:hover{ .title_style { width: 300px; - line-height: 18px; + line-height: 18px;loadBehaviors("other"); border: 1px solid #CCCCCC; background-color: #F5F5F5; text-align: center; @@ -244,6 +244,10 @@ a { margin-bottom: 10px; } +#behaviorUl{ + margin:8px 5px 0px 0px; +} + .all-behaviors .divider { height: 1px; width: 100%; @@ -253,48 +257,6 @@ a { border-bottom: 1px solid #ffffff; } -.button { - display: inline-block; - position: relative; - width: 80%; - margin: 0px; - padding: 0px; - text-align: center; - text-decoration: none; - font: bold 12px/25px Arial, sans-serif; - text-shadow: 1px 1px 1px rgba(255, 255, 255, .22); - -webkit-border-radius: 30px; - -moz-border-radius: 30px; - border-radius: 30px; - -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, .29), inset 1px 1px 1px - rgba(255, 255, 255, .44); - -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, .29), inset 1px 1px 1px - rgba(255, 255, 255, .44); - box-shadow: 1px 1px 1px rgba(0, 0, 0, .29), inset 1px 1px 1px - rgba(255, 255, 255, .44); - -webkit-transition: all 0.15s ease; - -moz-transition: all 0.15s ease; - -o-transition: all 0.15s ease; - -ms-transition: all 0.15s ease; - transition: all 0.15s ease; -} - -.gray { - color: #3689BB; - background: #EFEFEF; /* Old browsers */ - background: -moz-linear-gradient(top, #d3d3d3 0%, #8a8a8a 100%); - /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d3d3d3), - color-stop(100%, #8a8a8a)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #d3d3d3 0%, #8a8a8a 100%); - /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #d3d3d3 0%, #8a8a8a 100%); - /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #d3d3d3 0%, #8a8a8a 100%); - /* IE10+ */ - background: linear-gradient(top, #d3d3d3 0%, #8a8a8a 100%); /* W3C */ -} - BODY { padding-left: 20px; padding-top: 20px; diff --git a/Bench4Q-Web/src/main/webapp/css/index.css b/Bench4Q-Web/src/main/webapp/css/index.css index 149bde3d..d9988f46 100644 --- a/Bench4Q-Web/src/main/webapp/css/index.css +++ b/Bench4Q-Web/src/main/webapp/css/index.css @@ -112,7 +112,7 @@ h1 { font-size: 15; line-height: 30px; font-weight: bold; - font-family: Arial; + font-family: Microsoft YaHei,'宋体' , Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif; } .bottom-logo { @@ -121,4 +121,8 @@ h1 { height: 200px; padding-top: 20px; float: left +} + +body{ + font-size:13px; } \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-carousel.js b/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-carousel.js index 551de589..693fa0f1 100644 --- a/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-carousel.js +++ b/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-carousel.js @@ -1,169 +1 @@ -/* ========================================================== - * bootstrap-carousel.js v2.0.4 - * http://twitter.github.com/bootstrap/javascript.html#carousel - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* CAROUSEL CLASS DEFINITION - * ========================= */ - - var Carousel = function (element, options) { - this.$element = $(element) - this.options = options - this.options.slide && this.slide(this.options.slide) - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) - } - - Carousel.prototype = { - - cycle: function (e) { - if (!e) this.paused = false - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - return this - } - - , to: function (pos) { - var $active = this.$element.find('.active') - , children = $active.parent().children() - , activePos = children.index($active) - , that = this - - if (pos > (children.length - 1) || pos < 0) return - - if (this.sliding) { - return this.$element.one('slid', function () { - that.to(pos) - }) - } - - if (activePos == pos) { - return this.pause().cycle() - } - - return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) - } - - , pause: function (e) { - if (!e) this.paused = true - clearInterval(this.interval) - this.interval = null - return this - } - - , next: function () { - if (this.sliding) return - return this.slide('next') - } - - , prev: function () { - if (this.sliding) return - return this.slide('prev') - } - - , slide: function (type, next) { - var $active = this.$element.find('.active') - , $next = next || $active[type]() - , isCycling = this.interval - , direction = type == 'next' ? 'left' : 'right' - , fallback = type == 'next' ? 'first' : 'last' - , that = this - , e = $.Event('slide') - - this.sliding = true - - isCycling && this.pause() - - $next = $next.length ? $next : this.$element.find('.item')[fallback]() - - if ($next.hasClass('active')) return - - if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - this.$element.one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) - }) - } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid') - } - - isCycling && this.cycle() - - return this - } - - } - - - /* CAROUSEL PLUGIN DEFINITION - * ========================== */ - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('carousel') - , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) - if (!data) $this.data('carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (typeof option == 'string' || (option = options.slide)) data[option]() - else if (options.interval) data.cycle() - }) - } - - $.fn.carousel.defaults = { - interval: 5000 - , pause: 'hover' - } - - $.fn.carousel.Constructor = Carousel - - - /* CAROUSEL DATA-API - * ================= */ - - $(function () { - $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) { - var $this = $(this), href - , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data()) - $target.carousel(options) - e.preventDefault() - }) - }) - -}(window.jQuery); \ No newline at end of file +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('!4($){"1b 18";q u=4(9,a){2.$9=$(9)2.a=a 2.a.b&&2.b(2.a.b)2.a.i==\'S\'&&2.$9.H(\'16\',$.C(2.i,2)).H(\'11\',$.C(2.k,2))}u.12={k:4(e){5(!e)2.D=E 2.a.f&&!2.D&&(2.f=19($.C(2.3,2),2.a.f))6 2},I:4(g){q $7=2.$9.A(\'.7\'),m=$7.14().m(),x=m.13($7),o=2 5(g>(m.V-1)||g<0)6 5(2.h){6 2.$9.P(\'w\',4(){o.I(g)})}5(x==g){6 2.i().k()}6 2.b(g>x?\'3\':\'B\',$(m[g]))},i:4(e){5(!e)2.D=R 10(2.f)2.f=17 6 2},3:4(){5(2.h)6 6 2.b(\'3\')},B:4(){5(2.h)6 6 2.b(\'B\')},b:4(j,3){q $7=2.$9.A(\'.7\'),$3=3||$7[j](),y=2.f,n=j==\'3\'?\'Y\':\'W\',U=j==\'3\'?\'Z\':\'X\',o=2,e=$.15(\'b\')2.h=R y&&2.i()$3=$3.V?$3:2.$9.A(\'.1f\')[U]()5($3.Q(\'7\'))6 5($.L.N&&2.$9.Q(\'b\')){2.$9.t(e)5(e.J())6 $3.p(j)$3[0].1o $7.p(n)$3.p(n)2.$9.P($.L.N.1n,4(){$3.z([j,n].M(\' \')).p(\'7\')$7.z([\'7\',n].M(\' \'))o.h=E 1q(4(){o.$9.t(\'w\')},0)})}G{2.$9.t(e)5(e.J())6 $7.z(\'7\')$3.p(\'7\')2.h=E 2.$9.t(\'w\')}y&&2.k()6 2}}$.v.c=4(d){6 2.1d(4(){q $2=$(2),8=$2.8(\'c\'),a=$.T({},$.v.c.K,F d==\'1g\'&&d)5(!8)$2.8(\'c\',(8=1h u(2,a)))5(F d==\'1j\')8.I(d)G 5(F d==\'1i\'||(d=a.b))8[d]()G 5(a.f)8.k()})}$.v.c.K={f:1m,i:\'S\'}$.v.c.1p=u $(4(){$(\'1s\').H(\'1e.c.8-1t\',\'[8-b]\',4(e){q $2=$(2),r,$l=$($2.O(\'8-l\')||(r=$2.O(\'r\'))&&r.1c(/.*(?=#[^\\s]+$)/,\'\')),a=!$l.8(\'1a\')&&$.T({},$l.8(),$2.8())$l.c(a)e.1l()})})}(1r.1k);',62,92,'||this|next|function|if|return|active|data|element|options|slide|carousel|option||interval|pos|sliding|pause|type|cycle|target|children|direction|that|addClass|var|href||trigger|Carousel|fn|slid|activePos|isCycling|removeClass|find|prev|proxy|paused|false|typeof|else|on|to|isDefaultPrevented|defaults|support|join|transition|attr|one|hasClass|true|hover|extend|fallback|length|right|last|left|first|clearInterval|mouseleave|prototype|index|parent|Event|mouseenter|null|strict|setInterval|modal|use|replace|each|click|item|object|new|string|number|jQuery|preventDefault|5000|end|offsetWidth|Constructor|setTimeout|window|body|api'.split('|'),0,{})) diff --git a/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-collapse.js b/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-collapse.js index fbc915b9..03c25c59 100644 --- a/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-collapse.js +++ b/Bench4Q-Web/src/main/webapp/lib/bootstrap/js/bootstrap-collapse.js @@ -1,157 +1 @@ -/* ============================================================= - * bootstrap-collapse.js v2.0.4 - * http://twitter.github.com/bootstrap/javascript.html#collapse - * ============================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* COLLAPSE PUBLIC CLASS DEFINITION - * ================================ */ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.collapse.defaults, options) - - if (this.options.parent) { - this.$parent = $(this.options.parent) - } - - this.options.toggle && this.toggle() - } - - Collapse.prototype = { - - constructor: Collapse - - , dimension: function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - , show: function () { - var dimension - , scroll - , actives - , hasData - - if (this.transitioning) return - - dimension = this.dimension() - scroll = $.camelCase(['scroll', dimension].join('-')) - actives = this.$parent && this.$parent.find('> .accordion-group > .in') - - if (actives && actives.length) { - hasData = actives.data('collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('collapse', null) - } - - this.$element[dimension](0) - this.transition('addClass', $.Event('show'), 'shown') - this.$element[dimension](this.$element[0][scroll]) - } - - , hide: function () { - var dimension - if (this.transitioning) return - dimension = this.dimension() - this.reset(this.$element[dimension]()) - this.transition('removeClass', $.Event('hide'), 'hidden') - this.$element[dimension](0) - } - - , reset: function (size) { - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - [dimension](size || 'auto') - [0].offsetWidth - - this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - - return this - } - - , transition: function (method, startEvent, completeEvent) { - var that = this - , complete = function () { - if (startEvent.type == 'show') that.reset() - that.transitioning = 0 - that.$element.trigger(completeEvent) - } - - this.$element.trigger(startEvent) - - if (startEvent.isDefaultPrevented()) return - - this.transitioning = 1 - - this.$element[method]('in') - - $.support.transition && this.$element.hasClass('collapse') ? - this.$element.one($.support.transition.end, complete) : - complete() - } - - , toggle: function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - } - - - /* COLLAPSIBLE PLUGIN DEFINITION - * ============================== */ - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('collapse') - , options = typeof option == 'object' && option - if (!data) $this.data('collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.defaults = { - toggle: true - } - - $.fn.collapse.Constructor = Collapse - - - /* COLLAPSIBLE DATA-API - * ==================== */ - - $(function () { - $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) { - var $this = $(this), href - , target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - , option = $(target).data('collapse') ? 'toggle' : $this.data() - $(target).collapse(option) - }) - }) - -}(window.jQuery); \ No newline at end of file +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('!7($){"X W";9 h=7(3,a){2.$3=$(3)2.a=$.V({},$.q.4.K,a)8(2.a.g){2.$g=$(2.a.g)}2.a.f&&2.f()}h.Y={Z:h,5:7(){9 B=2.$3.w(\'A\')b B?\'A\':\'10\'},m:7(){9 5,p,c,i 8(2.j)b 5=2.5()p=$.U([\'p\',5].13(\'-\'))c=2.$g&&2.$g.M(\'> .O-N > .v\')8(c&&c.P){i=c.6(\'4\')8(i&&i.j)b c.4(\'l\')i||c.6(\'4\',E)}2.$3[5](0)2.k(\'H\',$.D(\'m\'),\'R\')2.$3[5](2.$3[0][p])},l:7(){9 5 8(2.j)b 5=2.5()2.y(2.$3[5]())2.k(\'x\',$.D(\'l\'),\'14\')2.$3[5](0)},y:7(z){9 5=2.5()2.$3.x(\'4\')[5](z||\'1f\')[0].1e 2.$3[z!==E?\'H\':\'x\'](\'4\')b 2},k:7(C,n,I){9 o=2,u=7(){8(n.1h==\'m\')o.y()o.j=0 o.$3.F(I)}2.$3.F(n)8(n.19())b 2.j=1 2.$3[C](\'v\')$.G.k&&2.$3.w(\'4\')?2.$3.1a($.G.k.1b,u):u()},f:7(){2[2.$3.w(\'v\')?\'l\':\'m\']()}}$.q.4=7(d){b 2.15(7(){9 $2=$(2),6=$2.6(\'4\'),a=J d==\'17\'&&d 8(!6)$2.6(\'4\',(6=1d h(2,a)))8(J d==\'1i\')6[d]()})}$.q.4.K={f:Q}$.q.4.S=h $(7(){$(\'12\').16(\'11.4.6-1j\',\'[6-f=4]\',7(e){9 $2=$(2),r,t=$2.L(\'6-t\')||e.18()||(r=$2.L(\'r\'))&&r.1g(/.*(?=#[^\\s]+$)/,\'\'),d=$(t).6(\'4\')?\'f\':$2.6()$(t).4(d)})})}(T.1c);',62,82,'||this|element|collapse|dimension|data|function|if|var|options|return|actives|option||toggle|parent|Collapse|hasData|transitioning|transition|hide|show|startEvent|that|scroll|fn|href||target|complete|in|hasClass|removeClass|reset|size|width|hasWidth|method|Event|null|trigger|support|addClass|completeEvent|typeof|defaults|attr|find|group|accordion|length|true|shown|Constructor|window|camelCase|extend|strict|use|prototype|constructor|height|click|body|join|hidden|each|on|object|preventDefault|isDefaultPrevented|one|end|jQuery|new|offsetWidth|auto|replace|type|string|api'.split('|'),0,{})) diff --git a/Bench4Q-Web/src/main/webapp/login.jsp b/Bench4Q-Web/src/main/webapp/login.jsp index 188ebf31..dba5c2e1 100644 --- a/Bench4Q-Web/src/main/webapp/login.jsp +++ b/Bench4Q-Web/src/main/webapp/login.jsp @@ -19,13 +19,17 @@ - - - - @@ -37,30 +41,26 @@
- -
@@ -103,7 +108,9 @@ style="font-size: 18px; margin-left: 40px; height: 30px; width: 300px;" onblur="checkName(this.value)" /> + style='display: none; color: red; margin-left: 40px'> + +
@@ -112,7 +119,9 @@
-    
+     + +
@@ -120,14 +129,20 @@ style="font-size: 18px; margin-left: 40px; height: 30px; width: 300px;" onblur="checkPass(this.value)" /> + style='display: none; color: red; margin-left: 40px'> + +
- + onClick="login()"> + + +
diff --git a/Bench4Q-Web/src/main/webapp/script/editScript.js b/Bench4Q-Web/src/main/webapp/script/editScript.js index 3867563c..6f49b7d3 100644 --- a/Bench4Q-Web/src/main/webapp/script/editScript.js +++ b/Bench4Q-Web/src/main/webapp/script/editScript.js @@ -49,7 +49,11 @@ function createALi(ulNode, name, action) { function choosePlugin(selectedNode) { pluginName = selectedNode.firstChild.nodeValue; - loadBehaviors("other"); + if(pluginName=="All"){ + loadBehaviors("all"); + }else{ + loadBehaviors("other"); + } } function loadBehaviors(mark) { diff --git a/Bench4Q-Web/src/main/webapp/script/index.js b/Bench4Q-Web/src/main/webapp/script/index.js index 5c8d1b28..90633a1d 100644 --- a/Bench4Q-Web/src/main/webapp/script/index.js +++ b/Bench4Q-Web/src/main/webapp/script/index.js @@ -1,6 +1,6 @@ $("#bench4q").mouseover(function(){document.getElementById("bench4q").setAttribute("src", "images/bench4q-2.png");}); -$("#bench4q").mouseout(function(){document.getElementById("bench4q").setAttribute("src", "images/bench4q-1.png");}); +$("#bench4q").mouseout(function(){document.getElementById("bench4q").setAttribute("src", "images/headerLogo.png");}); $("#register").mouseover(function(){document.getElementById("register").setAttribute("src", "images/goon.jpg");}); diff --git a/Bench4Q-Web/src/main/webapp/script/scriptTable.js b/Bench4Q-Web/src/main/webapp/script/scriptTable.js index 92b34469..b67086b4 100644 --- a/Bench4Q-Web/src/main/webapp/script/scriptTable.js +++ b/Bench4Q-Web/src/main/webapp/script/scriptTable.js @@ -1,8 +1,8 @@ -var viewButton = "View" +var viewButton = "View" + " "; -var editButton = "Edit" +var editButton = "Edit" + " "; -var deleteButton = "Delete"; +var deleteButton = "Delete"; function loadScript(table, actionId) { table.dataTable().fnClearTable(); @@ -12,7 +12,7 @@ function loadScript(table, actionId) { for ( var i = 0; i < data.length; i++) { addScriptTableRow(table, data[i], actionId); } - addScriptAction(); + /*addScriptAction();*/ } else { // show load banner or error alert(data.failedMessage); @@ -54,20 +54,26 @@ function addScriptTableRow(table, data, actionId) { function deleteScript(obj) { var scriptId = getScriptId(obj); - if (confirm("Are you sure you want to delete this script?")) { - $.post("deleteScript", { - scriptId : scriptId - }, function(data) { - if (data.success) { - alert("delete success,please refresh this page"); - table.dataTable().fnDeleteRow(row.rowIndex - 1); - } else { - alert("this script can not be delete in DB:"+data.failedMessage); - // error message - } - }); - } + var c=confirm("Are you sure you want to delete this script?"); + if (c==true) { + deleteAScript(scriptId); + } } + +function deleteAScript(scriptId){ + $.post("deleteScript", { + scriptId : scriptId + }, function(data) { + if (data.success) { + alert("delete success,please refresh this page"); + table.dataTable().fnDeleteRow(row.rowIndex - 1); + } else { + alert("this script can not be delete in DB:"+data.failedMessage); + // error message + } + }); +} + function editScript(obj) { var scriptId = getScriptId(obj); var scriptName = getScriptName(obj);