BVB Source Codes

Pcook CMS bubble guest v3.0 SDCMS version Show menu.js Source code

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download menu.js Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code - Type:.js
  1. /*
  2. *######################################
  3. * eWebEditor v4.00 - Advanced online web based WYSIWYG HTML editor.
  4. * Copyright (c) 2003-2007 eWebSoft.com
  5. *
  6. * For further information go to http://www.ewebsoft.com/
  7. * This copyright notice MUST stay intact for use.
  8. *######################################
  9. */
  10.  
  11.  
  12. var sMenuHr="<tr><td align=center valign=middle height=2><TABLE border=0 cellpadding=0 cellspacing=0 width="+(lang["UIMenuWidth"]-22)+" height=2><tr><td height=1 class=HrShadow><\/td><\/tr><tr><td height=1 class=HrHighLight><\/td><\/tr><\/TABLE><\/td><\/tr>";
  13. var sMenu1="<TABLE border=0 cellpadding=0 cellspacing=0 class=Menu width="+lang["UIMenuWidth"]+"><tr><td width=18 valign=bottom align=center style='background:url(sysimage/contextmenu.gif);background-position:bottom;'><\/td><td width="+(lang["UIMenuWidth"]-18)+" class=RightBg><TABLE border=0 cellpadding=0 cellspacing=0>";
  14. var sMenu2="<\/TABLE><\/td><\/tr><\/TABLE>";
  15.  
  16. var oPopupMenu = null;
  17. if (BrowserInfo.IsIE55OrMore){
  18.         oPopupMenu = window.createPopup();
  19. }
  20.  
  21.  
  22. function getMenuRow(s_Disabled, s_Event, s_Image, s_Html) {
  23.         var s_MenuRow = "";
  24.         s_MenuRow = "<tr><td align=center valign=middle><TABLE border=0 cellpadding=0 cellspacing=0 width="+(lang["UIMenuWidth"]-18)+"><tr "+s_Disabled+"><td valign=middle height=20 class=MouseOut onMouseOver=this.className='MouseOver'; onMouseOut=this.className='MouseOut';";
  25.         if (s_Disabled==""){
  26.                 s_MenuRow += " onclick=\"parent."+s_Event+";parent.oPopupMenu.hide();\"";
  27.         }
  28.         s_MenuRow += ">"
  29.         if (s_Image !=""){
  30.                 s_MenuRow += "&nbsp;<img border=0 src='buttonimage/"+config.ButtonDir+"/"+s_Image+"' width=20 height=20 align=absmiddle "+s_Disabled+">&nbsp;";
  31.         }else{
  32.                 s_MenuRow += "&nbsp;";
  33.         }
  34.         s_MenuRow += s_Html+"<\/td><\/tr><\/TABLE><\/td><\/tr>";
  35.         return s_MenuRow;
  36.  
  37. }
  38.  
  39.  
  40. function getFormatMenuRow(menu, html, image){
  41.         var s_Disabled = "";
  42.         if (!eWebEditor.document.queryCommandEnabled(menu)){
  43.                 s_Disabled = "disabled";
  44.         }
  45.         var s_Event = "format('"+menu+"')";
  46.         var s_Image = menu+".gif";
  47.         if (image){
  48.                 s_Image = image;
  49.         }
  50.         return getMenuRow(s_Disabled, s_Event, s_Image, html)
  51. }
  52.  
  53.  
  54. function getTableMenuRow(what){
  55.         var s_Menu = "";
  56.         var s_Disabled = "disabled";
  57.         switch(what){
  58.         case "TableInsert":
  59.                 if (!isTableSelected()) s_Disabled="";
  60.                 s_Menu += getMenuRow(s_Disabled, "TableInsert()", "tableinsert.gif", lang["TableInsert"])
  61.                 break;
  62.         case "TableProp":
  63.                 if (isTableSelected()||isCursorInTableCell()) s_Disabled="";
  64.                 s_Menu += getMenuRow(s_Disabled, "TableProp()", "tableprop.gif", lang["TableProp"])
  65.                 break;
  66.         case "TableCell":
  67.                 if (isCursorInTableCell()) s_Disabled="";
  68.                 s_Menu += getMenuRow(s_Disabled, "TableCellProp()", "tablecellprop.gif", lang["TableCellProp"])
  69.                 s_Menu += getMenuRow(s_Disabled, "TableCellSplit()", "tablecellsplit.gif", lang["TableCellSplit"])
  70.                 s_Menu += sMenuHr;
  71.                 s_Menu += getMenuRow(s_Disabled, "TableRowProp()", "tablerowprop.gif", lang["TableRowProp"])
  72.                 s_Menu += getMenuRow(s_Disabled, "TableRowInsertAbove()", "tablerowinsertabove.gif", lang["TableRowInsertAbove"]);
  73.                 s_Menu += getMenuRow(s_Disabled, "TableRowInsertBelow()", "tablerowinsertbelow.gif", lang["TableRowInsertBelow"]);
  74.                 s_Menu += getMenuRow(s_Disabled, "TableRowMerge()", "tablerowmerge.gif", lang["TableRowMerge"]);
  75.                 s_Menu += getMenuRow(s_Disabled, "TableRowSplit(2)", "tablerowsplit.gif", lang["TableRowSplit"]);
  76.                 s_Menu += getMenuRow(s_Disabled, "TableRowDelete()", "tablerowdelete.gif", lang["TableRowDelete"]);
  77.                 s_Menu += sMenuHr;
  78.                 s_Menu += getMenuRow(s_Disabled, "TableColInsertLeft()", "tablecolinsertleft.gif", lang["TableColInsertLeft"]);
  79.                 s_Menu += getMenuRow(s_Disabled, "TableColInsertRight()", "tablecolinsertright.gif", lang["TableColInsertRight"]);
  80.                 s_Menu += getMenuRow(s_Disabled, "TableColMerge()", "tablecolmerge.gif", lang["TableColMerge"]);
  81.                 s_Menu += getMenuRow(s_Disabled, "TableColSplit(2)", "tablecolsplit.gif", lang["TableColSplit"]);
  82.                 s_Menu += getMenuRow(s_Disabled, "TableColDelete()", "tablecoldelete.gif", lang["TableColDelete"]);
  83.                 break;
  84.         }
  85.         return s_Menu;
  86. }
  87.  
  88.  
  89. function showContextMenu(event){
  90.         if (!bEditMode) return false;
  91.  
  92.         var width = lang["UIMenuWidth"];
  93.         var height = 0;
  94.         var lefter = event.clientX;
  95.         var topper = event.clientY;
  96.  
  97.         var oPopDocument = oPopupMenu.document;
  98.         var oPopBody = oPopupMenu.document.body;
  99.  
  100.         var sMenu="";
  101.        
  102.         sMenu += getFormatMenuRow("cut", lang["Cut"]);
  103.         sMenu += getFormatMenuRow("copy", lang["Copy"]);
  104.         sMenu += getFormatMenuRow("paste", lang["Paste"]);
  105.         sMenu += getFormatMenuRow("delete", lang["Delete"]);
  106.         sMenu += getFormatMenuRow("selectall", lang["SelectAll"]);
  107.         sMenu += sMenuHr;
  108.         height += 102;
  109.  
  110.         if (isCursorInTableCell()){
  111.                 sMenu += getTableMenuRow("TableProp");
  112.                 sMenu += getTableMenuRow("TableCell");
  113.                 sMenu += sMenuHr;
  114.                 height += 286;
  115.         }
  116.  
  117.         if (isControlSelected("TABLE")){
  118.                 sMenu += getTableMenuRow("TableProp");
  119.                 sMenu += sMenuHr;
  120.                 height += 22;
  121.         }
  122.  
  123.         if (isControlSelected("IMG")){
  124.                 sMenu += getMenuRow("", "showDialog('img.htm', true)", "img.gif", lang["CMenuImg"]);
  125.                 sMenu += sMenuHr;
  126.                 sMenu += getMenuRow("", "zIndex('forward')", "forward.gif", lang["zIndexForward"]);
  127.                 sMenu += getMenuRow("", "zIndex('backward')", "backward.gif", lang["zIndexBackward"]);
  128.                 sMenu += sMenuHr;
  129.                 height += 64;
  130.         }
  131.  
  132.         if (tagInSelection("P")){
  133.                 sMenu += getMenuRow("", "showDialog('paragraph.htm', true)", "paragraph.gif", lang["CMenuParagraph"]);
  134.                 sMenu += sMenuHr;
  135.                 height += 22;
  136.         }
  137.  
  138.         sMenu += getMenuRow("", "findReplace()", "findreplace.gif", lang["FindReplace"]);
  139.         height += 20;
  140.  
  141.         sMenu = sMenu1 + sMenu + sMenu2;
  142.  
  143.         oPopDocument.open();
  144.         oPopDocument.write(config.StyleMenuHeader+sMenu);
  145.         oPopDocument.close();
  146.  
  147.         height+=2;
  148.         if(lefter+width > document.body.clientWidth) lefter=lefter-width;
  149.         //if(topper+height > document.body.clientHeight) topper=topper-height;
  150.  
  151.         oPopupMenu.show(lefter, topper, width, height, eWebEditor.document.body);
  152.         return false;
  153.  
  154. }
  155.  
  156.  
  157. function showToolMenu(menu){
  158.         if (!bEditMode) return false;
  159.         var sMenu = ""
  160.         var width = lang["UIMenuWidth"];
  161.         var height = 0;
  162.  
  163.         var lefter = event.clientX;
  164.         var leftoff = event.offsetX
  165.         var topper = event.clientY;
  166.         var topoff = event.offsetY;
  167.  
  168.         var oPopDocument = oPopupMenu.document;
  169.         var oPopBody = oPopupMenu.document.body;
  170.  
  171.         switch(menu){
  172.         case "font":
  173.                 sMenu += getFormatMenuRow("bold", lang["Bold"], "bold.gif");
  174.                 sMenu += getFormatMenuRow("italic", lang["Italic"], "italic.gif");
  175.                 sMenu += getFormatMenuRow("underline", lang["UnderLine"], "underline.gif");
  176.                 sMenu += getFormatMenuRow("strikethrough", lang["StrikeThrough"], "strikethrough.gif");
  177.                 sMenu += sMenuHr;
  178.                 sMenu += getFormatMenuRow("superscript", lang["SuperScript"], "superscript.gif");
  179.                 sMenu += getFormatMenuRow("subscript", lang["SubScript"], "subscript.gif");
  180.                 sMenu += sMenuHr;
  181.                 sMenu += getMenuRow("", "showDialog('selcolor.htm?action=forecolor', true)", "forecolor.gif", lang["ForeColor"]);
  182.                 sMenu += getMenuRow("", "showDialog('selcolor.htm?action=backcolor', true)", "backcolor.gif", lang["BackColor"]);
  183.                 sMenu += sMenuHr;
  184.                 sMenu += getMenuRow("", "insert('big')", "tobig.gif", lang["Big"]);
  185.                 sMenu += getMenuRow("", "insert('small')", "tosmall.gif", lang["Small"]);
  186.                 height = 206;
  187.                 break;
  188.         case "paragraph":
  189.                 sMenu += getFormatMenuRow("JustifyLeft", lang["JustifyLeft"], "justifyleft.gif");
  190.                 sMenu += getFormatMenuRow("JustifyCenter", lang["JustifyCenter"], "justifycenter.gif");
  191.                 sMenu += getFormatMenuRow("JustifyRight", lang["JustifyRight"], "justifyright.gif");
  192.                 sMenu += getFormatMenuRow("JustifyFull", lang["JustifyFull"], "justifyfull.gif");
  193.                 sMenu += sMenuHr;
  194.                 sMenu += getFormatMenuRow("insertorderedlist", lang["OrderedList"], "insertorderedlist.gif");
  195.                 sMenu += getFormatMenuRow("insertunorderedlist", lang["UnOrderedList"], "insertunorderedlist.gif");
  196.                 sMenu += getFormatMenuRow("indent", lang["Indent"], "indent.gif");
  197.                 sMenu += getFormatMenuRow("outdent", lang["Outdent"], "outdent.gif");
  198.                 sMenu += sMenuHr;
  199.                 sMenu += getFormatMenuRow("insertparagraph", lang["Paragraph"], "insertparagraph.gif");
  200.                 sMenu += getMenuRow("", "insert('br')", "br.gif", lang["BR"]);
  201.                 sMenu += sMenuHr;
  202.                 sMenu += getMenuRow((tagInSelection("P")) ? "" : "disabled", "showDialog('paragraph.htm', true)", "paragraph.gif", lang["CMenuParagraph"]);
  203.                 height = 226;
  204.                 break;
  205.         case "edit":
  206.                 var s_Disabled = "";
  207.                 if (history.data.length <= 1 || history.position <= 0) s_Disabled = "disabled";
  208.                 sMenu += getMenuRow(s_Disabled, "goHistory(-1)", "undo.gif", lang["UnDo"])
  209.                 if (history.position >= history.data.length-1 || history.data.length == 0) s_Disabled = "disabled";
  210.                 sMenu += getMenuRow(s_Disabled, "goHistory(1)", "redo.gif", lang["ReDo"])
  211.                 sMenu += sMenuHr;
  212.                 sMenu += getFormatMenuRow("Cut", lang["Cut"], "cut.gif");
  213.                 sMenu += getFormatMenuRow("Copy", lang["Copy"], "copy.gif");
  214.                 sMenu += getFormatMenuRow("Paste", lang["Paste"], "paste.gif");
  215.                 sMenu += getMenuRow("", "PasteText()", "pastetext.gif", lang["PasteText"]);
  216.                 sMenu += getMenuRow("", "PasteWord()", "pasteword.gif", lang["PasteWord"]);
  217.                 sMenu += sMenuHr;
  218.                 sMenu += getFormatMenuRow("delete", lang["Delete"], "delete.gif");
  219.                 sMenu += getFormatMenuRow("RemoveFormat", lang["RemoveFormat"], "removeformat.gif");
  220.                 sMenu += sMenuHr;
  221.                 sMenu += getFormatMenuRow("SelectAll", lang["SelectAll"], "selectall.gif");
  222.                 sMenu += getFormatMenuRow("Unselect", lang["UnSelect"], "unselect.gif");
  223.                 sMenu += sMenuHr;
  224.                 sMenu += getMenuRow("", "findReplace()", "findreplace.gif", lang["FindReplace"]);
  225.                 height = 248;
  226.                 break;
  227.         case "object":
  228.                 sMenu += getMenuRow("", "showDialog('selcolor.htm?action=bgcolor', true)", "bgcolor.gif", lang["BgColor"]);
  229.                 sMenu += getMenuRow("", "showDialog('backimage.htm', true)", "bgpic.gif", lang["BackImage"]);
  230.                 sMenu += sMenuHr;
  231.                 sMenu += getMenuRow("", "absolutePosition()", "abspos.gif", lang["absolutePosition"]);
  232.                 sMenu += getMenuRow("", "zIndex('forward')", "forward.gif", lang["zIndexForward"]);
  233.                 sMenu += getMenuRow("", "zIndex('backward')", "backward.gif", lang["zIndexBackward"]);
  234.                 sMenu += sMenuHr;
  235.                 sMenu += getMenuRow("", "showBorders()", "showborders.gif", lang["ShowBorders"]);
  236.                 sMenu += sMenuHr;
  237.                 sMenu += getMenuRow("", "insert('quote')", "quote.gif", lang["Quote"]);
  238.                 sMenu += getMenuRow("", "insert('code')", "code.gif", lang["Code"]);
  239.                 height = 166;
  240.                 break;
  241.         case "component":
  242.                 sMenu += getMenuRow("", "showDialog('img.htm', true)", "img.gif", lang["Image"]);
  243.                 sMenu += getMenuRow("", "showDialog('flash.htm', true)", "flash.gif", lang["Flash"]);
  244.                 sMenu += getMenuRow("", "showDialog('media.htm', true)", "media.gif", lang["Media"]);
  245.                 sMenu += getMenuRow("", "showDialog('file.htm', true)", "file.gif", lang["File"]);
  246.                 sMenu += sMenuHr;
  247.                 sMenu += getMenuRow("", "showDialog('fieldset.htm', true)", "fieldset.gif", lang["Fieldset"]);
  248.                 sMenu += getMenuRow("", "showDialog('iframe.htm', true)", "iframe.gif", lang["Iframe"]);
  249.                 sMenu += getFormatMenuRow("InsertHorizontalRule", lang["HorizontalRule"], "inserthorizontalrule.gif");
  250.                 sMenu += getMenuRow("", "showDialog('marquee.htm', true)", "marquee.gif", lang["Marquee"]);
  251.                 sMenu += sMenuHr;
  252.                 sMenu += getMenuRow("", "createLink()", "createlink.gif", lang["CreateLink"]);
  253.                 sMenu += getMenuRow("", "showDialog('anchor.htm', true)", "anchor.gif", lang["Anchor"]);
  254.                 sMenu += getMenuRow("", "mapEdit()", "map.gif", lang["Map"]);
  255.                 sMenu += getFormatMenuRow("UnLink", lang["Unlink"], "unlink.gif");
  256.                 height = 244;
  257.                 break;
  258.         case "tool":
  259.                 sMenu += getMenuRow("", "showDialog('symbol.htm', true)", "symbol.gif", lang["Symbol"]);
  260.                 sMenu += getMenuRow("", "insert('excel')", "excel.gif", lang["Excel"]);
  261.                 sMenu += getMenuRow("", "showDialog('emot.htm', true)", "emot.gif", lang["Emot"]);
  262.                 sMenu += sMenuHr;
  263.                 sMenu += getMenuRow("", "showDialog('art.htm', true)", "art.gif", lang["Art"]);
  264.                 sMenu += sMenuHr;
  265.                 sMenu += getMenuRow("", "insert('nowdate')", "date.gif", lang["NowDate"]);
  266.                 sMenu += getMenuRow("", "insert('nowtime')", "time.gif", lang["NowTime"]);
  267.                 height = 124;
  268.                 break;
  269.         case "file":
  270.                 sMenu += getMenuRow("", "format('Refresh')", "refresh.gif", lang["Refresh"]);
  271.                 sMenu += sMenuHr;
  272.                 sMenu += getMenuRow("", "setMode('CODE')", "modecodebtn.gif", lang["ModeCode"]);
  273.                 sMenu += getMenuRow("", "setMode('EDIT')", "modeeditbtn.gif", lang["ModeEdit"]);
  274.                 sMenu += getMenuRow("", "setMode('TEXT')", "modetextbtn.gif", lang["ModeText"]);
  275.                 sMenu += getMenuRow("", "setMode('VIEW')", "modeviewbtn.gif", lang["ModeView"]);
  276.                 sMenu += sMenuHr;
  277.                 sMenu += getMenuRow("", "sizeChange(300)", "sizeplus.gif", lang["SizePlus"]);
  278.                 sMenu += getMenuRow("", "sizeChange(-300)", "sizeminus.gif", lang["SizeMinus"]);
  279.                 sMenu += sMenuHr;
  280.                 sMenu += getMenuRow("", "format('Print')", "print.gif", lang["Print"]);
  281.                 sMenu += sMenuHr;
  282.                 sMenu += getMenuRow("", "showDialog('about.htm')", "about.gif", lang["About"]);
  283.                 sMenu += getMenuRow("", "window.open('http://www.ewebeditor.net')", "site.gif", lang["Site"]);
  284.                 height = 208;
  285.                 break;
  286.         case "table":
  287.                 sMenu += getTableMenuRow("TableInsert");
  288.                 sMenu += getTableMenuRow("TableProp");
  289.                 sMenu += sMenuHr;
  290.                 sMenu += getTableMenuRow("TableCell");
  291.                 height = 306;
  292.                 break;
  293.         case "form":
  294.                 sMenu += getFormatMenuRow("InsertInputText", lang["FormText"], "formtext.gif");
  295.                 sMenu += getFormatMenuRow("InsertTextArea", lang["FormTextArea"], "formtextarea.gif");
  296.                 sMenu += getFormatMenuRow("InsertInputRadio", lang["FormRadio"], "formradio.gif");
  297.                 sMenu += getFormatMenuRow("InsertInputCheckbox", lang["FormCheckbox"], "formcheckbox.gif");
  298.                 sMenu += getFormatMenuRow("InsertSelectDropdown", lang["FormDropdown"], "formdropdown.gif");
  299.                 sMenu += getFormatMenuRow("InsertButton", lang["FormButton"], "formbutton.gif");
  300.                 height = 120;
  301.                 break;
  302.         case "zoom":
  303.                 for (var i=0; i<aZoomSize.length; i++){
  304.                         if (aZoomSize[i]==nCurrZoomSize){
  305.                                 sMenu += getMenuRow("", "doZoom("+aZoomSize[i]+")", "checked.gif", aZoomSize[i]+"%");
  306.                         }else{
  307.                                 sMenu += getMenuRow("", "doZoom("+aZoomSize[i]+")", "space.gif", aZoomSize[i]+"%");
  308.                         }
  309.                         height += 20;
  310.                 }
  311.                 break;
  312.         }
  313.        
  314.         sMenu = sMenu1 + sMenu + sMenu2;
  315.        
  316.         oPopDocument.open();
  317.         oPopDocument.write(config.StyleMenuHeader+sMenu);
  318.         oPopDocument.close();
  319.  
  320.         height+=2;
  321.         if(lefter+width > document.body.clientWidth) lefter=lefter-width+22;
  322.  
  323.         oPopupMenu.show(lefter - leftoff - 2, topper - topoff + 22, width, height, document.body);
  324.  
  325.         return false;
  326. }
  327.  
  328.  
downloadmenu.js Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code
Related Source Codes/Software:
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
Jie Yang v0.6.3 article system - System functions: 1, the system settings A confi... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
C9 v2.1.1 static post system - Program USES ASP + ACC structure design and develo... 2016-09-21
Imitation green download station perfect version - Before increased | software home page, on the basi... 2016-09-21
Subdomain hosting edition v1.9 s taobao, pat - The background site admin 2016-09-21
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top