pagedown


Hide buttons on pagedown


I'm using pagedown on my website right now, and it's awesome so far, the only detail is
it's not a programming-oriented website, so I'd like to remove the 'code' button.
Is there a way I can do it? I tried using CSS to hide the buttons but the html has inline styles "left: xxx" which I can't change using CSS.
Thanks in advance!
If you open up Markdown.Editor.js, and scroll to approximately line 1360 (it varies depending upon which version you're using), you'll see an area with:
group1 = makeGroup(1);
buttons.bold = makeButton("wmd-bold-button", "Bold - Ctrl+B", "icon-bold", bindCommand("doBold"), group1);
buttons.italic = makeButton("wmd-italic-button", "Italic - Ctrl+I", "icon-italic", bindCommand("doItalic"), group1);
group2 = makeGroup(2);
buttons.link = makeButton("wmd-link-button", "Link - Ctrl+L", "icon-link", bindCommand(function (chunk, postProcessing) {
return this.doLinkOrImage(chunk, postProcessing, false);
}), group2);
buttons.quote = makeButton("wmd-quote-button", "Blockquote - Ctrl+Q", "icon-blockquote", bindCommand("doBlockquote"), group2);
buttons.code = makeButton("wmd-code-button", "Code Sample - Ctrl+K", "icon-code", bindCommand("doCode"), group2);
buttons.image = makeButton("wmd-image-button", "Image - Ctrl+G", "icon-picture", bindCommand(function (chunk, postProcessing) {
return this.doLinkOrImage(chunk, postProcessing, true);
}), group2);
So on and so forth. Simply quote out the buttons you don't want.
Alternatively, you can simply leave out the entire wmd-buttons div and only use the editor and preview components.
Search for doClick(buttons.code)in the code and comment it out
If you look at the makeButton function:
var makeButton = function (id, title, XShift, textOp) {
var button = document.createElement("li");
button.className = "wmd-button";
button.style.left = xPosition + "px";
xPosition += 25;
var buttonImage = document.createElement("span");
button.id = id + postfix;
button.appendChild(buttonImage);
button.title = title;
button.XShift = XShift;
if (textOp)
button.textOp = textOp;
setupButton(button, true); // <--- LOOK HERE
buttonRow.appendChild(button);
return button;
};
The true that is being passed in the call of the setupButton function is the isEnabled flag. What I did was just created another makeButton function and put it right under the first one. The only thing that I changed was that isEnabled flag to false. Then I changed to button.code = makeButton(...) to button.code = makeButton2(...).
buttons.code = makeButton2("wmd-code-button", getString("code"), "-80px", bindCommand("doCode"));

Related Links

How can I prevent pagedown from displaying images?
Hide buttons on pagedown

Categories

HOME
android
gridview
fuelux
angular2-material
apiblueprint
opendj
xbee
alsa
nuget-package
android-json
gluon-mobile
angularfire2
vert.x
elasticsearch-5
bing-maps
spin
arangodb
little-proxy
dkim
reactive-programming
jsonpath
selenium-ide
dynatrace
dimensional-modeling
android-7.0-nougat
video-editing
selinux
microsoft-ocr
ember-cli
epsilon
outliers
progress-bar
vex
anki
cognos-bi
cart
slacktextviewcontroller
numpy-broadcasting
protege4
openerp-7
dm-script
apns-php
health-monitoring
metawidget
mongoose-schema
news
xv6
smoothstate.js
importerror
memory-mapping
flask-login
rfc3339
dynamic-linq
datamaps
spring-data-couchbase
oracleclient
skin
libjpeg
cpu-cache
mathcad
android-instrumentation
rocks
slackware
stax
iotivity
dotnetnuke-7
signalr.client
mapinfo
bizagi
dbamp
uiactionsheet
yajsw
libav
halcon
concept-insights
spring-retry
assertion
dynatree
toolkit
haskell-warp
dronekit-android
branch-and-bound
omnifaces
google-refine
android-broadcast
zxspectrum
java-security
spring-remoting
renderer
rfc5322
spring-3
artemis
gtm-oauth2
http-patch
embedded-fonts
mbunit
ice-cube
flex++
jquery-1.9
alice
database-create
jsr286
fitbounds
isa-swizzling
convention
xcelsius
exponentiation
entitydatasource
commerceserver2007
timertask
instantiationexception
maven-1
web-garden
build-environment
cuda.net
sifr3

Resources

Encrypt Message