BVB Source Codes

Easy to point the content management system DianCMS v6.0.0 SQL version Show Comment.js Source code

Return Download Easy to point the content management system DianCMS v6.0.0 SQL version: download Comment.js Source code - Download Easy to point the content management system DianCMS v6.0.0 SQL version Source code - Type:.js
  1. function KeyPress() {
  2.     if (event.keyCode == 13) {
  3.         UserLogin();
  4.     }
  5. }
  6.  
  7. function CommentUserLogin() {
  8.     var username = document.getElementById("txtCommentUserName").value;
  9.     var password = document.getElementById("txtCommentPassWord").value;
  10.     var code = document.getElementById("txtComment_Code").value;
  11.     D.BLL.B_User.CommentAjaxLogin(username, password, "no", code, UserLogCommentCallBack);
  12. }
  13.  
  14. function UserLogCommentCallBack(res) {
  15.     if (res.value.split("|")[0] == "True") {
  16.         document.getElementById("UserLogin").style.display = "none";
  17.         document.getElementById("AddComment").style.display = "";
  18.         switch (res.value.split("|")[1]) {
  19.             case "text":
  20.                 document.getElementById("Text").style.display = "";
  21.                 document.getElementById("Ubb").style.display = "none";
  22.                 document.getElementById("Html").style.display = "none";
  23.                 break;
  24.             case "ubb":
  25.                 document.getElementById("Text").style.display = "none";
  26.                 document.getElementById("Ubb").style.display = "";
  27.                 document.getElementById("Html").style.display = "none";
  28.                 break;
  29.             case "html":
  30.                 document.getElementById("Text").style.display = "none";
  31.                 document.getElementById("Ubb").style.display = "none";
  32.                 document.getElementById("Html").style.display = "";
  33.                 break;
  34.         }
  35.         if (document.getElementById("imgVerify2") != null)
  36.             document.getElementById("imgVerify2").src = document.getElementById("imgVerify2").src + Math.random();
  37.     }
  38.     else {
  39.         alert(res.value.split("|")[0]);
  40.     }
  41. }
  42.  
  43. function SetComment() {
  44.     var ModelId = document.getElementById("txtModelId").value;
  45.     var ColId = document.getElementById("txtColId").value;
  46.     var InfoId = document.getElementById("txtInfoId").value;
  47.     var editor = document.getElementById("txtEditorType").value;
  48.     var _editor = document.getElementById("txtEditor").value;
  49.     var star = document.getElementById("txtStar").value;
  50.     var TypeCount = document.getElementsByName("RadioPosition");
  51.     var position;
  52.     var p = 0;
  53.     if (navigator.appName == "Microsoft Internet Explorer") {
  54.         p = 1;
  55.     }
  56.     for (var i = p; i < TypeCount.length; i++) {
  57.         if (TypeCount[i].checked) {
  58.             position = TypeCount[i].value;
  59.             break;
  60.         }
  61.     }
  62.     var content = "";
  63.  
  64.     switch (editor) {
  65.         case "text":
  66.             content = document.getElementById("txtContent").value;
  67.             break;
  68.         case "ubb":
  69.             content = document.getElementById("Ubb1_Content").value;
  70.             break;
  71.         case "html":
  72.             switch (_editor) {
  73.                 case "fckeditor":
  74.                     var oEditor = FCKeditorAPI.GetInstance("DianCMS_Content");
  75.                     content = oEditor.GetXHTML(true);
  76.                     break;
  77.                 case "ckeditor":
  78.                     content = CKEDITOR.instances.DianCMS_Content.getData()
  79.                     break;
  80.                 case "ueditor":
  81.                     content = UE.getEditor('DianCMS_Content').getContent();
  82.                     break;
  83.                 case "kindeditor":
  84.                     content = DianCMS_Content_editor.html();
  85.                     break;
  86.             }
  87.             break;
  88.     }
  89.     var code = "";
  90.     if (document.getElementById("txtCommentCode") != null)
  91.         code = document.getElementById("txtCommentCode").value;
  92.     D.BLL.B_Comment.Add(ModelId, ColId, InfoId, content, code, star, position, InfoCallBack);
  93. }
  94.  
  95. function InfoCallBack(res) {
  96.     if (res.value == "True") {
  97.         alert("成功发布评论");
  98.         window.location.reload();
  99.     }
  100.     else {
  101.         alert(res.value);
  102.     }
  103. }
  104.  
  105. function __start() {
  106.     var initialize_width = 0;
  107.     if (document.getElelmentById) { return false };
  108.     if (document.getElementsByTagName == null) { return false; }
  109.     var startLevelObj = document.getElementById("www_diancms_com");
  110.     if (startLevelObj == null) { return false; }
  111.     initialize_width = parseInt(startLevelObj.getAttribute("star_width"), 10);
  112.     if (isNaN(initialize_width) || initialize_width == 0) { return false; }
  113.     var ul_obj = startLevelObj.getElementsByTagName("ul");
  114.     if (ul_obj.length < 1) { return false; }
  115.     var length = ul_obj.length;
  116.     var li_length = 0;
  117.     var a_length = 0;
  118.     var li_obj = null;
  119.     var a_obj = null;
  120.     var defaultInputObj = null;
  121.     var defaultValue = null;
  122.     for (var i = 0; i < length; i++) {
  123.         li_obj = ul_obj[i].getElementsByTagName("li");
  124.         li_length = li_obj.length;
  125.         if (li_length < 0) { return false; }
  126.         //获取默认值
  127.         defaultInputObj = li_obj[0].getElementsByTagName("input"); if (!defaultInputObj) { return false; }
  128.         defaultValue = parseInt(defaultInputObj[0].value, 10);
  129.         if (!isNaN(defaultValue) && defaultValue != 0) {
  130.             //alert("有初始值!");
  131.             //li_obj[1].style.width=initialize_width*defaultValue+"px";
  132.             //defaultValue=0;
  133.         }
  134.         for (var j = 0; j < li_length; j++) {
  135.             a_obj = li_obj[j].getElementsByTagName("a");
  136.             if (a_obj.length < 1) { continue; }
  137.             if (a_obj[0].className.indexOf("star") > 0) {
  138.                 a_obj[0].onclick = function() {
  139.                     return give_value(this);
  140.                 }
  141.                 a_obj[0].onfocus = function() {
  142.                     this.blur();
  143.                 }
  144.             }
  145.         }
  146.     }
  147. }
  148. function give_value(obj) {
  149.     var status = true;
  150.     var parent_obj = obj.parentNode;
  151.     var i = 0;
  152.     while (status) {
  153.         i++;
  154.         if (parent_obj.nodeName == "UL") { break; }
  155.         parent_obj = parent_obj.parentNode;
  156.         if (i > 1000) { break; } //防止找不到ul发生死循环
  157.     }
  158.     var hidden_input = parent_obj.getElementsByTagName("input")[0];
  159.     if (hidden_input.length < 1) { /*alert("sorry?\nprogram error!")*/; }
  160.     var txt = obj.firstChild.nodeValue; //确保不能存在空格哦,因为这里用的firstChild
  161.     if (isNaN(parseInt(txt, 10))) { /*alert('level error!')*/; return false; }
  162.     hidden_input.setAttribute("value", txt.toString());
  163.     //固定选中状态,先找到初始化颜色那个li
  164.     var current_li = parent_obj.getElementsByTagName("li");
  165.     var length = current_li.length;
  166.     var ok_li_obj = null;
  167.     for (var i = 0; i < length; i++) {
  168.         if (current_li[i].className.indexOf("current_rating") >= 0) {
  169.             ok_li_obj = current_li[i]; break; //找到
  170.         }
  171.     }
  172.     __current_width = txt * 14;
  173.     document.getElementById("txtStar").value = txt;
  174.     ok_li_obj.style.width = __current_width + "px";
  175.     return false;
  176. }
  177. __start();
downloadComment.js Source code - Download Easy to point the content management system DianCMS v6.0.0 SQL version Source code
Related Source Codes/Software:
Ray speed v7.0 wage query system - To modify the software to conduct a comprehensive ... 2016-08-19
Address book v1.0 FaLiang three layer - This Demo is a three layer address book source cod... 2016-08-19
Deng Xi v2.4 website help system - Deng Xi website help system is a very useful help ... 2016-08-19
1.0 housing, rental housing sale platform - Rent housing rent out platform is a very typical r... 2016-08-19
Cloud on the CMS (SyCms) v1.95 - Add menus and blocks the system style functionalit... 2016-08-19
KesionICMS intelligent website system (school) v3.7 formal version - For school management web site, the kesion forward... 2016-08-19
KesionICMS intelligent website system (enterprise edition) v3.7 formal version - KesionICMS intelligent website (enterprise edition... 2016-08-19
KesionICMS intelligent website system (government) v3.7 formal version - Government Portal website construction Establish t... 2016-08-19
KesionICMS intelligent website system (gm) v3.7 formal version - KESIONICMS intelligent building systems with a fle... 2016-08-19
KesionIMALL v3.7 formal version online mall system - KESIONIMALLV3.7 online shop system, as a new e-com... 2016-08-19
fatfree - A powerful yet easy-to-use PHP micro-framework des... 2017-05-13
TSA-Travel-Sentry-master-keys - 3D reproduction of TSA Master key 2017-05-12
python3-cookbook - "The Python Cookbook" 3 rd Edition Translatio 2017-05-12
isso - a Disqus alternative https:... 2017-05-12
hologram - A markdown based documentation system for style gu... 2017-05-12
www.html5rocks.com - ....a top-notch resource for web developer 2017-05-12
MTStatusBarOverlay - A custom iOS status bar overlay seen in Apps like ... 2017-05-12
blueprint - Reverse engineer server configuration ... 2017-05-12
PullToRefresh - A simple iPhone TableViewController for adding the... 2017-05-12
mrjob - Run MapReduce jobs on Hadoop or Amazon Web Service... 2017-05-11

 Back to top