var BoardAuthorizer=Class.create(); Object.extend(BoardAuthorizer.prototype, { initialize: function( //id //, titleSize //, onair //, attachSize //, attachExtensions //, readable //, writable //, repliable //, subRepliable //, warnMessage boardInfo // hash ) { this.id =boardInfo.id; this.level =boardInfo.id ? 1 : 0; this.titleSize =boardInfo.titleSize; this.onair =boardInfo.onair; this.attachSize =boardInfo.attachSize; this.attachExtensions =boardInfo.attachExtensions; this.readable =boardInfo.readable; this.writable =boardInfo.writable; this.repliable =boardInfo.repliable; this.subRepliable =boardInfo.subRepliable; this.warnMessage =boardInfo.warnMessage; this.noteMessage =boardInfo.noteMessage; this.name =boardInfo.name if (boardInfo.tabs) { var tabs=boardInfo.tabs; tabs='Àüüº¸±â,'+tabs; this.tabs =tabs.split(','); } else { this.tabs=[]; } if (boardInfo.seqs) { var seqs=boardInfo.seqs; seqs=','+seqs; this.seqs =seqs.split(','); } else { this.seqs=[]; } this.tabPos=0; this.curTabText=''; } , getTitleSize: function() { return this.titleSize; } , isOnair: function() { return this.onair=='Y' ? true : false; } , getAttachSize: function() { return this.attachSize; } , isUploadable: function(file) { var allowedExt=""; if (allowedExt=this.attachExtensions.strip()) { var ext=file.replace(/(.*\.)([0-9a-z]+)$/,'$2'); //var ext="test123".match(/\d+$/); var myre=new RegExp(",?"+ext+",?", 'i'); if (!myre.test(allowedExt)) { var msg=this.warnMessage; msg=msg.replace(/@0/, ext); msg=msg.replace(/@1/, allowedExt); alert(msg); return false; } } return true; } , isReadable: function() { return this.readable <=this.level; } , isWritable: function() { return this.writable <=this.level; } , isRepliable: function() { return this.repliable <=this.level; } , isSubRepliable: function() { return this.subRepliable <=this.level; } , getLevel: function() { return this.level; } , getTabs: function() { return this.tabs; // array } , getSeqs: function() { return this.seqs; // array } , drawTabs: function(thisName, tabBase, tab, tabPos) { var tabStr=""; tabStr +="