/* Source View | SyntaxHighlirhter | JavaScript, html5 and CSS3 Study | (c) 2014 twitter@sumo_ninja_jp
*/

var sv = function() {
  var param = window.location.search.substring( 1 );
  var obj = JSON.parse( decodeURIComponent( param ) );

  $( "#sv_title" ).text( obj.title );
  $( "#sv_url" ).text( obj.url );

  var i = obj.files.length;
  while( i > 0 ) {
    $( "#sv_url" ).after( "<pre title='" + obj.files[--i].title + "' />" );
  }

  var xhrs = [];

  for( i = 0; i < obj.files.length; i++ ) {
    xhrs[i] = new XMLHttpRequest();
    xhrs[i].open( "GET", obj.url + obj.files[i].name, false );
    xhrs[i].onload = function() {
      var pre = "pre[title='" + obj.files[i].title + "']";
      $( pre ).text( xhrs[i].responseText );
      $( pre ).addClass( "brush: " + obj.files[i].brush );
       SyntaxHighlighter.highlight();
    }
    xhrs[i].send();
  }
}

window.addEventListener( "load", sv, false);

@@ -104,18 +104,18 @@
 */%0A%0Avar 
-sv
+rp
  = funct
@@ -181,61 +181,499 @@
 ;%0A  
-var obj = JSON.parse( decodeURIComponent( param ) );%0A
+if( param === undefined %7C%7C param.length %3C= 0 ) %7B%0A    $( %22#sv_title%22 ).text( %22No parameters.%22 );%0A    return;%0A  %7D%0A%0A  var obj = JSON.parse( decodeURIComponent( param ) );%0A  var xhr;%0A  if( obj.entry !== undefined ) %7B%0A    xhr = new XMLHttpRequest();%0A    xhr.open( %22GET%22, obj.url + obj.entry, false );%0A    xhr.onload = function() %7B%0A      param = xhr.responseText;%0A      obj = JSON.parse( param );%0A      sv( obj );%0A    %7D%0A    xhr.send();%0A  %7D%0A  else %7B%0A    sv( obj );%0A  %7D%0A%7D%0A%0Avar sv = function( obj ) %7B
 %0A  $
@@ -887,17 +887,16 @@
 s = %5B%5D;%0A
-%0A
   for( i
@@ -1223,25 +1223,25 @@
 i%5D.brush );%0A
- 
+%0A
       Syntax
@@ -1331,18 +1331,18 @@
 %22load%22, 
-sv
+rp
 , false)

Add parameter pattern: url to setting file.