forked from RallyTechServices/rich-text-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.2.1: Add rab support, fix scrollbars
- Loading branch information
Kyle Morse
committed
Oct 10, 2018
1 parent
ea24850
commit c2ed521
Showing
7 changed files
with
3,091 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
{ | ||
"name": "Rich Text App", | ||
"sdk": "2.1", | ||
"version": "0.1", | ||
"className": "CArABU.app.RichTextApp", | ||
"artifact": "F387" | ||
"artifact": "F387", | ||
"javascript": [ | ||
"src/javascript/utils/__ts-info-link.js", | ||
"src/javascript/utils/__ts-logger.js", | ||
"src/javascript/utils/__ts-utilities.js", | ||
"src/javascript/app.js" | ||
], | ||
"css": [ | ||
"src/style/app.css" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Rich Text App</title> | ||
|
||
<script type="text/javascript" src="/apps/2.1/sdk.js"></script> | ||
|
||
<script type="text/javascript"> | ||
Rally.onReady(function () { | ||
Ext.define("Rally.technicalservices.InfoLink",{extend:"Rally.ui.dialog.Dialog",alias:"widget.tsinfolink",informationHtml:null,title:"Build Information",defaults:{padding:5,margin:5},closable:!0,draggable:!0,autoShow:!0,width:350,informationalConfig:null,showLog:!1,logger:null,items:[{xtype:"container",itemId:"information"},{xtype:"container",itemId:"button_box"}],initComponent:function(){Ext.id(this);this.title="<span class='icon-help'> </span>"+this.title,this.callParent(arguments)},_generateChecksum:function(t){var i,n=305419896;for(t=(t=(t=t.replace(/var CHECKSUM = .*;/,"")).replace(/var BUILDER = .*;/,"")).replace(/\s/g,""),i=0;i<t.length;i++)n+=t.charCodeAt(i)*i;return n},_checkChecksum:function(t){var i=Ext.create("Deft.Deferred"),n=this;return Ext.Ajax.request({url:document.URL,params:{id:1},success:function(t){if(text=t.responseText,CHECKSUM){var e=n._generateChecksum(text);if(CHECKSUM!==e)return void i.resolve(!1)}i.resolve(!0)}}),i.promise},_addToContainer:function(t){var i=Ext.apply({xtype:"container",height:200,overflowY:!0},this.informationalConfig);t.add(i)},afterRender:function(){var t=Rally.getApp();if(!Ext.isEmpty(this.informationalConfig)){var i=this.down("#information");this._addToContainer(i)}this.showLog&&this.logger&&this.down("#button_box").add({xtype:"rallybutton",text:"Show Log",listeners:{scope:this,click:function(){this.logger.displayLog()}}}),t.isExternal()?this.addDocked({xtype:"container",cls:"build-info",padding:2,dock:"bottom",html:"... Running externally"}):this._checkChecksum(t).then({scope:this,success:function(t){t||this.addDocked({xtype:"container",cls:"build-info",dock:"bottom",padding:2,html:'<span class="icon-warning"> </span>Checksums do not match'})},failure:function(t){console.log("oops:",t)}}),this.callParent(arguments)},beforeRender:function(){if(this.callParent(arguments),this.informationHtml&&this.addDocked({xtype:"component",componentCls:"intro-panel",padding:2,html:this.informationHtml,dock:"bottom"}),this.addDocked({xtype:"container",cls:"build-info",padding:2,dock:"bottom",html:"This app was created by the CA AC Technical Services Team."}),APP_BUILD_DATE){var t=Ext.String.format("Built on: {0} <br/>Built by: {1}",APP_BUILD_DATE,BUILDER);ARTIFACT&&(t=t+"<br/>Source artifact: "+ARTIFACT),this.addDocked({xtype:"container",cls:"build-info",padding:2,dock:"top",html:t})}}}); | ||
Ext.define("CArABU.technicalservices.Logger",{saveForLater:!1,saveLines:100,logArray:[],constructor:function(t){Ext.apply(this,t)},setSaveForLater:function(t){this.saveForLater=t},log:function(t){var o="[ "+Ext.util.Format.date(new Date,"Y-m-d H:i:s.u")+" ]",e=[];e=Ext.Array.push(e,[o]),e=Ext.Array.push(e,Ext.Array.slice(arguments,0)),this.saveForLater&&(this.logArray||(this.logArray=[]),this.logArray.push(e.join(" ")),this.logArray.length>this.saveLines&&this.logArray.shift()),window.console&&console.log.apply(console,e)},getLogText:function(){return this.logArray&&0!==this.logArray.length?this.logArray.join("<br/>"):"-- no log --"},displayLog:function(){var t=this.getLogText();this.popup=Ext.create("Rally.ui.dialog.Dialog",{width:Ext.getBody().getWidth()-20,height:Ext.getBody().getHeight()-20,closable:!0,title:"Log",autoShow:!0,layout:"border",defaults:{layout:"fit",width:"50%",border:!1},items:[{region:"center",xtype:"container",html:t,autoScroll:!0}]})}}); | ||
Ext.define("TSUtilities",{singleton:!0,loadWsapiRecords:function(e){var r=Ext.create("Deft.Deferred");return Ext.create("Rally.data.wsapi.Store",Ext.Object.merge({model:"Defect",fetch:["ObjectID"]},e)).load({callback:function(e,o,t){t?r.resolve(e):(console.error("Failed: ",o),r.reject("Problem loading: "+o.error.errors.join(". ")))}}),r.promise},loadAStoreWithAPromise:function(e,r){var o=Ext.create("Deft.Deferred");return Ext.create("Rally.data.wsapi.Store",{model:e,fetch:r}).load({callback:function(e,r,t){t?o.resolve(this):(console.error("Failed: ",r),o.reject("Problem loading: "+r.error.errors.join(". ")))}}),o.promise}}); | ||
Ext.define("CArABU.app.RichTextApp",{extend:"Rally.app.App",componentCls:"app",defaults:{padding:10},layout:"fit",config:{defaultSettings:{html:"<em>Use the gear to change display text...</em>"}},integrationHeaders:{name:"CArABU.app.TSApp"},launch:function(){this.removeAll();var t=this.getSetting("html");this.add({xtype:"component",html:t,cls:"default-counter"})},getSettingsFields:function(){return[{xtype:"container",margin:"10 70 0 60",html:'<div class="variable-label">Display Text</div>'},{name:"html",flex:1,xtype:"rallyrichtexteditor",margin:"10 70 0 60",fieldLabel:"Informational Text",_createResizer:function(){},resizeable:!1}]},getOptions:function(){return[{text:"About...",handler:this._launchInfo,scope:this}]},_launchInfo:function(){this.about_dialog&&this.about_dialog.destroy(),this.about_dialog=Ext.create("Rally.technicalservices.InfoLink",{showLog:this.getSetting("saveLog"),logger:this.logger})},isExternal:function(){return void 0===this.getAppId()}}); | ||
|
||
Rally.launchApp('CArABU.app.RichTextApp', { | ||
name:"Rich Text App", | ||
parentRepos:"", | ||
version:"0.2.1" | ||
}); | ||
|
||
}); | ||
</script> | ||
|
||
|
||
<style type="text/css"> | ||
.tsinfolink{position:absolute;right:0px;width:14px;height:14px;border-radius:7px;text-align:center;color:white;background:#C0C0C0;border-style:solid;border-width:1px;margin-top:25px;margin-right:5px;cursor:pointer}.variable-label{font-family:ProximaNovaSemiBold, Helvetica, Arial;text-transform:uppercase;font-size:11px}.default-counter{font-family:ProximaNova, Helvetica, Arial;font-size:14px} | ||
</style> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Oops, something went wrong.