/* exported UIPShortcodesPage*/
/* global Utils, UIPPreviewAnchor, editor, _$ */
/**
 *
 * @param {ProviderData} data
 * @constructor
 */
function UIPShortcodesPage(data) {
    'use strict';
    UIPShortcodesPage.superclass.constructor.call(this, data);
}

Utils.extend(UIPShortcodesPage, UIPPreviewAnchor);

UIPShortcodesPage.prototype.getItems = function (callback) {
    'use strict';

    var items = [];

    var theme = editor.themeController.getTheme(),
        themeStack = _$(theme).getPseudoStack();
    var content = window.storages.editor.getData(themeStack).read('/shortcodes.html');
    var categories = $('h1', $(content));

    for (var i = 0; i < categories.length; i++) {
        var category = $(categories[i]);
        var item = {
            caption: category.attr('data-caption'),
            value: category.attr('data-value'),
            icon: category.attr('data-icon'),
            group: '',
            class: category.attr('data-value')
        };
        items.push(item);
    }

    //this.value(items[0].value);
    callback(null, items);
};
