How can I get rid of the call to action button on my Weebly site? - weebly

I can't find any way to get rid of the call to action button on my landing page layout in Weebly. Is it possible to get rid of this button?

You need to perform two steps.
Remove the button from the desktop layout.
Open the layout file in HTML edit mode.
Remove the following line:
<div class="button-wrap">{action:button global="false"}</div>
Remove the button from the mobile layout.
Add the following script to the Header Code of the page:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js">
</script>
<script language='javascript'>
$(document).ready(function(){
$('.landing-container').remove();
});
</script>
You can see it in action on this site for gluten free products.

Related

Testing if a button clicks and makes a paragraph disappear in phantomjs with Selenium

So at the moment I have a super simple html file where if I click a button, a paragraph disappears. I've tried that and it works. Now I want to test it by running phantomjs as a browser with Selenium webdriver in a testing setup consisting of Mocha and Chai. I can test if the button is there with the correct text, and I can set the CSS of it. I can tell this works from using screenshots for when each test finishes. However, whenever I try to get the button to actually click, the paragraph still remains there in the screenshot.
This is the line I use:
driver.findElement(By.id('hide')).click()
But it doesn't seem to work.
Also when I try to check if the paragraph is there or not, I get a load of errors back.
assert.equal(element.getAttribute(), ":hidden", "Paragraph hidden when button clicked");
I'm pretty knew to this, so if anybody can show me how or point me to some documentation I would be grateful.
This is my HTML code
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
console.log("Hiding");
$("#hide").text("Done somethign")
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<h1>Simple Heading to Test</h1>
<p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
</body>
</html>
and my complete test for hiding the paragraph at the moment
test.it('should hide paragraph', function(){
driver.get('http://localhost:3000/example.html');
driver.findElement(webdriver.By.xpath("/html/body/p")).click()
})
To test whether or not the paragraph is visible:
element = driver.find_element_by_id('Paragraph')
if element.is_displayed():
print "Paragraph found"
else:
print "Paragraph not found"
As for the button, can you post what the errors you are getting are? and can you post the html of the button?

Change the subsite Logo URL IN SharePoint

I have created a main site and I have created many subsite under the main site.
When I am in any main page and click on the logo icon, the page redirects to the home page.
But, when I am in any subsite and click on the logo icon, the page redirects to the subsite homepage rather than the main hompage.
I would like to change the navigation URL to the root site. Let me know if I have to edit any masterpage, or is there any common page that will inherit to all the child application.
Thanks
We have 2 ways to do this.
Method 1:
From the Snippet Gallery, copy and paste the default SiteLogo code snippet into your master page into the appropriate place you want it to be displayed.
In the SiteLogo code, search for SharePoint:SPSimpleSiteLink to find the relevant opening and closing tags. Now simply change the tag names to SharePoint:SPLinkButton instead.
Then simply add the attribute NavigateUrl to this tag and set it’s value to “~sitecollection/”.
Example:
Default snippet code:
<!--MS:<SharePoint:SPSimpleSiteLink runat="server" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">-->
...
<!--ME:</SharePoint:SPSimpleSiteLink>-->
Should become this:
<!--MS:<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">-->
...
<!--ME:</SharePoint:SPLinkButton>-->
Ref link
Method 2:
We are going to add custom js in the master page => our site is a publishing site
We find the site logo in the below hierarchy(in a rendered page).
<div id='DeltaSiteLogo'>
<a href='site url'>
<img src='siteIconPath.png/whatever extension'/>
</a>
</div>
So we may try the following for redirecting to the site collection/root web url on click of the logo.
// Add the following js in the '.html' design file that associates with the corresponding masterpage.
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
$("div#DeltaSiteLogo a").attr("href",_spPageContextInfo.siteAbsoluteUrl);
});
//]]>
</script>
It works.
Edit on the SharePoint Designer Master Pages > seattle.master .
Crtl F - Search for DeltaSiteLogo
DEFAULT:
<SharePoint:SPSimpleSiteLink CssClass="ms-siteicon-a" runat="server" id="onetidProjectPropertyTitleGraphic" >
<SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=47" runat="server"/>
</SharePoint:SPSimpleSiteLink>
Change To This (copy & paste the script):
<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">
<SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=47" runat="server"/>
</SharePoint:SPLinkButton>

Primefaces p:overlayPanel show on right click, prevent browser contextMenu?

<p:overlayPanel showEvent="contextmenu" ..>
I like to show the overlay on right click. The browser also shows its context menu.
Is there a way to prevent browser showing its context menu?
Thanks.
You can write a javaScript function to disable browser contextMenu. Something like this
<script type="text/javascript">
document.oncontextmenu=function(){return false};
</script>
For your information, This technique will fail if the user disables JavaScript.

How can a button in an iframe open a new url in a chrome extension

I have an extension which adds a bar at the top of a webpage. i have inserted the iframe in the content script using
document.body.insertBefore(iframe, document.body.firstChild);
The iframe has a button
<button id="mybutton">Click to help</button>
When the user clicks the button I want to redirect them to a new url in the same window. Is this possible?
The reason I want to do this is on certain websites I would like to change the url to include an additional parameter. I chose the iframe option as it more visible than an extension in the bar. Therefore if there is an alternative way to do this I would be happy to learn about it.
Your iframe.....
<html>
<head>
</head>
<script type="text/javascript">
function changeParent(e){
parent.location="http://google.com.au";
}
function onLoad(){
document.querySelector("#mybutton").onclick = changeParent;
}
</script>
<body onload="onLoad()">
<a id="mybutton">Change Parents URL</a>
</body>
</html>
Would be a good case for info bars if they ever come out of experimental....
http://code.google.com/chrome/extensions/experimental.infobars.html

Dojo layout rendering problem

Press F5 in this example: DojoToolkit.
First the content is shown, and after that the layout gets into it's final state. In my application I want the opposite, so that the layout gets rendered, and after that the content is displayed. I don't want that 'jumping' phenomenon when loading. Is it possible to fix this somehow?
No, I don't think that there is such an option. Anyway, you could use a container div (with all the dojo layout elements in it) with initial state visbility:hidden, and after the page is loaded and parsed change it's visibility to "visible".
<div id="container" style="visibility:hidden">
<!-- dijit widgets inside the "container"-->
</div>
<script type="text/javascript">
dojo.ready(function(){
dojo.style("container:, "visibility", "visible");
});
</script>

Resources