Ueditor integrated use (sharepoint Integration), ueditorsharepoint

Source: Internet
Author: User

Ueditor integrated use (sharepoint Integration), ueditorsharepoint

Ueditor deployment path (integrated with sharepoint)

C: \ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 15 \ template \ layouts \ Resource \ ueditor \ net

Note: You need to "convert to application"

You need to modify the uedittor. config. js File

The reference code of the front-end page is as follows:

 

1 <table> 2 <tr> 3 <td style = "display: block;"> 4 <p> sorting Number: </p> 5 </td> 6 <td> 7 <input id = "txt_num" type = "text" style = "width: 300px; "/> 8 </td> 9 </tr> 10 <tr> 11 <td> 12 <p> title: </p> 13 </td> 14 <td> 15 <table style = "width: 100%; "> 16 <tr> 17 <td> 18 <input id =" txt_title "type =" text "style =" width: 300px; "/> </td> 19 <td style =" text-align: right; "> 20 <input type =" button "onclick =" saveContent () "val Ue = "save"/> 21 <input type = "button" onclick = "skip () "value =" cancel "/> 22 </td> 23 </tr> 24 </table> 25 </td> 26 </tr> 27 <tr> 28 <td style = "display: block; "> 29 <p> content: </p> 30 </td> 31 <td> 32 <script id = "editor" type = "text/plain" style = "width: 1024px; height: 500px; "> </script> 33 </td> 34 </tr> 35 <tr> 36 <td> </td> 37 <td style =" text-align: right; "> 38 <input type =" button "onclick =" saveContent () "valu E = "save"/> 39 <input type = "button" onclick = "skip () "value =" cancel "/> 40 </td> 41 </tr> 42 </table> 43 </div> 44 <% }%> 45 <script type =" text/javascript "> 46 // instantiate editor 47 // we recommend that you use the factory method getEditor to create and reference an editor instance, if you reference this editor under a closure, you can directly call UE. getEditor ('editor') can get the relevant instance 48 // var ue = UE. getEditor ('editor'); 49 50 function saveContent () {51 var arr = UE. getEditor ('editor '). getContent (); 52 var cur_title = $ ('# txt_title '). v Al (); 53 var itemId = "<% = item_id %>"; 54 var listName = "<% = Props_Data_listID %> "; 55 var operation = "<% = operation %>"; 56 var serialNumber = $ ('# txt_num '). val (); 57 var myreg =/^ [0-9,] * $/; 58 if (! Myreg. test (serialNumber) | serialNumber = "") {59 alert ('enter a valid sorting number (1-99 )! '); 60 return; 61 if (serialNumber <1 | serialNumber> 99) {62 alert ('enter a valid sorting number (1-99 )! '); 63 return; 64} 65} 66 67 if (cur_title = "") {68 alert (' enter the title! '); 69 return; 70} 71 72 $. ajax ({73 type: "post", 74 url :".. /_ layouts/15/Resource/ueditor/newMagazineSave. ashx ", 75 data: {" content ": arr," title ": cur_title," operation ": operation," listName ": listName," itemId ": itemId, "serialNumber": serialNumber}, 76 datatype: "text", 77 success: function () {78 window. close (); <% -- window. location. href = "<% = showUrl %>"; -- %> 79}, 80 error: function (e) {81 alert (e); 82} 83 }); 84} 85 86 87 function skip () {88 window. close (); 89} 90 91 function setContent (isAppendTo) {92 var cur_content = "<% = content %>"; 93 UE. getEditor ('editor '). setContent (cur_content, isAppendTo); 94} 95 96 $ (window ). load (function () {97 var ue = UE. getEditor ('editor'); 98 var operation = "<% = operation %>"; 99 if (operation = "edit") 100 {101 ue. ready (function () {102 setContent (); 103}); 104 $ ("# txt_num "). val = "<% = serialNumber %>"; 106 document. getElementById ("txt_num "). value = "<% = serialNumber %>"; 107 $ ("# txt_title "). val = "<% = title %>"; 109 document. getElementById ("txt_title "). value = "<% = title %>"; 110} 111}); 112 113 </script>

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.