From 754d9153095ec89be57ca8bd2144ddbac1b0eebb Mon Sep 17 00:00:00 2001 From: benweet Date: Tue, 22 Apr 2014 18:40:24 +0100 Subject: [PATCH] Fixed editor performance issue --- Gruntfile.js | 17 +----- public/cache.manifest | 2 +- public/res-min/img/menu-icon.png | Bin 4144 -> 4265 bytes public/res-min/main.js | 48 +++++++-------- public/res-min/themes/base.css | 4 +- public/res-min/themes/default.css | 11 ++-- public/res-min/themes/gray.css | 11 ++-- public/res-min/themes/night.css | 11 ++-- public/res-min/themes/school.css | 11 ++-- public/res/editor.js | 86 ++++++++++++++++----------- public/res/extensions/welcomeTour.js | 4 +- public/res/libs/Markdown.Editor.js | 10 +++- public/res/styles/base.less | 8 +++ 13 files changed, 121 insertions(+), 102 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index f6998dbf..2c6e99f7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -74,19 +74,6 @@ module.exports = function(grunt) { }, }, 'string-replace': { - 'font-parameters': { - files: { - './': 'public/res-min/themes/*.css', - }, - options: { - replacements: [ - { - pattern: /(font\/fontello\.\w+)\?\w+/g, - replacement: '$1' - } - ] - } - }, 'constants': { files: { 'public/res/constants.js': 'public/res/constants.js' @@ -202,10 +189,8 @@ module.exports = function(grunt) { */ grunt.registerTask('build-css', function() { - // First compile less files + // Compile less files grunt.task.run('less:compile'); - // Remove fontello checksum arguments - grunt.task.run('string-replace:font-parameters'); }); diff --git a/public/cache.manifest b/public/cache.manifest index 88fb1cc6..1f86d4da 100644 --- a/public/cache.manifest +++ b/public/cache.manifest @@ -1,5 +1,5 @@ CACHE MANIFEST -#Date Sun Apr 20 2014 18:20:19 +#Date Tue Apr 22 2014 12:03:32 CACHE: res/worker.js diff --git a/public/res-min/img/menu-icon.png b/public/res-min/img/menu-icon.png index 29c2951969a9be098dde4007a2bece91b37d4cb4..062c485bdd9aa4cc81e1ca9d18c98e714e39dbbe 100644 GIT binary patch delta 1592 zcmV-82FLlZAgLj+g$jQL4oO5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C~`}}Q5bW*k@0EfC= zjuxeHu7AhG!bg4J^tN2mZbhRj3s{537NYaipu#=q-H;lCu=@~E*SS8nfXxsRpdUGQ z#6q{iM+0USzz^^v$X0&&t-1 in e)}function i(e){var t=ht[e]={};return ot.each(e.match(st)||[],function(e,n){t[n]=!0}),t}function r(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ot.expando+Math.random()}function o(e,n,i){var r;if(i===t&&1===e.nodeType)if(r="data-"+n.replace(bt,"-$1").toLowerCase(),i=e.getAttribute(r),"string"==typeof i){try{i="true"===i?!0:"false"===i?!1:"null"===i?null:+i+""===i?+i:vt.test(i)?JSON.parse(i):i}catch(o){}mt.set(e,n,i)}else i=t;return i}function a(){return!0}function s(){return!1}function l(){try{return z.activeElement}catch(e){}}function c(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function u(e,t,n){if(ot.isFunction(t))return ot.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return ot.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(It.test(t))return ot.filter(t,e,n);t=ot.filter(t,e)}return ot.grep(e,function(e){return tt.call(t,e)>=0!==n})}function d(e,t){return ot.nodeName(e,"table")&&ot.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function f(e){var t=jt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function h(e,t){for(var n=e.length,i=0;n>i;i++)gt.set(e[i],"globalEval",!t||gt.get(t[i],"globalEval"))}function m(e,t){var n,i,r,o,a,s,l,c;if(1===t.nodeType){if(gt.hasData(e)&&(o=gt.access(e),a=gt.set(t,o),c=o.events)){delete a.handle,a.events={};for(r in c)for(n=0,i=c[r].length;i>n;n++)ot.event.add(t,r,c[r][n])}mt.hasData(e)&&(s=mt.access(e),l=ot.extend({},s),mt.set(t,l))}}function g(e,n){var i=e.getElementsByTagName?e.getElementsByTagName(n||"*"):e.querySelectorAll?e.querySelectorAll(n||"*"):[];return n===t||n&&ot.nodeName(e,n)?ot.merge([e],i):i}function v(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ft.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function b(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),i=t,r=Zt.length;r--;)if(t=Zt[r]+n,t in e)return t;return i}function y(e,t){return e=t||e,"none"===ot.css(e,"display")||!ot.contains(e.ownerDocument,e)}function x(t){return e.getComputedStyle(t,null)}function w(e,t){for(var n,i,r,o=[],a=0,s=e.length;s>a;a++)i=e[a],i.style&&(o[a]=gt.get(i,"olddisplay"),n=i.style.display,t?(o[a]||"none"!==n||(i.style.display=""),""===i.style.display&&y(i)&&(o[a]=gt.access(i,"olddisplay",E(i.nodeName)))):o[a]||(r=y(i),(n&&"none"!==n||!r)&>.set(i,"olddisplay",r?n:ot.css(i,"display"))));for(a=0;s>a;a++)i=e[a],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?o[a]||"":"none"));return e}function S(e,t,n){var i=Vt.exec(t);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):t}function C(e,t,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=ot.css(e,n+Yt[o],!0,r)),i?("content"===n&&(a-=ot.css(e,"padding"+Yt[o],!0,r)),"margin"!==n&&(a-=ot.css(e,"border"+Yt[o]+"Width",!0,r))):(a+=ot.css(e,"padding"+Yt[o],!0,r),"padding"!==n&&(a+=ot.css(e,"border"+Yt[o]+"Width",!0,r)));return a}function T(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,o=x(e),a=ot.support.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,o);if(0>=r||null==r){if(r=qt(e,t,o),(0>r||null==r)&&(r=e.style[t]),Wt.test(r))return r;i=a&&(ot.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+C(e,t,n||(a?"border":"content"),i,o)+"px"}function E(e){var t=z,n=Xt[e];return n||(n=k(e,t),"none"!==n&&n||(Ut=(Ut||ot("