Use WinRTXamlToolkit.Controls.AlternativePage - windows-runtime

I am trying to use the alternative page. I have the same problem with WinRTXamlToolkit.Controls.AlternativePage.
I add a AppShell : UserControl to my project but i can't navigate to the page. What else i must do?

You don't need AppShell to use AlternativePage. You need the AlternativeFrame.

Related

Where to place widgets in Yii2 application

I'm using Yii2 to create my application. I also like to use the widget feature, but I'm not sure, what is the best practice for the widget code location. The Yii2 directory-structure provides 2 directories:
#app/components
#app/widgets
The location "2." (#app/widgets) sounds like the best location for widgets. But, the Yii2 documentation for widgets used the location "1." (#app/components)
So my question: what is the right place for own widgets?
I put it in #app/components/*.
There I also put
#app/components/widgets/*
#app/components/helpers/*
#app/components/validators/*
#app/components/otherComponent/*
#app/components/MyActiveRecord.php
#app/components/MyController.php
and other components of my application

How to Include "onclick" Object in WordPress HTML

I'm using attempting to add an "onclick" object to a page in a singlesite (i.e. rather than multisite) WordPress that triggers an event. The code is:
Send a voice message
When attempting to save the code, WordPress strips the onclick object leaving:
Send a voice message
A user on another forum suggested that this restriction should only apply to multisite non-superadmin users. Again, this is a siglesite with only one admin user.
It is understood that WordPress removes "onclick" from HTML to prevent malicious code. Still, does anyone know how to resolve this?
Thanks.
It appears that with current Wordpress (I'm on 4.9.4), TinyMCE does the filtering directly on the editor screen, not when the form is submitted. The allowedtags and allowedposttags don't seem to matter, so the solution above does not solve the problem for me.
The method I have developed uses the tiny_mce_before_init filter to alter the allowed tags within TinyMCE. The trick is to add the extended_valid_elements setting with the updated versions of the elements allowed for a.
First, look in the page http://archive.tinymce.com/wiki.php/Configuration3x:valid_elements to find the current value for a, which right now is
a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur]
And add to the end of that the onclick attribute:
a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick]
Then use that in the filter function like this:
function allow_button_onclick_mce($settings) {
$settings['extended_valid_elements'] = "a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick]";
return $settings;
}
add_filter('tiny_mce_before_init', 'allow_button_onclick_mce');
which you install in your functions.php file in Wordpress. You can see it in action by toggling the text and visual view on the edit page. Without the extended list, the onclick goes away. With it, it remains.
You can solve this by changing the anchor tag into button and adding a script. For more info please refer to this link: Wordpress TinyMCE Strips OnClick & OnChange (need jQuery).
By resolving, I'm assuming you mean to allow the onclick attribute. You will want to be careful with this, because modifying the allowed tags does this for all your users.
You can modify the list of allowed tags and attributes, by adding this to your functions.php file:
function allow_onclick_content() {
global $allowedposttags, $allowedtags;
$newattribute = "onclick";
$allowedposttags["a"][$newattribute] = true;
$allowedtags["a"][$newattribute] = true; //unnecessary?
}
add_action( 'init', 'allow_onclick_content' );
I suggest trying it with only $allowedposttags first to see if that works for you. According to this other stackexchange post, you should only need allowedtags if you need it for comments or possibly non-logged-in users, but when I did something similar in the past, I needed both of them to work.
On a side note, if you want a list of all already allowed tags and attributes, look inside your /wp-includes/kses.php file.

Open generated Web Page with WebBrowser object in VB

I'd like to know if it possible to show HTML page created in VB using WebBrowser object without using files on disk.
That is, create HTML file in memory and show it within WebBrowser object.
Thanks!
Using Visual Basic in .Net Framework...
webBrowser1.DocumentText = "<html><body><a href='http://www.mywebsite.com'>My Web Site</a></body></html>"
In old Visual Basic 6, try...
WebBrowser1.Document.Open
WebBrowser1.Document.Write "<html><body><a href='http://www.mywebsite.com'>My Web Site</a></body></html>"
WebBrowser1.Document.Close
First wait for the DocumentComplete event (navigate to about:blank if you start from scratch), then use the document's IPersistMoniker (recommended if you want to provide a base url) or IPersistStreamInit interface to load HTML content.
You can find an example (the LoadHtmlIntoBrowser method) in the csexwb project.
Well, I've found the solution. It's not so complicated.
The solution is to run from the VB:
*
WebBrowserObject.Navigate "about:HTML TEXT"
It works, I've checked it.

For MediaWiki Skin Setting HTML Title to "[Site Name]" instead of "Main Page - [Site Name]"

I'm using a custom version of the monobook skin. How do I set the HTML title to "[Site Name]" instead of "Main Page - [Site Name]"?
You should be able to put something like the following in your common.js, and get it to execute on only the Main Page.
if {{{{PAGENAME}}=="Main Page"
{
document.title = "{{SITENAME}}";
}
It's not totally correct because I don't know javascript.
Try editing [[MediaWiki:Pagetitle]] - set it to "{{SITENAME}}" instead of the default "$1 - {{SITENAME}}".
Perhaps you can use MediaWikis parser functions to achieve something like what Adrian Archer answered, but run by the server rather than the client (so search engines will take heed). You'll have to edit [[MediaWiki:Pagetitle]] as Joshua C. Lerner said, then. Extension:ParserFunctions is bundled with MediaWiki 1.18 and above, so http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions will help you!

Silverlight app in iframe access to parent window

I have Silverlight application test page named A.html hosted in an iframe which is an element of B.html, so is there a way for Silverlight app to access elements in B.html by referring something like HtmlPage.Document..?
Thanks!
You can always walk up the DOM tree by doing something like this:
var htmlElement = HtmlPage.Document.DocumentElement.Parent;
In the container html page, add following function:
function GetParent
{
return parent;
}
In the SL control, do this:
HtmlWindow parent = (HtmlWindow)HtmlPage.Window.Invoke("GetParentWindow");
Now to invoke any function from the parent Html page, just call
parent.Invoke("myFunction");
Hope this solves your issue.
Ahmad.
Using Silverlight/Moonlight is very risky. Most of your website's guests will not have this plugin installed. This will strongly limit your website accessibility.
Use Flash instead, or even better use only [x]html+css+javascript.