This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 显示下一篇 | |
* | |
* @access public | |
* @param string $default 如果没有下一篇,显示的默认文字 | |
* @return void | |
*/ | |
function theNext($widget, $default = NULL) | |
{ | |
$db = Typecho_Db::get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
** 加法函数,用来得到精确的加法结果 | |
** 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 | |
** 调用:accAdd(arg1,arg2) | |
** 返回值:arg1加上arg2的精确结果 | |
**/ | |
function accAdd(arg1, arg2) { | |
var r1, r2, m, c; | |
try { | |
r1 = arg1.toString().split(".")[1].length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**清空表格**/ | |
function clearLocationTable(){ | |
var objTable = document.getElementById("locationTable"); | |
var length = objTable.rows.length; | |
for (var i = 1; i<length; i++){ | |
objTable.deleteRow(1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
标题 | |
# 这是 H1 <一级标题> | |
## 这是 H2 <二级标题> | |
### 这是 H3 <三级标题> | |
#### 这是 H4 <四级标题> | |
##### 这是 H5 <五级标题> | |
###### 这是 H6 <六级标题> | |
文字格式 | |
**这是文字粗体格式** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>JQuery Flickr Loading Animation</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var wwidth = $(window).width(); | |
var bluewidth = $("#shapeblue").width(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 从EXECL中拷贝多行数据,粘贴至HTML INPUT控件中。 | |
* event 用户键盘操作对象 | |
* obj 被粘贴的控件对象 | |
* num 第几行 | |
**/ | |
function copyValue(event, obj ,num){ | |
if (event != null && event.ctrlKey && event.keyCode == 86) { | |
var text = window.clipboardData.getData("Text"); | |
var input = document.getElementsByName(obj.name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 对Date的扩展,将 Date 转化为指定格式的String | |
* 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符 | |
* 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) | |
* eg: | |
* (new Date()).pattern("yyyy-MM-dd hh:mm:ss.S") ==> 2007-07-02 08:09:04.423 | |
* (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2007-03-10 二 20:09:04 | |
* (new Date()).pattern("yyyy-MM-dd EE hh:mm:ss") ==> 2007-03-10 周二 08:09:04 | |
* (new Date()).pattern("yyyy-MM-dd EEE hh:mm:ss") ==> 2007-03-10 星期二 08:09:04 | |
* (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2007-7-2 8:9:4.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 生成随机字符串 | |
* | |
* @access public | |
* @param integer $length 字符串长度 | |
* @param string $specialChars 是否有特殊字符 | |
* @return string | |
*/ | |
public static function randString($length, $specialChars = false) { | |
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* CODETANK | |
* Copyright (c) 2012, Tencent AlloyTeam, All rights reserved. | |
* http://CodeTank.AlloyTeam.com/ | |
* | |
* @version 1.0 | |
* @author AlloyTeam | |
* | |
* .d8888b. 888 88888888888 888 TM | |
* d88P Y88b 888 ''''888'''' 888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("html,body").click(function(e) { | |
var gcd = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善"); | |
var n = Math.floor(Math.random() * gcd.length); | |
var $i = $("<b/>").text(gcd[n]); | |
var x = e.pageX, | |
y = e.pageY; | |
$i.css({ | |
"z-index": 99999, | |
"top": y - 20, | |
"left": x, |
NewerOlder