Umbraco media picker adds dimensions to images - umbraco

When I insert an image from the Media section into an Umbraco Rich Text Editor field using the standard Media Picker that comes with a clean Umbraco 7 install it adds height and width attributes to the HTML as well as appending it to the URL.
Like this:
<img style="width: 500px; height: 160.55045871559633px;" src="/media/1038/image.jpg?width=500&height=160.55045871559633" alt="some alt" rel="1100" />
How can I stop this from happening? I don't want to have to go into the HTML and remove this every time I add an image.

You can change the default dimensions in the Richetext editor settings for images or 0 to disable. This adds the image with the original dimensions.
You might also want to add the following properties to your img elements: max-width: 100%; height: auto !important.

I know it's a bit late to answer this but I came across the same issue but the fix advised seems only to apply when you're actually editing within Umbraco. In my case we were editing in a custom angular editor and the rich text editor was being instantiated and configured within javascript.
The solution for this was to add the maxImageSize parameter to the RTE config as follows:
scope.rteView = [{
label: null,
description: null,
view: 'rte',
config: {
editor: {
toolbar: ["code", "styleselect", "bold", "italic", "bullist", "numlist", "link", "umbmediapicker", "spellchecker"],
stylesheets: ["Editor"],
maxImageSize: 0,
dimensions: {
height: 600,
width: '100%'
},
hideLabel: true
},
hideLabel: true
}
}];
Hope it helps someone.

Related

Reducing arrow size of mat-paginator without using ng-deep

I have used mat-paginator in my project
and wanted to reduce size of pagination arrows without using ng-deep
screenshot of mat-paginator result
Currently I am able to do it with following code:
::ng-deep .mat-paginator-icon {
width: 3vh;
margin-top: -0.5vh;
}
But have to do it without using ng-deep!
Any suggestions?
I tried encapsulation: ViewEncapsulation.None
and achieved results but that's affecting/disordering other UI features on that web page
add some class to your mat-paginator something like
<mat-paginator class="a-c"></mat-paginator>
then in your global style.css use this class to apply styles
.a-c .mat-paginator-icon {
width: 3vh;
margin-top: -0.5vh;
}

Trix WYSIWYG Editor change default rows/vertical height of textfield

I read through the Trix documentation and an answer did not jump out at me for this. It appears that the Trix WYSIWYG editor defaults to 3 displayed rows:
Any chance this can be toggled to more rows, for example: 15 or so rows:
It is a matter of setting the min-height css attribute. Using javascript, this works if you only have one trix-editor on the page:
$('trix-editor').css("min-height", "350px");
If you have multiple trix editors on the page and you only want to change the default height for that one: what I did is I wrapped the trix editor in a div, set a class on that div, and used find:
$('.solution-trix-field-wrapper').find($('trix-editor')).css("min-height", "350px");
Yes, you are right, but I have solved the different way.
You can be overriding the default CSS like trix-content class
.trix-content{
height: 350px;
}
you can increase the height using this CSS if you want to use scroll after some depth then overflow-y: auto; like
.trix-content{
height: 350px;
overflow-y: auto;
}
after 350px it will automatically add the scrollbar.
Where should I add the code?
Try adding it to your stylesheets/application.scss file (if you're using sass - or equivalent files).
In rails 7 I had to override the min-height of the trix-editor element. Code in app/assets/stylesheets/actiontext.css
trix-editor {
min-height: 15em;
}

Flickity slider with custom css per carousel-cell

I want to set custom height (and possible other things) the the flickity 'carousel-cells' INDIVIDUALLY. I can see it is calculated somehow with with javascript by the flickity package itself.
How could I overwrite this, to create something like this (with the smaller inactive slide)?
.
I have tried to give the carousel-cells a height of 300px, and the active carousel (who has a class is-selected) a height of 500px. That did not work.
.carousel-cell {
width: 70%;
height: 300px;
background: #8C8;
}
.is-selected{
height: 500px !important;
}
A simple codepen to get you started if you like.
You need to work off the asNavFor sample until you get to a view like in this CodePen

How can I preserve double spacing when users paste text into Quill.js editor?

I have an ASP.NET MVC application, which uses Quill.js. I want users to be able to copy double spaced text from, say, MS Word, and paste it into my Quill editor while preserving their double spacing.
In View:
<div class="editor">
#Html.Raw(Model.EvaluationText)
</div>
js:
var basicEditor = new Quill('.editor', {
modules: {
toolbar: {
container: '.editor-toolbar'
}
},
theme: 'snow'
});
When I look at devtools, I see that there is a div with class 'ql-paste-manager,' which is what I think I need to override, but I'm not sure how or if this is the way to go.
If you know the text is double spaced you can control this with CSS. Just set the line height to 200% (or whatever value you'd like). Ex.
.ql-editor div, .ql-editor li {
line-height: 200%;
}
However Quill's paste manager does not currently support detecting if the text pasted was single or double spaced.

Sproutcore: Changing css properties on mouse events

In sproutcore I'm trying to change the border thickness of a div when a user mouses over it. All the other code is working but I can't find how to either access the css properties directly or attach a new classname to the div.
borderDiv: SC.View.design({
layout:{top:60, left:60, width: 400, height: 525},
classNames:"panel",
mouseEntered: function(evt) {
alert("this is working");
//
// No idea what to put here to change css properties
//
return YES
}
})
I think you can do something like
this.$().addClass()
to add any class you want.
Not exactly what I was looking for but what mostly gets the job done is using css pseudo-classes. :hover, :active, and :focus cover most bases for my use.

Resources