JCE editor adding extra inside empty div in Joomla 2.5 - editor

In the JCE editor while creating the content at the editor window at source mode if I give
<div class="text"></div>
toggle to design and then again toggle back to source its adding inbetween the div as
<div class="text"> </div>.
How to fix this issue. Please help on this

In a newer version of JCE there is now also an option to 'Pad Empty tags'. If you set this to 'no' it will refrain from adding
Components --> JCE Editor --> Global Configuration --> Pad Empty Tags

Not sure why you want to do this, but this could be done by,
Components --> JCE Editor --> Global Configuration --> Under 'cleanup and output', change 'keep non-breaking spaces' to 'no'. Save it and try now.

Related

Localized multilingual wix installer Does not display the values of string in .wxl files in the correct language

I created .msi installer using wix toolset 3.10 . I had localized the installer to be multi-language (just one .msi file that display the language depending on the region settings of windows).
I had created da-DK.mst file and I used wisubstg.vbs to embed the language into the english .msi file so I have one multilingual installer works for both Danish and English but I got two issues
any strings that gets its values from the language files which is
WixUI_da-DK.wxl , does not display the correct language it always displays the default language value which is english
the other problem is that the built in strings cut off in the Danish language in some forms .
what is the problem here and how to fix it ?
This is My UI from the .wxs file
<UI>
<UIRef Id="WixUI_InstallDir"/>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<Icon Id="icon.ico" SourceFile=".....\Images\Img_app.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<!-- end snippet -->
If your text is getting cut off you need to change your UI's dimensions.
Whatever control you are using to display that text make its width a bigger number.
I can't comment on the "Launch App Name" text always being English since there is not enough information about that UI Control or what text it is displaying. You would need to add some more information about the UI you are using.
Here's a link to the default dialogs for wix
https://github.com/wixtoolset/wix3/tree/develop/src/ext/UIExtension/wixlib
In the browsedlg.wxs you have this control defined.
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.BrowseDlgDescription)" />
unfortunately, Danish is rather long for the description here and so the installer cuts off the text and uses an ellipses.
I think the easiest way to fix this is to add a new wxs file to your project called AppNameBrowseDlg.wxs and just copy in the whole xml from here https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/BrowseDlg.wxs . You will need to change the <Dialog> Id to be "AppNameBrowseDlg" as well. Now you can make the width of the Description control bigger so hopefully the Danish text fits properly.
To use this new dialog you also need to add another wxs file and you can call it AppName_InstallDir.wxs which will be a copy of this https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/WixUI_InstallDir.wxs . Here you need to change the <UI> Id to AppName_InstallDir
Just change the <DialogRef Id="BrowseDlg"> to <DialogRef Id="AppNameBrowseDlg">
You'll also need to modify these lines
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
to reference your AppNameBrowseDlg
This essentially replicates the dialog and UI definition that you were using in your installer. In your Product, you just need to change the UIRef to be "AppName_InstallDir" and it will use your defined UI that replaced the default browsedlg with one that can hopefully fit the Danish text. I would also consider submitting a wix improvement here https://github.com/wixtoolset/issues/issues asking that the WixUI's browsedlg's description control is wider.
For your Launch text you're getting stuck with english because you are using the English msi as a base for the other languages. The way this checkbox has been implemented means you are hardcoding the english text from the property that the checkbox control's text value is set to. The way you are localizing the msi is probably creating multiple strings tables and selecting strings from the appropriate table at runtime. But, the checkbox doesn't get its text value from the strings table. Instead, it is from the value of a property which was set at to be the value of "LaunchApp". (Incidentally, if you used the Danish version of the msi as a base, this text would always be Danish).
We can fix this in much the same way we modified the Wix BrowseDlg. In this case we want to copy over the ExitDialog to AppNameExitDialog.wxs from here https://github.com/wixtoolset/wix3/blob/develop/src/ext/UIExtension/wixlib/ExitDialog.wxs
You will need to rename the Dialog Id to AppNameExitDialog and then we want to look at this control
<Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]">
<Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed</Condition>
</Control>
you want to change it to the following
<Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="!(loc.LaunchApp)" />
Additionally, windows installer is unable to display the background of a checkbox automatically as any other color than the grey-ish one you see in the screenshot you linked. If you want to get rid of this grey behind the text, you can actually modify the checkbox control's width and height to be about the size of the checkbox itself and set the text to "". Then you need to add another Text control to the UI that goes where the Check box's text used to go. This way you would have not have any grey background behind the text. The downside of this is that you must click the actual checkbox to toggle whether it is checked or not whereas before you could click anywhere in the grey area.
Again, to properly reference this new dialog you need to go to your AppName_InstallDir.wxs file and change the ExitDialog references to instead be AppNameExitDlg and also change the one <Publish> referencing the ExitDialog.
Hope this helps. The git repository is very useful for understanding how wix really works under the hood.

What is the best way to customize elements with jquery mobile

When using jQuery Mobile .js along with jQuery Mobile .css, what is the best way to customize the default styling such as a link button?
Using jQM, a simple link can be turned into a button by using the following code:
Link button
data-role="button" allows jQM to add classes to the link so it can be styled into mobile button touch abled like so:
<a href="index.html" data-role="button" data-corners="true" data-shadow="true"
data-iconshadow="true" data-wrapperels="span" data-theme="c" class="ui-btn
ui-shadow ui-btn-corner-all ui-btn-up-c"><span class="ui-btn-inner
ui-btn-corner-all"><span class="ui-btn-text">Link button</span></span></a>
Is it OK to actually edit the jQM css file for example the ui-btn-up-c class? Or is it better to override the styles somehow, perhaps in an external stylesheet?
I have a couple of concerns. I am wondering if it's possible to break some of the functionality by directly editing jQM.css as jQM seems to use the stylesheet heavily.
Also will it be a problem on updating? Do jQM release a new stylesheet when a new version comes out which would override my edits to the main jQM stylesheet?
Basically what I am asking is how do I edit the jQuery Mobile built in theme?
Thanks and look forward to your answers :)
Intro
If you want to change classic jQuery Mobile CSS everything depends on what do you want to do.
Theme roller
Classic way would be to create a completely new set of theme's or add them to existing ones. It is done through jQuery Mobile theme roller. When you open it it will automatically create 3 themes you can then modify as you wish. Or you can Import your current theme CSS and add several more themes (this is probably best solution if you want to change complete look).
Custom CSS changes
This solution requires a little bit of finesse. First if possible NEVER change original CSS unless you are 100% sure what you are doing. For example if you change default button classes it will also affect other widgets that use button classes and there are a lot of them.
Correct way would be to change single/multiple elements with custom CSS file. This way original CSS files is intact and new one can be changed / removed at any time.
To do this you will need to use Chrome Webmaster tools or additional plugin called Firebug (for Chrome and FireFox). There are several more solutions but this two are most commonly used.
Problem to think about
Not all is well in this solution. For example, classic a tag button can be easily modified cause that same a tag will stay as a parent of a future styled jQuery Button. But, if your button is created from input tag, like this:
<input type="text" value="Some value" id="change-me"/>
you cant use #change-me id to correct its CSS. Mainly because this input is not a parent tag for a future button, it will be a inner part of a button when jQuery Mobile styles it. It will look like this:
<div class="ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow ui-body-c">
<input type="text" id="change-me" value="Some value" class="ui-input-text ui-body-c"/>
</div>
To fix this wrap that input with another div element. Move id from input to div element and then use it to change inner CSS styles.
How to correctly override CSS styles
This is one of a most common questions in this StackOverflow group. When changing predefined CSS rules you must use !important keyword. Changes will usually not work without it. For example if you want to change input button style background (from a previous example, wrapped in a div) you would do it like this:
#change-me .ui-input-text {
background-color: red !important;
}
If nothing else works change original CSS file(s)
jQuery Mobile can have 1 or 2 CSS files. When using one file both theme and structure is included, or they can be separated into two files. This is useful if you want to change CSS directly. Theme CSS can be easily imported and exported into theme roller without affecting structure CSS file.
One last thing, some things can only be changed by modifying original structure CSS file. For example jQuery Mobile uses a horrible blue glow effect to show when some element has been pressed. It can be removed only directly from structure CSS file.
The solution lies in CSS specificity within your own additional CSS file. All you need to do to override any formatting in JQM is to first apply an id to the element you wish to override JQM formatting with your own CSS.
Next, in your own CSS, specify that the class be applied to the id of the container.
As an example, I'll remove the JQM border from an image link below.
#img_button_1 .ui-btn-inner {border: none !important;}
Where #img_button_1 is the id of the HTML anchor element.
<a id="img_button_1" data-role="button" data-theme="none" data-corners="false" data-shadow="false" data-inline="true"
href="http://www.google.com" target="_blank"><img src="http://www.google.com/images/srpr/logo1w.png" alt="Google" />
</a>
It's as simple as that.
One more important thing, and that is that load order of the external CSS files is significant, and you will want to load your own CSS after JQM CSS.
I have forked a working example at jsFiddle below.
http://jsfiddle.net/Z8Xnx/14/
The biggest benefit with this approach, is you do not have to alter the JQM CSS at all, and can leave it alone. This becomes important if your want to import your JQM back into the ThemeRoller tool at a later date. If you modify the actual JQM CSS by hand, you may have an issue successfully importing your JQM back into ThemeRoller again.
I have successfully used this approach to resolve every JQM CSS conflict I have run across since figuring out this specicivity requirement issue.
Hope this helps everyone with an easy solution to their JQM style conundrums.
** UPDATE **
It has been noted to me that this method does not work with the latest version of JQM (1.3.0b1), and that is not correct. I have investigated and found this to be a problem with the implementation of this version of JQM at jsFiddle. To prove this, I have put up an example page on my own space with the exact same code as that shown in the jsFiddle example. This means as of my writting, you really can't trust anything at jsFiddle using the lastest version of JQM from the options. Just a heads up, and you can find the working implementation at...
jQuery Mobile CSS Override Example
If you are looking to simply change the styling then you can use the jQuery Mobile themeroller.
http://jquerymobile.com/themeroller/index.php
Otherwise, I would suggest using another stylesheet rather than directly editing the jQuery mobile stylesheet.
If you are looking to reduce the number of files that you are serving to your visitors then I would compress both stylesheets and then just insert your styles below their styles as a production copy. That way, you can keep them compressed and combined for production, but you could keep them separate for easy upgrading later and for development ease of use.

Is there a way to get Sublime Text 2 to autocomplete HTML attributes?

I was wondering if there is a way to get Sublime Text 2 to autocomplete HTML attributes like in Aptana?
Autocomplete is enabled by default when you use "<" and your tag and then hit enter. So if you enter <p and then hit enter it will finish out the tag pair for you... where you will end up with <p></p> and your cursor will be in the middle. You can change this to tab if you prefer by pasting the following into your Preferences -> Settings - User file:
{
"auto_complete_commit_on_tab": true
}
This will override the default value of false for completion on tab. Again that is only if you wish to use tab instead of enter.
Hey you may try https://github.com/agibsonsw/HTMLAttributes or install trought package control package called "HTMLAttributes" ;). Its works for me. For example you type:
<p then press space bar then ctrl+space and you got list of attributes.
You can try to use emmet package. It was made specifically for html&css code completion. For more information you should read the documentation.
I was having the same issue; although I use both plugin packages HTMLAttributes and Emmet, neither one provides the auto-complete functionality I was looking for that's similar to Dreamweaver's.
Solution: I found a package called SublimeCodeIntel that does exactly what I needed.
Example: I code html emails and do a lot of inline CSS. End goal:
<td style="vertical-align:top;">
After installing SublimeCodeIntel, I typed <td style="v and a list of CSS properties starting with "v" displays.
Using my arrow keys, I select vertical-align and press tab to confirm, then type the letter "t" and a list of CSS values now displays.
I select top and then press tab to again confirm my selection.
Note: You can create predefined snippets for Emmet for undefined CSS properties but I wanted something "out of the box" instead of having to a) learn how to create them via the documentation (though I'm sure it's simple), and b) create a snippet each time I came across an undefined CSS property/value like vertical-align.
Hope this helps.

Sitecore Rich Text Html Editor Profile - set global default

OK I can't believe this can't be found anywhere so I'm asking the question.
Is there a way to set the default Html Editor Profile in Sitecore so I don't have the override the Source field on each individual Rich Text field?
e.g. I want to make this the default option for the Html editor:
/sitecore/system/Settings/Html Editor Profiles/Rich Text Medium
Its an old question but here is the solution I found in Sitecore 6.5 - I was looking to do the same thing in 6.5:
You can change the value to the path of your default editor in the web.config. This will change is across all fields where the source is not defined.
<!-- HTML EDITOR DEFAULT PROFILE
Path to the default html editor profile.
Default value: /sitecore/system/Settings/Html Editor Profiles/Rich Text Default
-->
<setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Profiles/Rich Text Default"/>
It seems to fall back to the "/sitecore/system/Settings/Html Editor Profiles/Rich Text Default" in case the source is not defined. Thus, if you try to modify this default profile, every RTE field will obtain these modifications by default, without specifying the source.
Never tried it myself, though...

WYSIWYG editor and loaded content trouble

I have a wysiwyg editor ckeditor. It has a textarea. Okay, everything works fine, but until I'm trying to load content which already has inputs elements (textarea). So, we have:
<textarea id="ckeditor">
... Loadable content ...
<textarea id="some_other"></textarea>
</textarea>
As you see loadable textarea is closing ckeditor-area, and another content is outside editor. Any suggestions to make another textarea in my ckeditor-area?
Escape it:
<textarea>...</textarea>...</textarea>
There are functions for that in every language, e.g. htmlspecialchars in PHP.

Resources