According to QtInstaller documentation , we can hide a default page , by setting their visibility to false:
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
But this is not working with QtInstaller version 4.4 , any clues?
Related
I have homepage which is created by using multiple small template pages in wordpress. I have set menus on it . now i want to go on particular section/ template using menu. like if i press contact menu button then it should go smoothly downwards of homepage where the contact template has been called. I am using "Page scroll to id" plugin of wordpress but its not working. I have also seen that this plugin work when the page is created by dashoard page. Please help me , how can i navigate to my template page/section using this plugin. If any other plugin is there , please tell me about it . i will try to use that too.
Thanks
To create smooth scroll on link click follow the below steps :
Step 1: Add section ids in menu href including #section1 from admin section Appearance >> Menu .
Step 2: Create section or div with id name section1.
<div id="section1"></div>
Step 3: Paste the below code under your custom js file.
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var hash = this.hash;
// Using jQuery's animate() method to add smooth page scroll
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = hash;
});
} // End if
});
});
I hope it will helps you.
I'm trying to call a specific FullCalendar view, not necessarily my default view, through a URL.
Something like /my_calendar/?&mode=month.
I searched the documentation and couldn't easily find anything that points to this.
I found this though where they claim this is implemented in Drupal somehow. Not sure how to backport (if easily possible?).
Any idea on how to achieve this?
So on your calendar page, before your fullcalendar configuration you will need to add the following code. This will check if $_GET['mode'] is set in the url and if it is, it will use a switch to make sure it is a valid value and then assign the JavaScript variable to that value and echo it to the page and if it is not set or if the value does not match it will assign the default value of month.
<script>
<?php
if(isset($_GET['mode'])) {
switch ($_GET['mode']) {
case "month":
echo "var mode = 'month';";
break;
case "agendaWeek":
echo "var mode = 'agendaWeek';";
break;
default:
echo "var mode = 'month';";
break;
}
} else {
echo "var mode = 'month';";
}
?>
</script>
Then in your fullcalendar configuration you just need to set the following.
defaultView: mode,
Note: your IDE may say that mode is not defined if your fullcalendar configuration and fullcalendar page are separate. Thats fine as long as its defined on the calendar page before the script. With this code, a page like calendar.php?mode=agendaWeek will load the calendar with default view set to agendaWeek.
Could anyone help me make a new field type for NHP Theme Options Framework based on "upload" type so that it would use the new "Media Manager" that Wordpress uses since 3.5 instead of Media Uploader. This would be very useful for use with sliders.
Maybe this post would be helpful.
you're in luck i needed this same functionality. I managed to do it by looking at the code and applying the same override techniques as the the old media manager.
In fact i've written a tutorial about it here.
Here's the javascript code:
(function($){
var doc = {
ready: function(){
// initialize only if our button is in the page
if($('#btn_browse_files').length > 0){
slider.init();
}
}
},
slider = {
// the following 2 objects would be our backup containers
// as we will be replacing the default media handlers
media_send_attachment: null,
media_close_window: null,
init: function(){
// bind the button's click the browse_clicked handler
$('#btn_browse_files').click(slider.browse_clicked);
},
browse_clicked: function(event){
// cancel the event so we won't be navigated to href="#"
event.preventDefault();
// backup editor objects first
slider.media_send_attachment = wp.media.editor.send.attachment;
slider.media_close_window = wp.media.editor.remove;
// override the objects with our own
wp.media.editor.send.attachment = slider.media_accept;
wp.media.editor.remove = slider.media_close;
// open up the media manager window
wp.media.editor.open();
},
media_accept: function(props, attachment){
// this function is called when the media manager sends in media info
// when the user clicks the "Insert into Post" button
// this may be called multiple times (one for each selected file)
// you might be interested in the following:
// alert(attachment.id); // this stands for the id of the media attachment passed
// alert(attachment.url); // this is the url of the media attachment passed
// for now let's log it the console
// not you can do anything Javascript-ly possible here
console.log(props);
console.log(attachment);
},
media_close: function(id){
// this function is called when the media manager wants to close
// (either close button or after sending the selected items)
// restore editor objects from backup
wp.media.editor.send.attachment = slider.media_send_attachment;
wp.media.editor.remove = slider.media_close_window;
// nullify the backup objects to free up some memory
slider.media_send_attachment= null;
slider.media_close_window= null;
// trigger the actual remove
wp.media.editor.remove(id);
}
};
$(document).ready(doc.ready);
})(jQuery);
fyi...http://reduxframework.com/ is a fork of NHP and has added 3.5 media loader and also fixed other areas of NHP.
I just switched over to and so far not to bad.
See the usage in our vafpress theme framework github code snippet:
media manager with WP < 3.5 fallback
in the code, there is also this variable (vp_wp.use_new_media_upload), that you will need to 'expose' into your JS code via wp_localize_script, that variable needed to state whether the Wordpress you're running is under 3.5 or not, if it's under 3.5 then it's should not use the new media manager, and use the old method using thickbox media-upload.php iframe.
NHP has just merged with Redux Framework and Redux 3.0 has been released. It can be run as a Wordpress Plugin or Embedded within a theme. You should really give the new version a try.
http://wordpress.org/plugins/redux-framework/
It has full Wordpress media 3.5 support, and then some. It not only stores the media URL, but also the ID and full-dimension size.
Seriously, check it out.
I use MVC 4 with this custom displaymodeprovider. Even if I set it as "false" it still on iPhone returns mobile version, though I want to return regular version of the website. Please help
DisplayModeProvider.Instance.Modes.Insert(0, new
DefaultDisplayMode("Mobile")
{
ContextCondition = (context => false)
});
I set the break point inside this this code and it calls, though it still return mobile version.
Eventually I've figured out the problem
MVC 4 already has his own redirection for "Mobile" prefix. so to use custom logic we need to remove that DisplayModeProvider for "Mobile" prefix, like this:
var mobileModel = DisplayModeProvider.Instance.Modes.FirstOrDefault(a => a.DisplayModeId == "Mobile");
if (mobileModel != null)
{
DisplayModeProvider.Instance.Modes.Remove(mobileModel);
}
DisplayModeProvider.Instance.Modes.Insert(0, new
DefaultDisplayMode("Mobile")
{
ContextCondition = (context => <USE ANY YOUR CUSTOM LOGIC>)
});
This answer will be very useful for people who want that their website will be available in both versions for iPad or iPhone or Android and we can for example store in coockie user selection which version of the website we should display in his device.
The Portlets in Plone are quite handy but I'd like to be able to provide some method to users to be able to temporarily hide/show the portlets column. That is, by clicking a button, the portlets column should collapse and you see the content page in full width. Then clicking again and the portlets panel on the left expands and the main content page width shrinks to accommodate.
I've observed the HTML ID of the portlets column is "portal-column-one" and I tried adding a button to the page that runs javascript to set the visibility property of that element to "hidden" but this seemed to have no effect. I was able to go into Firebug and add style="visibility:hidden;" to the "portal-column-one" element and it had the effect of making the region invisible w/o resizing the page.
I am using Plone 4.1. I have the site configured with navigation portlet on all pages except the main page which has Navigation, Review List and Recent Changes.
So it seems it must be possible to embed some javascript in the page (I was thinking of adding this to the plone.logo page which I've already customized). But I guess its more complicated than the few stabs I've made at it.
Thanks in advance for any advice.
Solution (Thanks to input from Ulrich Schwarz and hvelarde):
The solution I arrived at uses JavaScript to set CSS attributes to show/hide the Portlets Column (Left side) and expand the content column to fill the space the porlets column filled.
I started by customizing the Plone header template to add a link for the user to toggle the view of the Porlets column. I also put the necessary javascript functions in this header.
To customize the header, go to the following page (need to be logged in as Admin of your Plone site):
http://SERVER/SITE/portal_view_customizations/zope.interface.interface-plone.logo
Where:
SERVER is the address and port of your site (e.g. localhost:8080)
SITE is the short name of your Plone Site
To create this page:
Go to Site Setup (as Admin)
Go to Zope Management Interface
Click on "portal_view_customizations"
Click on "plone.logo" (or at least this is where I choose to put the button so it would be located just above the navigation Portlet)
Add the following to the page:
<script>
function getById(id) {
return document.getElementById(id);
}
function TogglePortletsPanel() {
var dispVal = getById('portal-column-one').style.display
if( dispVal == "none") { // Normal display
SetPortletsPanelState("inline");
} else { // Full Screen Content
SetPortletsPanelState("none");
}
}
function SetPortletsPanelState(dispVal) {
var nav = getById('portal-column-one');
var content = getById('portal-column-content');
if( dispVal == "none") { // Normal display
nav.style.display='none';
content.className='cell width-full position-0';
// Set cookie to updated value
setCookie("portletDisplayState","none",365);
} else { // Full Screen Content
nav.style.display='inline';
content.className='cell width-3:4 position-1:4';
// Set cookie to updated value
setCookie("portletDisplayState","inline",365);
}
}
function InitializePortletsPanelState() {
var portletDisplayState=getCookie("portletDisplayState");
//alert("portletDisplayState="+portletDisplayState)
if (portletDisplayState!=null) SetPortletsPanelState(portletDisplayState);
}
function setCookie(c_name,value,exdays) {
//alert(c_name+"="+value);
// cookie format: document.cookie = 'name=value; expires=Thu, 2 Aug 2001 20:47:11 UTC; path=/'
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var exp= ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + escape(value) + exp + "; path=/";
}
function getCookie(c_name) {
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++) {
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name) return unescape(y);
}
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {oldonload(); }
func();
}
}
}
addLoadEvent(InitializePortletsPanelState);
</script>
<a style="font-size:50%;" href="javascript:TogglePortletsPanel();">Toggle Portlets Panel</a>
6. Save the page
Notes:
I got the names of the plone div elements using Firebug.
I also used Firebug to experiment with different settings to speed up prototyping. For example, editing the HTML inline to verify settings do as expected.
There is a slight but of delay until the Left Portlet panel is hidden. This is only obvious on Safari for me (which is probably due to how fast it is) but not on Firefox or IE.
Maybe it's just a matter of setting the right property: you want display:none, not visibility:hidden.
But even then, the content area will probably not reflow automatically, you'll need to (dynamically) change the class on it as well.
Specifically, you'll need to put classes width-full and position-0 on portal-column-content, instead of width-1:2 and position-1:4.
This must be achieved client side by javascript (jquery).
You must first read documentation about the css grid framework used by plone: deco.gs. The website is down so, git clone this repo: https://github.com/limi/deco.gs and open pages in a webbrowser
Note: you just have to change css classes on the containers.
Try adi.fullscreen, it respects Plone's css-structure as Ulrich Schwarz thoughtfully mentioned.