看到网页上面的特效,是不是想应用到自己的邮件当中去呢?想的话那就赶快来行动吧!
每一种特效插入到网页当中都可以分成几个步骤。
首先看一下配置文件的结构
[common] //公共信息
total_steps = 2 //实现本特效要多少步骤(例如2即表示下面的step1到step2起作用)
[step1] //第一步
...
...
[step2] //第二步
...
...
每个步骤由一些关键字组成
insert_type
insert_element
insert_element_id //和insert_element配合使用,如果没有指定id,则默认是该类型第一//个元素
insert_where
insert_content
insert_style_key
insert_style_value
insert_attribute_key
insert_attribute_value
insert_input_dialog_type
insert_input_dialog_text
insert_type目前有以下取值:
script:插入一段script语言
html:插入一段html语句
style:给指定元素插入一种style
attribute:给指定元素插入一种attribute
filesrc:给网页插入一个文件索引
inputdialog:打开一种对话框提示用户输入
insert_type的取值也决定了其他关键字的有效与否:
insert_type = script时
insert_element、insert_element_id指定插入的目标位置相关元素
insert_where取值:beforeBegin、afterBegin、beforeEnd、afterEnd、currentSelect
位置描述:beforeBegin<tagName>afterBegin beforeEnd</tagName>afterEnd
(注:当insert_where = currentSelect时,insert_element、insert_element_id无效)
insert_content指定插入的内容,改内容必须是<script ...>script内容</script>的形式
(注:一般情况下,内容较长,所以要换行,对于换行的内容,要采用以下的形式才能正确分辨
insert_content = ``...
...
...``
其中``不是双引号,而是由两个 ` 号组成,该符号位置在键盘数字1的左边,切记!)
insert_type = html时
insert_element、insert_element_id指定插入的目标位置相关元素
insert_where取值:beforeBegin、afterBegin、beforeEnd、afterEnd、currentSelect、bodyInside,前面5项性质和insert_type = script时一样,重点介绍一下bodyInside:
当insert_where = bodyInside时,当前页面body元素的内容将会被插到要插入的内容中间去,其位置在内容中以%s表明,如:
insert_content = ``...html1 %s html2``,则当前body的内容将会插入到%s指定的位置,并且以新得到的html内容覆盖掉原body元素当中的内容
insert_type = style时
insert_element、insert_element_id共同指定目标元素
insert_style_key、insert_style_value负责给指定的元素设置style
insert_type = attribute时
insert_element、insert_element_id共同指定目标元素
insert_attribute_key、insert_attribute_value负责给指定的元素设置attribute
insert_type = filesrc时,将会在head元素的后面插入一不显示的图片,其内容大概是:
<IMG id=%s src=%s style=\"DISPLAY: none\"></IMG>,以此当作文件的索引。
insert_element_id指定IMG元素的id
insert_content指定元素的src,内容为相对路径(当前路径为\effect)
该索引主要供script语言使用,只要在script语言中读取该元素的src属性,则能够得到所需文件的路径(无需打开文件对话框,与insert_type = inputdialog不同)
insert_type = inputdialog时,则会弹出对话框提示用户输入
insert_input_dialog_type指定对话框的类型,目前取值为:
text:弹出对话框要求输入文本索引,insert_input_dialog_text指定提示信息
若没有指定insert_element、insert_element_id,则认为该文本索引被script使用,并在head后面插入索引,形式为<COMMENT id=%s name=\"%s\"></COMMENT>,在script中用语句读取该元素的name属性即可得到内容
若指定了insert_element、insert_element_id,则认为该文本索引被html使用,所以还要指定insert_attribute_key,那么输入的内容将会代替指定元素的原属性值
file:弹出对话框要求选择文件索引
若没有指定insert_element、insert_element_id,则认为该文件索引被script使用,并在head后面插入索引,形式为<IMG id=%s src=\"%s\" style=\"DISPLAY: none\"></IMG>,在script中用语句读取该元素的src属性即可得到内容
若指定了insert_element、insert_element_id,则认为该文本索引被html使用,所以还要指定insert_attribute_key,那么得到的文件全称(路径+文件名)将会代替指定元素的原属性值
font:弹出对话框要求选择字体属性索引
在head后面插入字体属性索引,形式为<FONT id=%s face=%s size=%d color=#%s></FONT>,必须指定insert_element_id,以供script正确读取其字体的属性
具体的使用请参考已提供的特效,最后别忘记编辑以下effect.ini,不然就不能在写邮件时看到你自己添加的特效了,effect.ini很简单,相信难不到大家 ^O^