Set name/label for custom links in TYPO3 RTE - typo3

I added a new link class to the TYPO3 (6.2.14) RTE like shown below
RTE {
classesAnchor {
myNewClass {
class = very-long-class additional-class
type = page
}
}
default {
proc.allowedClasses := addToList(very-long-class additional-class)
buttons {
link.properties.class.allowedClasses := addToList(very-long-class additional-class)
}
}
}
Everything works fine and the editor can choose the new link style when he selects some text in the RTE and creates a link (shown below).
My problem is, that the link name is not really understandable. Is it possible to define a name or label for the link (changing the class-name is not an option), so the "Style" field will show a more understandable name?

The names are set in "classes" of the RTE object. The value are any CSS-styles to give a hint, how it looks like.
RTE.classes {
your-class-name {
name = Your Awesome Class Name
value = margin: 2px; padding: 2px; background: #00b5dc; color: #fff; border: 1px solid #3a6674;
}
}

Related

JavaFX TextFlow set default text color

As the title, it's possible to to apply a default color to all text of a TextFlow component?
TextFlow textFlow = new TextFlow();
textFlow.setId("supertextflow");
// Somewhere else in the code
textFlow.getChildren()
.add(new Text("Dynamic added text! OMG!"));
I tryed different solution but none of them works
#supertextflow {
-fx-text-fill: red;
}
#supertextflow * .text{
-fx-fill: red;
}
#supertextflow > * > .text {
-fx-fill: red;
}
I know that Text is another component, but why i can't style it from it's parent?
Well you can't do that with Text cause it's style class doesn't have fill css rule if you look at the JavaFX CSS Reference Guide. So I would suggest to leave the Text and use Label instead. If you do then you could use the css rule below :
#supertextflow > .label {
-fx-text-fill: blue;
-fx-font-size : 20px;
}
In case you want to keep using Text you will have to set each element (Text) inside the FlowPane a specific id (ex. #customText) and then use it to set the CSS rule like below :
#supertextflow > #customText {
-fx-fill: red;
-fx-font-size : 20px;
}
Edit : As James_D mentioned on the commends below you should use Type Selector (I am guessing that's the correct term) on the CSS rule in order to style all the Text nodes inside your TextFlow without needed to set any ids on them :
#supertextflow > Text {
-fx-fill: red;
-fx-font-size : 20px;
}

Adding costum styles to Typo3 RTE. Some are not saved

I add costum styles to the RTE with a CSS File:
RTE.default.contentCSS = EXT:netjapan/Resources/Public/css/rte.css
For some elements this works. For example for a ulElement:
ul.liststyle1 {
list-style: none;
padding-left: 17px;
}
When I select the ul in the RTE I can chose the Blockstyle liststyle1.
I want to do the same for p:
p.test {
font-size: 80%;
}
And when I select the p I can chose the Blockstyle test and the style is used. But when I save the Blockstyle is gone.
I added this Typoscript:
RTE.default {
removeTags = sdfield, strike
proc.entryHTMLparser_db.removeTags = sdfield, strike
}
So that p is not in the removeTags list. But it had no effect.
Anyone know how it comes that the Blockstyle is removed on the pElement?
I had simillar problem last week. Sometimes RTE is going crazy. I mean that there is no logical sense in it. Check this: marke the text and use the container style it will wrap it in div but there will be also <p> in it so you will have something like <div><p class="bodytext">text</p></div> - you can add style for that. At least this solved my problem

Custom CSS :: Blocks

I had been developed a custom block 'Colleges', along with a stylesheet: styles.css within the block.
by using moodle2.8+
styles.css
.block_colleges .header { display:none; }
.block_colleges .title h2 { color:#fff; font-size:18px; font-weight:bold; margin:-5px; }
.block_colleges { float:left; margin-left:5px; width:317px !important; }
.block_colleges .content { border:1px solid lightgray; border-top-left-radius:10px; border-top-right-radius:10px; border-bottom-left-radius:10px; border-bottom-right-radius:10px; margin-top:0px; border:0px solid #a6c9e2; padding:0px; min-height:220px; }
The above css should be applicable for only students and teachers...and for admin, the css shouldn't be applicable i.e., a moodle block format design.
Can we create block::custom css, different for student/teacher and admin.
A file named styles.css in the main directory of a Moodle block will automatically be cached and used on the page. There's no way to load different CSS based on role that I know of.
If you want to show different CSS for different roles, perhaps you can have role specific CSS classes, then change the classes in your markup based on the logged in user's role.
For example:
#block_colleges.student .header { display:**none**; }
#block_colleges.teacher .header { display:**block**; }
In your block_colleges.php file, you could write something like:
if (is_siteadmin())
{
// class = admin
}
else
{
// class = student
}
This is how I would do it.

How to disable default 'Click to edit' on Jeditable?

I'm using the jeditable plugin for making some values editable. I noticed that when a value is empty the default text 'Click top edit' appears which I don't want. But I still want to make that field editable too. How to manage this?
I noticed a suggestion at http://www.datatables.net/forums/discussion/5865/jeditable-and-default-click-to-edit/p1, but that does not seem to work - at least not for me; when using the placeholder : "" the field is not editable anymore.
My related code:
$('.edit').editable('edit_save.php', {
cancel : 'Cancel',
submit : 'OK'
});//$('.edit').editable('jeditable_save.php', {
Without any text to fill it, the editable element needs to be an inline block with height and width like this:
.edit {
border: 1px solid red;
display: inline-block;
min-height: 20px;
min-width: 100px;
}
and set a blank placeholder like you mentioned:
$('.edit').editable(function (value, settings) {
return value;
}, {
cssclass: 'editing',
placeholder: '',
});
See this fiddle http://jsfiddle.net/chrisdillon/37JqF/
I tried add this row: placeholder:'
&
nbsp;' and it works.
If you can add this row, you see your input is empty.
$('.edit').editable('Something', {
something,...
placeholder:' ',
})

Look up GWT CellTable header style/s?

How can TH style name/s of a GWT CellTable's heading be looked up programatically?
I have looked at the Client Bundle documentation but it isn't immediately obvious to me how it all fits together. Thanks.
Not sure exactly what you want to do when accessing the TH style names.
If you want to override the standard css style of a celltable header, here are some of the css styles you can override to change the Look and Feel of the component.
.cellTableFirstColumnHeader {}
.cellTableLastColumnHeader {}
.cellTableHeader {
border-bottom: 2px solid #6f7277;
padding: 3px 15px;
text-align: left;
color: #4b4a4a;
text-shadow: #ddf 1px 1px 0;
overflow: hidden;
}
.cellTableSortableHeader {
cursor: pointer;
cursor: hand;
}
.cellTableSortableHeader:hover {
color: #6c6b6b;
}
.cellTableSortedHeaderAscending {
}
.cellTableSortedHeaderDescending {
}
Here is the complete list of styles for cellTables CellTable.css
Now if you want to access you header programmatically, you can use this solution to get the TableSectionElement corresponding the the Header of your table. Then you can access the row, then the cells, and lookup for their styles I guess.
Last thing if you want to override the header style, maybe you can use the following method when adding your column to your table
public void addColumn(Column<T, ?> col, Header<?> header)
Then create your Header or use a TextHeader for example then set your style on it before adding it to the table using
public void setHeaderStyleNames(String styleNames)
Example
TextHeader textHeader = new TextHeader("headerTitle");
textHeader.setHeaderStyleNames("my-style");
myTable.addColumn(myColumn, textHeader);
Easy solution:
import com.google.gwt.user.cellview.client.CellTable.Resources;
private String getCellTableHeaderStyle() {
Resources res = GWT.create(Resources.class);
return res.cellTableStyle().cellTableHeader();
}