Last active
July 31, 2020 19:16
-
-
Save dvdsmpsn/6918249 to your computer and use it in GitHub Desktop.
Inject a meta tag into Atlassian Confluence and then access it from JavaScript using AJS.params.workForAppFusions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<web-panel name="Fulfillment Web Panel" | |
key="fulfillment-web-panel" | |
location="atl.header" | |
weight="1000" | |
class="com.appfusions.confluence.plugins.fulfillment.webpanels.FulfillmentWebPanel"> | |
<description key="fulfillment-web-panel.description">Looking for something more fulfilling?</description> | |
</web-panel> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.appfusions.confluence.plugins.fulfillment.webpanels; | |
import com.atlassian.plugin.web.model.WebPanel; | |
import java.io.IOException; | |
import java.io.Writer; | |
import java.util.Map; | |
public class FulfillmentWebPanel implements WebPanel | |
{ | |
public String getHtml(Map<String, Object> stringObjectMap) | |
{ | |
// AJS.params.workForAppFusions | |
return "<meta name=\"ajs-work-for-app-fusions\" content=\"Looking for something more fulfilling? Try AppFusions http://www.appfusions.com/display/Dashboard/Make+it+Happen+Team\" />"; | |
} | |
@Override | |
public void writeHtml(Writer writer, Map<String, Object> context) throws IOException | |
{ | |
writer.write(getHtml(context)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Print a message in the console. | |
* @see: <a href="https://twitter.com/dvdsmpsn/status/388297619875041280">Screenshot</a> | |
*/ | |
AJS.toInit(function () { | |
AJS.log(AJS.params.workForAppFusions); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment