After selecting an Image from 'Image list', there shows the image 'Preview' and
a 'Dimensions' dropdown, with default value 'Original' selected.
How do I set selected default to 'Preview (400x400)' and therefore have 'myPhoto.png/image_preview' for HTML content.
Look inside the TinyMCE egg at Products/TinyMCE/skins/tinymce/plugins/ploneimage/ploneimage.htm.pt
Change this line (95):
<option tal:repeat="item portal_tinymce/getImageScales" tal:attributes="value item/value" tal:content="item/title" />
to:
<option tal:repeat="item portal_tinymce/getImageScales" tal:attributes="value item/value; selected python: 'Preview' in item['title']" tal:content="item/title" />
TinyMCE use Plone global image handling settings for image scaling/tag render. Look for it at Controlpanel > Image handling.
Url address should be $YOUR_PLONE_URL/##imaging-controlpanel
Related
OVERVIEW:
We are using this plugin -- bootstrap-datetimejs (https://github.com/Eonasdan/bootstrap-datetimepicker). And I have it setup to show the time only
$(".timePicker").datetimepicker({
format: 'LT'
});
We are using ractivejs for our javascript library and my html goes like this
<label for="apptEndTime">End Time</label>
<div class="timePicker">
<input name="apptEndTime" id="apptEndTime" class="form-control date" type="text" value="{{apptEndTime}}" />
</div>
<label>Duration (mins)</label>
<input type="number" class="form-control" value="{{duration}}" id="duration" />
so apptEndTime is binded to ractive object data apptEndTime, and so does the duration. In my code, I made it that if the duration increases, it will also update the value of apptEndTime data. It successfully updated and displayed the apptEndTime.
PROBLEM:
Though it successfully updated and displayed the apptEndTime, when I click the clock icon of the datetimepicker, it still shows the previous time. As you can see on the screenshot below, it already displayed as 11:58 PM but when I click the clock icon, it still shows as 11:57 PM
QUESTION:
Is there a way that when I updated the value of apptEndTime, the time on the time selection menu (when the clock icon is clicked) will also gets updated?
I've already tried googling for day regarding this, but I can't seem to find the right solution. Also tried checking the documentation but can't find any related information
Ok my teammate was able to answer this question. He just added this line of code
$('input[name=appEndTime]').closest('.timePicker').data("DateTimePicker").date(appointmentObj.apptEndTime);
Where:
$('input[name=appEndTime]') is the affected input field
closest('.timePicker'). The '.timePicker' here is the name of your datetimepicker class/id when you initialize datetimepicker
data("DateTimePicker"). You just follow this, because all functions should be accessed via data("DateTimePicker") as mentioned on the plugin page:
https://getdatepicker.com/4/Functions/
date(appointmentObj.apptEndTime). date is the function name (though it is not found on the list of functions from their page :( ). And appointmentObj.apptEndTime is value that I want to set on the menu
I want to create a dropdown with scrollable list items. I used overflow-y: scroll; in CSS but not worked as I expected. Please check the sample svelte code written below.
<script>
let names = ['Name1','Name2','Name3','Name4','Name5',
'Name6','Name7','Name8','Name9','Name10',
'Name11','Name12','Name13','Name14','Name15',
'Name16','Name17','Name18','Name19','Name20',];
let selected;
</script>
<select bind:value={selected}>
{#each names as name}
<option value={name}>
{name}
</option>
{/each}
</select>
Svelte REPL Example
How can I achieve this in Svelte?
I need to display the dropdown lists as in the picture
EDIT
I used the size attribute for the <select></select> tag but the list items are not selectable and the dropdown height is getting broken. I want to display the scrollable dropdown list items when I click on the dropdown field.
Set a size <select ... size="8">
I got a user administration and want to check the checkbox before the label with 'test'. The checkbox and label are seperate from eachother. I can't use //input[#type='checkbox'])[3] because the checkbox and label can appear on a different row.
checkbox user
checkbox bla
checkbox trying
checkbox test
html of checkbox: <input type="checkbox" class="ant-checkbox-input ng-valid ng-dirty ng-touched">
html users: <app-userprofile-title _ngcontent-ads-c205="" _nghost-ads-c77="" class="ng-star-inserted">test</app-userprofile-title>
Try using this Xpath
//input[#type='checkbox']//*[contains(., 'test')]
I have added a custom set of buttons for adding simple grids to the editor. These have the following structure;
<div class="grid">
<div class="col-1-2"><p>Column 1</p></div>
<div class="col-1-2"><p>Column 2</p></div>
</div>
A custom CSS assigned displays the grids correctly. However as soon as the user goes to edit the text..understandably by deleting it all or highlighting and trying to replace, TinyMCE immediately removes the empty tags so if the user deletes the text Column 1 we end up with this;
<div class="grid">my new text<br />
<div class="col-1-2"><p>Column 2</p></div>
</div>
I have tried adding;
extended_valid_elements : 'div[id|class|style]'
but it had no effect.
How can I stop TinyMCE from removing these empty tags or am I going about this the wrong way..?
Thanks
I have an HTML input element of type select. The height of the element is 28px. Without modifying the element with CSS, the text inside gets automatically vertically-aligned in all browsers except for IE8. In IE8 the select's text is in the bottom left corner of the element.
Does anyone know how to vertically-align the text inside an HTML select element?
Without your html it is hard to know exactly what you are styling. It sounds like you are using something like <input type="select" /> but that isn't actually valid html.
However, to vertically align the text in the middle you need to set the line-height to be the same figure as your height.
So in this case you would need to set line-height: 28px; to match height: 28px;.
For your html I would recommend either using:
<input type="text" /> if you are looking for a standard text input
or
If you are looking for a drop down selection:
<select>
<option value="Test1">Test 1</option>
<option value="Test2">Test 2</option>
</select>