iphone HTML entities not interpreted - iphone

I am currently working on a website for a client, who encounters a bug that even I am not able to reproduce...
Here is a page example : http://newsletter.thenextgag.com/#/5/2014-01-02
My client is using an iphone to navigate through the website and seems to encounter a realy weird bug : it looks like HTML entities are not interpreted, or that special characters are transformed into HTML entities and not showing correctly. Here is the image he produced to me :
Do you have an idea ? I made some search but was unable to find anything on it..
I am using HTML5 and AngularJS, but I can't see why it should change anything..
Thanks

I see you're using Angular 1.2.3 and the linky filter. There seems to be some changes in 1.2.4 in $santize, that the linky filter uses, that affects how it handles escaped/entity characters.
If you create an extremely simple page, with the following controller:
app.controller('MainCtrl', function($scope) {
$scope.content = "L\u2019appli iPhone de l\u2019ann\u00e9e. Qui n\u2019a pas perdu un ou des amis \u00e0 cause de leur addiction \u00e0 ces bonbons ?";
});
with a template:
<div ng-bind-html="content | linky"></div>
Then using Angular 1.2.3 on an iPhone (in my case, iPhone 4 running IOS 7.04), the output is:
L’appli iPhone de l’année. Qui n’a pas perdu un ou des amis à cause de leur addiction à ces bonbons ?L’appli iPhone de l’année. Qui n’a pas perdu un ou des amis à cause de leur addiction à ces bonbons ?L’appli iPhone de l’année. Qui n’a pas perdu un ou des amis à cause de leur addiction à ces bonbons ?L’appli iPhone de l’année. Qui n’a pas perdu un ou des amis à cause de leur addiction à ces bonbons ?
But doing the same thing on Angular 1.2.4 results in
L’appli iPhone de l’année. Qui n’a pas perdu un ou des amis à cause de leur addiction à ces bonbons ?
I'm testing using https://npmjs.org/package/http-server on a Mac, in case there are some other issues at work that means this can't be reproduced everywhere.
So my solution would be to change the version of Angular you're using to 1.2.4 or later.

Related

How do you show a specific label on a post?

I currently have the code below (from a blogger template) which seems to randomize the label on each post that pops out on my blog. How do I enforce that I only want to show 1 of these 4 labels only: san francisco, los angeles, chicago, new york. Each blog has one of these labels.
<div class='postags'>
<b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a>
<b:if cond='data:label.isLast != "true"'/>
</b:loop>
</b:if>
</div>
if you want to show only one label you can use limit, but you can't specify which one that appears
<div class='postags'>
<b:if cond='data:post.labels'>
<b:loop values='data:post.labels limit 1' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a>
</b:loop>
</b:if>
</div>

Remove autogenerated HTML in typo3

Trying to get into typo3; unfortunately the docs aren't really helpful for me. After creating a backend-layout I am trying to output multiple columns.
Right now I'm getting the following output:
<div id="c23" class="frame frame-default frame-type-text frame-layout-0">
<a id="c30"></a>
<header>
<h2 class="">Title</h2>
</header>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed …</p>
</div>
I'd like to have the output without any extra elements, like this:
<h2>Title</h2>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed …</p>
What is the correct way to get the "correct" output in typoscript?
Such HTML attributes comming from EXT:fluid_styled_content (/typo3/sysext/fluid_styled_content/Resources/Private/Layouts/Default.html).
To adapt this and all other files, you should make a copy of folders Templates, Partials, Layouts from /typo3/sysext/fluid_styled_content/Resources/Private, define them via typoscript constants as new paths:
styles.templates {
templateRootPath = [PATH/TO/YOUR/FOLDER/Templates]
partialRootPath = [PATH/TO/YOUR/FOLDER/Partials]
layoutRootPath = [PATH/TO/YOUR/FOLDER/Layouts]
}
and adpat them for your needs, especially /PATH/TO/YOUR/FOLDER/Layouts/Default.html
This is best done in a recommended own sitepackage. You could use https://sitepackagebuilder.com/new/ to start with.
If is TYPO3 7.6
Yo need to override boostrap-package Layouts/ContentElements/Default.html
because there are created that classes and from that files remove wrapper
div id="c{data.uid}" class="frame frame-type-{data.CType} frame-layout-{data.layout} {sectionClass}"
Only wrapper!
with FSC (fluid_styled_content) all your markup is in fluid-templates, which you can override.
go to your server and copy files from (webroot)/typo3/sysext/fluid_styled_content/Resources/Private/ + Layouts/ and/or Partials/ and/or Templates/.
In typoscript setup you need to define additional pathes to your variants.
Don't copy all files, but copy only those you modify.
In your case you probably need to modify the Layouts/* and Partials/header.

no body on email from cfmail

I have this code that is sending an email to me when some query is running on database from coldfusion. I'd receive the email without problems but there is no body on it, only shows the subject. I tryed using no type on cfmail tag and changing the cfmailpart tag type="html" for type="text", but nothing happens. The funny thing is that in my local folder CF8/mail/undelivr i can see the body of the email and shows itself without problems, but when this code go to production, doesn't work. Some clue about what is happening?
this is the code i'm using now:
<cfset fechaActual = dateformat(Now(),"dd-mm-yyyy") >
<cfset horaActual = TimeFormat(now(), "HH:mm:ss") >
<cfset archivoActual = CGI.http_host & CGI.script_name & "?" & CGI.query_string>
<cfmail type="html" to="xxx#xxx.com,xxx#xxx.com,xxx#xxx.com" from="xxx#xxx.com" subject="Delete tabla xxx #fechaActual# hrs.">
<cfmailpart type="text">
Este aviso indica que ha sido ejecutado un DELETE en la tabla xxx.
Hora de ejecución: #horaActual#
Fecha de ejecución: #fechaActual#
Ruta:D:\xxx\xxx\xxx\xxx\xxx.cfm
Url: #archivoActual#
Linea: xx
IDs Eliminados: #idaviso#
</cfmailpart>
</cfmail>
Thank you!!!
best regards
I suggest using both text and HTML cfmailparts. Including both increases the probability that they will be readable by everyone. You might want to make the text only cfmailpart very basic with limited information.
Be sure to include text only within the text cfmailpart and HTML formatted text in the HTML cfmailpart.
<cfmail type="html">
<cfmailpart type="text">
Este aviso indica
</cfmailpart>
<cfmailpart type="html">
<p>Some HTML words</p>
</cfmailpart>
</cfmail>

Dynamically replacing DIV's inner text in GWT

I'm looking for the possibilities that GWT, SmartGWT, offers in terms of dynamically changing the inner HTML text of an element.
Let go though an example :
I have some lorem ipsum text in a DIV element as it follows :
<div id="text">
Lorem <span style="background-color:red">ipsum </span>
dolor sit amet, consectetur adipiscing elit.
Duis convallis iaculis
<span style="background-color:red">ipsum </span>
magna sagittis vel. Lorem
<span style="background-color:red">ipsum </span> dolor sit amet.
</div>
Desired functionality :
I want the user to be allowed to decide at runtime what text is "marked" (red colored). This impact in two things :
Being able to remove an span element, thus replacing
<span style="background-color:red">ipsum </span>
by
ipsum
Being able to add an span element (by doing the opposite)
Once the user has selected the text he wants to "mark", I use something like
RootPanel.get("text").getElement().
setInnerHTML("html content with some new spans tags");
to update the HTML code with the new selection (to achieve that I have some GWT classed that keeps track of the marked text).
This seems to be a little brutal for me because I'm in a situation that I often update the inner HTML code.
Is there any way using GWT (working closely with the DOM) or SmartGWT, to achieve that in a less violent way ?
To access the DOM of your page you can call Document.get(), which has a convenience method for finding an element by it's id Document.get().getElementById("test");
Of course, you should keep a reference to this element so as not to have to search through the DOM everytime you want to access it, because this is brutal.
private Element testDiv = Document.get().getElementById("test");
...
testDiv.setInnerHTML("Some html");
...
testDiv.setInnerHTML("Some other html");
But once you have a reference to this element, calling setInnerHTML is the most efficient way to do what you want. I'm not sure why you think this is brutal. This is probably even more efficient than when you call a method on a widget to change it's content, like setText(" ...") on a TextBox for example, because these methods usually check the value passed as parameter for security.
Security could also be a concern for you, depending on what the user can do. But usually if a user can modify the HTML in your page that's a concern. You might want to look at GWT's SafeHTML feature.
If you're looking for RichText components, you can look at GWT's RichTextArea for example. But this type of component is usually not well supported by all browsers and will take more resources than what you're doing already so I don't recommend it.

Zend_Translate and translation issues

I wonder how I could translate the following?
(french) Vous avez oublié votre mot de passe ?
(english) Forgot your password ?
(dutch) Paswoord vergeten ?
As you may notice, the problem is that in the dutch version, the sentence starts with password and in the french and english version, it starts with the subject/verb.
I usually do it like this:
<?php echo $this->translate('Vous avez oublié votre'); ?>
<?php echo $this->translate('mot de passe'); ?> ?
Unfortunately that won't work here because as said earlier in the dutch version the sentence starts with the password.
You have to use embedded parameters ( %1\$s): http://framework.zend.com/manual/en/zend.translate.using.html