All pastes #143638 Raw Edit

Anonymous

public text v1 · immutable
#143638 ·published 2006-08-22 03:31 UTC
rendered paste body
Alias -l html { dll $+(",$scriptdirnHTMLn_2.92.dll,") $1- } 
Alias -l nhtml { return $+(",$scriptdirnHTMLn_2.92.dll,") }
Alias -l mdx.fullpath { return $+(",$scriptdirmdx.dll,") }
Alias -l mdxinit { dll $mdx.fullpath SetMircVersion $version | dll $mdx.fullpath MarkDialog $dname }
Alias -l mdx { dll $mdx.fullpath $1- }
Alias -l di.open { 
  if (!$2) { if ($dialog($1) != $null) { dialog -ve $1 } | else { dialog -mod $1 $1 } }
  else { if ($dialog($1) != $null) { dialog -ve $1 } | else { dialog - $+ $$2 $1 $1 } }
}
Alias -l start.wbv {
  mdxinit | if (%webvDOCk != none) { mdx SetDialog $dname style dlgmodal }
  mdx SetControlMDX $dname 1,2,3,4,5,6,7 ToolBar list nodivider flat > $scriptdirbars.mdx
  mdx SetControlMDX $dname 10 ProgressBar > $scriptdirctl_gen.mdx
  if ($os == xp) { mdx SetFont $dname 1,2,3,4,5,6,7 14 900 Arial }
  mdx SetBorderStyle $dname 1,2,3,4,5,6,7 windowedge
  mdx SetDialog $dname bgcolor $rgb(199,199,199)
  mdx SetColor 1,2,3,4,5,6,7 textbg $rgb(199,199,199)
  mdx SetColor 1,2,3,4,5,6,7 background $rgb(199,199,199)
  tb 1 Back 11 Go Back 
  tb 2 Forward 8 Go Forward
  tb 3 Refresh 12 Refresh Current Page
  tb 4 Stop 10 Stop Page Download
  tb 5 Go 5 Navigate to Page
  tb 6 Favorites 13 Favorites Folder
  tb 7 Close 7 Close Browser
}
Alias -l dock { 
  if (%webvDOCK == toolbar) { dll $+(",$scriptdirktools.dll,") DockToolbar $dialog($$1).hwnd }
  if (%webvDOCK == switch) { dll $+(",$scriptdirktools.dll,") DockSwitchbar $dialog($$1).hwnd }
  if (%webvDOCK == none) { dialog -sb wbv $window(-3).x 26 373 11 } 
}
Alias -l tb {
  did -i $dname $1 1 bmpsize 16 16
  did -i $dname $1 1 setimage +nh icon small $3 $+ , $+ $scriptdirsbar.icl
  did -a $dname $1 1 $2 $chr(9) $4-
}
dialog wbv {
  title "Web Viewer By KiX"
  size -1 -1 802 21
  option dbu
  icon $scriptdirsbar.icl $+ , 4
  list 1, 1 0 29 11, size
  list 2, 29 0 40 11, size
  list 3, 67 0 40 11, size
  list 4, 104 0 29 11, size
  list 6, 239 0 46 11, size
  list 5, 213 0 25 11, size
  list 7, 286 0 1900 11, size
  combo 8, 133 0 79 50, size edit drop
  text "", 9, 350 100 100 100
  text "", 10, 322 2 50 7
}
Alias -l www {
  window -Bk0 $1 
  html attach $window($1).hwnd
  html navigate $2-
  echo -a $dll($nhtml,handler,progress.handler)
}
;Page progress
;-------------
Alias progress.handler {
  var %change = $1-
  if ($dialog(wbv)) { 
    did -i wbv 8 0 $dll($nhtml,url,$1-) 
    if (progress_change isin %change) { did -a wbv 10 0 0 $gettok(%change,4,32) | did -ra wbv 10 $gettok(%change,3,32) }
  }

  return S_OK
}
Alias -l back { html back $window($1).hwnd }
Alias -l fwd { html forward $window($1).hwnd }
Alias -l rfsh { html refresh $window($1).hwnd }
Alias -l stop { html stop $window($1).hwnd }
Alias go { 
  if (!$1) { www $newindow($window(0)) www.google.com }
  if ($1) { www $newindow($window(0)) $1- }
  if ($dialog(wbv)) { did -a wbv 8 $1- } 
}
Alias newindow { 
  var %w = 1,%wins = 1
  while ($window(%w)) {
    if (web isin $ifmatch) { inc %wins }
    inc %w 
  }
  :winname
  var %window = $+(@web,%wins)
  if ($window(%window)) { inc %wins | goto winname }
  return %window
}
On *:active:@web*:{ if ($dialog(wbv)) { did -ra wbv 9 $active } }
On *:dialog:wbv:init:0:{ dock $dname | start.wbv }
On *:dialog:wbv:sclick:1:{ back $did(9) }
On *:dialog:wbv:sclick:2:{ fwd $did(9) }
On *:dialog:wbv:sclick:3:{ rfsh $did(9) }
On *:dialog:wbv:sclick:4:{ stop $did(9) }
On *:dialog:wbv:sclick:5:{ go $did(8) }
On *:dialog:wbv:sclick:6:{ dopen fvr fvr -mod }
On *:dialog:wbv:sclick:7:{ .timerCLOSEWBV -h 1 1 dialog -x wbv }
;favorites
;---------
dialog fvr {
  title "Favorites"
  size $window(-3).x $window(-3).y  117 184
  option dbu
  icon $scriptdirsbar.icl $+, 13
  list 1, 0 0 117 134, size
  edit "", 2, 19 140 94 12, return autohs
  edit "", 3, 19 152 94 12, return autohs
  list 4, 9 169 101 11, size
  text "Site", 5, 5 143 14 8, disable
  text "URL", 6, 5 155 14 8, disable
  box "", 7, 1 134 115 49
  box "", 8, 1 163 115 20
}
Alias -l load.table { if (!$hget($1)) { hmake $1 100 | if ($isfile($+(",$scriptdir,$1,.hsh,")) == $true) { hload $1 $+(",$scriptdir,$1,.hsh,") } } }
Alias -l save.table { hsave -o $1 $+(",$scriptdir,$1,.hsh,") }
Alias -l start.fvr {
  mdxinit | if ($os == xp) { mdx SetFont $dname 1,2,3,4,5,6 14 900 Arial }
  mdx SetControlMDX $dname 4 ToolBar list nodivider > $scriptdirbars.mdx
  mdx SetBorderStyle $dname 1,4 windowedge
  mdx SetControlMDX $dname 1 ListView report rowselect single sortascending > $scriptdirviews.mdx
  did -i $dname 1 1 headerdims 110 110
  did -i $dname 1 1 headertext Site $chr(9) Url
  did -i $dname 4 1 bmpsize 16 16  
  did -i $dname 4 1 setimage +nh icon small 6, $+ $scriptdirsbar.icl
  did -i $dname 4 1 setimage +nh icon small 7, $+ $scriptdirsbar.icl
  did -i $dname 4 1 setimage +nh icon small 10, $+ $scriptdirsbar.icl
  did -a $dname 4 1 Add $chr(9) Add Site to List
  did -a $dname 4 2 Delete $chr(9) Delete Site From List
  did -a $dname 4 3 Exit $chr(9) Exit 
}
Alias -l start.ngs {
  mdxinit | if ($os == xp) { mdx SetFont $dname 1,2,3,4,5,6 14 900 Arial }
  mdx SetControlMDX $dname 4 ToolBar list nodivider > $scriptdirbars.mdx
  mdx SetBorderStyle $dname 1,4 windowedge
  mdx SetControlMDX $dname 1 ListView report rowselect single sortascending > $scriptdirviews.mdx
  did -i $dname 1 1 headerdims 110 110
  did -i $dname 1 1 headertext Game $chr(9) Url
  did -i $dname 4 1 bmpsize 16 16  
  did -i $dname 4 1 setimage +nh icon small 6, $+ $scriptdirsbar.icl
  did -i $dname 4 1 setimage +nh icon small 7, $+ $scriptdirsbar.icl
  did -i $dname 4 1 setimage +nh icon small 10, $+ $scriptdirsbar.icl
  did -a $dname 4 1 Add $chr(9) Add Game to List
  did -a $dname 4 2 Delete $chr(9) Delete Game From List
  did -a $dname 4 3 Exit $chr(9) Exit 
}

Alias favorites { 
  var %f = 1
  if ($hget($1)) { 
    did -r $1 1 
    while ($hget($1,%f).data) { did -a $1 1 $hget($1,%f).item $chr(9) $ifmatch | inc %f }
  }
}
On *:dialog:fvr:init:0:{ start.fvr | load.table $dname | save.table $dname | favorites $dname }
On *:dialog:fvr:close:0:{ save.table  $dname | hfree fvr }
On *:dialog:fvr:dclick:1:{ go $gettok($did(1).seltext,11-,32) }
On *:dialog:fvr:sclick:4:{ 
  var %id = $did(4).sel
  if (%id == 2) && ($did(2) != $null) && ($did(3) != $null) { 
    hadd fvr $replace($did(2),$chr(32),-) $did(3)
    favorites $dname | did -rf $dname 3,2
  }
  if (%id == 3) && ($did(1).sel) { hdel fvr $gettok($did(1).seltext,6,32) | favorites $dname }
  if (%id == 4) { .timerCLOSEFVR -h 1 1 dialog -x $dname }
}

dialog ngs {
  title "Net Games"
  size $window(-3).x $window(-3).y 117 184
  option dbu
  icon $scriptdirsbar.icl $+ , 13
  list 1, 0 0 117 134, size
  edit "", 2, 19 140 94 12, return autohs
  edit "", 3, 19 152 94 12, return autohs
  list 4, 9 169 101 11, size
  text "Game", 5, 3 143 16 8, disable
  text "URL", 6, 3 155 16 8, disable
  box "", 7, 1 134 115 49
  box "", 8, 1 163 115 20
}
On *:dialog:ngs:init:0:{ start.ngs | load.table $dname | save.table $dname | favorites $dname }
On *:dialog:ngs:close:0:{ save.table  $dname | hfree ngs }
On *:dialog:ngs:dclick:1:{ go $gettok($did(1).seltext,11-,32) }
On *:dialog:ngs:sclick:4:{ 
  var %id = $did(4).sel
  if (%id == 2) && ($did(2) != $null) && ($did(3) != $null) { 
    hadd ngs $replace($did(2),$chr(32),-) $did(3)
    favorites $dname | did -rf $dname 3,2
  }
  if (%id == 3) && ($did(1).sel) { hdel ngs $gettok($did(1).seltext,6,32) | favorites $dname }
  if (%id == 4) { .timerCLOSENGS -h 1 1 dialog -x $dname }
}
menu channel,status,nicklist,menubar { 
  -
  Browser
  . $iif(!$dialog(wbv),Open,Close)  :{ if ($dialog(wbv)) { .timerCLOSEWBV -h 1 1 dialog -x wbv } | else { di.open wbv -mod } }
  .-
  .Favorites:di.open fvr -md
  .-
  .Dock
  ..Show on Start ( $+ %webvST $+ )
  ... $iif(%webvST == Yes,No,Yes) :{ if (%webvST == no) { set %webvST Yes | return } | else { set %webvST No | return } }
  ..-  
  ..Toolbar $iif(%webvDOCK == toolbar,<-) :{ set %webvDOCK toolbar | if ($dialog(wbv)) { .timerCLOSEWBV -h 1 1 dialog -x wbv | .timerOPENWBV -h 1 2 di.open wbv -mod } }
  ..Switchbar $iif(%webvDOCK == switch,<-) :{ set %webvDOCK switch | if ($dialog(wbv)) { .timerCLOSEWBV -h 1 1 dialog -x wbv | .timerOPENWBV -h 1 2 di.open wbv -mod } }
  ..Un Dock $iif(%webvDOCK == none,<-) :{ set %webvDOCK none | if ($dialog(wbv)) { .timerCLOSEWBV -h 1 26 dialog -x wbv | .timerOPENWBV -h 1 2 di.open wbv -mod } }
  .-
  .Help
  ..How to:{ 
    echo -ai30 :: 12,12|15,1To Open type /browser 
    echo -ai30 :: 12,12|15,1To use the Browsers page process globally in other scripts you input /go www.yourpage.com 
    echo -ai30 :: 12,12|15,1This will open a new browser window with your page.
  }
  ..Read-Me:{ run $+(",$scriptdirWBVreadme.txt,") } 
}
;On *:start:{ if (%webvST == yes) { di.open wbv -mod } }
;On *:load:{ set %webvDOCK toolbar | set %webvST yes | echo -a :: 12,12|15,1Loaded WebView 3.0 by 14K15i0X | echo -a :: 12,12|15,1Type /browser to open | echo -a :: 12,12|15,1To use the browsers page process globally input /go www.page.com }
;On *:unload:{ unset %webv* | echo -a :: 12,12|15,1Un-loaded WebView 3.0 by 14K15i0X }