BVB Source Codes

PeterCMS3 v3.2 Show fullscreen.html Source code

Return Download PeterCMS3 v3.2: download fullscreen.html Source code - Download PeterCMS3 v3.2 Source code - Type:.html
  1. <html>
  2. <head><title>全屏编辑</title>
  3. <style type="text/css"> body {  margin: 0px; border: 0px; background-color: buttonface; } </style>
  4.  
  5. <script>
  6.  
  7. // if we pass the "window" object as a argument and then set opener to
  8. // equal that we can refer to dialogWindows and popupWindows the same way
  9. if (window.dialogArguments) { opener = window.dialogArguments; }
  10.  
  11. var _editor_url = "../";
  12. document.write('<scr'+'ipt src="' +_editor_url+ 'editor.js" language="Javascript1.2"></scr'+'ipt>');
  13.  
  14. var parent_objname = location.search.substring(1,location.search.length);  // parent editor objname
  15. var parent_config  = opener.document.all[parent_objname].config;
  16.  
  17. var config         = cloneObject( parent_config );
  18. var objname        = 'editor'; // name of this editor
  19.  
  20. //  DOMViewerObj = config;
  21. //  DOMViewerName = 'config';
  22. //  window.open('/innerHTML/domviewer.htm');  
  23.  
  24. /* ---------------------------------------------------------------------- *\
  25.   Function    :
  26.   Description :
  27. \* ---------------------------------------------------------------------- */
  28.  
  29. function _CloseOnEsc() {
  30.   if (event.keyCode == 27) {
  31.     update_parent();
  32.     window.close();
  33.     return;
  34.   }
  35. }
  36.  
  37. /* ---------------------------------------------------------------------- *\
  38.   Function    : cloneObject
  39.   Description : copy an object by value instead of by reference
  40.   Usage       : var newObj = cloneObject(oldObj);
  41. \* ---------------------------------------------------------------------- */
  42.  
  43. function cloneObject(obj) {
  44.   var newObj          = new Object;
  45.  
  46.   // check for array objects
  47.   if (obj.constructor.toString().indexOf('function Array(') == 1) {
  48.     newObj = obj.constructor();
  49.   }
  50.  
  51.   for (var n in obj) {
  52.     var node = obj[n];
  53.     if (typeof node == 'object') { newObj[n] = cloneObject(node); }
  54.     else                         { newObj[n] = node; }
  55.   }
  56.  
  57.   return newObj;
  58. }
  59.  
  60. /* ---------------------------------------------------------------------- *\
  61.   Function    : resize_editor
  62.   Description : resize the editor when the user resizes the popup
  63. \* ---------------------------------------------------------------------- */
  64.  
  65. function resize_editor() {  // resize editor to fix window
  66.   var editor = document.all['_editor_editor'];
  67.  
  68.   newWidth  = document.body.offsetWidth;
  69.   newHeight = document.body.offsetHeight - editor.offsetTop;
  70.  
  71.   if (newWidth < 0) { newWidth = 0; }
  72.  if (newHeight < 0) { newHeight = 0; }
  73.  
  74.  editor.style.width  = newWidth;
  75.  editor.style.height = newHeight;
  76. }
  77.  
  78. /* ---------------------------------------------------------------------- *\
  79.  Function    : init
  80.  Description : run this code on page load
  81. \* ---------------------------------------------------------------------- */
  82.  
  83. function init() {
  84.  // change maximize button to minimize button
  85.  config.btnList["popupeditor"] = ['popupeditor', 'Minimize Editor',  'update_parent(); window.close();', 'fullscreen_minimize.gif'];
  86.  
  87.  // set htmlmode button to refer to THIS editor
  88.  config.btnList["htmlmode"]    = ['HtmlMode',    'View HTML Source', 'editor_setmode(\'editor\')',  'ed_html.gif'];
  89.  
  90.  // change image url to be relative to current path
  91.  config.imgURL = "../images/";
  92.  
  93.  // generate editor and resize it
  94.  editor_generate('editor', config);
  95.  resize_editor();
  96.  
  97.  // switch mode if needed
  98.  if (parent_config.mode == 'textedit') { editor_setmode(objname, 'textedit'); }
  99.  
  100.  // set child window contents
  101.  var parentHTML = opener.editor_getHTML(parent_objname);
  102.  editor_setHTML(objname, parentHTML);
  103.  
  104.  // continuously update parent editor window
  105.  window.setInterval(update_parent, 333);
  106.  
  107.  // setup event handlers
  108.  document.body.onkeypress = _CloseOnEsc;
  109.  window.onresize = resize_editor;
  110. }
  111.  
  112. /* ---------------------------------------------------------------------- *\
  113.  Function    : update_parent
  114.  Description : update parent window editor field with contents from child window
  115. \* ---------------------------------------------------------------------- */
  116.  
  117. function update_parent() {
  118.  var childHTML = editor_getHTML(objname);
  119.  opener.editor_setHTML(parent_objname, childHTML);
  120. }
  121.  
  122.  
  123. </script>
  124. </head>
  125. <body scroll="no" onload="init()" onunload="update_parent()">
  126.  
  127. <div style="margin: 0 0 0 0; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; "></div>
  128.  
  129. <textarea name="editor" style="width:100%; height:300px"></textarea><br>
  130.  
  131. </body></html>
downloadfullscreen.html Source code - Download PeterCMS3 v3.2 Source code
Related Source Codes/Software:
Subdomain hosting edition v1.9 s taobao, pat - The background site admin 2016-09-21
Imitation green download station perfect version - Before increased | software home page, on the basi... 2016-09-21
C9 v2.1.1 static post system - Program USES ASP + ACC structure design and develo... 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
Pcook CMS bubble guest v3.0 SDCMS version - Developed by Asp+Access, and meet the needs of sma... 2016-09-21
Download IT mop stand (with site to download the database ACC) - Background management: http://www.xxx.com/admin/ad... 2016-09-21
Jie Yang v0.6.3 article system - System functions: 1, the system settings A confi... 2016-09-21
Seven VIP jubilee dance CMS management system - The Admin \ Inc \ Mold_Inc Asp 2016-09-21
126oo CMS film station system - This procedure ASP + ACC/ASP + SQL, using new kern... 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