How I can put text in the middle of post box. I posting this post by Graph API
facebook_access_token.post("/me/feed", {
:message => "Lorem ipsum dolor sit amet",
:name => "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
:link => 'http://heiaheia.com',
:description => ' ',
:picture => 'http://images.apple.com/downloads/dashboard/justforfun/images/earth_20090309105503.jpg'
})
If you mean vertically align it in the middle, then its not possible. Its box has a minimum height as you see.
Related
Hi everyone I am creating a text editor and I would like to know if there is the possibility to insert a Uibutton in the middle of the text. I am not referring to a url but to a real button.
For now I am creating the editor with a UIViewRepresentable and then with a regex I look for the part of the text to be transformed
Lorem ipsum dolor sit amet, <button id = "4"> consectetur adipiscing elit. Maecenas ornare </button> eget sapien vel gravida.
My goal is to transform the text between the <button> tag into a UIButton or in any case into a tappable text that can perform an action. To understand the equivalent of
Button (action: {
self.mode = "normal"
}) {
Text ("title")
}
some idea? Is it possible to achieve this?
Thank you!
js with HandleBar, I have been using it for a couple of days now but I have hit a problem.
Basically i have the following json data:
{
"id":1009,
"parent_id":1007,
"template":"blog-post",
"path":"/blog-post/another-test-blog-post/",
"name":"another-test-blog-post",
"created":1389310922,
"modified":1389371901,
"created_users_id":41,
"modified_users_id":41,
"title":"Another Test Blog Post",
"headline":null,
"summary":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum quis lectus dui. ",
"image_caption":"Another Image Caption",
"images":{
"blog-sample-image-medium.png":{
"basename":"blog-sample-image-medium.png",
"description":"",
"tags":"",
"formatted":true,
"modified":1389352919,
"created":1389352919
}
},
"sub_heading":"Another Sub Heading"
}
It is valid data and I am able to obtain parameters and display within my handle bars template. However I am unable to access the properties within "images", I have tried also sorts of techniques and am unable to do so. Here is the part of my template in question:
{{#each item in model}}
<div class="media-element" {{#ifIsNthItem nth=3}} style="margin-right: 0px;" {{/ifIsNthItem}}>
<div style="skyiq-element-icon blog-element">
</div>
<div class="media-main-image grayscale" style="">
</div>
<p class="sub-heading">{{item.title}}</p>
<ul>
<li><i aria-hidden="true" class="skycon-user-profile"></i> By Liam Powell</li>
<li><i aria-hidden="true" class=" skycon-info"></i> 02/Dec/2013</li>
</ul>
<p>{{{item.summary}}}</p>
read more
<div class="skyiq-line"></div>
<i class=" skycon-share" aria-hidden="true"></i> Share
</div>
{{/each}}
So parameters such as item.summary display but I can not display item.images.1.basename for example.
Any help or a point in the right direction would be a great help.
Thanks in advance
Three things:
1) The way you're accessing it like this: {{item.images.1.basename}} makes me think you want to treat images like an array. You can't access items in an array using the index number in handlebars like you would in javascript. Ember provides helper properties called firstObject and lastObject on arrays that let you access the first and last object of the array. But, there isn't a secondObject which it looks like you want in the case you laid out. Typically the way you would access elements in an array is by iterating over them using an {{#each}}.
2) In the JSON you posted, images isn't an array but an object. So, you would access items on it like this: {{item.images.blog-sample-image-medium.png.basename}}.
3) Ember is likely going to not like the fact that the object key blog-sample-image-medium.png has a period in it, since that's how it figures out when it's time to access the next object. You should try and figure out how to get the period out of the keys name.
I am using Foundation 4.2.3 from Zurb, but when I print pages, the grid layout is always not maintained.
For example,
<div class="row">
<div class="small-3 columns">
XXX
</div>
<div class="small-9 columns">
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
</div>
</div>
This renders as
but it becomes this when printed.
Is there a fix to this so that the grid layout is maintained?
I added this to my .scss file at the end:
#media print {
div.columns {
float:left!important;
padding-left:0.9375em!important;
padding-right:0.9375em!important;
width:8.3333333333%!important;
}
}
The issue ist that ".large-XXX .columns" in the grid is only defined for "#media screen":
foundation/_variables.scss:98
$small: "only screen and (min-width: #{$small-screen})";
foundation/components/_grid.scss:153
#media #{$small} {
#for $i from 1 through $total-columns {
.large#{-$i} { #include grid-column($columns:$i,$collapse:null,$float:false); }
}
...
}
So what I did was add a line after foundation/_variables.scss is included that overrides this:
// This includes all of the foundation global elements that are needed to work with any of the other files.
#import "foundation/variables";
$small: "screen and (min-width: #{$small-screen}), print";
Of course, this only works if you don't auto-include all of foundation by way of #import "foundation", but instead include all of them manually (i.e., uncomment the respective lines in _foundation.scss).
I did this in the variables.scss file for Foundation 5, although it's not perfect.
// $screen: "only screen";
$screen: "print, screen";
I have the following data structure for a simple messaging app:
App.Message = DS.Model.extend({
title: DS.attr("string"),
body: DS.attr("string"),
isRead: DS.attr("boolean"),
replyTo: DS.belongsTo("App.Message")
});
App.Message.FIXTURES = [{
id: "1",
title: "Eos ut amet persius, ea ius nibh iudico",
body: "Lorem ipsum dolor sit amet, nam et hinc doctus alienum, in vel latine conceptam.",
isRead: true,
replyTo: null
},
{
id: "2",
title: "Ad est dolor veniam delenit.",
body: "Lorem ipsum dolor sit amet, nam et hinc doctus alienum, in vel latine conceptam.",
isRead: false,
replyTo: "1"
},
{
id: "3",
title: "Eu nec summo placerat reprehendunt.",
body: "Lorem ipsum dolor sit amet, nam et hinc doctus alienum, in vel latine conceptam. Tale eirmod omittantur sit ne. Minim noster philosophia per eu, mel putent veritus an, ex veniam ubique consulatu has. At stet diceret repudiare ius, probo liber diceret no est. Ridens efficiantur vim te.",
isRead: false,
replyTo: "1"
}];
I am trying to display replies to a message when it is selected but none are appearing. The message subject and body are displaying fine so I know my routes, controllers and templates are set up correctly for the parent entity at least.
Here are my templates (with almost all markup removed for brevity):
<script type="text/x-handlebars" data-template-name="message">
<h2>{{ title }}</h2>
<p>{{ body }}</p>
{{ render "messageResponses" responses }}
</script>
<script type="text/x-handlebars" data-template-name="messageResponses">
{{#each responses}}
<p>{{ body }}</p>
{{/each}}
</script>
And my Message controller (the part I'm probably doing wrong):
App.MessageController = Ember.ObjectController.extend({
responses: function() {
return App.Message.find({ replyTo: this.get("id") );
}
});
Try findProperty instead:
App.MessageController = Ember.ObjectController.extend({
responses: function() {
return App.Message.findProperty('replyTo', this.get("id"));
}
});
I'm having my first play around with Ember.js, and am falling at the first hurdle. Been trying for ages to get this to work, but I keep getting the error "Cannot call method 'extend' of undefined "
In my HTML I have this:
<script type="text/x-handlebars">
{{#view App.MainView}}
<div class="hero-unit">
<h1>{{blogTitle}}</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non neque a eros dapibus posuere. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
{{/view}}
</script>
And in my JS I have this:
var App = Ember.Application.create();
//define main view
App.MainView = Ember.View.extend({
blogTitle: 'Epic Blog'
});
According to the docs, this should just render the template fine, but no matter hoe hard I try I get the error...
Anyone know what I'm doing wrong?
What Ember.js version are you using? I've created a JSFiddle with your code using Ember.js 0.9.8.1 and it works, see http://jsfiddle.net/pangratz666/D3VuA/.
Also, you have to declare App as global variable by omitting the var. This is needed so bindings and paths in the templates work:
App = Ember.Application.create();
...