Need Correct var for the Current Image Being Displayed - slider

I am trying to access the current img src being displayed in a jssor_slider, but cannot seem to find the var. I think it is in the mini.js file but that's a pain to sift through. Is there a public var that holds the current img src being displayed that I can pass to another script?

get current slide index with
jssor_slider_1.$CurrentIndex();
See API

Related

How to access value from react-native-cn-richtext-editor

I have successfully implemented react-native-cn-richtext-editor with limited toolbar functions.
I want to know that, how to get value (text that we have typed) from editor.
I am new in RN, have tried to get value but didn't get success. How can I resolve this issue, as I want to sent this text to server and then do further process.
In given example of this library there is method onValueChange on change the content object is present in value and to extract the value below example is there
onValueChanged = (value) => {
console.log(value[0].content[0].text)
}
Finally I got the solution of above question.
convert the value in HTML with convertToHtmlString write following command,
let html = convertToHtmlString(this.state.value)
for more details refer this github link

How to upload an image on Pentaho dashboard ? ( variable, condition, local path)

I want to display an image depending on parameter called "ca_code" on dashboard.
All the images are in a repository of my current theme ( I know that you can also upload images to server, must be easiler but I need to keep this), here's an example of an image path:
D:\pentaho\pentaho-8-2\pentaho-server\pentaho-solutions\system\common-ui\resources\themes\sapphire\img_project\CA120.jpg
Here, 120 is a ca_code. I get this ca_code as variable by query component.
Here's what I tried on Post Fetch of query component:
function f(ca_code) {
var ca_code=ca_code.resultset;
var img = '<img src="../common-ui/resources/themes/sapphire/img_project/CA'+ca_code.resultset+'.jpg/content"/>';
var img_default='<img src="../common-ui/resources/themes/sapphire/img_project/CA000.jpg/content"/>';
document.getElementById('ca_logo').innerHTML=img;
}
And it doesn't work, think it is the path prob.
When I used HTML on Layout Panel, the path was fine, the image was displayed but I can't do on HTML because I need variable ca_code, I want to do it on Query Component - Post Fetch.
And also, how to check if the image exists ? If it doesn't exist, I want to display img_default.
Any help would be nice !

fetching element from 2nd element of array protractor

I have 4 container boxes on a page which are identical. I have taken all of them in an array. Now each container box contains some elements which are identical as well. I want to fetch 2nd element from 1st container.
Below is what i used to fetch my container and it is working fine:
var pageContent = element(by.css('[class="main-content"]'));
expect(pageContent.all(by.css('.modularBoxContent')).count()).tobe(4);
Now if i want to fetch count of all elements with class as labelText insider modular box container, i am able to do that by using below:
expect(pageContent.all(by.css('.modularBoxContent')).all(by.css('[class="labelText"]')).count()).tobe(10);
But this is giving me labelText present in all 4 containers. I want to get count of labelText only in first container or get text of first labelText in first container. I tried below code but it is not working and getting error message
TypeError: this.pageContent.get is not a function
expect(pageContent.get(0).all(by.css('.modularBoxContent')).all(by.css('[class="labelText"]')).count()).tobe(3);
I also tried below but that is not working as well.
Getting same error as above for this as well.
expect(pageContent.all(by.css('.modularBoxContent')).get(1).all(by.css('[class="labelText"]')).get(0).getText()).tobe(3);
Can someone please suggest correct usage?
I think this should work for you, let's try this. Since all containers have the same class, create an array with .all() and use .get() to retrieve the desired index.
var pageContent = element(by.css('.main-content'));
var firstContainer = pageContent.all(by.css('.modularBoxContent')).first(); // or could have used .get(0);
Once your first container is successfully identified, now you just chain locator calls to find all the children under it. Since you said you wanted the second element under the first container, we'll use .get(1) (1 is the index, so it's the second item in the array).
var secondChild = firstContainer.all(by.css('[class="labelText"]')).get(1);
And, just an FYI, a lot of this could probably be refactored to be shorter if you wanted. For example, you can chain your CSS calls, no need to separate them:
The above code should be the same as this:
var firstContainer = element.all(by.css('.main-content .modularBoxContent')).first();
var secondChild = firstContainer.all(by.css('.labelText')).get(1);

Is It Possible To Use Embedded Resource Images For ObjectListView SubItems

I can't seem to find any information on this, but does anyone know if it is possible to use an embedded image from my.resources within an ObjectListView SubItem?
I am currently using images stored in an ImageList control, but I find for some reason, those images get corrupted and start displaying imperfections. I don't have the problem if I pull them from the embedded resources as I previously have with the normal listview control.
I am using the ImageGetter routine to return a key reference the ImageList, however, ultimately I would like to pull these from embedded resources. I would like to also do this for animated GIF references as well.
If anyone knows a way, could you please assist. Sample code would be appreciated.
Thanks
You can return three different types from the ImageGetter
int - the int value will be used as an index into the image list
String - the string value will be used as a key into the image list
Image - the Image will be drawn directly (only in OwnerDrawn mode)
So option number 3 could be what you want. Note that you have to set objectListView1.OwnerDraw = true.
If that does not work, an alternative could be to load the images into the ImageList at runtime. There is an example here.
this.mainColumn.ImageGetter = delegate(object row) {
String key = this.GetImageKey(row);
if (!this.listView.LargeImageList.Images.ContainsKey(key)) {
Image smallImage = this.GetSmallImageFromStorage(key);
Image largeImage = this.GetLargeImageFromStorage(key);
this.listView.SmallImageList.Images.Add(key, smallImage);
this.listView.LargeImageList.Images.Add(key, largeImage);
}
return key;
};
This dynamically fetches the images if they haven’t been already fetched. You will need to write the GetImageKey(), GetSmallImageFromStorage() and GetLargeImageFromStorage() methods. Their names will probably be different, depending on exactly how you are deciding which image is shown against which model object.

Need a Hyperlink control to do several things at once

On my site I have a DataList full of image thumbnails. The thumbnails are HyperLink controls that, when clicked, offer an enlarged view of the source image (stored in my database).
My client wants a facebook Like button on each image and I was hoping to put that in the lightbox window that appears when you click on a thumbnail.
My challenge here is that to generate the info for the Like, I need to create meta tags and each image should, preferably, create it's own meta tags on the fly.
What I can't figure out is how to make the HyperLink click open the lightbox AND create the meta tags at the same time.
Any help will be greatly appreciated.
For a live view of the site, go to http://www.dossier.co.za
The way that we approach similar problems is to hook the onclick event of the href in javascript.
Depending on exactly what you need to do, you can even prevent the standard browser behavior for the hyperlink from executing by returning false from the javascript method.
And in some cases, we just use the hyperlink for "show" by setting the href to "#".
Here is an example that combines all of these concepts:
File Name
In this case, the specified javascript is executed, there is no real hyperlink, and the browser doesn't try to navigate to the specified URL because we return false in the javascript.
Add a Classname to the opening table tag like class="tbl_images" so we can use JQuery to access it. Capture the click on the td and pickup the id of the item. Pass that id to your code as required to generate your meta tags. In the following when the user clicks on an anchor in a td, a function will run.
I use this all the time to access attributes in the td so i can run a function. You could use something like this to pickup values from your image/anchor and create something...
$("#tbl_images > tbody > tr ").each(function () {
//get the id of the tr (if required)
var id = $(this).attr("id");
var ImageTitle = $(this).find("img.Image_Class_Name").attr("title");
//on click of anchor with classname of lighthouse run function,
//passing in our id or other data in the row to our function
$(this).find("td: > a.lighthouse").click(function () {
//update script for this record
MyFunction(id,ImageTitle);
});
});