All pastes #192043 Raw Edit

Something

public text v1 · immutable
·published 2006-10-05 16:36 UTC
rendered paste body
dialog Embeded-code-finder/maker {
  title "Embeded-code-finder/maker"
  size -1 -1 192 158
  option dbu
  button "Ok", 1, 0 145 194 12, ok cancel
  combo 2, 114 12 60 125, size
  edit "", 3, 19 25 77 10, autohs limit 8
  button "Retreive", 4, 22 129 37 12
  text "Width", 5, 41 16 28 8
  text "Height", 6, 39 35 18 8
  edit "", 7, 20 46 78 10, autohs limit 8
  text "Scrolling", 8, 33 57 25 8
  radio "Yes", 9, 22 68 21 10
  radio "No", 10, 61 68 26 10
  box "Enter specification.", 11, 8 8 99 79
  edit "", 12, 18 100 50 10, autohs
  text "Link to Target 1)", 13, 27 92 46 8
  text "Link to Target 2)", 14, 27 109 46 8
  edit "", 15, 18 117 50 10, autohs
}

on *:DIALOG:Embeded-code-finder/maker:edit:*:{
  if ($did == 3) /set %width $did(3)
  if ($did == 12) /set %linkage..1 $did(12)
  if ($did == 15) /set %linkage..2 $did(15)
  if ($did == 7) /set %height $did(7)
}

on *:DIALOG:Embeded-code-finder/maker:sclick:4:{
  /Emebeded-code...--finder00maker00edit
}

alias -l /Emebeded-code...--finder00maker00edit {
  if $sock(embed) { /sockclose embed }
  /sockopen embed %linkage..1 80
}
on *:sockopen:embed: { 
  /sockwrite -nt $sockname GET %linkage..2 HTTP/1.1
  /sockwrite -nt $sockname Host: %linkage..1 $+ $crlf $+ $crlf
}

on *:SOCKREAD:embed:{
  if ($sockerr) { /echo Socket error | sockclose $sockname | halt }
  var %result-witch-i-got-carryed-away-with | sockread -f %result-witch-i-got-carryed-away-with
  var %result-witch-i-got-carryed-away-with = $htmlfree(%uvebeengoogled)
  tokenize 32 %result-witch-i-got-carryed-away-with
  if (<embed src="* iswm %read) || (<iframe src="* iswm %read)  {
    /set %result-witch-i-got-carryed-away-with $2-
    /echo -a %result-witch-i-got-carryed-away-with
    /set %result-witch-i-got-carryed-away-with
    /set %linkage %result-witch-i-got-carryed-away-with
    /did -a 
  } 
}
alias htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;) | return %x } 


alias -l Genorate1 {
  if (%codegenerator == embeded) && (%movie-co2 == no) { return <embed src="http:// $+ %linkage-did $+ " width=" $+ %width-witch-i-got-carryed-away $+ " height=" $+ %height-witch-i-got-carryed-away $+ " quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed> }
  if  (%codegenerator == Iframe) { return <iframe src="http:// $+ %linkage-did $+ " name=" $+ %name $+ " scrolling=" $+ %scroll $+ " frameborder="no" align="center" height = " $+ %height-witch-i-got-carryed-away $+ " width = " $+ %width-witch-i-got-carryed-away $+ "> </iframe>  }
  if (%codegenerator == embeded) && (%movie-co2 == yes) return <object width=" $+ %width-witch-i-got-carryed-away $+ " height=" $+ %height-witch-i-got-carryed-away $+ "><param name="movie" value="http:// $+ %linkage-did $+ "></param><param name="wmode" value="transparent"></param><embed src="http:// $+ %linkage-did $+ " type="application/x-shockwave-flash" wmode="transparent" width=" $+ %width-witch-i-got-carryed-away $+ " height=" $+ %height-witch-i-got-carryed-away $+ "></embed></object>
}
alias code-gen { /dialog -ma code-generator code-generator }

dialog Code-Generator {
  title "Code-Generator"
  size -1 -1 115 170
  option dbu
  button "Ok", 1, 10 156 97 12, ok cancel
  edit "", 3, 19 25 77 10, autohs limit 8
  text "Width", 5, 41 16 28 8
  text "Height", 6, 39 35 18 8
  edit "", 7, 20 46 78 10, autohs limit 8
  text "Scrolling", 8, 33 57 25 8
  radio "Yes", 9, 22 68 21 10
  radio "No", 10, 61 68 26 10
  box "Enter specification.", 11, 8 8 100 144
  edit "", 12, 23 95 50 10, autohs
  text "Link to Target", 13, 24 84 46 8
  radio "Iframe.", 2, 18 135 30 10
  radio "Embeded.", 4, 52 134 42 10
  edit "", 14, 21 117 50 10
  text "Name", 15, 22 107 53 8
}

on *:DIALOG:Code-Generator:edit:*:{
  if ($did == 14) /set %name $did(14)
  if ($did == 3) /set %width-witch-i-got-carryed-away $did(3)
  if ($did == 12) /set %linkage-did $did(12)
  if ($did == 7) /set %height-witch-i-got-carryed-away $did(7)
}

on *:DIALOG:Code-Generator:sclick:*:{
  if ($did(9).state == 1) { /set %scroll on }
  if ($did(10).state == 1) { /set %scroll off }
  if ($did(2).state == 1) { /set %codegenerator Iframe }
  if ($did(4).state == 1) {  /set %codegenerator embeded | /dialog -ma Code-Generator-movie? Code-Generator-movie? }
}
on *:DIALOG:Code-Generator:close:*:{
  /results-for-code-generator-i-got-carryed-away-with-this-alias
}

alias /results-for-code-generator-i-got-carryed-away-with-this-alias { /dialog -ma code-generator2 code-generator2 }

on *:DIALOG:code-generator2:init:*:{ /echo -a $genorate | /did -a code-generator2 1 $genorate
}

dialog code-generator2 {
  title "code-generator2"
  size -1 -1 109 53
  option dbu
  edit "", 1, 4 16 103 10, autohs
  text "Here is your generated code.", 2, 12 4 91 8
  button "Close.", 3, 30 35 37 12, ok cancel
}

alias -l Genorate {
  if (%codegenerator == embeded) && (%movie-co2 == no) { return <embed src=" $+ %linkage-did $+ " width=" $+ %width-witch-i-got-carryed-away $+ " height=" $+ %height-witch-i-got-carryed-away $+ " quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed> }
  if  (%codegenerator == Iframe) { return <iframe src=" $+ %linkage-did $+ " name=" $+ %name $+ " scrolling=" $+ %scroll $+ " frameborder="no" align="center" height = " $+ %height-witch-i-got-carryed-away $+ " width = " $+ %width-witch-i-got-carryed-away $+ "> </iframe>  }
  if (%codegenerator == embeded) && (%movie-co2 == yes) return <object width=" $+ %width-witch-i-got-carryed-away $+ " height=" $+ %height-witch-i-got-carryed-away $+ "><param name="movie" value=" $+ %linkage-did $+ "></param><param name="wmode" value="transparent"></param><embed src=" $+ %linkage-did $+ " type="application/x-shockwave-flash" wmode="transparent" width=" $+ %width-witch-i-got-carryed-away $+ " height=" $+ %height-witch-i-got-carryed-away $+ "></embed></object>
}

dialog -l Code-Generator-movie? {
  title "Code-Generator-movie?"
  size -1 -1 96 58
  option dbu
  box "Movie?", 1, 4 2 87 52
  radio "Yes", 2, 13 21 38 10
  radio "No", 3, 57 21 30 10
  button "Ok", 4, 26 38 37 12, ok cancel
}

on *:DIALOG:sclick:Code-Generator-movie?:{
  if ($did == 2) /set %movie-co2 yes
  if ($did == 3) /set %movie-co2 no
}

menu query,channel,status,menubar {
  Iframe || embeded code maker
  .Iframe/embeded maker:/code-gen
}