|
cnitblog.com/lxasp - - 有一种信念叫做编程
|
posts - 62, comments - 34, trackbacks - 0, articles - 0
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>简单的日期插件开发思路</title> <meta http-equiv="content-type" content="text/html;charset=gb2312"> <!--把下面代码加到<head>与</head>之间--> <style type="text/css"> <!-- .monthcal table { border-collapse:collapse ; border:none} .monthcal table th {border:1px solid #ccc} .monthcal table td {border:1px solid #ccc} --> </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript">//<!--
//取得每个月有多少天 function getDaysInMonth(month,year) { var daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31]; if ((month==1)&&(year%4==0)&&((year%100!=0)||(year%400==0))){ return 29; }else{ return daysInMonth[month]; } }
function caldraw1(yyyy,mm,dd){ var $me=$("#cal1"); //输入一个年、月、日,取得该月的1号是星期几 var month1stday=new Date(yyyy,mm-1,1); //取得日期 var the1stweek=month1stday.getDay(); //取得星期 var monthalldays=getDaysInMonth(mm-1,yyyy); //取得天数 var lastTdId=the1stweek+monthalldays; //取得表格最后ID //填充th var ww=["日","一","二","三","四","五","六"]; $("th",$me).each(function(i,n){ $(n).text(ww[i]); });
//填充td var k=0; $("td",$me).each(function(i,n){ if (i>=the1stweek && i<lastTdId){ $(n).text(++k); if(k==dd) $(n).css('font-weight','bold'); } }); $("#debug").val( yyyy+'.'+mm+'.'+dd + '\n\n' + $me.html() ); }
$().ready(function() { caldraw1(2009,8,25); });
//--> </script> </head> <body>
<pre> 1.输入一个年、月、日,取得该月的1号是星期几
2,画一个7x7的表格 第一行为标题,填充:日一二三四五六
其他填充 id="d0" 至到 "d41"
</pre>
<div id="cal1" class="monthcal"> <table> <tr> <th scope="col"></th> <th scope="col"></th> <th scope="col"></th> <th scope="col"></th> <th scope="col"></th> <th scope="col"></th> <th scope="col"></th> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
</div>
<textarea id="debug" style="width:98%;height:500px"></textarea>
</body> </html>
jQuery 插件代码编写模板 jQuery-Plugin-Template 下载: http://www.lxasp.com/dbbs/a/a.asp?B=101&ID=13
/* @name: jQuery Plugin Template for Coding */ ;(function($) {//[--jQuery Plugin Container
//declare the plugin's version ; use to check the plugin exists $.__plugin_name__ = $.__plugin_name__ || {version:'0.1.0'};
//[--Plugin Define var __plugin_name__ = function(node,opts) {
var me=this,$me=$(this); var $mine=$(node); //get the plugin's Operation jQuery DOM Element
//Public Methods $.extend(me, { show: function() { __show__(); }, hide: function() { __hide__(); }, options: function() { //return the preset options to users code //let users can be change options by later code return opts; } });
//Private Variables ( Module Level ) var m_var1, m_var2, m_var3;
//init the plugin function __init__(){ alert('jQuery Plugin init'); if (opts.autoShow) __show__(); } __init__();
//Private Functions function __show__(){ //function code $mine.text('Hello jQuery Plugin !'); //call the event opts.onShow(me,opts); }
function __hide__(){ //function code $mine.text(''); //call the event opts.onHide(me,opts); }
};//--]Plugin Define
//jQuery Plugin Implementation $.fn.__plugin_name__ = function(conf) {
//return existing instance // let users can use the Public Methods //Usage: var obj = $('#id').__plugin_name__({ <options> }).data("__plugin_name__"); var el = this.eq(typeof conf == 'number' ? conf : 0).data("__plugin_name__"); if (el) { return el; }
//setup default options var opts = { autoShow:true, onShow:function(e,o){}, onHide:function(e,o){}, api:false };
//if no users options then use the default options $.extend(opts, conf);
// install the plugin for each items in jQuery this.each(function() { el = new __plugin_name__(this, opts); $(this).data("__plugin_name__", el); });
//api=true let users can immediate use the Public Methods return opts.api ? el: this;
};
})(jQuery);//--]jQuery Plugin Container
仿MSN右下角提示窗口(XHTML+JQUERY版本) 有“关闭”、“最小化”、“还原”功能,支持固定滚动位置 XHTML+CSS+JQUERY 支持 IE,FF,Google 浏览器
2:09 2009-8-21 初步改写 18:24 2009-8-21 初步写好插件 22:27 2009-8-21 基本完成 version: 0.8.12
相关描述:( 关键词 / KEYWORD ) Outlook like Message Notification / MSN Messenger like Popup Tip Box on the Right Bottom of the Screen / Window Corner
特色功能: 初始时最小化,鼠标移入则还原大小,鼠标离开则最小化 更改固定位置: [7][8][9] [4][5][6] [1][2][3] [单击显示] [单击隐藏] [初始最大化(不能缩放)] [初始最小化(自动缩放)] [最大化] [最小化] [无特效] [特效1] [特效2] [特效3] [透明50%] [不透明] [显示5秒后消失]
http://www.lxasp.com/jquery/
Outlook like Message Notification / MSN Messenger like Popup Tip Box on the Right Bottom of the Screen/Corner = jquery.floatFix(lxasp's code)
[jquery.floatFix Demo1] with jquery.floatFix plugin's default
[jquery.floatFix Demo2] with jquery.floatFix plugin controlling two boxes
[jquery.floatFix Demo3] with jquery.floatFix plugin ( flexible position / customize )
1 下载和安装: http://tortoisesvn.net/downloads 下载一个安装版和一个简体中文包2个安装包,并安装之。
2 建立版本库目录(Project's DataBase Folder) 2.1 在你的重要资料的分区新建一个目录叫“SVNDB” 2.2 在这个目录里面再建立一个属于你的某个工程的子目录例如“Project1”,假如你有多个工程,则建立几个 2.3 在“Project1”的资源管理器的目录树右键菜单“tortoisesvn”->“在此创建版本库” 2.4 新建版本库后,再在此目录按右键菜单找到“版本库浏览器”,在版本库浏览器里,把URL里面的地址(例如“file:///E:/SVNDB/Project1”)复制(备用)
3 将现有工程的目录和文件导入版本库(Exists Project's Source Temp Folder) 3.1 将你的现有工程的目录复制到一个临时的目录(例如C:\Project1),将里面的不需要加入版本库的文件或目录清理好 3.2 在2.4的那个版本库浏览器里,右键,加入文件夹C:\Project1(加入完成后,C:\Project1这个目录就可以彻底删除了) 3.3 版本库在浏览器里右键把Project1改名为trunk
4 建立日常使用的工作目录(Project's Workspace Folder) 4.1 在你的日常使用的目录中建立一个文件夹(例如:E:\Project1) 4.2 资源管理器的目录树中,在E:\Project1右键菜单点击“SVN 检出” 4.3 在“SVN 检出”的对话框中,URL地址里面填“file:///E:/SVNDB/Project1/trunk”(最好有后面的trunk) 4.4 检出完成后,此目录里面就填充满工程的文件和目录了,那么日后编辑或开发代码就在此目录里面工作了。
其他说明: ·日后写了部分代码,觉得需要备份时就“SVN 提交”,过了些时间要刷新一下就“SVN 更新” ·Windows的资源管理器的右键菜单在工作目录里面有点不太正常,可以换其他的资源管理器(例如:Q-Dir/FreeCmd/MDIE/TotalCmd等) ·在SVN中最重要的目录: DataBase Folder ,此文件夹其实就是个备份的数据库,把工程的目录和文件都用zip压缩在此目录里面(可以观察一下此目录下文件的更改) ·如果要撤销某个工程使用的SVN,则在资源管理器删除DataBase Folder和Workspace Folder即可。
补充几个目录的说明: trunk -- 主干日常开发 branches -- 新分支做定制 tags -- 历届版本存档
几个目录的示例: http://blog.csdn.net/syd_programming/archive/2009/07/16/4353183.aspx
http://www.lxasp.com/jquery/
jQuery UI (其实也是个插件集成库)过于庞大而且不好分离。
因此本人就根据自己的使用,整理了这个jQuery简化的常用代码库。
|
常用公共组件
|
|
|
数据外储
|
jquery.metadata.js
|
将json数据内置于class 使得被代码来调用
|
|
|
热键控制
|
jquery.hotkeys.js
|
|
|
|
坐标定位
|
jquery.dimensions.js
|
这个插件均有被其他插件调用到
|
|
|
控件拖放
|
jquery.dragresize.js
|
有用到dimensions
|
|
|
控件滚动
|
jquery.scrollto.js
|
|
|
常用效果插件
|
|
|
提示文字和下拉列表
|
jquery.cluetip.js
|
有用到dimensions 有用到metadata
|
|
|
选项卡标签页TAB切换
|
jquery.toolstabs.js
|
内部自带有history组件
|
|
|
页内弹出对话框
|
jquery.modalform.js
|
有用到dimensions 有用到dragresize
|
|
|
|
|
|
|
◇以上暂时就叫做“基本插件”集成后的总大小: 40KB
|
|
|
|
|
|
|
较大插件(分离出来需要时再手动加载)
|
|
|
表单验证
|
jquery.validate.js
|
30KB
|
|
|
日期时间控件(非jQuery)
|
jscalendar.js
|
38KB
|
◇仅一个插件都有30KB,所以认为是较大插件。这里所说的大小都是jsmin最小化后的大小。
摘要: [原创]领星票据打印宝[简易版] v0.1.0518
◆功能特点:
◇支持多种票据模板:支票、银行进账单等
◇支持横向、纵向、侧向旋转的打印方式、支持A4、A3、A2等纸张
◇支持多种打印机:平推针式打印机、喷墨打印机、激光打印机、票据专用打印机等
◇每个字段均可精确定位到0.1毫米,均可设置不同字体大小
◇所见即所得的打印预览效果,可以更直观方便的调整位置等参数
◇支持备选列表设置,方便从下拉框中选取常用预设数据
◇支持模板参数保存,可以为不同的打印机作不同参数设置
◇采用INI格式文件作为模板,便于高级用户进行修改
◇采用Office 2007主题样式的强大界面,可灵活设定工具栏、快捷键等
◇[简易版]完全免费,无须注册,无功能限制,永不过期
阅读全文
摘要: 其实我的现在这个ACP框架已经是在以前的2个版本的改良改写后的版本了。第一个版本的后台登录代码…………;第二个版本的后台登录代码…………;
可以明显看出,前身的版本的代码两都在200行以上,而现在的版本仅不足100行。 阅读全文
<!--#include file="acp/acp.asp"-->
<!--#include file="config.asp"-->
<!--#include file="app/Nome_MD5.asp"-->
<%
NoCache

If Request.QueryString("go")="check" Then

Call CheckLogin()
Else

If tp.Open("admin\Login.htm") Then
tp("FORM_ACT")="?go=check"
tp.Pump
Else
zerr "打开模板失败"
End If
End If


Sub CheckLogin()
Dim a,b
With db
.TypeStr
Dim VF_ua_name : VF_ua_name=.VF("ua_name")
Dim VF_ua_pwd : VF_ua_pwd=.VF("ua_pwd")
Dim VF_vpwd : VF_vpwd=.VF("vpwd")
Dim VF_vcode : VF_vcode=.VF("vcode")

End With
If db.HasErr Then
zerr db.GetErr
End If
If Session("GetCode")<>VF_vcode Then zerr "验证码不正确"
If VF_vpwd<>"123" Then zerr "内部密码不正确"
a=db.Read("SELECT ua_id, ua_name, ua_pwd, ua_ugid, ug_name FROM LX_UA LEFT JOIN LX_UG ON LX_UA.ua_ugid = LX_UG.ug_id WHERE " & db.ES("ua_name","=",VF_ua_name) )
If Not IsArray(a) Then zerr "用户名不正确"
If a(2,0)<>md5(VF_ua_pwd) Then zerr "密码不正确"

b=db.Read("SELECT lf_id FROM LX_MGF WHERE flag=-1 AND " & db.EN("ug_id","=",a(3,0) ) & " ORDER BY lf_id " )
Session("ua_id")=a(0,0)
Session("ua_name")=a(1,0)
Session("ua_ugid")=a(3,0)
Session("ua_ugname")=a(4,0)
Session("ua_rgt")=XRgt(b)
Pause("<script>window.top.location.replace('Admin.asp')</script>")
End Sub

Function XRgt(rgts)
Dim i,a,u
If IsArray(rgts) Then
u=UBound(rgts,2)
ReDim a(u)
For i=0 To u
a(i)=","&rgts(0,i)
Next
XRgt=Join(a,"")
End If
End Function
%>
<!--#include file="acp/acp.asp"-->
<!--#INCLUDE FILE="acp/clsList.asp"-->
<!--#include file="config.asp"-->
<%

Response.Write ShowList()

ca.removeall

Function ShowList()
Dim ls,t

use.ls ls
Set ls.Cache=ca
If ls.Open("./tpl/default/list.htm") Then
ls.PSize=20
ls.SetRS(conn,"SELECT COUNT(*) FROM AE_Demo1")="SELECT ab_id, ab_title, ab_date FROM AE_Demo1 ORDER BY ab_date DESC"
t=ls.Text
If ls.HasErr Then
zerr ls.GetErr
End If
t=Replace(t,"{=dirSKIN}","./tpl/default/")
t=Replace(t,"{=info_runtimer}",GetTimer)
t=Replace(t,"{=info_sqlcount}",sqlcount)
t=Replace(t,"{=title}", GPV_site_name )
ShowList=t
Else
Pause "打开模板失败"
End If
End Function


%>
<!--#include file="acp/acp.asp"-->
<%
tp.cache=empty '禁用缓存模板
tp.open "Untitled-1.html" '打开刚才的HTML
tp("title")="hello acp" '设置title标签
tp("text")=now '设置text标签
tp.pump '显示结果
%>
|
|