473,562 Members | 3,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Customizing Theme File Processing (more than just .css, .jpg, etc)

Hello,

I'm working with some third-party JS code, such as mootools and
moo.fx, among a few others. They have some really nice "flashy"
features, such as fading from one color to another to bring
attention. I would like to use these settings, but I am currently
restricted to a single theme (more specifically, one color scheme),
because you must specify the start and stop color in JS.

If I could "theme" JS files, then I could create a JS file with a ton
of constants. By creating a .js file in a Theme's directory, it would
register a:
<script type="text/javascript" src="app_themes/theme_name/
file_name.js"></script>

Doing so would act like a .css file except for my .js file. Then in
my file_name.js file:

var FadeFromColor = "FFF";
var FadeToColor = "000";
-----------------------
The above is just an example, of course. Is there any way I can
extend PageTheme to do these types of things? Is there any kind of
PageTheme Provider that I can access?

I've searched all over the net, but I'm unable to find anything. Any
sort of information would be appreciated.

Thank you
-eli

Jun 12 '07 #1
1 1278
For anyone that cares, I gave in and did it OnInit. I would ideally
like to do it through a provider of sorts, but for now this will work:

protected override void OnLoad(EventArg s e)
{
base.OnLoad(e);

if(!string.IsNu llOrEmpty(Page. Theme))
{
DirectoryInfo dir = new
DirectoryInfo(P age.Server.MapP ath(Page.Resolv eUrl("~/App_Themes/" +
Page.Theme)));

FileInfo[] files = dir.GetFiles("* .js",
SearchOption.To pDirectoryOnly) ;

foreach(FileInf o file in files)
{

Page.ClientScri pt.RegisterClie ntScriptInclude (this.GetType() ,
file.Name, Page.ResolveUrl ("~/App_Themes/" + Page.Theme + "/" +
file.Name));
}
}
}

grexi...@gmail. com wrote:
Hello,

I'm working with some third-party JS code, such as mootools and
moo.fx, among a few others. They have some really nice "flashy"
features, such as fading from one color to another to bring
attention. I would like to use these settings, but I am currently
restricted to a single theme (more specifically, one color scheme),
because you must specify the start and stop color in JS.

If I could "theme" JS files, then I could create a JS file with a ton
of constants. By creating a .js file in a Theme's directory, it would
register a:
<script type="text/javascript" src="app_themes/theme_name/
file_name.js"></script>

Doing so would act like a .css file except for my .js file. Then in
my file_name.js file:

var FadeFromColor = "FFF";
var FadeToColor = "000";
-----------------------
The above is just an example, of course. Is there any way I can
extend PageTheme to do these types of things? Is there any kind of
PageTheme Provider that I can access?

I've searched all over the net, but I'm unable to find anything. Any
sort of information would be appreciated.

Thank you
-eli
Jun 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2211
by: jjack100 | last post by:
In asp.net 2.0 you can apply custom themes based on a user profile, etc. And you can change the theme programmatically, etc. But how do you edit or create a theme programmatically? I am working on a content management system where the user needs to be able to select fonts, colors, etc. Right now I can only see how to let the user select from...
4
4236
by: Neil Jones | last post by:
Hello, I would like to create my own theme(s) for a couple of my own blog sites. I am hoping a few better themes could bring lot more readers. So far, I have stayed with the default wordpress theme (blue title). There are a lot of web sites I have seen that have very attractive themes. I am not a programmer and do not like to edit the...
4
2948
by: Neil Jones | last post by:
Hello, I would like to create my own theme(s) for a couple of my own blog sites. I am hoping a few better themes could bring lot more readers. So far, I have stayed with the default wordpress theme (blue title). There are a lot of web sites I have seen that have very attractive themes. I am not a programmer and do not like to edit the...
0
7652
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7867
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8095
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7625
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7934
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6219
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2073
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.