Symbian.org/Main.js
changeset 16 6544cc5386ce
parent 15 5e64ec5b1dfe
child 17 5dc2963cd75f
equal deleted inserted replaced
15:5e64ec5b1dfe 16:6544cc5386ce
    49 var wikiFeedName = "New on Symbian.org Wiki";
    49 var wikiFeedName = "New on Symbian.org Wiki";
    50 var wikiFeedUrl = symbianOrgBaseUrl+"/wiki/index.php?title=Special:NewPages&feed=rss";
    50 var wikiFeedUrl = symbianOrgBaseUrl+"/wiki/index.php?title=Special:NewPages&feed=rss";
    51 var wikiBaseUrl = symbianOrgBaseUrl+"/wiki/index.php";
    51 var wikiBaseUrl = symbianOrgBaseUrl+"/wiki/index.php";
    52 
    52 
    53 // Update variables
    53 // Update variables
    54 var myversion = "1.0rc11";
    54 var myversion = "1.0rc13";
    55 var versionWikiPageUrl = wikiBaseUrl + "/Symbian.org_WRT_Widget";
    55 var versionWikiPageUrl = wikiBaseUrl + "/Symbian.org_WRT_Widget";
    56 var versionWikiPageString = "Current widget version is [";
    56 var versionWikiPageString = "Current widget version is [";
    57 var downloadUrl = symbianOrgBaseUrl + "/wiki/images/c/c5/Symbian.org.wgz";
    57 var downloadUrl = symbianOrgBaseUrl + "/wiki/images/c/c5/Symbian.org.wgz";
    58 
    58 
    59 // UI elements
    59 // UI elements
   159 	home.addControl(wikiButton);
   159 	home.addControl(wikiButton);
   160 	
   160 	
   161 	// add bugzilla button
   161 	// add bugzilla button
   162 	var bugzillaButton = new NavigationButton(3, "right.gif", "Bugzilla")
   162 	var bugzillaButton = new NavigationButton(3, "right.gif", "Bugzilla")
   163 	bugzillaButton.addEventListener("ActionPerformed", function(){login(function(){bugzilla.show();});});
   163 	bugzillaButton.addEventListener("ActionPerformed", function(){login(function(){bugzilla.show();});});
       
   164 //	bugzillaButton.addEventListener("ActionPerformed", function(){bugzilla.show();});
   164 	home.addControl(bugzillaButton);
   165 	home.addControl(bugzillaButton);
   165 	
   166 	
   166 	// soft keys
   167 	// soft keys
   167 	home.setupSoftKeys = function()  {
   168 	home.setupSoftKeys = function()  {
   168 	    if (window.widget) {
   169 	    if (window.widget) {
   233 	aboutLabel.setExpanded(true);
   234 	aboutLabel.setExpanded(true);
   234 	about.addControl(aboutLabel);
   235 	about.addControl(aboutLabel);
   235 
   236 
   236 	home.show();
   237 	home.show();
   237 	setDefaultFontSizeForScreenSize();
   238 	setDefaultFontSizeForScreenSize();
   238 	login(null);	
   239 //	login(null);	
   239 }
   240 }
   240 
   241 
   241 // Callback for when menu items are selected.
   242 // Callback for when menu items are selected.
   242 function menuItemSelected(id) {
   243 function menuItemSelected(id) {
   243 	var currentView = uiManager.getView();
   244 	var currentView = uiManager.getView();
   380 		}
   381 		}
   381 		else {
   382 		else {
   382 			// no preference available, check screen size
   383 			// no preference available, check screen size
   383 			if (window.screen.width > 400 || window.screen.height > 400) {
   384 			if (window.screen.width > 400 || window.screen.height > 400) {
   384 				// hi res screen, use large font
   385 				// hi res screen, use large font
   385 				setCssBodyFontSize(18);
   386 				setCssBodyFontSize(30);
   386 			}
   387 			}
   387 			else {
   388 			else {
   388 				// lo res screen, use small font
   389 				// lo res screen, use small font
   389 				setCssBodyFontSize(14);
   390 				setCssBodyFontSize(14);
   390 			}
   391 			}
   404 			setCssBodyFontSize(currentFontSize - 2);
   405 			setCssBodyFontSize(currentFontSize - 2);
   405 		}
   406 		}
   406 	}
   407 	}
   407 }
   408 }
   408 
   409 
   409 function setCssBodyFontSize(size) {
   410 function setCssBodyFontSize(size){
   410     if (window.widget) {
   411     if (window.widget) {
   411 		currentFontSize = size;
   412 		currentFontSize = size;
   412 		var sizestring = "" + size;
   413 		var sizestring = "" + size;
   413 		document.body.style.fontSize = sizestring + "px";
   414 		document.body.style.fontSize = sizestring + "px";
   414 		widget.setPreferenceForKey(sizestring, "fontsize");
   415 		widget.setPreferenceForKey(sizestring, "fontsize");