The only way I have discovered how to fix the iMessage “Waiting for Activation” Error :(

Image

 

Las week, I installed the beta release of iOS 7. I have an iPhone 4 in good shape and I decided to keep up with the upgrade.

Everything went just fine. The system seems a little bit like a mix between Android and Windows and something in the middle, but it is ok.. I mean, is just a beta..

Anyway, I noticed that the battery was drawing down faster than with the version 6.1.3. I have experienced several crashes but again.. I keep saying to my self: IT IS JUST A BETA!!!

The problem with iMessage came to me when I just activated the Airplane Mode. Weird uh? After turning off the Airplane Mode, I started noticing my messages were green instead of blue and I went to setting panel > iMessage and I realized the option was turned off. And when I tried to turn it on I have the annoying message:

“Waiting for activation”

And nothing more! And also when I hold the button to turn iMessage (or Facetime) on, it crashes back to the home screen.

I tried a lot of the solutions already posted over the Internet, but nothing helped me out. So I decided to erase all content and settings from the iPhone’s settings. The just setup the iPhone from my backup (I make periodically backups on iCloud and on my computer.. just in case.. and this time was the case! ) and it seems to have fixed the problem.

It is a shame that this kind of extreme solutions have to happen with iOS. I know that no system is reliable and perfect but the expectations on iOS 7 were really high.

So my conclusion is:

1) Always make a backup!
2) Erase and Restore your settings. D’ont erase the content, just the settings. (Settings > General > Reset > Reset all Settings)

If you know any other (and no so drastic) way, please let me know.

Be grateful with what you have and fearless with what you want.. Stop criticizing and start working in you from inside to express it outside..

How to do an accordion effect to quick launch menu with jQuery in Sharepoint 2010

This is the code I used to do an accordion effect to the quick launch menu in Sharepoint designer with jQuery. Also, you have to put this code in your Portal Master Page in order to see the changes applied. In my case, I have a separate Javascript file where all custom functionality is concentrated.

CSS code:


.imgAlign
 {
 padding-right:9px;
 padding-top:6px;
 padding-bottom:3px;
 }
.imgTrnspAlign
 {
 padding-right:10px;
 }

jQuery Code:

$(document).ready(function ()
{

    // Put the arrow images for the elements with children. 
    $("div.menu-vertical>ul.root>li.static>a").each(function ()
    {
        var hasChild = $(">ul", $(this).parent()).html();

        if (hasChild != null)
        {
            $(this).find("span.menu-item-text").prepend("<img src='../Images/plusArrow.png' border='0' class='imgAlign' />");
        
        } else {
        
             $(this).find("span.menu-item-text").prepend("<img src='../Images/transparentArrow.png' border='0' class='imgTrnspAlign' />");


        
        }

    });


    // This function activates the arrow functionality to toggle the submenu elements. The header (father item) is a link it self. You may be want to consult this link, so the functionality is only for the arrow image.

    $("img.imgAlign").toggle(

    function ()
    {
        $("img.imgAlign").attr('src', '../Images/plusArrow.png');
        $(this).attr('src', '/_layouts/AGCOCorpBranding/Portal.master/Images/minusArrow.png');
        if ($(this).parent().parent().parent().parent().html().indexOf('none') &gt; -1)
        {
            $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static").css("display", "none");
            $("&gt;ul", $(this).parent().parent().parent().parent()).show("fast");
            $(this).attr('src', '../Images/minusArrow.png');
        }
        else
        {
            $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static").css("display", "none");
            $("&gt;ul", $(this).parent().parent().parent().parent()).hide("fast");
            $(this).attr('src', '../Images/plusArrow.png');
        }
    }, function ()
    {
        if ($(this).parent().parent().parent().parent().html().indexOf('none') &gt; -1)
        {
            $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static").css("display", "none");
            $("&gt;ul", $(this).parent().parent().parent().parent()).show("fast");
            $(this).attr('src', '../Images/minusArrow.png');
        }
        else
        {
            $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static").css("display", "none");
            $("&gt;ul", $(this).parent().parent().parent().parent()).hide("fast");
            $(this).attr('src', '../Images/plusArrow.png');
        }
    });
    
    
    
   
    
     $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static").css("display", "none");
 
    var s = $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static&gt;li.selected").parent();
    var p = s.parent();
    var img = p.find('img');
    img.attr('src', '../Images/plusArrow.png');
    p.find('ul').css("display", "none");
 
   
   // When you are in a child link page the menu is still showing with the child element highlighted.

     if ( $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static").children().hasClass("selected")) {
           $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static li.selected").parent().css("display",""); 
        img.attr('src', '../Images/minusArrow.png');
 

    } else {
    
        $("div.menu-vertical&gt;ul.root&gt;li.static&gt;ul.static").css("display", "none");
    
    }

    

});
   

These are the images files I used in this implementation:
transparentArrow.png
plusarrow.png
minusarrow.png

References and credits:

How to convert string to Proper Casing in XSLT

We need first to make a xsl template to prepare the function of proper case:

<xsl:template name="TitleCase">
<xsl:param name="text" />
<xsl:param name="lastletter" select="' '"/>
<xsl:if test="$text">
<xsl:variable name="thisletter" select="substring($text,1,1)"/>
<xsl:choose>
<xsl:when test="$lastletter=' '">
<xsl:value-of select="translate($thisletter,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$thisletter"/>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="TitleCase">
<xsl:with-param name="text" select="substring($text,2)"/>
<xsl:with-param name="lastletter" select="$thisletter"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

The we have to invoke a xsl variable to call the template just like this:

<xsl:variable name="CapNameSite">
<xsl:call-template name="TitleCase">
<xsl:with-param name="text" select="translate(normalize-space($noDashed), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />
</xsl:call-template>
</xsl:variable>

And we can use the variable just like this:

<div class="title">
<xsl:value-of select="$CapNameSite"/>
</div>

How to dynamically change the anchor href within a div element using jQuery and javascript.

The task was changing the href values from anchor elements inside a div. These anchor elements has relative links, for example:

/home/organization.html

/company/about_us.html

The idea is the add a global variable called “portalUrl” (which conatins the current URL from the site) before these values to make these links seems absoulutes:

portalUrl="http://thesite.com";

Final result:

http://thesite.com/home/organization.html

http://thesite.com/company/about_us.html

Other requirement was if the relative link had the string “TeamSites.aspx” the global value should be “workspaceUrl”:

workspaceUrl="http://workspace.thesite.com";

Image

This is the code using jQuery:

 $j('#my_footer a').each(function (value) {
var anchor = $j(this);
var current = anchor.attr('href');
var tsitesUrl = 'TeamSites.aspx';
if (current.indexOf(tsitesUrl) < 0) {
anchor.attr('href', portalUrl + current);
} else {
anchor.attr('href', workspaceUrl + current);
}
});

I noticed that this piece of code was not working correctly in Safari and Internet Explorer (7,8 and 9). After extensive research I found that the function “attr” from jQuery has a weird behavior with these browser. So, the solution was to translate the jQuery function into a javascript function:

var myfooter = document.getElementById("my_footer");
var allanchors = myfooter.getElementsByTagName("a");
var tsitesUrl = 'TeamSites.aspx';

for (var i = 0; i < allanchors.length; i++) {
var link = allanchors[i];
var hrefs = link.getAttribute("href");

if (hrefs.indexOf("http") < 0) { //this leave the absolute links out in case they exist.
    if (hrefs.indexOf(tsitesUrl) < 0) {
        link.href = portalUrl + hrefs;
    } else {
        link.href = workspaceUrl + hrefs;
    }
} //if http
} // for

how to force link from iframe to be opened in the parent window

I was facing a little issue regarding some links from iframe web part. I needed to open the link in the same parent page, instead of open it in a new page.

So I did an extensive research and I found the best solution was to use the base tag. Add the following to the head of the page in the iframe:

<base target=”_parent” />

This will load all links on the page in the parent window.

If you want your links to load in a new window, use:

<base target=”_blank” />