Lose the [None] and fix jquery issue

This commit is contained in:
Jonathan Corwin 2011-05-21 18:43:37 +01:00
parent 218ee2db2b
commit 031525b0e6
3 changed files with 15 additions and 12 deletions

View File

@ -506,13 +506,13 @@ class MediaManagerItem(QtGui.QWidget):
# multiple service items? # multiple service items?
if self.singleServiceItem or self.remoteTriggered: if self.singleServiceItem or self.remoteTriggered:
log.debug(u'%s Add requested', self.plugin.name) log.debug(u'%s Add requested', self.plugin.name)
self.addToService([None], self.remoteTriggered) self.addToService(replace=self.remoteTriggered)
else: else:
items = self.listView.selectedIndexes() items = self.listView.selectedIndexes()
self.addToService(items)
def addToService(self, items, replace=None):
for item in items: for item in items:
self.addToService(item)
def addToService(self, item=None, replace=None):
serviceItem = self.buildServiceItem(item, True) serviceItem = self.buildServiceItem(item, True)
if serviceItem: if serviceItem:
serviceItem.from_plugin = False serviceItem.from_plugin = False

View File

@ -247,8 +247,11 @@ window.OpenLP = {
var text = JSON.stringify({"request": {"id": id}}); var text = JSON.stringify({"request": {"id": id}});
$.getJSON( $.getJSON(
"/api/" + $("#search-plugin").val() + "/add", "/api/" + $("#search-plugin").val() + "/add",
{"data": text}) {"data": text},
function () {
history.back(); history.back();
}
);
return false; return false;
} }
} }

View File

@ -499,7 +499,7 @@ class HttpConnection(object):
plugin = self.parent.parent.pluginManager.get_plugin_by_name(type) plugin = self.parent.parent.pluginManager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem: if plugin.status == PluginStatus.Active and plugin.mediaItem:
item_id = plugin.mediaItem.createItemFromId(id) item_id = plugin.mediaItem.createItemFromId(id)
plugin.mediaItem.addToService([item_id]) plugin.mediaItem.addToService(item_id)
def send_response(self, response): def send_response(self, response):
http = u'HTTP/1.1 %s\r\n' % response.code http = u'HTTP/1.1 %s\r\n' % response.code