fixed issue with xwiki widgets

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent d4cb4b2b01
commit 3146be4c29
  1. 6
      resources/library/search/Image Planete.wgs/index.html
  2. 7
      src/gui/UBFeaturesWidget.cpp

@ -69,7 +69,7 @@
var iHeight = $("<input type='hidden'/>"); var iHeight = $("<input type='hidden'/>");
var iWidth = $("<input type='hidden'/>"); var iWidth = $("<input type='hidden'/>");
var iTitle = $("<input type='hidden'/>"); var iTitle = $("<input type='hidden'/>");
var iThumbnailUrl = $("<input type='hidden'/>");
// We use titleNoFormatting so that no HTML tags are left in the // We use titleNoFormatting so that no HTML tags are left in the
// title // title
//title.innerHTML = result.title; //title.innerHTML = result.title;
@ -96,12 +96,14 @@
iHeight.attr("value", result.height); iHeight.attr("value", result.height);
iWidth.attr("value", result.width); iWidth.attr("value", result.width);
iTitle.attr("value",result.title); iTitle.attr("value",result.title);
iThumbnailUrl.attr("value",newImg.src);
//imgContainer.append($(title)); //imgContainer.append($(title));
imgContainer.append(iUrl); imgContainer.append(iUrl);
imgContainer.append(iContent); imgContainer.append(iContent);
imgContainer.append(iHeight); imgContainer.append(iHeight);
imgContainer.append(iWidth); imgContainer.append(iWidth);
imgContainer.append(iTitle); imgContainer.append(iTitle);
imgContainer.append(iThumbnailUrl);
// Put our title + image in the content // Put our title + image in the content
imgContainer.appendTo(contentDiv); imgContainer.appendTo(contentDiv);
@ -252,6 +254,8 @@
parent.find("input:hidden").eq(3).val() + parent.find("input:hidden").eq(3).val() +
"</value></data><data><key>Title</key><value>" + "</value></data><data><key>Title</key><value>" +
parent.find("input:hidden").eq(4).val() + parent.find("input:hidden").eq(4).val() +
"</value></data><data><key>thumbnailUrl</key><value>" +
parent.find("input:hidden").eq(5).val() +
"</value></data></metadata>"; "</value></data></metadata>";
return meta; return meta;
} }

@ -236,7 +236,7 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )
bool isLocal = QFileInfo(widgetsUrl).exists(); bool isLocal = QFileInfo(widgetsUrl).exists();
if (isLocal) {
QString strType = UBFileSystemUtils::mimeTypeFromFileName(widgetsUrl); QString strType = UBFileSystemUtils::mimeTypeFromFileName(widgetsUrl);
UBMimeType::Enum thumbType = UBFileSystemUtils::mimeTypeFromString(strType); UBMimeType::Enum thumbType = UBFileSystemUtils::mimeTypeFromString(strType);
@ -259,7 +259,7 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )
break; break;
} }
} else if (!widgetsThumbsUrl.isNull()) { if (!widgetsThumbsUrl.isNull()) {
previewImageUrl = ":/images/libpalette/loading.png"; previewImageUrl = ":/images/libpalette/loading.png";
if (!imageGatherer) if (!imageGatherer)
imageGatherer = new UBDownloadHttpFile(0, this); imageGatherer = new UBDownloadHttpFile(0, this);
@ -271,9 +271,8 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )
} }
QString tmp = QUrl::fromEncoded(metadata["Url"].toAscii()).toString(); QString tmp = QUrl::fromEncoded(metadata["Url"].toAscii()).toString();
qDebug() << tmp;
UBFeature feature( "/root", QImage(previewImageUrl), QString(), tmp/*metadata["Url"]*/, FEATURE_ITEM ); UBFeature feature( "/root", QImage(previewImageUrl), QString(), widgetsThumbsUrl, FEATURE_ITEM );
feature.setMetadata( metadata ); feature.setMetadata( metadata );
centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturePropertiesList); centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturePropertiesList);

Loading…
Cancel
Save