127 lines
4.4 KiB
XML
127 lines
4.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<root>
|
||
<LabelType>静态类</LabelType>
|
||
<LabelIntro>
|
||
</LabelIntro>
|
||
<OutType>txt</OutType>
|
||
<LabelDataType>static</LabelDataType>
|
||
<EnabelAjax>False</EnabelAjax>
|
||
<Version officialVersion="" modifiedVersions="3500" compatibleVersion="" />
|
||
<LabelTemplate>
|
||
<![CDATA[<div class="left_box">
|
||
<dl>
|
||
<dt>邮件订阅</dt>
|
||
<dd id="MailSubscribes">
|
||
<div id="MailSubscribesContent">
|
||
<img src="{PE.SiteConfig.SkinPath/}Images/loading.gif" alt="正在加载中......"/>
|
||
</div>
|
||
<div id="MailSubscribesAct" Style="display:none">
|
||
<img src="{PE.SiteConfig.SkinPath/}Images/loading.gif" alt="正在提交中......"/>
|
||
</div>
|
||
<div id="MailSubscribesControl">
|
||
您的邮件地址: <br />
|
||
<INPUT id="MailSubscribesMail" class=inputtext name="MailSubscribesMail" /> <br />
|
||
<INPUT id="MailSubscribesbtnSubscribe" class=inputbutton onclick="return MailSubscribesDoSumbit();" value="订阅" type="button" name="MailSubscribesbtnSubscribe">
|
||
</div>
|
||
</dd>
|
||
</dl>
|
||
</div>
|
||
<script src="{PE.SiteConfig.ajaxsitepath/}JS/jquery.pack.js" type="text/javascript" language="javascript"></script>
|
||
<script type="text/javascript" language="JavaScript">
|
||
jQuery(document).ready(function(){
|
||
MailSubscribesGetList(0);
|
||
});
|
||
|
||
function MailSubscribesDoSumbit()
|
||
{
|
||
var ids='';
|
||
var email=jQuery("#MailSubscribesMail").val();
|
||
var RegEmail= /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||
if(!email.match(RegEmail))
|
||
{
|
||
alert('请输入正确的Email !');
|
||
return false;
|
||
}
|
||
jQuery("#MailSubscribesContent").find(":checkbox[id^='MailSubscribesid']").each(
|
||
function(){
|
||
if($(this).attr("checked"))
|
||
{
|
||
if(ids!='')
|
||
{
|
||
ids+=',';
|
||
}
|
||
ids+=$(this).attr("value");
|
||
}
|
||
});
|
||
if(ids=='')
|
||
{
|
||
alert('请选择订阅项!');
|
||
return false;
|
||
}
|
||
jQuery("#MailSubscribesContent").hide();
|
||
jQuery("#MailSubscribesAct").show();
|
||
jQuery.ajax({
|
||
type: "POST",
|
||
cache: false,
|
||
url: '{PE.SiteConfig.ajaxsitepath/}MailSubscribe/MailSubscribes.aspx?Ajax=true',
|
||
data: "<?xml version='1.0' encoding='utf-8'?><root><action>do</action><ids>"+ ids +"</ids><email>"+ email +"</email></root>",
|
||
error: function(msg) {
|
||
alert("Ajax请求出错!");
|
||
jQuery("#MailSubscribesContent").show();
|
||
jQuery("#MailSubscribesAct").hide();
|
||
},
|
||
success: function(xml) {
|
||
var stats = jQuery("status", xml).text();
|
||
if(stats=='ok')
|
||
{
|
||
alert(jQuery("body", xml).text());
|
||
MailSubscribesGetList(0);
|
||
}else
|
||
{
|
||
alert(jQuery("body", xml).text());
|
||
}
|
||
jQuery("#MailSubscribesContent").show();
|
||
jQuery("#MailSubscribesAct").hide();
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
function MailSubscribesGetList(num)
|
||
{
|
||
jQuery("#MailSubscribesContent").html('<img src="{PE.SiteConfig.SkinPath/}Images/loading.gif" alt="正在加载中......"/>');
|
||
jQuery.ajax({
|
||
type: "POST",
|
||
cache: false,
|
||
url: '{PE.SiteConfig.ajaxsitepath/}MailSubscribe/MailSubscribes.aspx?Ajax=true',
|
||
data: "<?xml version='1.0' encoding='utf-8'?><root><action>list</action><num>"+ num +"</num></root>",
|
||
error: function(msg) {
|
||
alert("Ajax请求出错!");
|
||
},
|
||
success: function(xml) {
|
||
var stats = jQuery("status", xml).text();
|
||
if(stats=='ok')
|
||
{
|
||
var str='';
|
||
jQuery(xml).find("list > item").each(function(i){
|
||
var Text=jQuery(this).text();
|
||
var value=jQuery(this).attr("id");
|
||
str+='<INPUT id=MailSubscribesid_'+ i +' type="checkbox" name=MailSubscribesItems_'+ i +' value="'+ value +'"><LABEL for=MailSubscribesid_'+ i+'>'+ Text +'</LABEL><br />';
|
||
});
|
||
if(str=='')
|
||
{
|
||
jQuery("#MailSubscribesContent").html("没有订阅项列表!");
|
||
jQuery("MailSubscribesControl").hide();
|
||
}else{
|
||
jQuery("#MailSubscribesContent").html(str);
|
||
}
|
||
}else if(stats=='err')
|
||
{
|
||
jQuery("#MailSubscribes").html(jQuery("body", xml).text());
|
||
}
|
||
}
|
||
});
|
||
}
|
||
</script>]]>
|
||
</LabelTemplate>
|
||
</root> |