Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added jQuery loadAdScript plugin and example

  • Loading branch information...
commit 6e1cd77420167cf468e0ecc712e520cfc3a2ab92 1 parent 1b178d5
Ben Alman authored

Showing 61 changed files with 17,539 additions and 0 deletions. Show diff stats Hide diff stats

  1. +19 0 examples/config.php
  2. BIN  examples/donate.gif
  3. +551 0 examples/index.css
  4. +124 0 examples/index.php
  5. +2 0  examples/loadadscript/a.js
  6. +5 0 examples/loadadscript/b.js
  7. +1 0  examples/loadadscript/b1.js
  8. +7 0 examples/loadadscript/c.js
  9. +2 0  examples/loadadscript/c1.js
  10. +1 0  examples/loadadscript/c1a.js
  11. +3 0  examples/loadadscript/c2.js
  12. +1 0  examples/loadadscript/c2a.js
  13. +1 0  examples/loadadscript/c2b.js
  14. +141 0 examples/loadadscript/index.php
  15. +61 0 jquery.ba-loadadscript.js
  16. +9 0 jquery.ba-loadadscript.min.js
  17. +165 0 shared/SyntaxHighlighter/LGPLv3.txt
  18. BIN  shared/SyntaxHighlighter/scripts/clipboard.swf
  19. +61 0 shared/SyntaxHighlighter/scripts/shBrushAS3.js
  20. +59 0 shared/SyntaxHighlighter/scripts/shBrushBash.js
  21. +64 0 shared/SyntaxHighlighter/scripts/shBrushCSharp.js
  22. +99 0 shared/SyntaxHighlighter/scripts/shBrushCpp.js
  23. +93 0 shared/SyntaxHighlighter/scripts/shBrushCss.js
  24. +57 0 shared/SyntaxHighlighter/scripts/shBrushDelphi.js
  25. +43 0 shared/SyntaxHighlighter/scripts/shBrushDiff.js
  26. +69 0 shared/SyntaxHighlighter/scripts/shBrushGroovy.js
  27. +52 0 shared/SyntaxHighlighter/scripts/shBrushJScript.js
  28. +55 0 shared/SyntaxHighlighter/scripts/shBrushJava.js
  29. +60 0 shared/SyntaxHighlighter/scripts/shBrushJavaFX.js
  30. +74 0 shared/SyntaxHighlighter/scripts/shBrushPerl.js
  31. +91 0 shared/SyntaxHighlighter/scripts/shBrushPhp.js
  32. +35 0 shared/SyntaxHighlighter/scripts/shBrushPlain.js
  33. +76 0 shared/SyntaxHighlighter/scripts/shBrushPowerShell.js
  34. +56 0 shared/SyntaxHighlighter/scripts/shBrushPython.js
  35. +57 0 shared/SyntaxHighlighter/scripts/shBrushRuby.js
  36. +53 0 shared/SyntaxHighlighter/scripts/shBrushScala.js
  37. +68 0 shared/SyntaxHighlighter/scripts/shBrushSql.js
  38. +58 0 shared/SyntaxHighlighter/scripts/shBrushVb.js
  39. +71 0 shared/SyntaxHighlighter/scripts/shBrushXml.js
  40. +30 0 shared/SyntaxHighlighter/scripts/shCore.js
  41. +30 0 shared/SyntaxHighlighter/scripts/shLegacy.js
  42. +1,984 0 shared/SyntaxHighlighter/src/shCore.js
  43. +172 0 shared/SyntaxHighlighter/src/shLegacy.js
  44. BIN  shared/SyntaxHighlighter/styles/help.png
  45. BIN  shared/SyntaxHighlighter/styles/magnifier.png
  46. BIN  shared/SyntaxHighlighter/styles/page_white_code.png
  47. BIN  shared/SyntaxHighlighter/styles/page_white_copy.png
  48. BIN  shared/SyntaxHighlighter/styles/printer.png
  49. +342 0 shared/SyntaxHighlighter/styles/shCore.css
  50. +191 0 shared/SyntaxHighlighter/styles/shThemeDefault.css
  51. +193 0 shared/SyntaxHighlighter/styles/shThemeDjango.css
  52. +192 0 shared/SyntaxHighlighter/styles/shThemeEmacs.css
  53. +193 0 shared/SyntaxHighlighter/styles/shThemeFadeToGrey.css
  54. +192 0 shared/SyntaxHighlighter/styles/shThemeMidnight.css
  55. +192 0 shared/SyntaxHighlighter/styles/shThemeRDark.css
  56. BIN  shared/SyntaxHighlighter/styles/wrapping.png
  57. +42 0 shared/SyntaxHighlighter/test.html
  58. +264 0 shared/ba-debug.js
  59. +4,376 0 shared/jquery-1.3.2.js
  60. +6,240 0 shared/jquery-1.4.2.js
  61. +462 0 shared/jquery.ba-jqmq.js
19 examples/config.php
... ... @@ -0,0 +1,19 @@
  1 +<?PHP
  2 +
  3 +$shell['title1'] = "jQuery Misc Plugins";
  4 +$shell['link1'] = "http://benalman.com/projects/jquery-misc-plugins/";
  5 +
  6 +ob_start();
  7 +?>
  8 + <a href="http://benalman.com/projects/jquery-misc-plugins/">Project Home</a>,
  9 + <a href="http://github.com/cowboy/jquery-misc/">Source</a>
  10 +<?
  11 +$shell['h3'] = ob_get_contents();
  12 +ob_end_clean();
  13 +
  14 +$shell['jquery'] = 'jquery-1.4.2.js';
  15 +//$shell['jquery'] = 'jquery-1.3.2.js';
  16 +
  17 +$shell['shBrush'] = array( 'JScript' );
  18 +
  19 +?>
BIN  examples/donate.gif
551 examples/index.css
... ... @@ -0,0 +1,551 @@
  1 +/* YUI RESETS */
  2 +
  3 +/*
  4 +Copyright (c) 2008, Yahoo! Inc. All rights reserved.
  5 +Code licensed under the BSD License:
  6 +http://developer.yahoo.net/yui/license.txt
  7 +version: 2.5.2
  8 +*/
  9 +html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
  10 +
  11 +/*
  12 +Copyright (c) 2008, Yahoo! Inc. All rights reserved.
  13 +Code licensed under the BSD License:
  14 +http://developer.yahoo.net/yui/license.txt
  15 +version: 2.5.2
  16 +*/
  17 +body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
  18 +
  19 +/*
  20 +Copyright (c) 2008, Yahoo! Inc. All rights reserved.
  21 +Code licensed under the BSD License:
  22 +http://developer.yahoo.net/yui/license.txt
  23 +version: 2.5.2
  24 +*/
  25 +h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:bold;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;} em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:bold;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;}
  26 +
  27 +/* MISC RESETS */
  28 +
  29 +em, i {
  30 + font-weight: inherit;
  31 +}
  32 +
  33 +ul, ol {
  34 + margin-right: 0;
  35 +}
  36 +
  37 +pre {
  38 + white-space: pre-wrap;
  39 + white-space: -moz-pre-wrap;
  40 + white-space: -o-pre-wrap;
  41 + word-wrap: break-word;
  42 + _white-space: pre;
  43 +}
  44 +
  45 +/* LISTS */
  46 +
  47 +div.nav ul, ul.nav {
  48 + margin: 0 !important;
  49 + padding: 0 !important;
  50 +}
  51 +
  52 +div.nav li, ul.nav li {
  53 + list-style: none !important;
  54 + background: none !important;
  55 + margin: 0 !important;
  56 + padding: 0 !important;
  57 +}
  58 +
  59 +div.nav-inline ul, ul.nav-inline {
  60 + width: auto !important;
  61 +}
  62 +
  63 +div.nav-inline li, ul.nav-inline li {
  64 + display: inline !important;
  65 +}
  66 +
  67 +dl.inline {
  68 + margin-left: 0;
  69 +}
  70 +
  71 +dl.inline dt,
  72 +dl.inline dd {
  73 + margin: 0;
  74 + display: inline;
  75 +}
  76 +
  77 +/* HORIZONTAL RULE */
  78 +
  79 +hr {
  80 + height: 1px;
  81 + color: #777;
  82 +}
  83 +
  84 +div.hr {
  85 + height: 1px;
  86 + overflow: hidden;
  87 + border-bottom: 1px solid #777;
  88 + margin: 0.8em 0;
  89 +}
  90 +
  91 +
  92 +/* GENERAL-PURPOSE CLASSES */
  93 +
  94 +.hidden {
  95 + display: none !important;
  96 +}
  97 +
  98 +.inline {
  99 + display: inline !important;
  100 + float: none !important;
  101 +}
  102 +
  103 +.floatright {
  104 + display: inline;
  105 + float: right !important;
  106 +}
  107 +
  108 +.floatleft {
  109 + display: inline;
  110 + float: left !important;
  111 +}
  112 +
  113 +.clear {
  114 + clear: both !important;
  115 + display: block;
  116 +}
  117 +
  118 +.clearleft {
  119 + clear: left !important;
  120 + display: block;
  121 +}
  122 +
  123 +.clearright {
  124 + clear: right !important;
  125 + display: block;
  126 +}
  127 +
  128 +.left {
  129 + text-align: left !important;
  130 +}
  131 +
  132 +.right {
  133 + text-align: right !important;
  134 +}
  135 +
  136 +.center {
  137 + text-align: center !important;
  138 +}
  139 +
  140 +.nowrap {
  141 + white-space: nowrap !important;
  142 +}
  143 +
  144 +.uppercase {
  145 + text-transform: uppercase !important;
  146 +}
  147 +
  148 +.lowercase {
  149 + text-transform: lowercase !important;
  150 +}
  151 +
  152 +.nocase {
  153 + text-transform: default !important;
  154 +}
  155 +
  156 +.bold {
  157 + font-weight: 700 !important;
  158 +}
  159 +
  160 +.normal {
  161 + font-weight: 400 !important;
  162 +}
  163 +
  164 +.small {
  165 + font-size: 86% !important;
  166 +}
  167 +
  168 +@media print {
  169 + .hidden-print {
  170 + display: none !important;
  171 + }
  172 + .nopagebreak {
  173 + page-break-inside: avoid !important;
  174 + }
  175 +}
  176 +
  177 +@media screen {
  178 + .hidden-screen {
  179 + display: none !important;
  180 + }
  181 +}
  182 +
  183 +
  184 +/* HORIZONTAL + VERTICAL CENTERING */
  185 +
  186 +.center1 {
  187 + text-align: center;
  188 +}
  189 +
  190 +.center2 {
  191 + #left: 50%;
  192 +}
  193 +
  194 +.center3 {
  195 + margin: 0 auto;
  196 + #left: -50%;
  197 +}
  198 +
  199 +.center1, .vcenter1 {
  200 + display: table;
  201 + #display: block;
  202 + #text-align: auto;
  203 + #position: relative;
  204 +}
  205 +
  206 +.center2, .vcenter2 {
  207 + display: table-cell;
  208 + vertical-align: middle;
  209 + #position: absolute;
  210 + #top: 50%;
  211 +}
  212 +
  213 +.center3, .vcenter3 {
  214 + display: block;
  215 + #position: relative;
  216 + #top: -50%;
  217 +}
  218 +
  219 +/*
  220 +.center1, .vcenter1 { border: 1px solid #f00 !important; }
  221 +.center2, .vcenter2 { border: 1px solid #0f0 !important; }
  222 +.center3, .vcenter3 { border: 1px solid #00f !important; }
  223 +*/
  224 +
  225 +
  226 +/* CSS BG IMAGE REPLACEMENT */
  227 +
  228 +.bgfx, .bgfx1, .bgfx2 {
  229 + display: block;
  230 + width: 300px;
  231 + height: 50px;
  232 + padding: 0 !important;
  233 +}
  234 +
  235 +a.bgfx, a.bgfx1, a.bgfx2,
  236 +a.bgfx:hover, a.bgfx1:hover, a.bgfx2:hover {
  237 + text-decoration: none;
  238 + cursor: pointer;
  239 + cursor: hand;
  240 +}
  241 +
  242 +.bgfx {
  243 + position: relative;
  244 + overflow: hidden;
  245 + background: no-repeat 0 0;
  246 +}
  247 +
  248 +.bgfx1, .bgfx2 {
  249 + position: absolute;
  250 + left: 0;
  251 + top: 0;
  252 + z-index: 1;
  253 + background: no-repeat 0 0;
  254 +}
  255 +
  256 +
  257 +/* "HIT" LINKS */
  258 +
  259 +.hit, .hit .hit1 {
  260 + display: block;
  261 + position: absolute;
  262 + left: 0;
  263 + right: 0;
  264 + top: 0;
  265 + bottom: 0;
  266 + cursor: hand;
  267 + cursor: pointer;
  268 + _width: 100%;
  269 + _height: 100%;
  270 +}
  271 +
  272 +.hit {
  273 + z-index: 1000;
  274 +}
  275 +
  276 +.hit .hit1 {
  277 + #background: #fff;
  278 + #filter: alpha(opacity=1);
  279 +}
  280 +
  281 +
  282 +/* EXAMPLE CSS */
  283 +
  284 +/* http://colorschemedesigner.com/#3s40M--K-BRJD */
  285 +
  286 +.primary-1 { background-color: #008CD0 }
  287 +.primary-2 { background-color: #2C7091 }
  288 +.primary-3 { background-color: #005178 }
  289 +.primary-4 { background-color: #58C0F2 }
  290 +.primary-5 { background-color: #9FD7F2 }
  291 +
  292 +.secondary-a-1 { background-color: #0BE700 }
  293 +.secondary-a-2 { background-color: #36A131 }
  294 +.secondary-a-3 { background-color: #078500 }
  295 +.secondary-a-4 { background-color: #62F85A }
  296 +.secondary-a-5 { background-color: #A7F8A3 }
  297 +
  298 +.secondary-b-1 { background-color: #FE0006 }
  299 +.secondary-b-2 { background-color: #B13639 }
  300 +.secondary-b-3 { background-color: #920004 }
  301 +.secondary-b-4 { background-color: #FF5D61 }
  302 +.secondary-b-5 { background-color: #FFA7A9 }
  303 +
  304 +.complement-1 { background-color: #FF8900 }
  305 +.complement-2 { background-color: #B27836 }
  306 +.complement-3 { background-color: #934F00 }
  307 +.complement-4 { background-color: #FFB45D }
  308 +.complement-5 { background-color: #FFD6A7 }
  309 +
  310 +/*
  311 +bg: #FDEBDC
  312 +bg1: #FFBE7D
  313 +bg2: #FFAB59
  314 +orange: #FF7F00
  315 +brown: #913D00
  316 +lt. brown: #C4884F
  317 +*/
  318 +
  319 +html, body {
  320 + color: #000;
  321 + background: #fff;
  322 + font-family: Arial;
  323 +}
  324 +
  325 +body {
  326 + font-size: 0.8em;
  327 + margin: 1em;
  328 +}
  329 +
  330 +h1, h2 {
  331 + font-family: "Gill Sans", "Gill Sans MT", Arial, Helvetica, sans-serif;
  332 +}
  333 +
  334 +h1 {
  335 + font-size: 140%;
  336 + font-weight: 400;
  337 + text-transform: uppercase;
  338 + color: #FF7F00;
  339 + margin: 0 0 0.6em;
  340 +}
  341 +
  342 +h1 a {
  343 + color: #FF7F00;
  344 +}
  345 +
  346 +h1 a:hover {
  347 + color: #913D00;
  348 +}
  349 +
  350 +h1 .title {
  351 + color: #913D00;
  352 +}
  353 +
  354 +h1 a.title:hover {
  355 + color: #FF7F00;
  356 +}
  357 +
  358 +h2 {
  359 + font-size: 120%;
  360 + color: #913D00;
  361 +}
  362 +
  363 +h3 {
  364 + font-size: 100%;
  365 +}
  366 +
  367 +a {
  368 + color: #913D00;
  369 +}
  370 +
  371 +a:hover {
  372 + color: #FF7F00;
  373 +}
  374 +
  375 +.divider {
  376 + color: #C4884F;
  377 +}
  378 +
  379 +#page {
  380 + width: 700px;
  381 +}
  382 +
  383 +#header h1 {
  384 + white-space: nowrap;
  385 +}
  386 +
  387 +#footer {
  388 + clear: both;
  389 + padding-top: 2em;
  390 + font-size: 80%;
  391 + color: #C4884F;
  392 +}
  393 +
  394 +#footer a {
  395 + color: #C4884F;
  396 +}
  397 +
  398 +#footer a:hover {
  399 + color: #FF7F00;
  400 +}
  401 +
  402 +#donate {
  403 + color: #000;
  404 + background: #fff;
  405 + border: 1px solid #3D942F;
  406 + font-size: 80%;
  407 + padding: 0.5em;
  408 + float: right;
  409 + width: 11em;
  410 + margin: 0 0 1.5em 2em;
  411 + -moz-box-shadow: 0 0 6px #3D942F;
  412 + -webkit-box-shadow: 0 0 6px #3D942F;
  413 + box-shadow: 0 0 6px #3D942F;
  414 +}
  415 +
  416 +#donate form {
  417 + text-align: center;
  418 +}
  419 +
  420 +#donate .submit {
  421 + width: 74px;
  422 + height: 21px;
  423 +}
  424 +
  425 +pre {
  426 + overflow-x: auto;
  427 +}
  428 +
  429 +pre code {
  430 + display: block;
  431 + border: 1px solid transparent;
  432 + _border: none;
  433 +}
  434 +
  435 +/* ROUNDED BORDERS */
  436 +
  437 +#donate,
  438 +pre,
  439 +.syntaxhighlighter,
  440 +.syntaxhighlighter .toolbar {
  441 + -moz-border-radius: 10px;
  442 + -webkit-border-radius: 10px;
  443 + border-radius: 10px;
  444 +}
  445 +
  446 +/* PRE/CODE BLOCKS, SYNTAX HIGHLIGHTING */
  447 +
  448 +code, pre {
  449 + font-family: "Consolas","Monaco","Bitstream Vera Sans Mono","Courier New",Courier,monospace;
  450 +}
  451 +
  452 +a code {
  453 + color: inherit;
  454 +}
  455 +
  456 +code {
  457 + color: #913D00;
  458 + font-size: 12px;
  459 + font-weight: inherit;
  460 +}
  461 +
  462 +pre {
  463 + margin: 0 0 0.6em;
  464 + padding: 0 0.6em;
  465 + border: 1px solid #C4884F;
  466 + background: #fee0c5;
  467 + color: #000;
  468 +}
  469 +
  470 +pre code {
  471 + color: #000;
  472 +}
  473 +
  474 +pre,
  475 +.syntaxhighlighter,
  476 +.syntaxhighlighter div,
  477 +.syntaxhighlighter code,
  478 +.syntaxhighlighter span {
  479 + font-size: 11px !important;
  480 + line-height: 1.5em !important;
  481 +}
  482 +
  483 +pre,
  484 +.syntaxhighlighter,
  485 +.syntaxhighlighter .line:first-child .content {
  486 + min-height: 2.99em;
  487 +}
  488 +
  489 +.syntaxhighlighter .line:not(:last-child) .content {
  490 + min-height: 0;
  491 +}
  492 +
  493 +.syntaxhighlighter .content {
  494 + min-height: 0\9 !important; /* IE6, IE7, IE8 */
  495 +}
  496 +
  497 +.syntaxhighlighter,
  498 +.syntaxhighlighter code,
  499 +.syntaxhighlighter a {
  500 + word-wrap: break-word !important;
  501 +}
  502 +
  503 +.syntaxhighlighter .line .content .block {
  504 + background-position: 0 1.5em !important;
  505 +}
  506 +
  507 +.syntaxhighlighter {
  508 + width: auto !important;
  509 + margin: 0 0 0.6em !important;
  510 + padding: 0 1px !important;
  511 + background: #fee0c5 !important;
  512 + border: 1px solid #C4884F !important;
  513 + _zoom: 1;
  514 +}
  515 +
  516 +.syntaxhighlighter .toolbar {
  517 + right: 3px !important;
  518 + top: 3px !important;
  519 +}
  520 +
  521 +.syntaxhighlighter .line .number {
  522 + color: #C4884F !important;
  523 +}
  524 +
  525 +.syntaxhighlighter .lines .content {
  526 + border-color: #C4884F !important;
  527 +}
  528 +
  529 +.syntaxhighlighter .lines .line:first-child,
  530 +.syntaxhighlighter .lines .line:first-child .content {
  531 + -moz-border-radius-topright: 10px;
  532 + -webkit-border-top-right-radius: 10px;
  533 +}
  534 +
  535 +.syntaxhighlighter .lines .line:last-child,
  536 +.syntaxhighlighter .lines .line:last-child .content {
  537 + -moz-border-radius-bottomright: 10px;
  538 + -webkit-border-bottom-right-radius: 10px;
  539 +}
  540 +
  541 +.syntaxhighlighter.nogutter .lines .line:first-child,
  542 +.syntaxhighlighter.nogutter .lines .line:first-child .content {
  543 + -moz-border-radius-topleft: 10px;
  544 + -webkit-border-top-left-radius: 10px;
  545 +}
  546 +
  547 +.syntaxhighlighter.nogutter .lines .line:last-child,
  548 +.syntaxhighlighter.nogutter .lines .line:last-child .content {
  549 + -moz-border-radius-bottomleft: 10px;
  550 + -webkit-border-bottom-left-radius: 10px;
  551 +}
124 examples/index.php
... ... @@ -0,0 +1,124 @@
  1 +<?PHP
  2 +
  3 +$shell = array();
  4 +$base = '../';
  5 +
  6 +$shell['title2'] = 'Examples';
  7 +$shell['link2'] = '../';
  8 +
  9 +include 'config.php';
  10 +
  11 +ob_start();
  12 +?>
  13 + <div id="donate">
  14 + <p>Your generous donation allows me to continue developing and updating my code!</p>
  15 + <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  16 + <input type="hidden" name="cmd" value="_s-xclick">
  17 + <input type="hidden" name="hosted_button_id" value="5791421">
  18 + <input class="submit" type="image" src="../donate.gif" name="submit" alt="PayPal - The safer, easier way to pay online!">
  19 + <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
  20 + </form>
  21 + <div class="clear"></div>
  22 + </div>
  23 +<?
  24 +$shell['donate'] = ob_get_contents();
  25 +ob_end_clean();
  26 +
  27 +function draw_shell() {
  28 + global $shell, $base;
  29 +
  30 +?><!DOCTYPE html>
  31 +<html lang="en">
  32 +<head>
  33 + <meta http-equiv="content-type" content="text/html; charset=utf-8">
  34 + <title>Ben Alman &raquo; <?= $shell['title1'] ?><? if ( $shell['title2'] ) { print ' &raquo; ' . $shell['title2']; } ?><? if ( $shell['title3'] ) { print ' &raquo; ' . $shell['title3']; } ?></title>
  35 + <script type="text/javascript" src="<?= $base ?>../shared/ba-debug.js"></script>
  36 + <?
  37 + if ( $shell['jquery'] ) {
  38 + ?><script type="text/javascript" src="<?= $base ?>../shared/<?= $shell['jquery'] ?>"></script><?
  39 + }
  40 +
  41 + ?><script type="text/javascript" src="<?= $base ?>../shared/SyntaxHighlighter/scripts/shCore.js"></script><?
  42 +
  43 + if ( $shell['shBrush'] ) {
  44 + foreach ( $shell['shBrush'] as $brush ) {
  45 + ?><script type="text/javascript" src="<?= $base ?>../shared/SyntaxHighlighter/scripts/shBrush<?= $brush ?>.js"></script><?
  46 + }
  47 + }
  48 + ?>
  49 + <link rel="stylesheet" type="text/css" href="<?= $base ?>../shared/SyntaxHighlighter/styles/shCore.css">
  50 + <link rel="stylesheet" type="text/css" href="<?= $base ?>../shared/SyntaxHighlighter/styles/shThemeDefault.css">
  51 + <link rel="stylesheet" type="text/css" href="<?= $base ?>index.css">
  52 +
  53 +<?= $shell['html_head'] ?>
  54 +
  55 +</head>
  56 +<body>
  57 +
  58 +<div id="page">
  59 + <div id="header">
  60 + <h1>
  61 + <a href="http://benalman.com/" class="title"><b>Ben</b> Alman</a>
  62 + <?
  63 + $i = 1;
  64 + while ( $shell["title$i"] ) {
  65 + print ' &raquo; ';
  66 + if ( $shell["link$i"] ) {
  67 + print '<a href="' . $shell["link$i"] . '">' . $shell["title$i"] . '</a>';
  68 + } else {
  69 + print $shell["title$i"];
  70 + }
  71 + $i++;
  72 + }
  73 + ?>
  74 + </h1>
  75 + <?
  76 + $i = 2;
  77 + while ( $shell["h$i"] ) {
  78 + print "<h$i>" . $shell["h$i"] . "</h$i>";
  79 + $i++;
  80 + }
  81 + ?>
  82 + <?= $shell['html_header'] ?>
  83 + </div>
  84 + <div id="content">
  85 + <?= $shell['html_body'] ?>
  86 + </div>
  87 + <div id="footer">
  88 + <p>
  89 + If console output is mentioned, but your browser has no console, this example is using <a href="http://benalman.com/projects/javascript-debug-console-log/">JavaScript Debug</a>. Click this bookmarklet: <a href="javascript:if(!window.firebug){window.firebug=document.createElement(&quot;script&quot;);firebug.setAttribute(&quot;src&quot;,&quot;http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js&quot;);document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init()}else{setTimeout(arguments.callee)}})();void (firebug);if(window.debug&&debug.setCallback){(function(){if(window.firebug&&window.firebug.version){debug.setCallback(function(b){var a=Array.prototype.slice.call(arguments,1);firebug.d.console.cmd[b].apply(window,a)},true)}else{setTimeout(arguments.callee,100)}})()}};">Debug + Firebug Lite</a> to add the Firebug lite console to the current page. Syntax highlighting is handled by <a href="http://alexgorbatchev.com/">SyntaxHighlighter</a>.
  90 + </p>
  91 + <p>
  92 + All original code is Copyright &copy; 2010 "Cowboy" Ben Alman and dual licensed under the MIT and GPL licenses. View the <a href="http://benalman.com/about/license/">license page</a> for more details.
  93 + </p>
  94 + </div>
  95 +</div>
  96 +
  97 +</body>
  98 +</html><?
  99 +
  100 +}
  101 +
  102 +if ( count( get_included_files() ) == 2 ) {
  103 + $shell['link2'] = '';
  104 +
  105 + $shell['h2'] = 'Select an example:';
  106 + $shell['h3'] = '';
  107 +
  108 + $shell['html_body'] = '';
  109 +
  110 + $files = scandir( '.' );
  111 + foreach ( $files as $file ) {
  112 + if ( $file != '.' && $file != '..' && file_exists( "$file/index.php" ) ) {
  113 + $file_contents = file_get_contents( "$file/index.php" );
  114 + $title = preg_replace( '/^.*\$shell\[\'title3\'\]\s*=\s*"(.*?)";.*$/s', '$1', $file_contents );
  115 + $title = $title == $file_contents ? $file : stripcslashes( $title );
  116 + $shell['html_body'] .= "<a href=\"$file/\">$title</a><br>";
  117 + }
  118 + }
  119 +
  120 + $base = '';
  121 + draw_shell();
  122 +}
  123 +
  124 +?>
2  examples/loadadscript/a.js
... ... @@ -0,0 +1,2 @@
  1 +document.write('This content was written using document.write.. done!');
  2 +document.write('<br>External JavaScript files: <a href="a.js">a.js</a>');
5 examples/loadadscript/b.js
... ... @@ -0,0 +1,5 @@
  1 +document.write('This content was written using document.write. ');
  2 +document.write('One, ');
  3 +document.write('<script type="text/javascript" src="b1.js"></script>');
  4 +document.write('three.. done!');
  5 +document.write('<br>External JavaScript files: <a href="b.js">b.js</a>, <a href="b1.js">b1.js</a>');
1  examples/loadadscript/b1.js
... ... @@ -0,0 +1 @@
  1 +document.write('two, ');
7 examples/loadadscript/c.js
... ... @@ -0,0 +1,7 @@
  1 +document.write('This content was written using document.write. ');
  2 +document.write('One, ');
  3 +document.write('<script type="text/javascript" src="c1.js"></script>');
  4 +document.write('four, ');
  5 +document.write('<script type="text/javascript" src="c2.js"></script>');
  6 +document.write('eight.. done!');
  7 +document.write('<br>External JavaScript files: <a href="c.js">c.js</a>, <a href="c1.js">c1.js</a>, <a href="c1a.js">c1a.js</a>, <a href="c2.js">c2.js</a>, <a href="c2a.js">c2a.js</a>, <a href="c2b.js">c2b.js</a>');
2  examples/loadadscript/c1.js
... ... @@ -0,0 +1,2 @@
  1 +document.write('two, ');
  2 +document.write('<script type="text/javascript" src="c1a.js"></script>');
1  examples/loadadscript/c1a.js
... ... @@ -0,0 +1 @@
  1 +document.write('three, ');
3  examples/loadadscript/c2.js
... ... @@ -0,0 +1,3 @@
  1 +document.write('<script type="text/javascript" src="c2a.js"></script>');
  2 +document.write('<script type="text/javascript" src="c2b.js"></script>');
  3 +document.write('seven, ');
1  examples/loadadscript/c2a.js
... ... @@ -0,0 +1 @@
  1 +document.write('five, ');
1  examples/loadadscript/c2b.js
... ... @@ -0,0 +1 @@
  1 +document.write('six, ');
141 examples/loadadscript/index.php
... ... @@ -0,0 +1,141 @@
  1 +<?PHP
  2 +
  3 +include "../index.php";
  4 +
  5 +$shell['title3'] = "loadAdScript";
  6 +
  7 +$shell['h2'] = 'Keep ad scripts that use document.write from breaking your stuff!';
  8 +
  9 +// ========================================================================== //
  10 +// SCRIPT
  11 +// ========================================================================== //
  12 +
  13 +ob_start();
  14 +?>
  15 +$(function(){
  16 +
  17 + // a.js simply calls document.write a few times. It's not great, but it's not
  18 + // the end of the world.
  19 + $('#a').loadAdScript( 'a.js', function(){
  20 + $(this).show(); // When the ad script has loaded, show the ad.
  21 + });
  22 +
  23 + // b.js calls document.write and loads another external script that also calls
  24 + // document.write. It's starting to get ugly, but that's what third party ad
  25 + // networks are all about!
  26 + $('#b').loadAdScript( 'b.js', function(){
  27 + $(this).show(); // When the ad script has loaded, show the ad.
  28 + });
  29 +
  30 + // c.js calls document.write and loads multiple other external scripts that
  31 + // also call document.write and load other external scripts. Look out, because
  32 + // there's a "web 1.0 document write" party in your page, and everyone's invited!
  33 + $('#c').loadAdScript( 'c.js', function(){
  34 + $(this).show(); // When the ad script has loaded, show the ad.
  35 + });
  36 +
  37 +});
  38 +<?
  39 +$shell['script'] = ob_get_contents();
  40 +ob_end_clean();
  41 +
  42 +// ========================================================================== //
  43 +// HTML HEAD ADDITIONAL
  44 +// ========================================================================== //
  45 +
  46 +ob_start();
  47 +?>
  48 +<script type="text/javascript" src="../../shared/jquery.ba-jqmq.js"></script>
  49 +<script type="text/javascript" src="../../jquery.ba-loadadscript.js"></script>
  50 +<script type="text/javascript" language="javascript">
  51 +
  52 +<?= $shell['script']; ?>
  53 +
  54 +$(function(){
  55 +
  56 + // Syntax highlighter.
  57 + SyntaxHighlighter.highlight();
  58 +
  59 +});
  60 +
  61 +</script>
  62 +<style type="text/css" title="text/css">
  63 +
  64 +/*
  65 +bg: #FDEBDC
  66 +bg1: #FFD6AF
  67 +bg2: #FFAB59
  68 +orange: #FF7F00
  69 +brown: #913D00
  70 +lt. brown: #C4884F
  71 +*/
  72 +
  73 +#page {
  74 + width: 700px;
  75 +}
  76 +
  77 +.ad {
  78 + display: none;
  79 + width: 468px;
  80 + height: 60px;
  81 + border: 1px solid #000;
  82 + margin-bottom: 1em;
  83 +}
  84 +
  85 +.ad a {
  86 + color: #aaa;
  87 +}
  88 +
  89 +.ad a:hover {
  90 + color: #FF7F00;
  91 +}
  92 +
  93 +</style>
  94 +<?
  95 +$shell['html_head'] = ob_get_contents();
  96 +ob_end_clean();
  97 +
  98 +// ========================================================================== //
  99 +// HTML BODY
  100 +// ========================================================================== //
  101 +
  102 +ob_start();
  103 +?>
  104 +<?= $shell['donate'] ?>
  105 +
  106 +<p>
  107 + With <a href="http://benalman.com/projects/jquery-misc-plugins/#loadadscript">jQuery loadAdScript</a> you can load third party ad network scripts that use <code>document.write</code> into specific containers. The only downside is that the ads will load serially.. but that's necessary to keep them from stepping on each others' toes. And the upside is that your site isn't completely borked!
  108 +</p>
  109 +<p>
  110 + Requires the <a href="http://benalman.com/projects/jquery-message-queuing-plugin/">jQuery Message Queueing</a> plugin.
  111 +</p>
  112 +
  113 +<h3>Sample ads</h3>
  114 +
  115 +<p>
  116 + In this example, the ads are hidden by default, and are only shown when their ad script has finished executing.
  117 +</p>
  118 +
  119 +<div id="a" class="ad"></div>
  120 +<div id="b" class="ad"></div>
  121 +<div id="c" class="ad"></div>
  122 +
  123 +<h3>The code</h3>
  124 +
  125 +<div class="clear"></div>
  126 +
  127 +<pre class="brush:js">
  128 +<?= htmlspecialchars( $shell['script'] ); ?>
  129 +</pre>
  130 +
  131 +<?
  132 +$shell['html_body'] = ob_get_contents();
  133 +ob_end_clean();
  134 +
  135 +// ========================================================================== //
  136 +// DRAW SHELL
  137 +// ========================================================================== //
  138 +
  139 +draw_shell();
  140 +
  141 +?>
61 jquery.ba-loadadscript.js
... ... @@ -0,0 +1,61 @@
  1 +/*!
  2 + * jQuery loadAdScript - v1.0 - 3/2/2010
  3 + * http://benalman.com/projects/jquery-misc-plugins/
  4 + *
  5 + * Copyright (c) 2010 "Cowboy" Ben Alman
  6 + * Dual licensed under the MIT and GPL licenses.
  7 + * http://benalman.com/about/license/
  8 + */
  9 +
  10 +(function($){
  11 + '$:nomunge'; // Used by YUI compressor.
  12 +
  13 + // A few references.
  14 + var doc = document,
  15 + write = doc.write,
  16 +
  17 + // Create queue.
  18 + q = $.jqmq({
  19 +
  20 + // Only iterate when q.next() is called.
  21 + delay: -1,
  22 +
  23 + // For each queue item, do this.
  24 + callback: function( item ) {
  25 +
  26 + // Override document.write.
  27 + doc.write = function( html ) {
  28 + item.elems.append( html );
  29 + };
  30 +
  31 + // Get script
  32 + $.getScript( item.url, function(){
  33 +
  34 + // Execute callback if specified.
  35 + item.callback && item.callback.call( item.elems );
  36 +
  37 + // Process next queue item, if exists.
  38 + q.next();
  39 + });
  40 + },
  41 +
  42 + // When the queue completes, set document.write back.
  43 + complete: function(){
  44 + doc.write = write;
  45 + }
  46 + });
  47 +
  48 + // The plugin method.
  49 + $.fn.loadAdScript = function( url, callback ) {
  50 +
  51 + // Add this to the queue.
  52 + q.add({
  53 + elems: this,
  54 + url: url,
  55 + callback: callback
  56 + });
  57 +
  58 + return this;
  59 + };
  60 +
  61 +})(jQuery);
9 jquery.ba-loadadscript.min.js
... ... @@ -0,0 +1,9 @@
  1 +/*
  2 + * jQuery loadAdScript - v1.0 - 3/2/2010
  3 + * http://benalman.com/projects/jquery-misc-plugins/
  4 + *
  5 + * Copyright (c) 2010 "Cowboy" Ben Alman
  6 + * Dual licensed under the MIT and GPL licenses.
  7 + * http://benalman.com/about/license/
  8 + */
  9 +(function($){var c=document,a=c.write,b=$.jqmq({delay:-1,callback:function(d){c.write=function(e){d.elems.append(e)};$.getScript(d.url,function(){d.callback&&d.callback.call(d.elems);b.next()})},complete:function(){c.write=a}});$.fn.loadAdScript=function(d,e){b.add({elems:this,url:d,callback:e});return this}})(jQuery);
165 shared/SyntaxHighlighter/LGPLv3.txt
... ... @@ -0,0 +1,165 @@
  1 + GNU LESSER GENERAL PUBLIC LICENSE
  2 + Version 3, 29 June 2007
  3 +
  4 + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  5 + Everyone is permitted to copy and distribute verbatim copies
  6 + of this license document, but changing it is not allowed.
  7 +
  8 +
  9 + This version of the GNU Lesser General Public License incorporates
  10 +the terms and conditions of version 3 of the GNU General Public
  11 +License, supplemented by the additional permissions listed below.
  12 +
  13 + 0. Additional Definitions.
  14 +
  15 + As used herein, "this License" refers to version 3 of the GNU Lesser
  16 +General Public License, and the "GNU GPL" refers to version 3 of the GNU
  17 +General Public License.
  18 +
  19 + "The Library" refers to a covered work governed by this License,
  20 +other than an Application or a Combined Work as defined below.
  21 +
  22 + An "Application" is any work that makes use of an interface provided
  23 +by the Library, but which is not otherwise based on the Library.
  24 +Defining a subclass of a class defined by the Library is deemed a mode
  25 +of using an interface provided by the Library.
  26 +
  27 + A "Combined Work" is a work produced by combining or linking an
  28 +Application with the Library. The particular version of the Library
  29 +with which the Combined Work was made is also called the "Linked
  30 +Version".
  31 +
  32 + The "Minimal Corresponding Source" for a Combined Work means the
  33 +Corresponding Source for the Combined Work, excluding any source code
  34 +for portions of the Combined Work that, considered in isolation, are
  35 +based on the Application, and not on the Linked Version.
  36 +
  37 + The "Corresponding Application Code" for a Combined Work means the
  38 +object code and/or source code for the Application, including any data
  39 +and utility programs needed for reproducing the Combined Work from the
  40 +Application, but excluding the System Libraries of the Combined Work.
  41 +
  42 + 1. Exception to Section 3 of the GNU GPL.
  43 +
  44 + You may convey a covered work under sections 3 and 4 of this License
  45 +without being bound by section 3 of the GNU GPL.
  46 +
  47 + 2. Conveying Modified Versions.
  48 +
  49 + If you modify a copy of the Library, and, in your modifications, a
  50 +facility refers to a function or data to be supplied by an Application
  51 +that uses the facility (other than as an argument passed when the
  52 +facility is invoked), then you may convey a copy of the modified
  53 +version:
  54 +
  55 + a) under this License, provided that you make a good faith effort to
  56 + ensure that, in the event an Application does not supply the
  57 + function or data, the facility still operates, and performs
  58 + whatever part of its purpose remains meaningful, or
  59 +
  60 + b) under the GNU GPL, with none of the additional permissions of
  61 + this License applicable to that copy.
  62 +
  63 + 3. Object Code Incorporating Material from Library Header Files.
  64 +
  65 + The object code form of an Application may incorporate material from
  66 +a header file that is part of the Library. You may convey such object
  67 +code under terms of your choice, provided that, if the incorporated
  68 +material is not limited to numerical parameters, data structure
  69 +layouts and accessors, or small macros, inline functions and templates
  70 +(ten or fewer lines in length), you do both of the following:
  71 +
  72 + a) Give prominent notice with each copy of the object code that the
  73 + Library is used in it and that the Library and its use are
  74 + covered by this License.
  75 +
  76 + b) Accompany the object code with a copy of the GNU GPL and this license
  77 + document.
  78 +
  79 + 4. Combined Works.
  80 +
  81 + You may convey a Combined Work under terms of your choice that,
  82 +taken together, effectively do not restrict modification of the
  83 +portions of the Library contained in the Combined Work and reverse
  84 +engineering for debugging such modifications, if you also do each of
  85 +the following:
  86 +
  87 + a) Give prominent notice with each copy of the Combined Work that
  88 + the Library is used in it and that the Library and its use are
  89 + covered by this License.
  90 +
  91 + b) Accompany the Combined Work with a copy of the GNU GPL and this license
  92 + document.
  93 +
  94 + c) For a Combined Work that displays copyright notices during
  95 + execution, include the copyright notice for the Library among
  96 + these notices, as well as a reference directing the user to the
  97 + copies of the GNU GPL and this license document.
  98 +
  99 + d) Do one of the following:
  100 +
  101 + 0) Convey the Minimal Corresponding Source under the terms of this
  102 + License, and the Corresponding Application Code in a form
  103 + suitable for, and under terms that permit, the user to
  104 + recombine or relink the Application with a modified version of
  105 + the Linked Version to produce a modified Combined Work, in the
  106 + manner specified by section 6 of the GNU GPL for conveying
  107 + Corresponding Source.
  108 +
  109 + 1) Use a suitable shared library mechanism for linking with the
  110 + Library. A suitable mechanism is one that (a) uses at run time
  111 + a copy of the Library already present on the user's computer
  112 + system, and (b) will operate properly with a modified version
  113 + of the Library that is interface-compatible with the Linked
  114 + Version.
  115 +
  116 + e) Provide Installation Information, but only if you would otherwise
  117 + be required to provide such information under section 6 of the
  118 + GNU GPL, and only to the extent that such information is
  119 + necessary to install and execute a modified version of the
  120 + Combined Work produced by recombining or relinking the
  121 + Application with a modified version of the Linked Version. (If
  122 + you use option 4d0, the Installation Information must accompany
  123 + the Minimal Corresponding Source and Corresponding Application
  124 + Code. If you use option 4d1, you must provide the Installation
  125 + Information in the manner specified by section 6 of the GNU GPL
  126 + for conveying Corresponding Source.)
  127 +
  128 + 5. Combined Libraries.
  129 +
  130 + You may place library facilities that are a work based on the
  131 +Library side by side in a single library together with other library
  132 +facilities that are not Applications and are not covered by this
  133 +License, and convey such a combined library under terms of your
  134 +choice, if you do both of the following:
  135 +
  136 + a) Accompany the combined library with a copy of the same work based
  137 + on the Library, uncombined with any other library facilities,
  138 + conveyed under the terms of this License.
  139 +
  140 + b) Give prominent notice with the combined library that part of it
  141 + is a work based on the Library, and explaining where to find the
  142 + accompanying uncombined form of the same work.
  143 +
  144 + 6. Revised Versions of the GNU Lesser General Public License.
  145 +
  146 + The Free Software Foundation may publish revised and/or new versions
  147 +of the GNU Lesser General Public License from time to time. Such new
  148 +versions will be similar in spirit to the present version, but may
  149 +differ in detail to address new problems or concerns.
  150 +
  151 + Each version is given a distinguishing version number. If the
  152 +Library as you received it specifies that a certain numbered version
  153 +of the GNU Lesser General Public License "or any later version"
  154 +applies to it, you have the option of following the terms and
  155 +conditions either of that published version or of any later version
  156 +published by the Free Software Foundation. If the Library as you
  157 +received it does not specify a version number of the GNU Lesser
  158 +General Public License, you may choose any version of the GNU Lesser
  159 +General Public License ever published by the Free Software Foundation.
  160 +
  161 + If the Library as you received it specifies that a proxy can decide
  162 +whether future versions of the GNU Lesser General Public License shall
  163 +apply, that proxy's public statement of acceptance of any version is
  164 +permanent authorization for you to choose that version for the
  165 +Library.
BIN  shared/SyntaxHighlighter/scripts/clipboard.swf
Binary file not shown
61 shared/SyntaxHighlighter/scripts/shBrushAS3.js
... ... @@ -0,0 +1,61 @@
  1 +/**
  2 + * SyntaxHighlighter
  3 + * http://alexgorbatchev.com/
  4 + *
  5 + * SyntaxHighlighter is donationware. If you are using it, please donate.
  6 + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
  7 + *
  8 + * @version
  9 + * 2.0.320 (May 03 2009)
  10 + *
  11 + * @copyright
  12 + * Copyright (C) 2004-2009 Alex Gorbatchev.
  13 + *
  14 + * @license
  15 + * This file is part of SyntaxHighlighter.
  16 + *
  17 + * SyntaxHighlighter is free software: you can redistribute it and/or modify
  18 + * it under the terms of the GNU Lesser General Public License as published by
  19 + * the Free Software Foundation, either version 3 of the License, or
  20 + * (at your option) any later version.
  21 + *
  22 + * SyntaxHighlighter is distributed in the hope that it will be useful,
  23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25 + * GNU General Public License for more details.
  26 + *
  27 + * You should have received a copy of the GNU General Public License
  28 + * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
  29 + */
  30 +SyntaxHighlighter.brushes.AS3 = function()
  31 +{
  32 + // Created by Peter Atoria @ http://iAtoria.com
  33 +
  34 + var inits = 'class interface function package';
  35 +
  36 + var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
  37 + 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
  38 + 'extends false final finally flash_proxy for get if implements import in include Infinity ' +