overloaded sendIwcIntent

This commit is contained in:
Kevin Jahns
2014-08-19 16:06:39 +02:00
parent c40fe0e0b7
commit bb18c8d0f4
9 changed files with 82 additions and 50 deletions

View File

@@ -88,17 +88,25 @@ createIwcConnector = (callback, options)->
#
# Helper for sending iwc intents.
# @param {String} action_name The name of the action that is going to be send.
# @param {String} content The content that is atteched to the intent.
# @overload sendIwcIntent intent
# @param {Object} intent The intent object.
# @overload sendIwcIntent action_name, content
# @param {String} action_name The name of the action that is going to be send.
# @param {String} content The content that is atteched to the intent.
#
sendIwcIntent: (action_name, content)->
intent =
action: action_name
component: ""
data: ""
dataType: ""
flags: ["PUBLISH_GLOBAL"]
extras: content
intent = null
if arguments.length >= 2
[action_name, content] = arguments
intent =
action: action_name
component: ""
data: ""
dataType: ""
flags: ["PUBLISH_GLOBAL"]
extras: content
else
intent = arguments[0]
@duiClient.sendIntent(intent)