/[suikacvs]/markup/html/html5/spec-ja/edit2.cgi
Suika

Diff of /markup/html/html5/spec-ja/edit2.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Sun Oct 26 06:50:10 2008 UTC revision 1.2 by wakaba, Sun Oct 26 08:44:19 2008 UTC
# Line 42  Allow: POST Line 42  Allow: POST
42    }    }
43  } elsif ($path =~ m#^/([0-9a-f]+)\.json$#) {  } elsif ($path =~ m#^/([0-9a-f]+)\.json$#) {
44    my $hash = $1;    my $hash = $1;
45    my ($is_pattern, $entry) = get_entry ($hash);    my $entry = get_entry_or_fallback_entry ($hash);
   unless (defined $entry->{en}) {  
     $entry = get_fallback_entry ($hash);  
   }  
   $entry->{tags} ||= [] if defined $entry->{en};  
   $entry->{isPattern} = 1 if $is_pattern;  
46    
47    binmode STDOUT, ':encoding(utf-8)';    binmode STDOUT, ':encoding(utf-8)';
48    print "Content-Type: application/json\n\n";    print "Content-Type: application/json\n\n";
# Line 55  Allow: POST Line 50  Allow: POST
50    require JSON;    require JSON;
51    print scalar JSON::objToJson ($entry);    print scalar JSON::objToJson ($entry);
52    exit;    exit;
53    } elsif ($path eq '/updates.json') {
54      my $updates = {};
55      for (get_modified_hashes ()) {
56        $updates->{$_} = get_entry_or_fallback_entry ($_);
57      }
58    
59      binmode STDOUT, ':encoding(utf-8)';
60      print "Content-Type: application/json\n\n";
61    
62      require JSON;
63      print scalar JSON::objToJson ($updates);
64      exit;
65  }  }
66    
67  print q[Content-Type: text/plain ; charset=us-ascii  print q[Content-Type: text/plain ; charset=us-ascii

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24