
[Dup Trac #11497] Stylesheet helper $S(n).addCss(expression, cssText)
Reported by poste9 | April 15th, 2008 @ 10:40 PM
This function I used to manipulate my CSS with JavaScript. Of course u can do it better than me, its just a suggestion.
Usage:
$S(0).addCSS('div#mydivid ul li ',
'width:270px;'
'height:210px;'+
'float:left;'+
'margin-right:4px;');
$S(0) indicates document.styleSheets[0]
function $S(index) {
index = document.styleSheets[index];
Object.extend(index, {addCSS : function(seletor,rule) {
if ( this.insertRule)
this.insertRule(seletor + '{'+rule+'}', this.cssRules.length);
else if ( this.addRule )
this.addRule(seletor, rule, this.rules.length)
}
});
return Element.extend(index);
}
Comments and changes to this ticket
-
John-David Dalton April 16th, 2008 @ 01:00 AM
- Title changed from Stylesheet helper $S(n).addCss(expression, cssText) to [Dup Trac #11497] Stylesheet helper $S(n).addCss(expression, cssText)
This is a dup/spam by the original author:
-
Juriy Zaytsev April 16th, 2008 @ 03:25 AM
I believe we should close the tickets in a trac (as duplicate) rather than here, since all of them should be moved over to LH eventually.
-
John-David Dalton April 16th, 2008 @ 03:39 AM
The tickets in Trac have more responses and more history to them. That would be throwing out the baby with the bath water. Very bad idea.
A better Idea would be to convert them to lighthouse.
-
John-David Dalton April 16th, 2008 @ 10:19 PM
- Title changed from [Dup Trac #11497] Stylesheet helper $S(n).addCss(expression, cssText) to [Dup Trac #11497][ENH] Stylesheet helper $S(n).addCss(expression, cssText)
-
Tobie Langel April 16th, 2008 @ 10:20 PM
- State changed from new to patch_needed
- Title changed from [Dup Trac #11497][ENH] Stylesheet helper $S(n).addCss(expression, cssText) to [Dup Trac #11497] Stylesheet helper $S(n).addCss(expression, cssText)
jdalton: fyi, closing a ticket in trac doesn't delete it. I'd be in favor of closing the tickets in trac with a link to their LH equivalent.
I'm not too sure I like the proposed API for this.
Would be worth bringing the topic up on the core mailing list.
-
John-David Dalton April 16th, 2008 @ 10:23 PM
I know this Tobie :P
How about importing them trac to lighthouse:
-
John-David Dalton April 16th, 2008 @ 10:24 PM
I took delete as actual "delete" and not "close" ticket.
-
Tobie Langel April 17th, 2008 @ 01:25 AM
Hi again poste9,
Due to the large number of suggestions we receive, we can only accept enhancement requests with tested patches in the form of a diff file or (preferably) a GitHub pull request.
For help with creating a tested patch, see our contribute page.
Please feel free to reopen this ticket once you have either of these ready.
If you feel like discussing your enhancement proposal before working on a patch please join the conversation on the core mailing list.
Thanks for taking the time to contribute!
Tobie
-
Juriy Zaytsev April 17th, 2008 @ 02:11 AM
Isn't this a subset of http://dev.rubyonrails.org/ticke... ?
-
Tobie Langel April 18th, 2008 @ 01:15 PM
- State changed from patch_needed to enhancement
-
Andrew Dupont October 4th, 2008 @ 05:20 AM
- State changed from enhancement to not_for_core
Not worth adding to core, I think.
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
The Prototype JavaScript library.