Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 19th, 2005, 04:16 PM
Techno-Freak Techno-Freak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 28 Techno-Freak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 43 sec
Reputation Power: 0
Question WYSIWYG - Font

Hi,
I've created a font changing feature in my website, it can change the font, but it cant display the current font (for example, you have two pieces of text in different fonts (e.g. hello hi) your cursor is in the text: hi, and you move the cursor to the text: hello, the selection box needs to change to the selected font, but i cant make a way of doing it)
Code:
var fArray = new Array();
function add(string)
{
	var aia = fArray.length // aia stands for array item amount
	var naia = aia++ // n stands for new
	fArray[(eval(naia))] = string
}
function displayFonts()
{
	var a=dlgHelper.fonts.count; // dlgHelper is an object in the document, it just gives the script the information it needs to display the fonts.
	for (i = 1;i < a;i++)
	{
		add(dlgHelper.fonts(i));
	}
	displayFonts2();
}
function displayFonts2()
{
	var oSelect = document.getElementById("oSelect")
	for (i = 0; i < dlgHelper.fonts.count; i++)
	{
		var oOption = document.createElement("OPTION");
		oOption.text = fArray[i]
		oOption.Value = i
		oSelect.add(oOption);	
	}
}
function ChangeHeading()
{
	<!-- // -- To Be Made -- // -->
}
function ChangeFont()
{
	var root = document.iFrame.document
	var oSelect = document.getElementById("oSelect");
	var sSelection = oSelect.options[oSelect.selectedIndex].text;
	root.execCommand("FontName", false, sSelection);
}

That all works , but then this doesn't, but it should
Code:
function showFont()
{
	var curFnt=document.iFrame.document.queryCommandValue(  "fontname")
	var oSelect=document.getElementById("oSelect")
	var i;
	for (i in fArray)
	{
		var arrTxt=fArray[i]
		if (arrTxt==curFnt) oSelect.value=i; break;
	}
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > WYSIWYG - Font


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT