1/// <reference path="/js/jquery-1.4.1.min.js"/> 2/// <reference path="/js/Settings.js"/> 3 4(function (window) { 5 var constructor = function () { 6 var __msgWindow = { width: 300, height: 300, anonymous: true, enabled: false }; 7 8 var instance = { 9 initMessageWindow: function (settings) { 10 var defaults = { width: 300, height: 300, anonymous: true, enabled: false }; 11 settings = $.extend({}, defaults, settings); 12 13 __msgWindow.width = settings.width; 14 __msgWindow.height = settings.height; 15 __msgWindow.enabled = settings.enabled; 16 __msgWindow.anonymous = settings.anonymous; 17 18 if (isNaN(__msgWindow.width) || __msgWindow.width < 100 || __msgWindow.width > 3000) __msgWindow.width = 300; 19 if (isNaN(__msgWindow.height) || __msgWindow.height < 100 || __msgWindow.height > 3000) __msgWindow.height = 300; 20 }, 21 22 showMessageWindow: function () { 23 if (__msgWindow.enabled) { 24 var winHeight = $(window).height(); 25 var winWidth = $(window).width(); 26 27 $('#ModalOverlay').show(); 28 29 if (__msgWindow.anonymous) 30 $('#btnMsgWindowRemindMe').hide(); 31 else 32 $('#btnMsgWindowRemindMe').show(); 33 34 $('#MessageWindow').css({ 35 top: (winHeight / 2) - (__msgWindow.height / 2), 36 left: (winWidth / 2) - (__msgWindow.width / 2), 37 width: __msgWindow.width, 38 height: __msgWindow.height 39 }).show(); 40 41 var commandHeight = $('#MessageWindow .commands').outerHeight(); 42 $('#MessageWindow .content').height($('#MessageWindow').outerHeight() - (commandHeight + 34)); 43 } 44 }, 45 46 remindMessageWindow: function () { 47 $.ajax({
48 type: "POST", 49 url: "UserService.asmx/MsgWindowRemindMe", 50 data: "{}", 51 contentType: "application/json; charset=utf-8", 52 dataType: "json", 53 success: function (msg) { 54 55 } 56 }); 57 58 $('#ModalOverlay').hide(); 59 $('#MessageWindow').hide(); 60 }, 61 62 closeMessageWindow: function () { 63 $.ajax({ 64 type: "POST", 65 url: "UserService.asmx/MsgWindowDisable", 66 data: "{}", 67 contentType: "application/json; charset=utf-8", 68 dataType: "json", 69 success: function (msg) { 70 71 } 72 }); 73 74 $('#ModalOverlay').hide(); 75 $('#MessageWindow').hide(); 76 } 77 }; 78 79 return instance; 80 } 81 82 // Expose global singleton instance 83 window.SiteMaster = new constructor(); 84})(window); 85 86 87/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 88// Startup 89/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 90$(function () { 91 // Init Background. 92 93 $('#btnSettings').click(site_btnSettings_Click); 94 Settings.initialize(); 95 Settings.hide(site_SettingsHidden); 96 97 $('.ContentWrapper').css('box-shadow', '2px 2px 2px #E6E6E6'); 98 99 SiteMaster.showMessageWindow(); 100 101 //Navigation Drop Down 102 NavDropDown(); 103}); 104 105 106/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 107// Methods and Event Handlers 108/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 109function site_btnSettings_Click() { 110 $(this).blur(); 111 site_ShowSettings(true); 112} 113 114function site_ShowSettings(advancedView, onCloseCallback) { 115 // Display the overlay which will prevent interation outside of the settings popup 116 $('#ModalOverlay').show(); 117 118 // Initialize values to the ones stored in the cookie 119 Settings 120 .bind() 121 .enablePresentationTypes(false) 122 .enableOptions(true) 123 .enableCancelPresentation(false) 124 .show(); 125} 126 127function site_SettingsHidden() { 128 $('#ModalOverlay').hide(); 129} 130 131function NavDropDown() { 132 // When a list item that contains an unordered list 133 // is hovered on 134 $("#ReadingSystems li").has("ul").hover(function () { 135 136 //Add a class of current and fade in the sub-menu 137 $(this).addClass("current").children("ul").fadeIn(); 138 }, function () { 139 140 // On mouse off remove the class of current 141 // Stop any sub-menu animation and set its display to none 142 $(this).removeClass("current").children("ul").stop(true, true).css("display", "none"); 143 }).click(function () { 144 $("#ReadingSystems li ul").css("display", "none"); 145 }); 146} 147 148/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 149// YouTube Validation 150/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 151 152//var main_YouTubeValidateStatus = "pending"; 153 154//$(function () { 155// var waitForYouTubeValidation = function () { 156// var validateYouTube = $('#ValidateYouTubeFrame').get(0).contentWindow.validateYouTube; 157// if (validateYouTube == undefined) { 158// setTimeout(waitForYouTubeValidation, 100); 159// } 160// else { 161// main_YouTubeValidateStatus = validateYouTube() ? "success" : "failed"; 162// } 163// } 164// waitForYouTubeValidation(); 165//});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.