How to get hex code directly from jscolor? - color-picker

I'm trying to build a canvas app with color picker using jscolor.
Here are what I've done:
Included the file jscolor.js
Created a button with class="jscolor"
Code for the button:
<button id="strokeCol" class="jscolor {valueElement:'color_value'}" onchange="config.changeStrokeCol(this.jscolor)">
Stroke Color
</button>
When I select a color from the picker I can see the background color of the button changing in developer tool, but in RGB value. Read it somewhere else that I can simply get the HEX by specifying $('element').val(), but in my case it just gives me "" (blank).
The HTML also has no value attribute triggered by the click, not to say being updated. The examples only shows that I can specify a default value (which can't be updated as well).
Have I missed anything? Or has jscolor been updated to provide only RGB value through the background color?
The only workaround I can think of is allowing the HEX code to be displayed inside the button then use .html() to get the value, but it seems so unnecessary.

Problem solved when class is inserted to the
<input> tag. Strange!

Related

Tooltip type bar at zero value

I use a custom tooltip, and there, with null data, the bar type shows a tooltip with a value of 0, as I understand it, it shows the formattedValue. At the same time, if I use the tooltip from ChartJs, then everything is fine and it only shows the label. What do i do?
I tried turning off the custom tooltip and turning on the standard one. It shows only the label along the x-axis.
I also tried to write a callback label, and in this case I managed to return an empty value, but the point and color are displayed without an inscription, which is also not very beautiful

Adding fielddata to fixed text in report designer

Using the report-designer of Reportbuilder i want to add a long fixed text to my report with one or more included fields inside the text. Of course these fields should be filled with actual data, adjusting the text.
I remember I have done such a thing in the past, but cannot remember how. I thought you could accomplish this with a Text-field and something like 'This is the text and here {fieldname} fielddata is inserted', but that doesnt seem to work
Can anybody help?
Using reportbuilder 15.04
Response from Digital Metaphores:
Use the RichtText component! By setting MailMerge to true, you can add
datafields to text in the richtext editor
This adds the reference to the fielddata as a xml tag. Adding the fields Name from pipeline plData can be done like this:
<dbtext datapipeline='plData'>Name</dbtext>
Fill in the fixed text, then (making sure the focus is set to the text box, I.E. you have the flashing pipe cursor) right click in the place you want the data field to go, and click Create Placeholder.
In the Placeholder properties window give it a Label so you know what it is, then use the "Value" field to define what data from your datasets you want to be brought through.
You should end up with the Label you set in square brackets, like [Example] within the set text.

Reference for phClr in openxml

I am trying to find value for phClr, but no results.
Slide master is not having mapping for phClr.
I am aware that phClr is just a passed-in color value, but what exactly is its color reference?
Is it bg2 or anything else?
http://msdn.microsoft.com/en-us/library/cc964302(v=office.12).aspx
Blockquote
The scheme color value is set to placeholder color (the value phClr). This value appears throughout the fill, line, effect, and background styles and indicates that the settings are applied to the theme color applicable for a given style. This allows the same fill, line, and effect styles to populate across the theme colors that appear in the OfficeArt galleries.
“phClr” is a kind of placeholder color

jquery .attr('alt','logo').css('display','none') not working !

I have the three following lines and the first two line gets all the images on the document and hides all, but then when I add the third line shows all the images.
What I need its to hide only the images with the attribute alt=minimize and alt=maximize but for some reason hides all the images.
$('img').attr('alt', 'minimize').css("display","none");
$('img').attr('alt', 'maximize').css("display","none");
$('img').attr('alt', 'logo').css("display","inline");
I am using IE7, but it should be compatible with IE6 and IE8.
Any help would be very much appreciated.
Thanks.
I'm thinking you are not using the attr function correctly, might you be looking for the attribute equals selector?:
$('img[alt=minimize]').css("display","none");
What you did with your code was,
Select all images
Change their alt attribute to 'minimize'
Hide them
Select all images
Change their alt attribute to 'maximize'
Hide them
Select all images
Change their alt attribute to 'logo'
Hide them
what you do: you take every img in document and set alt to logo and then set display: inline;.
Note, that attr('alt',string) doesn't filter all images to those with alt=string, but rather sets alt attribute to string on all images.
What you want to use is this:
$('img[alt="minimize"]').css...
$('img[alt="maximize"]').css...
$('img[alt="logo"]').css...
In the call $('img').attr('alt', 'logo').css("display","inline"); the "attr" doesen't filter the set of dom elements You catch with $("img").
If you want to hide everithing but not the image with the attribute 'alt' = 'logo' I think You can:
give it an Id of logo and then calling: $("img").not("#logo").hide()
from the jquery website:
hide():
The matched elements will be hidden
immediately, with no animation. This
is roughly equivalent to calling
.css('display', 'none'), except that
the value of the display property is
saved in jQuery's data cache so that
display can later be restored to its
initial value. If an element has a
display value of inline, then is
hidden and shown, it will once again
be displayed inline.
and
attr( attributeName )
Returns: String
Description: Get the value of an
attribute for the first element in the
set of matched elements.
If instead you want to hide all the maximize and minimize images (both share the "imize" part of the attribute):
$(parentElement).find("img[#attr $= '*imize']").hide()
OP is referring to
http://dev.w3.org/csswg/css3-values/#attr
alt I think is simply a string type, not "logo" whatever that is, that is not a data type.
try that. in fact, you can look up alt in the html5 img
http://www.w3.org/TR/html5/the-img-element.html#the-img-element
http://www.w3.org/TR/html5/the-img-element.html#attr-img-alt
http://www.w3.org/TR/html5/the-img-element.html#alt
(in order of reference clicking, last one is the target)
even if this isn't the exact answer (it should be), it should be a step in the right direction.
I am actually trying myself to figure out how to reference a css property within css with attr() - it's mentioned within the top URL. if I had my druthers, I could be using css calc() along with it, but that's draft. maybe I can get it to work...

programmatically change the background color in eclipse

I have a question related to eclipse plugin development. Is there any means
by which I can programmatically change the background color in eclipse.
I am able to change the text foreground color by calling
setTextColor(color, offset, length, controlRedraw) in ITextViewer
but I don't find any function by which I can change the background
color of the text.
If anyone has been through this kindly share your thoughts.
Thanks
arav
I am not sure this can be done easily, short of extending your own version of a Text Editor, here you provide a Configuration Class which inturn accepts a PresentationReconciler Class which is like a Rule Class that tells you if you need to put a Foreground or a Background Color
See this document
PresentationReconciler
IPresentationDamager: define dirty region given a text change
IPresentationRepairer: recreate presentation for dirty region
DefaultDamagerRepairer does both, based on a token scanner
ITokenScanner: parse text into a token stream
RuleBasedScanner uses simple rules
Extract from the presentation
From Text Editor Recipes, Season’s recipes for your text editor
Tom Eicher, IBM Eclipse Team
Here, the null background color means, takes the default system background for that widget. (so here: white).
But you could specify whatever color you want, based on the partitioning of your document and on the rules that would apply.
I know this was asked a while ago, but in case anyone is looking for another solution, I thought I would post the following:
Since you are able to use the setTextColor method, then you should be able to use the changeTextPresentation method as well.
In the case of my plug-in, I have a TextListener that calls the TextChanged method I overwrote. I did the following to add background color using the changeTextPresentation method. In doing so, I was able to get a Green background with Black foreground. Not that I would want this, of course, but just for testing purposes.
public void TextChanged(TextEvent event){
...
TextPresentation presentation = new TextPresentation();
TextAttribute attr = new TextAttribute(new ColorManager().getColor(MyConstants.BLACK),
new ColorManager().getColor(MyConstants.GREEN), style);
presentation.addStyleRange(new StyleRange(startOffset, tokLength, attr.getForeground(),
attr.getBackground());
sourceViewer.changeTextPresentation(presentation, true); //sourceViewer is a global variable passed to my TextListener class constructor.
}