12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>模板动态化</title>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
- <script type="text/javascript">
- jQuery.fn.outerHTML = function(s) {
- return s ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html();
- };
- var dialogIndex;
- function showDialog(dialogID,dialogTitle,dialogURL,dialogWidth,dialogHeight){
- dialogIndex=layer.open({
- type: 2,
- title: dialogTitle,
- shade: 0.8,
- area: [dialogWidth+'px', dialogHeight+'px'],
- content: '${ctx}'+dialogURL //iframe的url
- });
- }
- function closeDialog(index){
- layer.close(index);
- }
- $(function(){
- $("#bc").click(function(){
- var _workbench=$("#workbench").contents();
- //alert(_workbench.find("html").outerHTML());
- _workbench.find(".dynamicembed").remove();
- _workbench.find("div[id^='yShade']").remove();
- //myconsole.log(_workbench.find("html").outerHTML());
- var temp=_workbench.find("html").outerHTML();
- //var temp=_workbench.find("html");
- var doctype="<!DOCTYPE html >";
-
- $.post("${ctx}/myconsole/template/save",{"tempID":"${tempID}","tempContent":doctype+temp},function(data){
- layer.msg(data);
- })
- })
- })
- </script>
- </head>
- <body>
- <div style="text-align:center;margin-bottom:10px;"><button id="bc" style="background:#f4a542;border-radius:5px;color:#fff;border:none;padding:8px 18px;font-size:13px;">保存</button></div>
- <iframe id="workbench" name="workbench" src="${ctx}/myconsole/dynamic/workbench?tempID=${tempID}" width=100% height=900></iframe>
- </body>
- </html>
|