1

我花了几个小时试图让你好图像插件工作。uploadUrl 和 searchUrl 都不起作用。

我用来在我的网页上初始化插件的脚本如下:

<script>

      jQuery(function() {
        jQuery('.editable').hallo({
          plugins: {
            'halloformat': {},
            'halloblock': {},
            'hallojustify': {},
            'hallolists': {},
            'hallolink': {},
            'halloreundo': {},
            'hallocleanhtml': {
              format: false,
              allowedTags: ['p', 'em', 'strong', 'br', 'div', 'ol', 'ul', 'li', 'a'],
              allowedAttributes: ['style']
            },
            'halloimage': {
                search: function(query, limit, offset, successCallback) {
                    response = {offset: offset, total: limit + 1, assets: searchresult.slice(offset, offset+limit)};
                    successCallback(response);
                },
                suggestions: null,
                uploadUrl: function() {
                  return '/library/'
                }
            }
          },
          editable: true
        });
        jQuery('.editable').bind('hallomodified', function(event, data) {
            jQuery('#modified').html("Editables modified");
        });
        jQuery('.editable').bind('halloselected', function(event, data) {
            jQuery('#modified').html("Selection made");
        });
        jQuery('.editable').bind('hallounselected', function(event, data) {
            jQuery('#modified').html("Selection removed");
        });
        jQuery('.editable').bind('hallorestored', function(event, data) {
            jQuery('#modified').html("restored");
        });
      });


    </script>

任何指针将不胜感激,谢谢,米歇尔

4

0 回答 0