BVB Source Codes

The latest thinkphp v5.2 work order system Show editor_plugin_src.js Source code

Return Download The latest thinkphp v5.2 work order system: download editor_plugin_src.js Source code - Download The latest thinkphp v5.2 work order system Source code - Type:.js
  1. /**
  2.  * editor_plugin_src.js
  3.  *
  4.  * Copyright 2009, Moxiecode Systems AB
  5.  * Released under LGPL License.
  6.  *
  7.  * License: http://tinymce.moxiecode.com/license
  8.  * Contributing: http://tinymce.moxiecode.com/contributing
  9.  */
  10.  
  11. (function() {
  12.         /**
  13.          * Auto Resize
  14.          *
  15.          * This plugin automatically resizes the content area to fit its content height.
  16.          * It will retain a minimum height, which is the height of the content area when
  17.          * it's initialized.
  18.          */
  19.         tinymce.create('tinymce.plugins.AutoResizePlugin', {
  20.                 /**
  21.                  * Initializes the plugin, this will be executed after the plugin has been created.
  22.                  * This call is done before the editor instance has finished it's initialization so use the onInit event
  23.                  * of the editor instance to intercept that event.
  24.                  *
  25.                  * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
  26.                  * @param {string} url Absolute URL to where the plugin is located.
  27.                  */
  28.                 init : function(ed, url) {
  29.                         var t = this, oldSize = 0;
  30.  
  31.                         if (ed.getParam('fullscreen_is_enabled'))
  32.                                 return;
  33.  
  34.                         /**
  35.                          * This method gets executed each time the editor needs to resize.
  36.                          */
  37.                         function resize() {
  38.                                 var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
  39.  
  40.                                 // Get height differently depending on the browser used
  41.                                 myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
  42.  
  43.                                 // Don't make it smaller than the minimum height
  44.                                 if (myHeight > t.autoresize_min_height)
  45.                                         resizeHeight = myHeight;
  46.  
  47.                                 // If a maximum height has been defined don't exceed this height
  48.                                 if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
  49.                                         resizeHeight = t.autoresize_max_height;
  50.                                         body.style.overflowY = "auto";
  51.                                         de.style.overflowY = "auto"; // Old IE
  52.                                 } else {
  53.                                         body.style.overflowY = "hidden";
  54.                                         de.style.overflowY = "hidden"; // Old IE
  55.                                         body.scrollTop = 0;
  56.                                 }
  57.  
  58.                                 // Resize content element
  59.                                 if (resizeHeight !== oldSize) {
  60.                                         deltaSize = resizeHeight - oldSize;
  61.                                         DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
  62.                                         oldSize = resizeHeight;
  63.  
  64.                                         // WebKit doesn't decrease the size of the body element until the iframe gets resized
  65.                                         // So we need to continue to resize the iframe down until the size gets fixed
  66.                                         if (tinymce.isWebKit && deltaSize < 0)
  67.                                                 resize();
  68.                                 }
  69.                         };
  70.  
  71.                         t.editor = ed;
  72.  
  73.                         // Define minimum height
  74.                         t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
  75.  
  76.                         // Define maximum height
  77.                         t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
  78.  
  79.                         // Add padding at the bottom for better UX
  80.                         ed.onInit.add(function(ed){
  81.                                 ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
  82.                         });
  83.  
  84.                         // Add appropriate listeners for resizing content area
  85.                         ed.onChange.add(resize);
  86.                         ed.onSetContent.add(resize);
  87.                         ed.onPaste.add(resize);
  88.                         ed.onKeyUp.add(resize);
  89.                         ed.onPostRender.add(resize);
  90.  
  91.                         if (ed.getParam('autoresize_on_init', true)) {
  92.                                 ed.onLoad.add(resize);
  93.                                 ed.onLoadContent.add(resize);
  94.                         }
  95.  
  96.                         // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
  97.                         ed.addCommand('mceAutoResize', resize);
  98.                 },
  99.  
  100.                 /**
  101.                  * Returns information about the plugin as a name/value array.
  102.                  * The current keys are longname, author, authorurl, infourl and version.
  103.                  *
  104.                  * @return {Object} Name/value array containing information about the plugin.
  105.                  */
  106.                 getInfo : function() {
  107.                         return {
  108.                                 longname : 'Auto Resize',
  109.                                 author : 'Moxiecode Systems AB',
  110.                                 authorurl : 'http://tinymce.moxiecode.com',
  111.                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
  112.                                 version : tinymce.majorVersion + "." + tinymce.minorVersion
  113.                         };
  114.                 }
  115.         });
  116.  
  117.         // Register plugin
  118.         tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
  119. })();
  120.  
downloadeditor_plugin_src.js Source code - Download The latest thinkphp v5.2 work order system Source code
Related Source Codes/Software:
V3.3.6 Workerman high-performance PHP Socket (framework) - High performance PHP Socket framework Workerman re... 2017-05-03
The phosphor meeting room reservation system MRBS (loop reservation v16.0) - The phosphor meeting room reservation system MRBS ... 2017-05-03
IDC v5.2.3 agent center - IDC Centre IDC for exploitation is a PHP+MySQL age... 2017-05-03
Zen master v9.0.1 project management software - Zen is the first domestic open source project mana... 2017-05-03
Ray speed v7.03 employee files management system - Employee files project is various, and some conten... 2017-05-03
HITCMS Haitian responsive electronic mechanical v3.0 foreign trade website source code - HITCMS Haitian response electronic machinery trade... 2017-05-03
Ray v7.02 speed survey system - Lightning speed survey system is a. NET+MSSQL deve... 2017-05-03
Cool HITCMS reactive black v3.0 enterprise website source code - HITCMS-Haitian response black enterprises website ... 2017-05-03
WebOA v17.2 network office automation system - WebOA network using b/s structure development of o... 2017-05-03
Pure imitation of han site source code, one a 】 【 c9cms kernel v1.0 - Generic http://www.wufazhuce.com/Han one · Config... 2017-05-04
zone.js - Implements Zones for JavaScript ... 2017-05-11
dragonfly - A Ruby gem for on-the-fly processing - suitable fo... 2017-05-11
oh-my-fish - The Fishshell Framework. 2017-05-11
canvas-lms - The open LMS by Instructure, Inc. 2017-05-11
ledger - Double-entry accounting system with a command-line... 2017-05-11
Python - My Python Examples http://w... 2017-05-11
blade - 2017-05-11
LaZagne - Credentials recovery project 2017-05-10
Pull-to-Refresh.Rentals-iOS - This project aims to provide a simple and customiz... 2017-05-10
spoon - Distributing instrumentation tests to all your And... 2017-05-10

 Back to top