@@ -147,8 +147,8 @@ const mouseUp = function () {
147147// ------------------------------------------------------------------------------
148148
149149const canvasPos = function ( ) {
150- canvasWidth = document . getElementById ( 'canvas' ) . width = osnTabWidth - 3 ;
151- canvasHeight = document . getElementById ( 'canvas' ) . height = osnTabHeight - 3 ;
150+ canvasWidth = ( document . getElementById ( 'canvas' ) as HTMLCanvasElement ) . width = osnTabWidth - 3 ;
151+ canvasHeight = ( document . getElementById ( 'canvas' ) as HTMLCanvasElement ) . height = osnTabHeight - 3 ;
152152} ;
153153
154154const osnTabPos = function ( ) {
@@ -272,8 +272,8 @@ const reload = function () {
272272 // table name
273273 for ( key3 in DesignerConfig . contr [ K ] [ key ] [ key2 ] ) {
274274 // field name
275- if ( ! document . getElementById ( 'check_vis_' + key2 ) . checked ||
276- ! document . getElementById ( 'check_vis_' + DesignerConfig . contr [ K ] [ key ] [ key2 ] [ key3 ] [ 0 ] ) . checked ) {
275+ if ( ! ( document . getElementById ( 'check_vis_' + key2 ) as HTMLInputElement ) . checked ||
276+ ! ( document . getElementById ( 'check_vis_' + DesignerConfig . contr [ K ] [ key ] [ key2 ] [ key3 ] [ 0 ] ) as HTMLInputElement ) . checked ) {
277277 // if hide
278278 continue ;
279279 }
@@ -373,7 +373,7 @@ const reload = function () {
373373 * @param colorLine
374374 */
375375const line = function ( x1 , y1 , x2 , y2 , colorLine ) {
376- var canvas = document . getElementById ( 'canvas' ) ;
376+ var canvas = ( document . getElementById ( 'canvas' ) as HTMLCanvasElement ) ;
377377 var ctx = canvas . getContext ( '2d' ) ;
378378 ctx . strokeStyle = colorLine ;
379379 ctx . lineWidth = 1 ;
@@ -488,7 +488,7 @@ const line3 = function (x1, y1, x2, y2, colorLine) {
488488} ;
489489
490490const circle = function ( x , y , r , w , color ) {
491- var ctx = document . getElementById ( 'canvas' ) . getContext ( '2d' ) ;
491+ var ctx = ( document . getElementById ( 'canvas' ) as HTMLCanvasElement ) . getContext ( '2d' ) ;
492492 ctx . beginPath ( ) ;
493493 ctx . moveTo ( x , y ) ;
494494 ctx . lineWidth = w ;
@@ -498,13 +498,13 @@ const circle = function (x, y, r, w, color) {
498498} ;
499499
500500const clear = function ( ) {
501- var canvas = document . getElementById ( 'canvas' ) ;
501+ var canvas = ( document . getElementById ( 'canvas' ) as HTMLCanvasElement ) ;
502502 var ctx = canvas . getContext ( '2d' ) ;
503503 ctx . clearRect ( 0 , 0 , canvasWidth , canvasHeight ) ;
504504} ;
505505
506506const rect = function ( x1 , y1 , w , h , color ) {
507- var ctx = document . getElementById ( 'canvas' ) . getContext ( '2d' ) ;
507+ var ctx = ( document . getElementById ( 'canvas' ) as HTMLCanvasElement ) . getContext ( '2d' ) ;
508508 ctx . fillStyle = color ;
509509 ctx . fillRect ( x1 , y1 , w , h ) ;
510510} ;
@@ -711,13 +711,13 @@ const newPage = function () {
711711// (del?) no for pdf
712712const save = function ( url ) {
713713 for ( var key in DesignerConfig . jTabs ) {
714- document . getElementById ( 't_x_' + key + '_' ) . value = parseInt ( document . getElementById ( key ) . style . left , 10 ) ;
715- document . getElementById ( 't_y_' + key + '_' ) . value = parseInt ( document . getElementById ( key ) . style . top , 10 ) ;
716- document . getElementById ( 't_v_' + key + '_' ) . value = document . getElementById ( 'id_tbody_' + key ) . style . display === 'none' ? 0 : 1 ;
717- document . getElementById ( 't_h_' + key + '_' ) . value = document . getElementById ( 'check_vis_' + key ) . checked ? 1 : 0 ;
714+ ( document . getElementById ( 't_x_' + key + '_' ) as HTMLInputElement ) . value = parseInt ( document . getElementById ( key ) . style . left , 10 ) ;
715+ ( document . getElementById ( 't_y_' + key + '_' ) as HTMLInputElement ) . value = parseInt ( document . getElementById ( key ) . style . top , 10 ) ;
716+ ( document . getElementById ( 't_v_' + key + '_' ) as HTMLInputElement ) . value = document . getElementById ( 'id_tbody_' + key ) . style . display === 'none' ? 0 : 1 ;
717+ ( document . getElementById ( 't_h_' + key + '_' ) as HTMLInputElement ) . value = ( document . getElementById ( 'check_vis_' + key ) as HTMLInputElement ) . checked ? 1 : 0 ;
718718 }
719719
720- document . getElementById ( 'container-form' ) . action = url ;
720+ ( document . getElementById ( 'container-form' ) as HTMLFormElement ) . action = url ;
721721 $ ( '#container-form' ) . trigger ( 'submit' ) ;
722722} ;
723723
@@ -1800,15 +1800,15 @@ const clickOption = function (dbName, tableName, columnName, tableDbNameUrl, opt
18001800
18011801const closeOption = function ( ) {
18021802 document . getElementById ( 'designer_optionse' ) . style . display = 'none' ;
1803- document . getElementById ( 'rel_opt' ) . value = '--' ;
1804- document . getElementById ( 'Query' ) . value = '' ;
1805- document . getElementById ( 'new_name' ) . value = '' ;
1806- document . getElementById ( 'operator' ) . value = '---' ;
1807- document . getElementById ( 'groupby' ) . checked = false ;
1808- document . getElementById ( 'h_rel_opt' ) . value = '--' ;
1809- document . getElementById ( 'h_operator' ) . value = '---' ;
1810- document . getElementById ( 'having' ) . value = '' ;
1811- document . getElementById ( 'orderby' ) . value = '---' ;
1803+ ( document . getElementById ( 'rel_opt' ) as HTMLSelectElement ) . value = '--' ;
1804+ ( document . getElementById ( 'Query' ) as HTMLTextAreaElement ) . value = '' ;
1805+ ( document . getElementById ( 'new_name' ) as HTMLInputElement ) . value = '' ;
1806+ ( document . getElementById ( 'operator' ) as HTMLSelectElement ) . value = '---' ;
1807+ ( document . getElementById ( 'groupby' ) as HTMLInputElement ) . checked = false ;
1808+ ( document . getElementById ( 'h_rel_opt' ) as HTMLSelectElement ) . value = '--' ;
1809+ ( document . getElementById ( 'h_operator' ) as HTMLSelectElement ) . value = '---' ;
1810+ ( document . getElementById ( 'having' ) as HTMLTextAreaElement ) . value = '' ;
1811+ ( document . getElementById ( 'orderby' ) as HTMLSelectElement ) . value = '---' ;
18121812} ;
18131813
18141814const selectAll = function ( tableName , dbName , idSelectAll ) {
@@ -1877,7 +1877,7 @@ const storeColumn = function (tableName, colName, checkboxId) {
18771877 var i ;
18781878 var k ;
18791879 var selectKeyField = '`' + tableName + '`.`' + colName + '`' ;
1880- if ( document . getElementById ( checkboxId ) . checked === true ) {
1880+ if ( ( document . getElementById ( checkboxId ) as HTMLInputElement ) . checked === true ) {
18811881 DesignerHistory . selectField . push ( selectKeyField ) ;
18821882 window . fromArray . push ( tableName ) ;
18831883 } else {
@@ -1910,59 +1910,59 @@ const storeColumn = function (tableName, colName, checkboxId) {
19101910const addObject = function ( dbName , tableName , colName , dbTableNameUrl ) {
19111911 var p ;
19121912 var whereObj ;
1913- var rel = document . getElementById ( 'rel_opt' ) ;
1913+ var rel = ( document . getElementById ( 'rel_opt' ) as HTMLSelectElement ) ;
19141914 var sum = 0 ;
19151915 var init = DesignerHistory . historyArray . length ;
19161916 if ( rel . value !== '--' ) {
1917- if ( document . getElementById ( 'Query' ) . value === '' ) {
1917+ if ( ( document . getElementById ( 'Query' ) as HTMLTextAreaElement ) . value === '' ) {
19181918 ajaxShowMessage ( window . sprintf ( window . Messages . strQueryEmpty ) ) ;
19191919
19201920 return ;
19211921 }
19221922
1923- p = document . getElementById ( 'Query' ) ;
1923+ p = ( document . getElementById ( 'Query' ) as HTMLTextAreaElement ) ;
19241924 whereObj = new DesignerHistory . Where ( rel . value , p . value ) ; // make where object
19251925 DesignerHistory . historyArray . push ( new DesignerHistory . HistoryObj ( colName , whereObj , tableName , DesignerConfig . hTabs [ dbTableNameUrl ] , 'Where' ) ) ;
19261926 sum = sum + 1 ;
19271927 }
19281928
1929- if ( document . getElementById ( 'new_name' ) . value !== '' ) {
1930- var renameObj = new DesignerHistory . Rename ( document . getElementById ( 'new_name' ) . value ) ; // make Rename object
1929+ if ( ( document . getElementById ( 'new_name' ) as HTMLInputElement ) . value !== '' ) {
1930+ var renameObj = new DesignerHistory . Rename ( ( document . getElementById ( 'new_name' ) as HTMLInputElement ) . value ) ; // make Rename object
19311931 DesignerHistory . historyArray . push ( new DesignerHistory . HistoryObj ( colName , renameObj , tableName , DesignerConfig . hTabs [ dbTableNameUrl ] , 'Rename' ) ) ;
19321932 sum = sum + 1 ;
19331933 }
19341934
1935- if ( document . getElementById ( 'operator' ) . value !== '---' ) {
1936- var aggregateObj = new DesignerHistory . Aggregate ( document . getElementById ( 'operator' ) . value ) ;
1935+ if ( ( document . getElementById ( 'operator' ) as HTMLSelectElement ) . value !== '---' ) {
1936+ var aggregateObj = new DesignerHistory . Aggregate ( ( document . getElementById ( 'operator' ) as HTMLSelectElement ) . value ) ;
19371937 DesignerHistory . historyArray . push ( new DesignerHistory . HistoryObj ( colName , aggregateObj , tableName , DesignerConfig . hTabs [ dbTableNameUrl ] , 'Aggregate' ) ) ;
19381938 sum = sum + 1 ;
19391939 // make aggregate operator
19401940 }
19411941
1942- if ( document . getElementById ( 'groupby' ) . checked === true ) {
1942+ if ( ( document . getElementById ( 'groupby' ) as HTMLInputElement ) . checked === true ) {
19431943 DesignerHistory . historyArray . push ( new DesignerHistory . HistoryObj ( colName , 'GroupBy' , tableName , DesignerConfig . hTabs [ dbTableNameUrl ] , 'GroupBy' ) ) ;
19441944 sum = sum + 1 ;
19451945 // make groupby
19461946 }
19471947
1948- if ( document . getElementById ( 'h_rel_opt' ) . value !== '--' ) {
1949- if ( document . getElementById ( 'having' ) . value === '' ) {
1948+ if ( ( document . getElementById ( 'h_rel_opt' ) as HTMLSelectElement ) . value !== '--' ) {
1949+ if ( ( document . getElementById ( 'having' ) as HTMLTextAreaElement ) . value === '' ) {
19501950 return ;
19511951 }
19521952
19531953 whereObj = new DesignerHistory . Having (
1954- document . getElementById ( 'h_rel_opt' ) . value ,
1955- document . getElementById ( 'having' ) . value ,
1956- document . getElementById ( 'h_operator' ) . value
1954+ ( document . getElementById ( 'h_rel_opt' ) as HTMLSelectElement ) . value ,
1955+ ( document . getElementById ( 'having' ) as HTMLTextAreaElement ) . value ,
1956+ ( document . getElementById ( 'h_operator' ) as HTMLSelectElement ) . value
19571957 ) ; // make where object
19581958
19591959 DesignerHistory . historyArray . push ( new DesignerHistory . HistoryObj ( colName , whereObj , tableName , DesignerConfig . hTabs [ dbTableNameUrl ] , 'Having' ) ) ;
19601960 sum = sum + 1 ;
19611961 // make having
19621962 }
19631963
1964- if ( document . getElementById ( 'orderby' ) . value !== '---' ) {
1965- var orderByObj = new DesignerHistory . OrderBy ( document . getElementById ( 'orderby' ) . value ) ;
1964+ if ( ( document . getElementById ( 'orderby' ) as HTMLSelectElement ) . value !== '---' ) {
1965+ var orderByObj = new DesignerHistory . OrderBy ( ( document . getElementById ( 'orderby' ) as HTMLSelectElement ) . value ) ;
19661966 DesignerHistory . historyArray . push ( new DesignerHistory . HistoryObj ( colName , orderByObj , tableName , DesignerConfig . hTabs [ dbTableNameUrl ] , 'OrderBy' ) ) ;
19671967 sum = sum + 1 ;
19681968 // make orderby
0 commit comments