Make PopUp completely intransparent - windows-store-apps

I use the popup to implement a kind of "autocomplete-list" with data from user-input.
The problem is: The popup is as little bit transparent and you can see the elements behind the list.
I want a list that is complete intransparent.
No "Opacity" is set, not to the popup, nor to the list (the element in the popup).
Has anybody an idea?
Thanks
Peter

The Popup control on its own is transparent. You will generally put a container inside it to host and layout the contents. This container should have a theme-appropriate background. Depending on your design that may be completely opaque or it may be partially transparent.
Here's an opaque snippet. You'll probably want to choose a different colour in production :)
<Popup x:Name="mypop">
<Grid Background="Magenta">
<TextBlock Width="600" TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"/>
</Grid>
</Popup>

Related

prevent linebreaks in html with php snippets

I have a html site which gets some textsnippets with php. I can not control how long those snippets are but want to keep my formatting.
I rather want that the text which is inserted via php not completely visible than have linebreaks. I assume there is a simple css solution to this, i just don't know what to search for. I had that problem several times the other way around, but cant find the code where it occured.
<div class="col-4">
{some PHP code that receives information}
</div>
Output:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Expected Output:
Lorem ipsum dolor sit amet, consetetur sa
The rest of the text should be in the html file but not be visible, counting characters is no option. Overflowing the boundaries of the div container is ok.
i wrote js script for your issue. try to understand it but if you have question, just ask in comments.
$(document).ready(function(){
var fulltext = $('#text').text();//change #text to your elements id or class
var nof = 3; //number of charachter from start , starts from 1
var removedText = fulltext.slice(nof,fulltext.length);
//slice nof to end to hide it
var selectedText = fulltext.slice(0,nof);
$('#text').text(selectedText);
$('#text').append('<p style="visibility:hidden">'+removedText+'</p>')
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="parent"style="background-color:#ffffff">
<h1 id="text">HelloWorld</h1>
</div>
My solution for now are just two simple css lines
white-space: nowrap;
float: initial;
The only thing i am still missing is that the text is always visible if it reaches over the div boundaries. Maybe someone knows a trick to that but this is no urgent...
Since you don't know how long the content would be you could perhaps use text-overflow:ellipsis combined with white-space:nowrap and for your problem
the text is always visible if it reaches over the div boundaries
you could use overflow:hidden. When all this combined together. You'll get this
div {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 300px;
margin auto;
}
<div class="col-4">
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</div>

How can i decode Html tags on Xamarin Forms

I'm getting list of data from API. Those are
*Id
*Description
*MinPhotoPath
*MaxPhotoPath
I want to get Description Like this
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
but i get infront of Lorem ipsum p and strong which is inside html tags and i'm getting infront of consectetur s inside html tags, something like that...
I tried to use WebUtility.HtmlDecode but its only decode the at the end of the text "\r\n".
I'm waiting for your help.Thanks.

Exclude stylesheet

For an application I'm developping, I want to build in the functionality to generate an invoice. This invoice is configurable, and I want to show a preview in my page. Based on the data I send back to my C# back-end, I will generate a .PDF file which will be made available for downloading.
In the back-end generation process, I will have no access to my stylesheet and will have to define all my classes completely inline. Because I want my preview to truly match what the invoice will end up looking like, I need to be able to exclude all other styling from the preview element.
Is there a way to do this?
Example:
<link href="Content/style.css" rel="stylesheet" />
<div>
<p>Use classes defined in style.css</p>
<div EXCLUDE CSS OUTSIDE THIS SCOPE>
<p>No access to style.css</p>
</div>
</div>
I understand that I could achieve the desired effect by simply making sure the previewer is placed outside of the scope where I inject my CSS, but due to the structure of my project, this is not an option.
Extra info:
I'm using a stylesheet purchased by the company I'm doing this project for. The stylesheet is very poorly set-up, however, and includes all sorts of default styling like:
table {
color: black !important;
}
I'm looking for a way to exclude all that styling without having to individually overwrite every property set in that stylesheet.
There is the all property, and the initial value to reset a property to the default settings of the browser. So if you wrap the part you want to be "excluded" from your styles into a tag to which you apply a class like the following (i.e. combined with the * selector), it should have the effect you want:
.unset * {
all: initial;
}
And in the HTML:
<div>
<p>Use classes defined in style.css</p>
<div class="unset">
<p>No access to style.css</p>
</div>
</div>
But unfortunately, all does not yet work in IE/Edge, it's "under consideration": http://caniuse.com/#search=all
Still, if your stylesheet doesn't use too many different properties (and if you know them), you could list those, define all of them as initial and apply it, using a selector as shown above. Example:
.unset * {
font-size: initial;
color: initial;
background: initial;
text-decoration: initial;
margin: initial;
padding: initial;
}
You can try to use the :not() selector and add it to each class in your CSS. Here is a simple example
div p:not(.secondParagraph){font-style:italic}
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p class="secondParagraph">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
For your problem you may do something like that:
Select elements with class "myClass" excluding those that are immediate children of elements with ID "myID" is:
*:not(#myID) > .para
However, the :not() selector is not supported in IE8 or less. look here for details about it.
If you don't need apply styling of .css file in page.just add disabled =true attribute .so that it won't apply the styling from that file.
see the link stackover link for reference.
<link rel="stylesheet" href="yourstyleXXX.css" disabled =true />
You could use ID like Gezzasa said.
<div id="expluded">
<p>Something.</p>
</div>
In css get new class as in.
#expluded {
put your parameters hare.
}

HTML mailto link with body text; outlook adding unwanted line break

When generating an email draft with body text from an HTML mailto link, Outlook's default formatting settings automatically add a line break after lines exceeding 120 characters that end with a line break (%0D%0A). Anyone know how I might prevent this from happening? My assumption is that this is how Outlook will behave and I won't be able to change that, at least not from the mailto link.
Let me know if you need any additional information or if I am being unclear. Thank you for your time.
EDIT: example jsfiddle : https://jsfiddle.net/q7rc1y65/2/
The only valid way to generate line breaks with the mailto: command is to use %0D%0A . Unfortunately Outlook automatically formats messages and treats text longer than 120 characters with a line break as a paragraph. You can see this by pressing ctrl+shift+8.
You can change how this behaves on your own install of outlook See Here, but you cannot use the mailto: command to control this behavior. An alternative solution would be to use an email form instead of the mailto link, then send the email server side. Here you have much greater control over the look and structure of the body and would have the ability to create html emails as well.
Here is the updated fiddle demonstrating your issue: JSFIDDLE .
MAIL!
<br /><br />
MAILTO HREF:
<div id='linkText'></div>
$().ready(function () {
var returnChar = encodeURIComponent('%0D%0A');
var subject = encodeURIComponent('this is the subject');
var body = encodeURIComponent('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nos ');
var bodySub120 = encodeURIComponent('Lorem ipsum dolor sit amet, consectetur adipiscing elit ');
var href = 'mailto:someone#somewhere.com?subject=' + subject + '&body=';
var href= href + bodySub120 + returnChar + bodySub120 + returnChar + body + returnChar + body + returnChar;
$('a').attr("href", href);
$('div#linkText').text(href);
});

Zend PDF: How do I print bold text or text in another color etc?

I have a long string, like:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Some of the words should be bold and some text should have another color and so on. Is it somehow possible to give the drawText function a string that already contains the correct syntax so the PDF will have the bold text and so on? Something like this:
$text = "my <b>text</b>...";
$page->drawText($text, 100, ($page->getHeight() - 100));
Its not working with HTML, but something simliar?
Thanks!
The short answer to your question is no, Zend Framework does not provide the formatting functions that you are looking for.
Zend_Pdf provides the primitive functions for drawing text, lines, circles, etc onto the page, but that's about it. If you want to bold some text in the middle of a line, you have to draw the first bit of text, change the font style to bold, draw the bit of text you want bolded, switch back to the original font style and then draw the remainder of the line. And you have to look after line wrapping, page breaks, etc, yourself too.
I wrote a blog post some time ago that talks about these challenges in more depth and have posted a wrapper class on github that makes Zend_Pdf a little easier to use. The post is here: http://yetanotherprogrammingblog.com/content/zend_pdf-wrapper-and-sample-code and the wrapper class is here: https://github.com/jamesggordon/Wrap_Pdf. Unfortunately this version of the class doesn't do precisely what you want, but it shouldn't be too hard to modify the writeText() method to implement the font changing system that you're after.
I too am looking for something similar. We have some legacy code that renders a PDF using Zend PDF.. it's very complicated.
I have in the past used something called DomPDF - this is probably what you need as it just turns HTML into PDF for you - very easy to use!
http://dompdf.github.io/
It can be done, check out zend.pdf.drawing;
http://framework.zend.com/manual/1.12/en/zend.pdf.drawing.html
You'd need to break your PHP strings up, then change the Zend PDF drawing styles between each PHP string.
$style->setFont(\Zend_Pdf_Font::fontWithName(\Zend_Pdf_Font::FONT_TIMES_BOLD), 12);
$page->setStyle($style);
$page->drawText(....);
$style->setFont(\Zend_Pdf_Font::fontWithName(\Zend_Pdf_Font::FONT_TIMES), 10);
$page->setStyle($style);
$page->drawText(....);