diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 484e6f2ab..18b936478 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -791,6 +791,10 @@ table#otheruserstable { border: 0 } +.buttonicon:before { + font-family: "fontawesome-etherpad"; +} + .buttonicon:focus{ border: 1px solid #666; } @@ -1320,19 +1324,7 @@ input[type=checkbox] { } -[data-icon]:before { - font-family: "fontawesome-etherpad" !important; - content: attr(data-icon); - font-style: normal !important; - font-weight: normal !important; - font-variant: normal !important; - text-transform: none !important; - speak: none; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - +[data-icon]:before, [class^="icon-"]:before, [class*=" icon-"]:before { font-family: "fontawesome-etherpad" !important; diff --git a/src/static/font/config.json b/src/static/font/config.json index f9c2c3d65..1c636281d 100644 --- a/src/static/font/config.json +++ b/src/static/font/config.json @@ -347,6 +347,24 @@ "css": "slideshare", "code": 59441, "src": "fontawesome" + }, + { + "uid": "d35a1d35efeb784d1dc9ac18b9b6c2b6", + "css": "pencil", + "code": 59449, + "src": "fontawesome" + }, + { + "uid": "0ddd3e8201ccc7d41f7b7c9d27eca6c1", + "css": "link", + "code": 59450, + "src": "fontawesome" + }, + { + "uid": "8fb55fd696d9a0f58f3b27c1d8633750", + "css": "table", + "code": 61646, + "src": "fontawesome" } ] } \ No newline at end of file diff --git a/src/static/font/fontawesome-etherpad.eot b/src/static/font/fontawesome-etherpad.eot index 284149e2b..35a002de2 100644 Binary files a/src/static/font/fontawesome-etherpad.eot and b/src/static/font/fontawesome-etherpad.eot differ diff --git a/src/static/font/fontawesome-etherpad.svg b/src/static/font/fontawesome-etherpad.svg index a64ba864e..b69d0d974 100644 --- a/src/static/font/fontawesome-etherpad.svg +++ b/src/static/font/fontawesome-etherpad.svg @@ -1,68 +1,130 @@ -Copyright (C) 2015 by original authors @ fontello.com +Copyright (C) 2018 by original authors @ fontello.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/static/font/fontawesome-etherpad.ttf b/src/static/font/fontawesome-etherpad.ttf index f596b4fe6..280a3d460 100644 Binary files a/src/static/font/fontawesome-etherpad.ttf and b/src/static/font/fontawesome-etherpad.ttf differ diff --git a/src/static/font/fontawesome-etherpad.woff b/src/static/font/fontawesome-etherpad.woff index ebca7fffa..c66051390 100644 Binary files a/src/static/font/fontawesome-etherpad.woff and b/src/static/font/fontawesome-etherpad.woff differ diff --git a/src/static/js/ace.js b/src/static/js/ace.js index bbf83c0e7..038ead7c2 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -230,7 +230,6 @@ function Ace2Editor() // disableCustomScriptsAndStyles can be used to disable loading of custom scripts if(!clientVars.disableCustomScriptsAndStyles){ $$INCLUDE_CSS("../static/css/pad.css"); - $$INCLUDE_CSS("../static/skins/" + clientVars.skinName + "/pad.css"); } var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ @@ -240,6 +239,7 @@ function Ace2Editor() return '../static/plugins/' + path; }); includedCSS = includedCSS.concat(additionalCSS); + $$INCLUDE_CSS("../static/skins/" + clientVars.skinName + "/pad.css"); pushStyleTagsFor(iframeHTML, includedCSS); @@ -314,7 +314,6 @@ window.onload = function () {\n\ var $$INCLUDE_CSS = function(filename) {includedCSS.push(filename)}; $$INCLUDE_CSS("../static/css/iframe_editor.css"); $$INCLUDE_CSS("../static/css/pad.css"); - $$INCLUDE_CSS("../static/skins/" + clientVars.skinName + "/pad.css"); var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ @@ -324,12 +323,13 @@ window.onload = function () {\n\ return '../static/plugins/' + path } ); includedCSS = includedCSS.concat(additionalCSS); + $$INCLUDE_CSS("../static/skins/" + clientVars.skinName + "/pad.css"); pushStyleTagsFor(outerHTML, includedCSS); // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) - outerHTML.push('', '', scriptTag(outerScript), '
x
'); + outerHTML.push('', '', scriptTag(outerScript), '
x
'); var outerFrame = document.createElement("IFRAME"); outerFrame.name = "ace_outer"; diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 8b0e2c3e9..9c69fad14 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5404,7 +5404,7 @@ function Ace2Inner(){ // didn't do this special case, we would miss out on any top margin // included on the first line. The default stylesheet doesn't add // extra margins/padding, but plugins might. - h = b.nextSibling.offsetTop - window.getComputedStyle(doc.body).getPropertyValue("padding-top"); + h = b.nextSibling.offsetTop - parseInt(window.getComputedStyle(doc.body).getPropertyValue("padding-top").split('px')[0]); } else { h = b.nextSibling.offsetTop - b.offsetTop; } diff --git a/src/static/js/pad.js b/src/static/js/pad.js index de613910d..a72225979 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -314,7 +314,7 @@ function handshake() // If the Monospacefont value is set to true then change it to monospace. if (settings.useMonospaceFontGlobal == true) { - pad.changeViewOption('useMonospaceFont', true); + pad.changeViewOption('padFontFamily', 'monospace'); } // if the globalUserName value is set we need to tell the server and the client about the new authorname if (settings.globalUserName !== false) @@ -560,19 +560,7 @@ var pad = { if(padcookie.getPref("rtlIsTrue") == true){ pad.changeViewOption('rtlIsTrue', true); } - - - var fonts = ['useMonospaceFont', 'useMontserratFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', - 'useGeorgiaFont', 'useImpactFont', 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont', - 'useTahomaFont', 'useTimesNewRomanFont', 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', - 'useWingDingsFont', 'useSansSerifFont', 'useSerifFont']; - - - $.each(fonts, function(i, font){ - if(padcookie.getPref(font) == true){ - pad.changeViewOption(font, true); - } - }) + pad.changeViewOption('padFontFamily', padcookie.getPref("padFontFamily")); hooks.aCallAll("postAceInit", {ace: padeditor.ace, pad: pad}); } diff --git a/src/static/js/pad_editor.js b/src/static/js/pad_editor.js index 0b282659d..ec2339562 100644 --- a/src/static/js/pad_editor.js +++ b/src/static/js/pad_editor.js @@ -29,14 +29,6 @@ var padeditor = (function() var pad = undefined; var settings = undefined; - // Array of available fonts - - var fonts = ['useMonospaceFont', 'useMontserratFont', 'useOpenDyslexicFont', 'useComicSansFont', 'useCourierNewFont', - 'useGeorgiaFont', 'useImpactFont', 'useLucidaFont', 'useLucidaSansFont', 'usePalatinoFont', 'useRobotoMonoFont', - 'useTahomaFont', 'useTimesNewRomanFont', 'useTrebuchetFont', 'useVerdanaFont', 'useSymbolFont', 'useWebdingsFont', - 'useWingDingsFont', 'useSansSerifFont', 'useSerifFont']; - - var self = { ace: null, // this is accessed directly from other files @@ -97,12 +89,7 @@ var padeditor = (function() // font family change $("#viewfontmenu").change(function() { - $.each(fonts, function(i, font){ - var sfont = font.replace("use",""); - sfont = sfont.replace("Font",""); - sfont = sfont.toLowerCase(); - pad.changeViewOption(font, $("#viewfontmenu").val() == sfont); - }); + pad.changeViewOption('padFontFamily', $("#viewfontmenu").val()); }); // Language @@ -154,45 +141,29 @@ var padeditor = (function() self.ace.setProperty("showsauthorcolors", !settings.noColors); } - var normalFont = true; - // Go through each font and see if the option is set.. - $.each(fonts, function(i, font){ - var isEnabled = getOption(font, false); - if(isEnabled){ - font = font.replace("use",""); - font = font.replace("Font",""); - font = font.toLowerCase(); - if(font === "monospace") self.ace.setProperty("textface", "monospace"); - if(font === "montserrat") self.ace.setProperty("textface", "Montserrat"); - if(font === "opendyslexic") self.ace.setProperty("textface", "OpenDyslexic"); - if(font === "comicsans") self.ace.setProperty("textface", "'Comic Sans MS','Comic Sans',cursive"); - if(font === "georgia") self.ace.setProperty("textface", "Georgia,'Bitstream Charter',serif"); - if(font === "impact") self.ace.setProperty("textface", "Impact,Haettenschweiler,'Arial Black',sans-serif"); - if(font === "lucida") self.ace.setProperty("textface", "Lucida,'Lucida Serif','Lucida Bright',serif"); - if(font === "lucidasans") self.ace.setProperty("textface", "'Lucida Sans','Lucida Grande','Lucida Sans Unicode','Luxi Sans',sans-serif"); - if(font === "palatino") self.ace.setProperty("textface", "Palatino,'Palatino Linotype','URW Palladio L',Georgia,serif"); - if(font === "robotomono") self.ace.setProperty("textface", "RobotoMono"); - if(font === "tahoma") self.ace.setProperty("textface", "Tahoma,sans-serif"); - if(font === "timesnewroman") self.ace.setProperty("textface", "'Times New Roman',Times,serif"); - if(font === "trebuchet") self.ace.setProperty("textface", "'Trebuchet MS',sans-serif"); - if(font === "verdana") self.ace.setProperty("textface", "Verdana,'DejaVu Sans',sans-serif"); - if(font === "symbol") self.ace.setProperty("textface", "Symbol"); - if(font === "webdings") self.ace.setProperty("textface", "Webdings"); - if(font === "wingdings") self.ace.setProperty("textface", "Wingdings"); - if(font === "sansserif") self.ace.setProperty("textface", "sans-serif"); - if(font === "serif") self.ace.setProperty("textface", "serif"); - - // $("#viewfontmenu").val(font); - normalFont = false; - } - }); - - // No font has been previously selected so use the Normal font - if(normalFont){ - self.ace.setProperty("textface", "'Helvetica Neue',Arial, sans-serif"); - // $("#viewfontmenu").val("normal"); + var fontFamily = newOptions['padFontFamily']; + switch (fontFamily) { + case "monospace": self.ace.setProperty("textface", "monospace"); break; + case "montserrat": self.ace.setProperty("textface", "Montserrat"); break; + case "opendyslexic": self.ace.setProperty("textface", "OpenDyslexic"); break; + case "comicsans": self.ace.setProperty("textface", "'Comic Sans MS','Comic Sans',cursive"); break; + case "georgia": self.ace.setProperty("textface", "Georgia,'Bitstream Charter',serif"); break; + case "impact": self.ace.setProperty("textface", "Impact,Haettenschweiler,'Arial Black',sans-serif"); break; + case "lucida": self.ace.setProperty("textface", "Lucida,'Lucida Serif','Lucida Bright',serif"); break; + case "lucidasans": self.ace.setProperty("textface", "'Lucida Sans','Lucida Grande','Lucida Sans Unicode','Luxi Sans',sans-serif"); break; + case "palatino": self.ace.setProperty("textface", "Palatino,'Palatino Linotype','URW Palladio L',Georgia,serif"); break; + case "robotomono": self.ace.setProperty("textface", "RobotoMono"); break; + case "tahoma": self.ace.setProperty("textface", "Tahoma,sans-serif"); break; + case "timesnewroman": self.ace.setProperty("textface", "'Times New Roman',Times,serif"); break; + case "trebuchet": self.ace.setProperty("textface", "'Trebuchet MS',sans-serif"); break; + case "verdana": self.ace.setProperty("textface", "Verdana,'DejaVu Sans',sans-serif"); break; + case "symbol": self.ace.setProperty("textface", "Symbol"); break; + case "webdings": self.ace.setProperty("textface", "Webdings"); break; + case "wingdings": self.ace.setProperty("textface", "Wingdings"); break; + case "sansserif": self.ace.setProperty("textface", "sans-serif"); break; + case "serif": self.ace.setProperty("textface", "serif"); break; + default: self.ace.setProperty("textface", ""); break; } - }, dispose: function() { diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index 08d6f68d6..7e744118f 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -166,25 +166,27 @@ function handleClientVars(message) // font family change $("#viewfontmenu").change(function(){ var font = $("#viewfontmenu").val(); - if(font === "monospace") setFont("Courier new"); - if(font === "opendyslexic") setFont("OpenDyslexic"); - if(font === "comicsans") setFont("Comic Sans MS"); - if(font === "georgia") setFont("Georgia"); - if(font === "impact") setFont("Impact"); - if(font === "lucida") setFont("Lucida"); - if(font === "lucidasans") setFont("Lucida Sans Unicode"); - if(font === "palatino") setFont("Palatino Linotype"); - if(font === "tahoma") setFont("Tahoma"); - if(font === "timesnewroman") setFont("Times New Roman"); - if(font === "trebuchet") setFont("Trebuchet MS"); - if(font === "verdana") setFont("Verdana"); - if(font === "symbol") setFont("Symbol"); - if(font === "webdings") setFont("Webdings"); - if(font === "wingdings") setFont("Wingdings"); - if(font === "sansserif") setFont("MS Sans Serif"); - if(font === "serif") setFont("MS Serif"); + switch (font) { + case "monospace": setFont("Courier new");break; + case "opendyslexic": setFont("OpenDyslexic");break; + case "comicsans": setFont("Comic Sans MS");break; + case "georgia": setFont("Georgia");break; + case "impact": setFont("Impact");break; + case "lucida": setFont("Lucida");break; + case "lucidasans": setFont("Lucida Sans Unicode");break; + case "palatino": setFont("Palatino Linotype");break; + case "tahoma": setFont("Tahoma");break; + case "timesnewroman": setFont("Times New Roman");break; + case "trebuchet": setFont("Trebuchet MS");break; + case "verdana": setFont("Verdana");break; + case "symbol": setFont("Symbol");break; + case "webdings": setFont("Webdings");break; + case "wingdings": setFont("Wingdings");break; + case "sansserif": setFont("MS Sans Serif");break; + case "serif": setFont("MS Serif");break; + default: setFont("");break; + } }); - } function setFont(font){ diff --git a/src/templates/pad.html b/src/templates/pad.html index a0b401d59..c40116d3a 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -81,8 +81,8 @@
- - + +
diff --git a/src/templates/timeslider.html b/src/templates/timeslider.html index 5aee24c7a..60194af12 100644 --- a/src/templates/timeslider.html +++ b/src/templates/timeslider.html @@ -36,6 +36,7 @@ <% e.begin_block("timesliderStyles"); %> + <% e.end_block(); %>