PHP Classes

File: editor/codemirror/addon/display/fullscreen.js

Recommend this page to a friend!
  Classes of Cedric Maenetja   Custom PHP HTML Parser   editor/codemirror/addon/display/fullscreen.js   Download  
File: editor/codemirror/addon/display/fullscreen.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Custom PHP HTML Parser
Process HTML to replace it with parameter values
Author: By
Last change:
Date: 2 years ago
Size: 1,497 bytes
 

Contents

Class file image Download
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/5/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { if (old == CodeMirror.Init) old = false; if (!old == !val) return; if (val) setFullscreen(cm); else setNormal(cm); }); function setFullscreen(cm) { var wrap = cm.getWrapperElement(); cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, width: wrap.style.width, height: wrap.style.height}; wrap.style.width = ""; wrap.style.height = "auto"; wrap.className += " CodeMirror-fullscreen"; document.documentElement.style.overflow = "hidden"; cm.refresh(); } function setNormal(cm) { var wrap = cm.getWrapperElement(); wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); document.documentElement.style.overflow = ""; var info = cm.state.fullScreenRestore; wrap.style.width = info.width; wrap.style.height = info.height; window.scrollTo(info.scrollLeft, info.scrollTop); cm.refresh(); } });