JFIF  H H (ICC_PROFILE   0 mntrRGB XYZ acsp   - desc trXYZ d gXYZ x bXYZ  rTRC  (gTRC  (bTRC  (wtpt  cprt  ب V 7eud akt !Q ,*R G PQ NČzŬb 56 6 6p z  "c8 3' 'Mq 6 G i t q l@ 9 0.ۚA c N|li: 9 蠃p / ^ Zn L  x84 v ;[#$ n h '  c 3 2o 8Ɛ5K Av*_ ?n X ?  p y ֆ ̈́# z 2 3 F0O e> { Gu . V (C ' h/ o%> x1X r:(>} { yc X 8b ] U : dO Ms VA p 'Z 3'3E - y bj: > j Ov Uw # 2cl~ @gF C jț bz ^: -t df j{XTh  8aU  M ^+d Al "(KK m1$$ X K K q rž o q g V FF#pG~ : ] ֦ !!Ң :pC+ A  zӬ ]. t `= ' h _/ }   @L \ , x㌼ z԰+ J - v + Y  [ '8 '  % X q= [4 Sj~ 4 ݢ # d ʂē R L5k X؊  > l :t\ ba B A\Q3 8 ( < A ; d ) n ӓLr Œ * |J : Ƒ 2rF G A 8 &\ A - J) /j `t.  E  A : T m "%Cb"! 7 wΦ Æ % ; [ ] U zmF kx + 7 ^ Ү R  "7 N+- b7 c ,.55 H T E`) P T ci 20y=MڭyٽS Odc i UJnq&~zn$ Rp )fG' 2 '  . mEϙ Z oV 𶛒u S ] | A @. )<  + '> ө :& $ ' L #   d{q H >*5; jDo ˷ Y m Ԉ*[9* 5 t Uf %3 = GU W\ ' AR _ W 4 _ P պ - | 4R F  JZ v0 d[ˠzJ| PU 8 ;鯌 ' V  cL , κ >   *e b)f, 0 "j1  1 v՘; b J ++ C Oz7 % > N U ,=z \ c EV K >Ic 7} . jHn;^觱GHI  H V ǂO: ߊ{mSV?K|@ A iA T`2 j 1 ~ K8’$ ~]=9ឦG * 9 E Mּm5X f 9 Q ĸ}i D% +t+;F : v : - & h _ rD | !  Ә ;Z l 븂' : C & Ҁae Kkm6 uT".}J&\ hci B2B + T 7 t?EPþЌ m A F\ l c2 ЊABm E,cն\Q J ]d 5  `O  Y@ 8 ?lx#  K iI& Ri1f R2f1N %_ g *T Ө ??N: }+ל ɀ h٭ q L ,ʈ B r c  u  Bmz  ̢TV^  뙏8' u fUX 3㓏 >NG : / ; H p饕 B 1 K  /%iɫ V Q% : _ - 1o L ? R oa\i^ F| W*Na)  P  X #y㯨 z+C ح\  в j i rm *d W ҡQb BȨ i'% NEb ? '[ h =`Oi U϶ u n R }GW 4f VJm  i R ~ J|l%m' % " LW  V 2 7 Ns X b ?_ = {s }ij4 Ý=SN jx FV "ԎI( E  )] ӝ Ж m [4 m `5 -7W f 󪥎 b Z K a#Vb% K Y 5 T $y` 4 6 ̼ p C 7 HM 'l{Oi + Pw~j,S5T4(F Ԩ; A `*HJ TP g t (6/ cg 5 U 1@Qb8 Y!  r < r 6h ) [{h h 8 3  0< y+V >BzOQ KF+6 v %= ~XD PpW c _-:߈   #c 坣 C W1 : ^ Q 06Ӭ q@ Dj $ UW $ ?9 F \cS M5 = 2> hב\,( ) JB k ; J #j徻W (p= o Q D #U Mh U *F  c ?N = n F5 Ӑ12 w 0 5Z 뀩4ڣ 霅 uC1 y %n J 8Ԑ *c r R 9W= H 9 , A ׻, . ZF b QEGVNs, q ' ;O Mm btN Vq Ow*֙kPѬ؈ X J  I ӯ E Wo k + R { %   j;   Y x 7&& , LԜ Y bw" lI (* `۹F A S - #$ 4 13)Q pڤ3Rx O J $c P]v i uq { k y N. - B ,@󪳪ڸ Ao  r% X0 U N b  9 򍕑 7)* 23 3 | Rn b @ q |E U y ́$!7 & ["X O y  ~ƓtADhP  ] m G 파 9 p= ԜZ]ӭ ሎ O eyq ! b I GU : 5~ F o L S T[е $]$g * w] ! ; m@ ޠ &IU ڬ{ ҄բ-.Sm Ғ `    vU"o L ; ' 5s " W )  @ ä  L 1i  } ^Y5 $+ P  v0o  HU @ȓ s Q M )  ? M\ 4 Q  $2 ;g  WJ /NwF JG D : y ό  Mf  W!  QUZ%a zҳ  DK _ X h M ^r ԝ^!d '<#ﴛ O { /F ? + $ Y ' wg'$ l  jG AH 7l 4   x Ѷ c }  I *e s g ~ ;ͤ t@  B 2 iB' 9C a 8 f TR: %  N O  @ m 3 s v w .@ 濾   ,FYrT0m UW _v>>d [ A 6 ڊx : Y T L Hv Ӻ! n S D} >[m E T0 _ ,'C] p  j  V ᅷ PDZ[- V0`  > } ܟpmֻ 2O6 O* ݹ X HS N(J / +1՟ #( P *g EO # w&j 6 ?; ڡ )+ U ]l \ /{莄 * I /  9 <'$ '#' y t/& -\\WP L`/p9 q  a' e ¨ E] f A A E Y nGtm, ϮwXT >AaN#  F j  ŵj Q Fd  q^< H? y J ܃2 * 3 T4 Ч H **W; (ꭽ ¾ P f= e yA 4 FJ 6{e ]J q OC  f#3 S J f i MM\ i T $ rG 8$ 9>2 :  M) Q #N K e &" E 8    . z <  mHk ? # t ˒ A ]; G0H : f! i ! j { 1 m } o 7 u; $   99Ӱ \n c z:zA Lq ޶w y K  T<  4 X, '!Y; Ͱ6 q G M~_ ~܂} t> ( z l }:r  L 9 fe}.- R*<`c6 o ܛ= pr ҽGB)nQ% )s*&i΍ %—Zb{ m[ N Nkb wB w Q* d F HP iܛ ; aV68j}\e I  GI'͔B ;yA  :^ bn - m # @ S6 ˎr  ; ~ cm ƻgU  : X6 G % < r ' dzX^} - H X D -C W`#  کpNH5 E y = 1 G # 꽁  C 5Yx z Y_"& A * C +q7Km 1Pm @in 88  N ^c.d p >[ g c {]c 4 ) f psgY ˅ > *"1 }2<1 7  5)] V5)kd kM ~` ΂  :{ 4  nG PTT b   뎱 ϶w FFᓂG8 >z F _ H  9_r D l: ҶH5  Z!Bj.y k} e rb:SOT ]!ǎ?n:H ε Z s y z tn [ 7N  Z#UQO$ . J #]Cr# Y X  9 c < '$ z 9  . $ $P nDS n 2 u5 X g\  ? |A  ᬰⶵ >> bE) Cb  -ruMc ׺ *,\)`^ m ge \k . ۫8  گ oK 1 gWM p U޻zI=EE rz: # 6 - -/ Wm \z8 מ 0x t A _c ?Ծ  c ^Mژ I MyO> l0 ċ }t7[ \ ʲ9̜ m_a[ 姯 rְ j P \k x 1 ' Cdm vF70e +  m- ]a ?ݝK uSMUm 8f Yb! ) 2Z.U  D \~: ܽ8z R ̪K c b s  &ߦ  1 $ , w \gc  3F$  iU#< ` : I 4{w . 2  a Q $ EX < p} x>N o?Gm N N rE $#J n҉ ! A H'< w  i i͗k ;  S;(PY y, | v G!H $ 4 ƴ @  V !қ 7  $ { O y W SY : I doI 5b _ s G q $ qIOg - B H]_ V  G  ! w0 p$    n U #ROMB $Zn: BD U KE 4 ec q } 3 ^  n BZ j b W  `l  Z d " " b ]nm!ij. {&*   F O? c u ]  u VQbj: J B .Xg J Fsq d祚N x ʣR ;! $ : F cU $R1- K 'ɋ I x8 Ϗoߠ F~ z " _^v 2 - f K  kW8 c . Ms- 6 =eV = ev \  L = g n22p< ׵?r Fۏ >z eP z Rog 8u ( tJ P߁ Z .p Ð ͢A ռ65 X syvm 6R W7W ; |0 >O үG @ ٳ< > om Լ()  kZJlK, F 4 )sn  O Q {u㌏ = A o  ,ծ ?eKB zG 6e6  f| C U _ 4 C[j͕M 8,%em M 8 \ c v COwTGi _9 4 BDf%  'ns 8 M P c  & - y"8R _j 3a +z+ N 9 Q lDQ 40 E V ۋ rH 2 I _ Y O ',:뿉 WN Hvﵐ0 B}n a*E zUb N# 0 e" f.Q  H  5" - H Vn= + #  Eiy- v8= g  `  o [ 鼛 2 . D ^ Q  eB  ؅q Ͽ R C~ B+J ۍ 8 4 * Ӗ Ν1 R B  I\  1[0 I 9y )  Y " 7 ]6 q g\ vP   s = Ѭ֕)פ  E < c` ϷU9 W ,: ? y 1h s U( T g e /룮 J A ]|   4a ZV AI eIhBI! l $ 3![q Hnw\7R { o M / ִ > 5&  gw j F E dc@K:V& W /k + = Y k[ @fU 5 zzmF ȖH,[  n -dc  w d[ z" g 4 ϘR r 0`B 8_; # $^Z  o5K ZYKj GY% s  "!a [9I2TF -  w# a ] ˒  I tٮ ei_ F pVЧ૱W 3e Ci 7 " } H  A pG> h  ֝ 5i T٧- ' `d X1   AF$ $< y  9~ , n  e boW >ޙ_ Z]ڷ T C U y J  G O }   > A" 5 a> Z U R - Z \9 jrW ݖQ Rݳ * ļ ] $ڵ Xq = / w z\ I  I # { ӭ l ^; F_R쵎 [ָ[gK KͰ o Q )W녕 і s *kuz ŨQde` WU_ KLE ~" g r< 2G y  އ L ( -V Y -Z( I U  0  | \ ; 8 C  m hl :̄D  k YHO k |:  *D Y ts س | zrO; 񍃌s T3 1 = j w y Ш ^nZ H m _G̮ 0W  󿓹 S ;  _$ mٛI D V =f -H } U  ]H A * vԶ  3\ Wh*I#$ @6  x ^ O Z C&J U 16 X D* if& B DGFY YP [KL X u X .Z h q Ghb  8 M# Mq t \c > aT 00= ㎨ʕ G Q Ԫ R ,Ĝ I9 zӦ JO 3Rn ` C 5 ܊@Q O1 N.ؔ"I\ YÖ Đ H d L \}IP~jm $ y ; :ZG  ZV Jv =&*UF#` `R`*S+p \=) ҭ 9 k  ̮Rš x 0' **ԑL kɺk +zJb # :|M Z ? j$ݼ & X )$ 6 F Y6ѕ/  ;  J *n l C *ų_ ԕ{ _ 6 :\47ڷ s 4R m Ċ = z * ʪ XT [ ] 5 Bl#a -˙bv 8 @ H   |R we9A%5& M % Z02T N)&&GfM 儀o Œ M ;= ./ /k~ E"a9/3 y ,> l j >  Z X y &ε Y P &h g e c< `` ] !}i'c KQ ulF Iʓ_\T58 ( +cJ q~ [d gm m/` Xڙ ht k q ו$ " c[P VY [uɜ&# 몵 "  Ⱦ qC  " Ü Ȕ!  <  M j8 u- d x * g ϫ t T Ld K laWڭ  \ ~ |  7 u` h( w ֋ c L= ˼ = F  vcG s } зU BS М; FI;  Q $8 +V|[C S 쮙 1 % YP Q% L VVK+& , c Ib ]  Vy i ~h  ?y F4  "5 A s- F ݆x5 5P&E :W@f;}  G y ^ ]U ITki 1 d﫠 *c N h ' c ؗY n s L :b  ? H :k M~ @ 8# I qɔ ~ :f ] P*i]H 'f jhx Tҗ 1 O : ^t $ 1]  UXz&  t OD T > (^ s &3 #N_ / x - 䬦? ~ v U- W$4  ' ӎ v RG |jy SW? u 4 ( 1 G[ ِ2 2jʎ hr m oյ ش gRͮ%ϟ Ѭ 9 o R  n-  &F - @  hgY _qN ;"2  !K J  šA ^, " aG 8` =1 4 =5 Mq k > U@UT  : R gj rK F. O$ I9'  =i }. _ One Hat Cyber Team
  • Your IP: 216.73.216.6
  • Server IP: 13.234.148.13
  • Server: Linux ip-172-31-36-101 5.15.0-1031-aws #35~20.04.1-Ubuntu SMP Sat Feb 11 16:19:06 UTC 2023 x86_64
  • Server Software: Apache/2.4.41 (Ubuntu)
  • PHP Version: 7.4.3-4ubuntu2.29
  • Buat File | Buat Folder
View File Name : rte.js
'; var $ajaxDialog = $('
' + data.message + '
').dialog({ width: 500, buttons: button_options, title: data.title }); // Attach syntax highlighted editor to export dialog /** * @var $elm jQuery object containing the reference * to the Export textarea. */ var $elm = $ajaxDialog.find('textarea'); PMA_getSQLEditor($elm); } else { PMA_ajaxShowMessage(data.error, false); } } // end showExport() }, // end exportDialog() editorDialog: function (is_new, $this) { var that = this; /** * @var $edit_row jQuery object containing the reference to * the row of the the item being edited * from the list of items */ var $edit_row = null; if ($this.hasClass('edit_anchor')) { // Remeber the row of the item being edited for later, // so that if the edit is successful, we can replace the // row with info about the modified item. $edit_row = $this.parents('tr'); } /** * @var $msg jQuery object containing the reference to * the AJAX message shown to the user */ var $msg = PMA_ajaxShowMessage(); $.get($this.attr('href'), { 'ajax_request': true }, function (data) { if (data.success === true) { // We have successfully fetched the editor form PMA_ajaxRemoveMessage($msg); // Now define the function that is called when // the user presses the "Go" button that.buttonOptions[PMA_messages.strGo] = function () { // Move the data from the codemirror editor back to the // textarea, where it can be used in the form submission. if (typeof CodeMirror !== 'undefined') { that.syntaxHiglighter.save(); } // Validate editor and submit request, if passed. if (that.validate()) { /** * @var data Form data to be sent in the AJAX request */ var data = $('form.rte_form').last().serialize(); $msg = PMA_ajaxShowMessage( PMA_messages.strProcessingRequest ); var url = $('form.rte_form').last().attr('action'); $.post(url, data, function (data) { if (data.success === true) { // Item created successfully PMA_ajaxRemoveMessage($msg); PMA_slidingMessage(data.message); that.$ajaxDialog.dialog('close'); // If we are in 'edit' mode, we must // remove the reference to the old row. if (mode === 'edit' && $edit_row !== null) { $edit_row.remove(); } // Sometimes, like when moving a trigger from // a table to another one, the new row should // not be inserted into the list. In this case // "data.insert" will be set to false. if (data.insert) { // Insert the new row at the correct // location in the list of items /** * @var text Contains the name of an item from * the list that is used in comparisons * to find the correct location where * to insert a new row. */ var text = ''; /** * @var inserted Whether a new item has been * inserted in the list or not */ var inserted = false; $('table.data').find('tr').each(function () { text = $(this) .children('td') .eq(0) .find('strong') .text() .toUpperCase(); text = $.trim(text); if (text !== '' && text > data.name) { $(this).before(data.new_row); inserted = true; return false; } }); if (! inserted) { // If we didn't manage to insert the row yet, // it must belong at the end of the list, // so we insert it there. $('table.data').append(data.new_row); } // Fade-in the new row $('tr.ajaxInsert') .show('slow') .removeClass('ajaxInsert'); } else if ($('table.data').find('tr').has('td').length === 0) { // If we are not supposed to insert the new row, // we will now check if the table is empty and // needs to be hidden. This will be the case if // we were editing the only item in the list, // which we removed and will not be inserting // something else in its place. $('table.data').hide('slow', function () { $('#nothing2display').show('slow'); }); } // Now we have inserted the row at the correct // position, but surely at least some row classes // are wrong now. So we will itirate throught // all rows and assign correct classes to them /** * @var ct Count of processed rows */ var ct = 0; /** * @var rowclass Class to be attached to the row * that is being processed */ var rowclass = ''; $('table.data').find('tr').has('td').each(function () { rowclass = (ct % 2 === 0) ? 'odd' : 'even'; $(this).removeClass().addClass(rowclass); ct++; }); // If this is the first item being added, remove // the "No items" message and show the list. if ($('table.data').find('tr').has('td').length > 0 && $('#nothing2display').is(':visible') ) { $('#nothing2display').hide('slow', function () { $('table.data').show('slow'); }); } PMA_reloadNavigation(); } else { PMA_ajaxShowMessage(data.error, false); } }); // end $.post() } // end "if (that.validate())" }; // end of function that handles the submission of the Editor that.buttonOptions[PMA_messages.strClose] = function () { $(this).dialog('close'); }; /** * Display the dialog to the user */ that.$ajaxDialog = $('
' + data.message + '
').dialog({ width: 700, minWidth: 500, maxHeight: $(window).height(), buttons: that.buttonOptions, title: data.title, modal: true, open: function () { if ($('#rteDialog').parents('.ui-dialog').height() > $(window).height()) { $('#rteDialog').dialog('option', 'height', $(window).height()); } $(this).find('input[name=item_name]').focus(); $(this).find('input.datefield').each(function () { PMA_addDatepicker($(this).css('width', '95%'), 'date'); }); $(this).find('input.datetimefield').each(function () { PMA_addDatepicker($(this).css('width', '95%'), 'datetime'); }); $.datepicker.initialized = false; }, close: function () { $(this).remove(); } }); /** * @var mode Used to remeber whether the editor is in * "Edit" or "Add" mode */ var mode = 'add'; if ($('input[name=editor_process_edit]').length > 0) { mode = 'edit'; } // Attach syntax highlighted editor to the definition /** * @var elm jQuery object containing the reference to * the Definition textarea. */ var $elm = $('textarea[name=item_definition]').last(); var linterOptions = {}; linterOptions[that.editorType + '_editor'] = true; that.syntaxHiglighter = PMA_getSQLEditor($elm, {}, null, linterOptions); // Execute item-specific code that.postDialogShow(data); } else { PMA_ajaxShowMessage(data.error, false); } }); // end $.get() }, dropDialog: function ($this) { /** * @var $curr_row Object containing reference to the current row */ var $curr_row = $this.parents('tr'); /** * @var question String containing the question to be asked for confirmation */ var question = $('
').text( $curr_row.children('td').children('.drop_sql').html() ); // We ask for confirmation first here, before submitting the ajax request $this.PMA_confirm(question, $this.attr('href'), function (url) { /** * @var msg jQuery object containing the reference to * the AJAX message shown to the user */ var $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); var params = getJSConfirmCommonParam(this, $this.getPostData()); $.post(url, params, function (data) { if (data.success === true) { /** * @var $table Object containing reference * to the main list of elements */ var $table = $curr_row.parent(); // Check how many rows will be left after we remove // the one that the user has requested us to remove if ($table.find('tr').length === 3) { // If there are two rows left, it means that they are // the header of the table and the rows that we are // about to remove, so after the removal there will be // nothing to show in the table, so we hide it. $table.hide('slow', function () { $(this).find('tr.even, tr.odd').remove(); $('.withSelected').remove(); $('#nothing2display').show('slow'); }); } else { $curr_row.hide('slow', function () { $(this).remove(); // Now we have removed the row from the list, but maybe // some row classes are wrong now. So we will itirate // throught all rows and assign correct classes to them. /** * @var ct Count of processed rows */ var ct = 0; /** * @var rowclass Class to be attached to the row * that is being processed */ var rowclass = ''; $table.find('tr').has('td').each(function () { rowclass = (ct % 2 === 1) ? 'odd' : 'even'; $(this).removeClass().addClass(rowclass); ct++; }); }); } // Get rid of the "Loading" message PMA_ajaxRemoveMessage($msg); // Show the query that we just executed PMA_slidingMessage(data.sql_query); PMA_reloadNavigation(); } else { PMA_ajaxShowMessage(data.error, false); } }); // end $.post() }); // end $.PMA_confirm() }, dropMultipleDialog: function ($this) { // We ask for confirmation here $this.PMA_confirm(PMA_messages.strDropRTEitems, '', function (url) { /** * @var msg jQuery object containing the reference to * the AJAX message shown to the user */ var $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); // drop anchors of all selected rows var drop_anchors = $('input.checkall:checked').parents('tr').find('.drop_anchor'); var success = true; var count = drop_anchors.length; var returnCount = 0; drop_anchors.each(function () { var $anchor = $(this); /** * @var $curr_row Object containing reference to the current row */ var $curr_row = $anchor.parents('tr'); var params = getJSConfirmCommonParam(this, $anchor.getPostData()); $.post($anchor.attr('href'), params, function (data) { returnCount++; if (data.success === true) { /** * @var $table Object containing reference * to the main list of elements */ var $table = $curr_row.parent(); // Check how many rows will be left after we remove // the one that the user has requested us to remove if ($table.find('tr').length === 3) { // If there are two rows left, it means that they are // the header of the table and the rows that we are // about to remove, so after the removal there will be // nothing to show in the table, so we hide it. $table.hide('slow', function () { $(this).find('tr.even, tr.odd').remove(); $('.withSelected').remove(); $('#nothing2display').show('slow'); }); } else { $curr_row.hide('fast', function () { $(this).remove(); // Now we have removed the row from the list, but maybe // some row classes are wrong now. So we will itirate // throught all rows and assign correct classes to them. /** * @var ct Count of processed rows */ var ct = 0; /** * @var rowclass Class to be attached to the row * that is being processed */ var rowclass = ''; $table.find('tr').has('td').each(function () { rowclass = (ct % 2 === 1) ? 'odd' : 'even'; $(this).removeClass().addClass(rowclass); ct++; }); }); } if (returnCount === count) { if (success) { // Get rid of the "Loading" message PMA_ajaxRemoveMessage($msg); $('#rteListForm_checkall').prop({ checked: false, indeterminate: false }); } PMA_reloadNavigation(); } } else { PMA_ajaxShowMessage(data.error, false); success = false; if (returnCount === count) { PMA_reloadNavigation(); } } }); // end $.post() }); // end drop_anchors.each() }); // end $.PMA_confirm() } }; // end RTE namespace /** * @var RTE.EVENT JavaScript functionality for events */ RTE.EVENT = { validateCustom: function () { /** * @var elm a jQuery object containing the reference * to an element that is being validated */ var $elm = null; if (this.$ajaxDialog.find('select[name=item_type]').find(':selected').val() === 'RECURRING') { // The interval field must not be empty for recurring events $elm = this.$ajaxDialog.find('input[name=item_interval_value]'); if ($elm.val() === '') { $elm.focus(); alert(PMA_messages.strFormEmpty); return false; } } else { // The execute_at field must not be empty for "once off" events $elm = this.$ajaxDialog.find('input[name=item_execute_at]'); if ($elm.val() === '') { $elm.focus(); alert(PMA_messages.strFormEmpty); return false; } } return true; } }; /** * @var RTE.ROUTINE JavaScript functionality for routines */ RTE.ROUTINE = { /** * Overriding the postDialogShow() function defined in common.js * * @param data JSON-encoded data from the ajax request */ postDialogShow: function (data) { // Cache the template for a parameter table row RTE.param_template = data.param_template; var that = this; // Make adjustments in the dialog to make it AJAX compatible $('td.routine_param_remove').show(); $('input[name=routine_removeparameter]').remove(); $('input[name=routine_addparameter]').css('width', '100%'); // Enable/disable the 'options' dropdowns for parameters as necessary $('table.routine_params_table').last().find('th[colspan=2]').attr('colspan', '1'); $('table.routine_params_table').last().find('tr').has('td').each(function () { that.setOptionsForParameter( $(this).find('select[name^=item_param_type]'), $(this).find('input[name^=item_param_length]'), $(this).find('select[name^=item_param_opts_text]'), $(this).find('select[name^=item_param_opts_num]') ); }); // Enable/disable the 'options' dropdowns for // function return value as necessary this.setOptionsForParameter( $('table.rte_table').last().find('select[name=item_returntype]'), $('table.rte_table').last().find('input[name=item_returnlength]'), $('table.rte_table').last().find('select[name=item_returnopts_text]'), $('table.rte_table').last().find('select[name=item_returnopts_num]') ); // Allow changing parameter order $('.routine_params_table tbody').sortable({ containment: '.routine_params_table tbody', handle: '.dragHandle', stop: function (event, ui) { that.reindexParameters(); }, }); }, /** * Reindexes the parameters after dropping a parameter or reordering parameters */ reindexParameters: function () { /** * @var index Counter used for reindexing the input * fields in the routine parameters table */ var index = 0; $('table.routine_params_table tbody').find('tr').each(function () { $(this).find(':input').each(function () { /** * @var inputname The value of the name attribute of * the input field being reindexed */ var inputname = $(this).attr('name'); if (inputname.substr(0, 14) === 'item_param_dir') { $(this).attr('name', inputname.substr(0, 14) + '[' + index + ']'); } else if (inputname.substr(0, 15) === 'item_param_name') { $(this).attr('name', inputname.substr(0, 15) + '[' + index + ']'); } else if (inputname.substr(0, 15) === 'item_param_type') { $(this).attr('name', inputname.substr(0, 15) + '[' + index + ']'); } else if (inputname.substr(0, 17) === 'item_param_length') { $(this).attr('name', inputname.substr(0, 17) + '[' + index + ']'); $(this).attr('id', 'item_param_length_' + index); } else if (inputname.substr(0, 20) === 'item_param_opts_text') { $(this).attr('name', inputname.substr(0, 20) + '[' + index + ']'); } else if (inputname.substr(0, 19) === 'item_param_opts_num') { $(this).attr('name', inputname.substr(0, 19) + '[' + index + ']'); } }); index++; }); }, /** * Overriding the validateCustom() function defined in common.js */ validateCustom: function () { /** * @var isSuccess Stores the outcome of the validation */ var isSuccess = true; /** * @var inputname The value of the "name" attribute for * the field that is being processed */ var inputname = ''; this.$ajaxDialog.find('table.routine_params_table').last().find('tr').each(function () { // Every parameter of a routine must have // a non-empty direction, name and type if (isSuccess) { $(this).find(':input').each(function () { inputname = $(this).attr('name'); if (inputname.substr(0, 14) === 'item_param_dir' || inputname.substr(0, 15) === 'item_param_name' || inputname.substr(0, 15) === 'item_param_type') { if ($(this).val() === '') { $(this).focus(); isSuccess = false; return false; } } }); } else { return false; } }); if (! isSuccess) { alert(PMA_messages.strFormEmpty); return false; } this.$ajaxDialog.find('table.routine_params_table').last().find('tr').each(function () { // SET, ENUM, VARCHAR and VARBINARY fields must have length/values var $inputtyp = $(this).find('select[name^=item_param_type]'); var $inputlen = $(this).find('input[name^=item_param_length]'); if ($inputtyp.length && $inputlen.length) { if (($inputtyp.val() === 'ENUM' || $inputtyp.val() === 'SET' || $inputtyp.val().substr(0, 3) === 'VAR') && $inputlen.val() === '' ) { $inputlen.focus(); isSuccess = false; return false; } } }); if (! isSuccess) { alert(PMA_messages.strFormEmpty); return false; } if (this.$ajaxDialog.find('select[name=item_type]').find(':selected').val() === 'FUNCTION') { // The length/values of return variable for functions must // be set, if the type is SET, ENUM, VARCHAR or VARBINARY. var $returntyp = this.$ajaxDialog.find('select[name=item_returntype]'); var $returnlen = this.$ajaxDialog.find('input[name=item_returnlength]'); if (($returntyp.val() === 'ENUM' || $returntyp.val() === 'SET' || $returntyp.val().substr(0, 3) === 'VAR') && $returnlen.val() === '' ) { $returnlen.focus(); alert(PMA_messages.strFormEmpty); return false; } } if ($('select[name=item_type]').find(':selected').val() === 'FUNCTION') { // A function must contain a RETURN statement in its definition if (this.$ajaxDialog.find('table.rte_table').find('textarea[name=item_definition]').val().toUpperCase().indexOf('RETURN') < 0) { this.syntaxHiglighter.focus(); alert(PMA_messages.MissingReturn); return false; } } return true; }, /** * Enable/disable the "options" dropdown and "length" input for * parameters and the return variable in the routine editor * as necessary. * * @param type a jQuery object containing the reference * to the "Type" dropdown box * @param len a jQuery object containing the reference * to the "Length" input box * @param text a jQuery object containing the reference * to the dropdown box with options for * parameters of text type * @param num a jQuery object containing the reference * to the dropdown box with options for * parameters of numeric type */ setOptionsForParameter: function ($type, $len, $text, $num) { /** * @var no_opts a jQuery object containing the reference * to an element to be displayed when no * options are available */ var $no_opts = $text.parent().parent().find('.no_opts'); /** * @var no_len a jQuery object containing the reference * to an element to be displayed when no * "length/values" field is available */ var $no_len = $len.parent().parent().find('.no_len'); // Process for parameter options switch ($type.val()) { case 'TINYINT': case 'SMALLINT': case 'MEDIUMINT': case 'INT': case 'BIGINT': case 'DECIMAL': case 'FLOAT': case 'DOUBLE': case 'REAL': $text.parent().hide(); $num.parent().show(); $no_opts.hide(); break; case 'TINYTEXT': case 'TEXT': case 'MEDIUMTEXT': case 'LONGTEXT': case 'CHAR': case 'VARCHAR': case 'SET': case 'ENUM': $text.parent().show(); $num.parent().hide(); $no_opts.hide(); break; default: $text.parent().hide(); $num.parent().hide(); $no_opts.show(); break; } // Process for parameter length switch ($type.val()) { case 'DATE': case 'TINYBLOB': case 'TINYTEXT': case 'BLOB': case 'TEXT': case 'MEDIUMBLOB': case 'MEDIUMTEXT': case 'LONGBLOB': case 'LONGTEXT': $text.closest('tr').find('a:first').hide(); $len.parent().hide(); $no_len.show(); break; default: if ($type.val() === 'ENUM' || $type.val() === 'SET') { $text.closest('tr').find('a:first').show(); } else { $text.closest('tr').find('a:first').hide(); } $len.parent().show(); $no_len.hide(); break; } }, executeDialog: function ($this) { var that = this; /** * @var msg jQuery object containing the reference to * the AJAX message shown to the user */ var $msg = PMA_ajaxShowMessage(); var params = getJSConfirmCommonParam($this[0], $this.getPostData()); $.post($this.attr('href'), params, function (data) { if (data.success === true) { PMA_ajaxRemoveMessage($msg); // If 'data.dialog' is true we show a dialog with a form // to get the input parameters for routine, otherwise // we just show the results of the query if (data.dialog) { // Define the function that is called when // the user presses the "Go" button that.buttonOptions[PMA_messages.strGo] = function () { /** * @var data Form data to be sent in the AJAX request */ var data = $('form.rte_form').last().serialize(); $msg = PMA_ajaxShowMessage( PMA_messages.strProcessingRequest ); $.post('db_routines.php', data, function (data) { if (data.success === true) { // Routine executed successfully PMA_ajaxRemoveMessage($msg); PMA_slidingMessage(data.message); $ajaxDialog.dialog('close'); } else { PMA_ajaxShowMessage(data.error, false); } }); }; that.buttonOptions[PMA_messages.strClose] = function () { $(this).dialog('close'); }; /** * Display the dialog to the user */ var $ajaxDialog = $('
' + data.message + '
').dialog({ width: 650, buttons: that.buttonOptions, title: data.title, modal: true, close: function () { $(this).remove(); } }); $ajaxDialog.find('input[name^=params]').first().focus(); /** * Attach the datepickers to the relevant form fields */ $ajaxDialog.find('input.datefield, input.datetimefield').each(function () { PMA_addDatepicker($(this).css('width', '95%')); }); /* * Define the function if the user presses enter */ $('form.rte_form').on('keyup', function (event) { event.preventDefault(); if (event.keyCode === 13) { /** * @var data Form data to be sent in the AJAX request */ var data = $(this).serialize(); $msg = PMA_ajaxShowMessage( PMA_messages.strProcessingRequest ); var url = $(this).attr('action'); $.post(url, data, function (data) { if (data.success === true) { // Routine executed successfully PMA_ajaxRemoveMessage($msg); PMA_slidingMessage(data.message); $('form.rte_form').off('keyup'); $ajaxDialog.remove(); } else { PMA_ajaxShowMessage(data.error, false); } }); } }); } else { // Routine executed successfully PMA_slidingMessage(data.message); } } else { PMA_ajaxShowMessage(data.error, false); } }); // end $.post() } }; /** * Attach Ajax event handlers for the Routines, Triggers and Events editor */ $(function () { /** * Attach Ajax event handlers for the Add/Edit functionality. */ $(document).on('click', 'a.ajax.add_anchor, a.ajax.edit_anchor', function (event) { event.preventDefault(); var type = $(this).attr('href').substr(0, $(this).attr('href').indexOf('?')); if (type.indexOf('routine') !== -1) { type = 'routine'; } else if (type.indexOf('trigger') !== -1) { type = 'trigger'; } else if (type.indexOf('event') !== -1) { type = 'event'; } else { type = ''; } var dialog = new RTE.object(type); dialog.editorDialog($(this).hasClass('add_anchor'), $(this)); }); // end $(document).on() /** * Attach Ajax event handlers for the Execute routine functionality */ $(document).on('click', 'a.ajax.exec_anchor', function (event) { event.preventDefault(); var dialog = new RTE.object('routine'); dialog.executeDialog($(this)); }); // end $(document).on() /** * Attach Ajax event handlers for Export of Routines, Triggers and Events */ $(document).on('click', 'a.ajax.export_anchor', function (event) { event.preventDefault(); var dialog = new RTE.object(); dialog.exportDialog($(this)); }); // end $(document).on() $(document).on('click', '#rteListForm.ajax .mult_submit[value="export"]', function (event) { event.preventDefault(); var dialog = new RTE.object(); dialog.exportDialog($(this)); }); // end $(document).on() /** * Attach Ajax event handlers for Drop functionality * of Routines, Triggers and Events. */ $(document).on('click', 'a.ajax.drop_anchor', function (event) { event.preventDefault(); var dialog = new RTE.object(); dialog.dropDialog($(this)); }); // end $(document).on() $(document).on('click', '#rteListForm.ajax .mult_submit[value="drop"]', function (event) { event.preventDefault(); var dialog = new RTE.object(); dialog.dropMultipleDialog($(this)); }); // end $(document).on() /** * Attach Ajax event handlers for the "Change event/routine type" * functionality in the events editor, so that the correct * rows are shown in the editor when changing the event type */ $(document).on('change', 'select[name=item_type]', function () { $(this) .closest('table') .find('tr.recurring_event_row, tr.onetime_event_row, tr.routine_return_row, .routine_direction_cell') .toggle(); }); // end $(document).on() /** * Attach Ajax event handlers for the "Change parameter type" * functionality in the routines editor, so that the correct * option/length fields, if any, are shown when changing * a parameter type */ $(document).on('change', 'select[name^=item_param_type]', function () { /** * @var row jQuery object containing the reference to * a row in the routine parameters table */ var $row = $(this).parents('tr').first(); var rte = new RTE.object('routine'); rte.setOptionsForParameter( $row.find('select[name^=item_param_type]'), $row.find('input[name^=item_param_length]'), $row.find('select[name^=item_param_opts_text]'), $row.find('select[name^=item_param_opts_num]') ); }); // end $(document).on() /** * Attach Ajax event handlers for the "Change the type of return * variable of function" functionality, so that the correct fields, * if any, are shown when changing the function return type type */ $(document).on('change', 'select[name=item_returntype]', function () { var rte = new RTE.object('routine'); var $table = $(this).closest('table.rte_table'); rte.setOptionsForParameter( $table.find('select[name=item_returntype]'), $table.find('input[name=item_returnlength]'), $table.find('select[name=item_returnopts_text]'), $table.find('select[name=item_returnopts_num]') ); }); // end $(document).on() /** * Attach Ajax event handlers for the "Add parameter to routine" functionality */ $(document).on('click', 'input[name=routine_addparameter]', function (event) { event.preventDefault(); /** * @var routine_params_table jQuery object containing the reference * to the routine parameters table */ var $routine_params_table = $(this).closest('div.ui-dialog').find('.routine_params_table'); /** * @var new_param_row A string containing the HTML code for the * new row for the routine parameters table */ var new_param_row = RTE.param_template.replace(/%s/g, $routine_params_table.find('tr').length - 1); // Append the new row to the parameters table $routine_params_table.append(new_param_row); // Make sure that the row is correctly shown according to the type of routine if ($(this).closest('div.ui-dialog').find('table.rte_table select[name=item_type]').val() === 'FUNCTION') { $('tr.routine_return_row').show(); $('td.routine_direction_cell').hide(); } /** * @var newrow jQuery object containing the reference to the newly * inserted row in the routine parameters table */ var $newrow = $(this).closest('div.ui-dialog').find('table.routine_params_table').find('tr').has('td').last(); // Enable/disable the 'options' dropdowns for parameters as necessary var rte = new RTE.object('routine'); rte.setOptionsForParameter( $newrow.find('select[name^=item_param_type]'), $newrow.find('input[name^=item_param_length]'), $newrow.find('select[name^=item_param_opts_text]'), $newrow.find('select[name^=item_param_opts_num]') ); }); // end $(document).on() /** * Attach Ajax event handlers for the * "Remove parameter from routine" functionality */ $(document).on('click', 'a.routine_param_remove_anchor', function (event) { event.preventDefault(); $(this).parent().parent().remove(); // After removing a parameter, the indices of the name attributes in // the input fields lose the correct order and need to be reordered. RTE.ROUTINE.reindexParameters(); }); // end $(document).on() }); // end of $()