48 lines
1.9 KiB
JavaScript
48 lines
1.9 KiB
JavaScript
$(document).ready(function(){
|
|
renderCommonXPagesConfigPage();
|
|
});
|
|
function renderCommonXPagesConfigPage(){
|
|
var contentStr="<div class='xpagePublishParticipant-wrap'>";
|
|
contentStr+="<div class='xpages-label-text'>设置显示个数</div>";
|
|
//contentStr+="<h3>流程发布门户-我参与的</h3><input id='systemxpage_tcount' type='text' placeholder='设置显示个数,点击空白处自动生成URL' value='' class='txt' style='width:90%;'>";
|
|
contentStr+="<input id='systemxpage_tcount' type='text' placeholder='请输入显示个数,点击空白处自动生成URL' value='' class='txt' style='width:90%;'>";
|
|
contentStr+="<textarea class='url xpagesContent' readonly></textarea>";
|
|
contentStr+="</div>";
|
|
$(".cwapp-right").append(contentStr);
|
|
|
|
var cwUrl = getCwUrl();//获取之前的存储的url链接
|
|
if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){
|
|
var count = getParamString(cwUrl,"count");
|
|
$("#systemxpage_tcount").val(count);
|
|
|
|
}
|
|
|
|
$("#systemxpage_tcount").blur(function(){
|
|
var count = $('#systemxpage_tcount').val();
|
|
if(count!=""){
|
|
var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_participant_msg&count="+count;
|
|
//$(".xpagesContent").empty();
|
|
//$(".xpagesContent").append(url);
|
|
$(".xpagePublishParticipant-wrap").find(".xpagesContent").val(url);
|
|
}else{
|
|
//$(".xpagesContent").empty();
|
|
$(".xpagePublishParticipant-wrap").find(".xpagesContent").val("");
|
|
}
|
|
});
|
|
}
|
|
|
|
function getParamString(url,name) {
|
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
|
var r = url.match(reg);
|
|
if (r != null) {
|
|
return unescape(r[2]);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function getCwUrl(){
|
|
//修改时默认参数定位
|
|
var subcwid = $("#cw-manage-dlg-content").find("li.current").attr("subcwid");
|
|
var cwUrl = $(".nav-config-panel[subcwid="+subcwid+"]").find("#cwUrl").val();
|
|
return cwUrl;
|
|
} |