removed methods used by jquery recommendation feature
@@ -95,85 +95,7 @@ export class ObjectProvider {
this.currentElement = {};
//this.currentPipeline = new this.Pipeline();
this.adjustingPipeline = {};
- }
- ;
-
- recElement(json) {
- this.json = json;
- this.name = json.name;
- this.getjQueryElement = function () {
- var element = this;
- var $el = $('<a style="text-decoration: none">')
- .data("recObject", element);
- this.addImageOrTextIcon($el, element.json, true, 'recommended');
-
- return $el;
};
}
- addImageOrTextIcon($element, json, small, type) {
- var iconUrl = "";
- if (type == 'block') {
- iconUrl = json.streams[0].iconUrl;
- } else {
- iconUrl = json.iconUrl;
- }
- ImageChecker.imageExists(iconUrl, function (exists) {
- if (exists) {
- var $img = $('<img>')
- .attr("src", iconUrl)
- .data("JSON", $.extend(true, {}, json));
- if (type == 'draggable') {
- $img.addClass("draggable-img tt");
- } else if (type == 'connectable') {
- $img.addClass('connectable-img tt');
- } else if (type == 'block') {
- $img.addClass('block-img tt');
- } else if (type == 'recommended') {
- $img.addClass('recommended-item-img tt');
- }
- $element.append($img);
- } else {
- var name = "";
- if (type == 'block') {
- name = json.streams[0].name;
- } else {
- name = json.name;
- }
- var $span = $("<span>")
- .text(this.getElementIconText(name) || "N/A")
- .attr(
- {
- "data-toggle": "tooltip",
- "data-placement": "top",
- "data-delay": '{"show": 1000, "hide": 100}',
- title: name
- })
- .data("JSON", $.extend(true, {}, json));
- if (small) {
- $span.addClass("element-text-icon-small")
- } else {
- $span.addClass("element-text-icon")
- }
- $element.append($span);
- }
- });
- }
-
- getElementIconText(string) {
- var result = "";
- if (string.length <= 4) {
- result = string;
- } else {
- var words = string.split(" ");
- words.forEach(function (word, i) {
- if (i < 4) {
- result += word.charAt(0);
- }
- });
- }
- return result.toUpperCase();
- }
-}
-
ObjectProvider.$inject = ['$http', 'RestApi', 'ImageChecker'];
\ No newline at end of file
