Skip to content

Commit

Permalink
chinese NG rules fix, mac transform enabled (buggy)
Browse files Browse the repository at this point in the history
  • Loading branch information
metaphox committed May 3, 2010
1 parent 559e6b5 commit 445208f
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 52 deletions.
11 changes: 11 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
VerTick is a wordpress theme optimised for vertical chinese.

install: copy the folder into /wordpress/wp-content/themes/

visit vertick.metaphox.name for detailed usage and stable version

Updates:

2010-05-03:
- 中文避头点规则修正
- Mac上强行横置英文,很难看
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- If you'd like to support VerTick, having the "powered by" link somewhere on your blog is the best way; it's our only promotion or advertising. -->
<p>
<?php bloginfo('name'); ?> is proudly powered by
<a href="http://wordpress.org/">WordPress</a>
<a href="http://wordpress.org/">WordPress</a>, and <a href="http://vertick.metaphox.name">VerTick</a> theme supported by <a href="http://www.typeisbeautiful.com">TIB</a>.
<br /><a href="<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a>
and <a href="<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>.
<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
function vertick_add_admin()
{
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) and isset($_REQUEST['action']) and 'save' == $_REQUEST['action'] ) {
if ( isset($_GET['page']) and $_GET['page'] == basename(__FILE__) and isset($_REQUEST['action']) and 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
if (isset($_REQUEST[ $value['id'] ])) update_option( $value['id'], $_REQUEST[ $value['id'] ] );
}
Expand Down
8 changes: 4 additions & 4 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<?php
$fontStack = array(
//tweak here if you dislike simplified chinese fonts
"Song" => 'fontFamily: "STSong, Hiragino Mincho Pro, LiSong Pro, MS Mincho, SimSun, WenQuanYi Micro Hei, serif"',
"Hei" => 'fontFamily: "Hiragino Sans GB, Hiragino Kaku Gothic Pro, LiHei Pro, Microsoft YaHei, SimHei, WenQuanYi Micro Hei, sans-serif"',
"FangSong" => 'fontFamily: "STFangSong, FangSong, MS Mincho, SimSun, WenQuanYi Micro Hei, serif"',
"Kai" => 'fontFamily: "STKaiti, KaiTi, WenQuanYi Micro Hei, serif"'
"Song" => 'fontFamily: "STSong, Hiragino Mincho Pro, LiSong Pro, MS Mincho, SimSun, WenQuanYi Micro Hei Mono"',
"Hei" => 'fontFamily: "Hiragino Sans GB, Hiragino Kaku Gothic Pro, LiHei Pro, Microsoft YaHei, SimHei, WenQuanYi Micro Hei Mono"',
"FangSong" => 'fontFamily: "STFangSong, FangSong, MS Mincho, SimSun, WenQuanYi Micro Hei Mono"',
"Kai" => 'fontFamily: "STKaiti, KaiTi, WenQuanYi Micro Hei Mono"'
);
$fs = get_option('vertick_fontstack');
echo $fs ? $fontStack[$fs] : $fontStack['Song'];
Expand Down
33 changes: 0 additions & 33 deletions js/nehan-min.js

This file was deleted.

16 changes: 8 additions & 8 deletions js/nehan.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ if(!Nehan.ParserHook){

// check if browser can support transform method
if (browser == "chrome"){
this.canTransform = true;
this.canTransform = true;
} else if (browser == "safari"){
this.canTransform = true;
this.canTransform = true;
} else if (browser == "firefox" && version >= 3.5){
this.canTransform = true;
this.canTransform = true;
} else if (this.isIE && !this.isVistaOrWin7 && version >= 6.0){
this.canTransform = true;
this.canTransform = true;
} else {
this.canTransform = false;
this.canTransform = false;
}
}
};
Expand Down Expand Up @@ -278,7 +278,7 @@ if(!Nehan.ParserHook){
// if mac and fontfamily is not defined properly, disable transform method.
if(Env.isMac && this.fontFamily){
//##VERTICK comment out this line to force enable mac transform. ugly tho.
Env.canTransform = (this.fontFamily.match(/Osaka-Mono/));
//Env.canTransform = (this.fontFamily.match(/Osaka-Mono/));
}

this.wrapCss = "";
Expand Down Expand Up @@ -862,7 +862,7 @@ if(!Nehan.ParserHook){
var ngChars = [ "?", "】", ",", ",", "》", "。",
"、", "・", "」", "」", "』",")", ">", "〉",
"≫","]", "〕", "]","]","!","!",") ",
"々", "ゝ", "ー", "-" ];
"々", "ゝ", "ー", "-", "”", "’", ":" ]; //#VerTick adds ”, ’, and :
for(i = 0; i < ngChars.length; i++){
if(s == ngChars[i]){
return true;
Expand All @@ -874,7 +874,7 @@ if(!Nehan.ParserHook){
StreamParser.prototype.isTailNg = function(s){
var ngChars = [ "【", "《", "「", "『", "(",
"[" , "[" , "〔" ,
"<", "≪", "(", "〈" ];
"<", "≪", "(", "〈", "“", "‘" ]; //#VerTick adds “ and ‘
for(i = 0; i < ngChars.length; i++){
if(s == ngChars[i]){
return true;
Expand Down
37 changes: 32 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
/*
Theme Name: VerTick (zh-hans)
Theme Name: VerTick
Theme URI: http://vertick.metaphox.name
Description: A Wordpress theme optimised for vertical chinese.
Version: 1.0
Description: A Wordpress theme optimised for vertical chinese, using Nehan layout engine.
Version: 0.8
Author: Metaphox
Author URI: http://blog.metaphox.name/
Tags: chinese, vertical-chinese, fixed-width, one-column, light, widgets
*/

/*
Copyright (c) 2010, Metaphox (foxisme@gmail.com)
licenced under MIT licence.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/

/* Reset CSS http://meyerweb.com/eric/tools/css/reset/ */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td {
margin: 0;
Expand Down Expand Up @@ -151,7 +178,7 @@ div#content {
margin-left: 20px;
padding-top: 0.5em;
text-align: center;
border-top: 0.125em double #999;
border-top: 0.125em double #999;
}

.posttitle h2 a {
Expand Down Expand Up @@ -231,7 +258,7 @@ div#content {
.entry a {
text-decoration: none!important;
color: #a00;
border-left: 1px dotted #a00;
/* border-left: 1px dotted #a00; */
}

.entry .text-layer {
Expand Down

0 comments on commit 445208f

Please sign in to comment.