Skip to content
This repository has been archived by the owner on Sep 12, 2020. It is now read-only.

Commit

Permalink
some new
Browse files Browse the repository at this point in the history
  • Loading branch information
TigerBeanst committed Jan 22, 2020
1 parent 2bbf9c2 commit 83ebac2
Show file tree
Hide file tree
Showing 31 changed files with 9,201 additions and 65 deletions.
34 changes: 34 additions & 0 deletions blocks/tm-button/block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
$word = block_value("tm-button-word");
$link = block_value("tm-button-link");
$color = block_value("tm-button-color");
if (block_value('tm-button-new')) {
//新窗口打开
$onclick = "window.open(\"$link\")";
} else {
//不是新窗口打开
$onclick = "window.location.href=\"$link\"";
}


$i = block_value('tm-button-style');
if ($i == "raised-colored") {
//浮动上色
echo "<button class='mdui-btn mdui-btn-raised mdui-ripple mdui-color-grey-700' onclick='$onclick'>$word</button>";
} elseif ($i == "raised-white") {
//浮动白色
echo "<button class='mdui-btn mdui-btn-raised mdui-ripple' onclick='$onclick'>$word</button>";
} elseif ($i == "flat-colored") {
//扁平上色
echo "<button class='mdui-btn mdui-ripple mdui-color-grey-700' onclick='$onclick'>$word</button>";
} elseif ($i == "flat-white") {
//扁平白色
echo "<button class='mdui-btn mdui-ripple' onclick='$onclick'>$word</button>";
} elseif ($i == "raised-custom") {
//浮动自定义颜色
echo "<button class='mdui-btn mdui-btn-raised mdui-ripple mdui-color-grey-700' onclick='$onclick'>$word</button>";
} elseif ($i == "flat-custom") {
//扁平自定义颜色
echo "<button class='mdui-btn mdui-ripple $color' onclick='$onclick'>$word</button>";
}
?>
40 changes: 40 additions & 0 deletions blocks/tm-button/preview.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
$word = block_value("tm-button-word");
$link = block_value("tm-button-link");
$color = block_value("tm-button-color");
if (block_value('tm-button-new')) {
//新窗口打开
$onclick = "window.open(\"$link\")";
} else {
//不是新窗口打开
$onclick = "window.location.href=\"$link\"";
}


$i = block_value('tm-button-style');
if ($i == "raised-colored") {
//浮动上色
echo "<b><i>TM-按钮(浮动上色)</i></b><br>";
echo "<button class='mdui-btn mdui-btn-raised mdui-ripple mdui-color-grey-700' onclick='$onclick'>$word</button>";
} elseif ($i == "raised-white") {
//浮动白色
echo "<b><i>TM-按钮(浮动白色)</i></b><br>";
echo "<button class='mdui-btn mdui-btn-raised mdui-ripple' onclick='$onclick'>$word</button>";
} elseif ($i == "flat-colored") {
//扁平上色
echo "<b><i>TM-按钮(扁平上色)</i></b><br>";
echo "<button class='mdui-btn mdui-ripple mdui-color-grey-700' onclick='$onclick'>$word</button>";
} elseif ($i == "flat-white") {
//扁平白色
echo "<b><i>TM-按钮(扁平白色)</i></b><br>";
echo "<button class='mdui-btn mdui-ripple' onclick='$onclick'>$word</button>";
} elseif ($i == "raised-custom") {
//浮动自定义颜色
echo "<b><i>TM-按钮(浮动自定义颜色)</i></b><br>";
echo "<button class='mdui-btn mdui-btn-raised mdui-ripple mdui-color-grey-700' onclick='$onclick'>$word</button>";
} elseif ($i == "flat-custom") {
//扁平自定义颜色
echo "<b><i>TM-按钮(扁平自定义颜色)</i></b><br>";
echo "<button class='mdui-btn mdui-ripple $color' onclick='$onclick'>$word</button>";
}
?>
1 change: 1 addition & 0 deletions blocks/tm-fontawesome/block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="<?php bloginfo("template_url");?>/fontawesome/css/all.min.css">
4 changes: 4 additions & 0 deletions blocks/tm-fontawesome/preview.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<b><i>TM-FontAwesome字体</i></b><br>
<link rel="stylesheet" href="<?php bloginfo("template_url");?>/fontawesome/css/all.min.css">
<i>(此处添加了 TM-FontAwesome字体 区块,文章将会调用此图标字体,请在「作为HTML编辑」模式下插入对应的图标字体。)</i><br>
<i>例如:需要 <i class="fab fa-wordpress"></i> 图标,在「作为HTML编辑」模式下插入 <<span>i</span> class="fab fa-wordpress"></<span>i</span>></i>
12 changes: 12 additions & 0 deletions blocks/tm-panel/block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="mdui-panel mdui-panel-gapless" mdui-panel="{accordion: true}">
<div class="mdui-panel-item <?php if (block_value('tm-panel-status')) {
echo 'mdui-panel-item-open';
} ?>">
<div class="mdui-panel-item-header"><?php block_field('tm-panel-title'); ?></div>
<div class="mdui-panel-item-body" <?php if (block_value('tm-panel-status')) {
echo 'style="height: auto;"';
} ?>>
<?php block_field('tm-panel-content'); ?>
</div>
</div>
</div>
13 changes: 13 additions & 0 deletions blocks/tm-panel/preview.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<b><i>TM-可扩展面板</i></b><br>
<div class="mdui-panel mdui-panel-gapless" mdui-panel="{accordion: true}">
<div class="mdui-panel-item <?php if (block_value('tm-panel-status')) {
echo 'mdui-panel-item-open';
} ?>">
<div class="mdui-panel-item-header"><?php block_field('tm-panel-title'); ?></div>
<div class="mdui-panel-item-body" <?php if (block_value('tm-panel-status')) {
echo 'style="height: auto;"';
} ?>>
<?php block_field('tm-panel-content'); ?>
</div>
</div>
</div>
6 changes: 6 additions & 0 deletions blocks/tm-todo-selection/block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php if(block_value("tm-todo-selection-checked")){
$check = " checked";
}else{
$check = "";
}?>
<label class="mdui-checkbox"><input type="checkbox" disabled<?php echo $check;?>><i class="mdui-checkbox-icon"></i><?php block_field("tm-todo-selection-word");?></label><br>
7 changes: 7 additions & 0 deletions blocks/tm-todo-selection/preview.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<b><i>TM-TODO复选</i></b><br>
<?php if(block_value("tm-todo-selection-checked")){
$check = " checked";
}else{
$check = "";
}?>
<label class="mdui-checkbox"><input type="checkbox" disabled<?php echo $check;?>><i class="mdui-checkbox-icon"></i><?php block_field("tm-todo-selection-word");?></label>
5 changes: 5 additions & 0 deletions fontawesome/css/all.min.css

Large diffs are not rendered by default.

Binary file added fontawesome/webfonts/fa-brands-400.eot
Binary file not shown.
Loading

0 comments on commit 83ebac2

Please sign in to comment.