Jump to content

Recommended Posts

Posted (edited)
I've gone through all the set up and configuration documentation provided with v8.4 but when we connect to the HAP site there is hardly anything displaying. I've attached a screenshot of what the page looks like and this is happening for all types of user and it happens both on IE and Chrome. Any help with this would be greatly appreciated. Thanks.

happage.jpg

Edited by thesk8rjesus
Posted
There seems to be a scripting error there as you shouldn't see the header on that page. Is there any way of doing some javascript debugging using the developer tools in your browser (F12). The console tab should show you any errors.
Posted

Had a look at the errors. We are getting "Uncaught ReferenceError: hap is not defined" on line 86 and 102. I've attached the code and put ------- next to the error lines for you

 

<br />
                                            $(document).ready(function () {<br />
                                                hap.livetiles.Init([<br />
<br />
-----------------------------------------------------------Uncaught ReferenceError: hap is not defined----------------------------------------------------------------<br />
<br />
                                                { Type: "myfiles" , Data: {  Group: "Resources", Name: "My Files", Url: "~/myfiles/", Target: "", Description: "Access your School My Files", Icon: "api/tiles/icons/64/64/images/icons/metro/folders-os/DocumentsFolder.png", Color:  { Base: '#04AEDA', Light: '#1DC7F3', Dark: '#0094C0' } } }, <br />
{ Type: "" , Data: {  Group: "Resources", Name: "My Emails", Url: "https://mail.towers.kent.sch.uk/owa/", Target: "", Description: "Access Email", Icon: "api/tiles/icons/64/64/images/icons/metro/office-15/outlook.png", Color:  { Base: '#1E70B6', Light: '#3789CF', Dark: '#04569C' } } }<br />
                                                ]);<br />
                                            });<br />
                                        
                                   
                               
                           
                   
               
               
               
           
           <br />
                var scrollpos = sliding = startClientX = startPixelOffset = pixelOffset = 0;<br />
                hap.load = hap.loadtypes.help;<br />
<br />
-----------------------------------------------Uncaught ReferenceError: hap is not defined-----------------------------------------------------------------<br />
<br />
                $(document).ready(function () {<br />
                    $("#HomeButtons").mousewheel(function(event, delta) {<br />
                        if (delta > 0) {<br />
                            if (scrollpos < ($("#HomeButtons > div").length - 1)) {<br />
                                scrollpos++;<br />
                                $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                                $("#HomeButtonsHeader h1").removeClass("active");<br />
                                $("#HomeButtonsHeader h1")[scrollpos].className = "active";<br />
                            }<br />
                        }<br />
                        else {<br />
                            if (scrollpos > 0) {<br />
                                scrollpos--;<br />
                                $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                                $("#HomeButtonsHeader h1").removeClass("active");<br />
                                $("#HomeButtonsHeader h1")[scrollpos].className = "active";<br />
                            }<br />
                        }<br />
                        return false;<br />
                    }).on('touchstart', function(event) { if (event.originalEvent.touches) event = event.originalEvent.touches[0]; if (sliding == 0) { sliding = 1; startClientX = event.clientX; } <br />
                    }).on('touchend', function (event) {<br />
                        if (sliding == 2) {<br />
                            sliding = 0;<br />
                            scrollpos = pixelOffset < startPixelOffset ? scrollpos + 1 : scrollpos - 1;<br />
                            scrollpos = Math.min(Math.max(scrollpos, 0), $("#HomeButtons > div").length - 1);<br />
                            $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                            $("#HomeButtonsHeader h1").removeClass("active");<br />
                            $("#HomeButtonsHeader h1")[scrollpos].className = "active";<br />
                        }<br />
                    }).on('touchmove', function(event) {<br />
                        event.preventDefault();<br />
                        if (event.originalEvent.touches)<br />
                            event = event.originalEvent.touches[0];<br />
                        var deltaSlide = event.clientX - startClientX;<br />
                        if (sliding == 2) {<br />
                            var touchPixelRatio = 1;<br />
                            if ((scrollpos == 0 && event.clientX > startClientX) || (scrollpos == $("#HomeButtons > div").length - 1 && event.clientX < startClientX))<br />
                                touchPixelRatio = 3;<br />
                            pixelOffset = startPixelOffset + deltaSlide / touchPixelRatio;<br />
                        }<br />
                    });<br />
                    $("#HomeButtons").css("width", (($("#HomeButtons > div").length * $("#HomeButtonsOutter").width()) + 200) + "px");<br />
                    if ($("#HomeButtons > div").length == 1) $("#rightscoll, #leftscroll").hide();<br />
                    $("#HomeButtons .panel").css("width", $("#HomeButtonsOutter").width() + "px");<br />
                    $("#leftscroll").click(function () {<br />
                        if (scrollpos > 0) {<br />
                            scrollpos--;<br />
                            $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                            $("#HomeButtonsHeader h1").removeClass("active");<br />
                            $("#HomeButtonsHeader h1")[scrollpos].className = "active";<br />
                        }<br />
                        return false;<br />
                    });<br />
                    $("#rightscoll").click(function () {<br />
                        if (scrollpos < ($("#HomeButtons > div").length - 1)) {<br />
                            scrollpos++;<br />
                            $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                            $("#HomeButtonsHeader h1").removeClass("active");<br />
                            $("#HomeButtonsHeader h1")[scrollpos].className = "active";<br />
                        }<br />
                        return false;<br />
                    });<br />
                    $(window).resize(function() {<br />
                        $("#HomeButtons").css("width", (($("#HomeButtons > div").length * $("#HomeButtonsOutter").width()) + 200) + "px");<br />
                        $("#HomeButtons .panel").css("width", $("#HomeButtonsOutter").width() + "px");<br />
                        $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                        $("#rightscoll, #leftscroll").css("height", $("#HomeButtonsOutter").height() + "px").css("line-height", $("#HomeButtonsOutter").height() + "px");<br />
                    });<br />
                    $("#HomeButtonsHeader h1 a").click(function () {<br />
                        scrollpos = $(this).parent().index();<br />
                        $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                        $("#HomeButtonsHeader h1").removeClass("active");<br />
                        this.parentNode.className = "active";<br />
                        return false;<br />
                    });<br />
                    $("#HomeButtonsOutter").animate({ scrollLeft: (scrollpos * ($("#HomeButtonsOutter").width() - 20) + (scrollpos * 20)) });<br />
                    $("#HomeButtonsHeader h1:first").addClass("active");<br />
                    $('input[type=submit]').button();<br />
                    $("#rightscoll, #leftscroll").css("height", $("#HomeButtonsOutter").height() + "px").css("line-height", $("#HomeButtonsOutter").height() + "px");<br />
                });<br />
            

Posted

I have re-read the following file :- /scripts/hap.web.js.js and noticed on line 12 that there was an else statement that wasnt link to anything i changed it from this

jsonError: function (xhr, ajaxOptions, thrownError) {
               try {
                   if (xhr.responseText.match(/\                    try { console.log(xhr.responseText); } catch (ex) { };
		else {
                       if (document.getElementById("errorlist") == null) $("#hapContent").append('');
                       $("" + jQuery.parseJSON(xhr.responseText).Message + "This error has been logged on the server's event log").appendTo("#errorlist");
                       setTimeout("hap.common.clearError();", 10000);
                       try { console.log(xhr.responseText); } catch (ex) { };
                   }
               } catch (e) { if (thrownError != "") alert(thrownError); }
           },

 

To this

jsonError: function (xhr, ajaxOptions, thrownError) {
               try {
                   if (xhr.responseText.match(/\					{
					window.location.reload();
					try { console.log(xhr.responseText); } catch (ex) { };
				}
				else {
                       if (document.getElementById("errorlist") == null) $("#hapContent").append('');
                       $("" + jQuery.parseJSON(xhr.responseText).Message + "This error has been logged on the server's event log").appendTo("#errorlist");
                       setTimeout("hap.common.clearError();", 10000);
                       try { console.log(xhr.responseText); } catch (ex) { };
                   }
               } catch (e) { if (thrownError != "") alert(thrownError); }
           },

and its now working, but i am now getting an error when i select myfiles i get the following error, even after copying over the new myfiles patch.

 

Source File: c:\inetpub\wwwroot\HAP\MyFiles\Default.aspx Line: 121

 

Line 119:			if (window.location.href.split('#')[1] != "" && window.location.href.split('#')[1]) {
Line 120:				curpath = window.location.href.split("#")[1];
Line 121:				if (typeof (window.FileReader) != 'undefined') { $("#MyFiles").attr("dropzone", "copy<%=DropZoneAccepted %>"); }
Line 122:				if (viewMode == 1) { $("#MyFiles").addClass("details"); $("#MyFilesHeaddings").show(); }
Line 123:				else if (viewMode == 2) $("#MyFiles").addClass("small");

 

Stack Trace:

[ArgumentOutOfRangeException: Index and count must refer to a location within the string.
Parameter name: count]
  System.String.RemoveInternal(Int32 startIndex, Int32 count) +0
  HAP.Web.MyFiles.Default.get_DropZoneAccepted() +448
  ASP.myfiles_default_aspx.__Render__control46(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\HAP\MyFiles\Default.aspx:121
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +131
  HAP.Web.Controls.CompressJS.Render(HtmlTextWriter writer) +99
  ASP.myfiles_default_aspx.__Render__control19(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\HAP\MyFiles\Default.aspx:77
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +131
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
  System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +315
  System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +48
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
  System.Web.UI.Page.Render(HtmlTextWriter writer) +40
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5290

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...