473,472 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Create 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 1268
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(EventArgs e)
{
base.OnLoad(e);

if(!string.IsNullOrEmpty(Page.Theme))
{
DirectoryInfo dir = new
DirectoryInfo(Page.Server.MapPath(Page.ResolveUrl( "~/App_Themes/" +
Page.Theme)));

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

foreach(FileInfo file in files)
{

Page.ClientScript.RegisterClientScriptInclude(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
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...
4
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...
4
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
1
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...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.