Last active
January 4, 2016 15:59
-
-
Save jdorrance/8644033 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
CQ.Ext.ns "UserAdminOverride" | |
class UserAdminOverride | |
@originalLoadRecord = CQ.security.UserProperties.prototype.loadRecord | |
@connectRoomItem = | |
xtype: "textfield" | |
fieldLabel: "url field" | |
anchor: "100%" | |
vtype: "url" | |
name: "urlfield" | |
@addConnectToSecurity : -> | |
CQ.security.data.AuthRecord.FIELDS.push name: "urlfield" | |
@doOverride : -> | |
_this = @ | |
CQ.Ext.override CQ.security.UserProperties, | |
loadRecord: (rec) -> | |
unless @userForm.find("name", "urlfield").length > 0 | |
@userForm.insert 3, _this.connectRoomItem | |
@userForm.doLayout() | |
_this.originalLoadRecord.apply this, arguments | |
UserAdminOverride.addConnectToSecurity() | |
UserAdminOverride.doOverride() | |
This file contains hidden or 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
var UserAdminOverride; | |
CQ.Ext.ns("InboxOverride"); | |
UserAdminOverride = (function() { | |
function UserAdminOverride() {} | |
UserAdminOverride.originalLoadRecord = CQ.security.UserProperties.prototype.loadRecord; | |
UserAdminOverride.connectRoomItem = { | |
xtype: "textfield", | |
fieldLabel: "url field", | |
anchor: "100%", | |
vtype: "url", | |
name: "urlfield" | |
}; | |
UserAdminOverride.addConnectToSecurity = function() { | |
return CQ.security.data.AuthRecord.FIELDS.push({ | |
name: "urlfield" | |
}); | |
}; | |
UserAdminOverride.doOverride = function() { | |
var _this; | |
_this = this; | |
return CQ.Ext.override(CQ.security.UserProperties, { | |
loadRecord: function(rec) { | |
if (!(this.userForm.find("name", "urlfield").length > 0)) { | |
this.userForm.insert(3, _this.connectRoomItem); | |
this.userForm.doLayout(); | |
} | |
return _this.originalLoadRecord.apply(this, arguments); | |
} | |
}); | |
}; | |
return UserAdminOverride; | |
})(); | |
UserAdminOverride.addConnectToSecurity(); | |
UserAdminOverride.doOverride(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment