12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>选择标签</title>
- <script type="text/javascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.min.js"></script>
- <style type="text/css">
- ul.ztree {margin-top: 10px;border: 1px solid #617775;background: #f0f6e4;width:220px;height:360px;overflow-y:scroll;overflow-x:auto;}
- .bq{font-size:14px;padding:5px 0 5px 30px;font-family: Microsoft YaHei;color:#4d4d4d;}
- .lm_lm{margin:10px 10px;}
- .lable{margin-right:5px;diaplay:inline;}
- </style>
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
- <script src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js" type="text/javascript" ></script>
- <script type="text/javascript">
- var _workbench=$("#workbench",parent.document.body).contents();
- var context=_workbench.find("[objid='${objid}']")[0].outerHTML;
- var cmstag=_workbench.find("[objid='${objid}']").attr("cmstag");
- var labelID1="";
- if(cmstag!=null&&cmstag!="undefined"){
- labelID1=cmstag.split(":")[0];
- }
- $(function(){
- if(labelID1=="xxlb"||labelID1=="lnlbfy"){
- $("#but").css('display','block');
- }
- document.getElementById("context").value = context;
- })
-
- function qd(){
- var contextedit=document.getElementById("context").value;
- _workbench.find("[objid='${objid}']")[0].outerHTML=contextedit;
- window.parent.closeDialog(window.parent.dialogIndex);
- }
-
- function getPosition(obj){
- var result = 0;
- if(obj.selectionStart){ //IE以外
- result = obj.selectionStart
- }else{ //IE
- var rng;
- if(obj.tagName == "textarea"){ //TEXTAREA
- rng = event.srcElement.createTextRange();
- rng.moveToPoint(event.x,event.y);
- }else{ //Text
- rng = document.selection.createRange();
- }
- rng.moveStart("character",-event.srcElement.value.length);
- result = rng.text.length;
- }
- return result;
- }
- function getValue(obj){
- if(labelID1=="xxlb"||labelID1=="lnlbfy"){
- var pos = getPosition(obj);
- var val1=obj.value.substr(0,pos);
- var val2=obj.value.substr(pos,obj.value.length);
-
- $("#val1").val(val1);
- $("#val2").val(val2);
-
-
- }
- }
-
- function edit(typeVal,name){
- var val1=$("#val1").val();
- var val2=$("#val2").val();
- var val3="";
- var f="$";
- if(typeVal=="infoURL"){
- val3="<a th:herf=\""+f+"{web.getStr('"+typeVal+"')}\" href='#'></a>";
- }else{
- val3="<span th:utext=\""+f+"{web.getStr('"+typeVal+"')}\" >"+name+"</span>";
- }
- document.getElementById("context").value = val1+val3+val2;
- }
- </script>
- </head>
- <body>
- <div><div id="nrmb" style="float:left;width: 80%;"><textarea cols="80" rows="20" name="context" id="context" onclick="getValue(this)"></textarea></div>
- <input type="hidden" id="val1">
- <input type="hidden" id="val2">
- <div style="display:none; " id="but">
- <input type="button" value="标题" onclick="edit('listtitle','标题')"><br>
- <input type="button" value="副标题" onclick="edit('Subhead','副标题')"><br>
- <input type="button" value="作者" onclick="edit('Author','作者')"><br>
- <input type="button" value="发布时间" onclick="edit('ReleaseTime','发布时间')"><br>
- <input type="button" value="摘要" onclick="edit('InfoSummary','摘要')"><br>
- <input type="button" value="文章链接" onclick="edit('infoURL','文章链接')"><br>
- </div></div>
- <div style="text-align:center;margin-top:40px;"><button id="qd" onclick="qd()" style="background:#4285f4;border-radius:5px;color:#fff;border:none;padding:8px 18px;font-size:13px;margin-right: 10px;">确定</button></div>
- </body>
- </html>
|