diff --git a/data/msfweb/app/views/layouts/msfweb.rhtml b/data/msfweb/app/views/layouts/msfweb.rhtml index edb580ac9d..e98d921bef 100644 --- a/data/msfweb/app/views/layouts/msfweb.rhtml +++ b/data/msfweb/app/views/layouts/msfweb.rhtml @@ -7,14 +7,23 @@ Metasploit Framework Web Console v.3 + <% ["prototype","effects","controls", "window", "application"].each do |js| %> + <%= javascript_include_tag js %><% end %> <%= stylesheet_link_tag "msfweb" %> - <%= javascript_include_tag "application" %> + <%= stylesheet_link_tag "window-themes/default" %> + <%= stylesheet_link_tag "window-themes/mac_os_x" %> -
+
@@ -30,6 +39,7 @@
<%= @content_for_layout %>
- + + \ No newline at end of file diff --git a/data/msfweb/app/views/msf/index.rhtml b/data/msfweb/app/views/msf/index.rhtml index 329235f01f..6204fd1314 100644 --- a/data/msfweb/app/views/msf/index.rhtml +++ b/data/msfweb/app/views/msf/index.rhtml @@ -1,5 +1,5 @@ -
+
Use the top menu for accessing the Metasploit modules and functionality. Ex. Exploits, Payloads, Encoders.
Active windows will appear in the taskbar (look at the page bottom). diff --git a/data/msfweb/public/javascripts/application.js b/data/msfweb/public/javascripts/application.js index b82703e46e..5d8eb5df97 100644 --- a/data/msfweb/public/javascripts/application.js +++ b/data/msfweb/public/javascripts/application.js @@ -3,3 +3,33 @@ * All Rights Reserved. */ +/* http://alistapart.com/articles/dropdowns/ */ +function initialize_topmenu() { + if (document.all&&document.getElementById) { + navRoot = document.getElementById("topmenu"); + for (i=0; i "; + else + content ="
"; + + var closeDiv = this.options.closable ? "
" : ""; + var minDiv = this.options.minimizable ? "
" : ""; + var maxDiv = this.options.maximizable ? "
" : ""; + var seAttributes = this.options.resizable ? "class='" + className + "_sizer' id='" + id + "_sizer'" : "class='" + className + "_se'"; + + win.innerHTML = closeDiv + minDiv + maxDiv + "\ + \ + \ + \ + \ + \ + \ +
 
"+ this.options.title +"
 
\ + \ + \ + \ + \ + \ + \ +
"+ content +"
\ + \ + \ + \ + \ + \ + \ +
 
 
 
\ + "; + + Element.hide(win); + this.options.parent.insertBefore(win, this.options.parent.firstChild); + Event.observe($(id + "_content"), "load", this.options.onload); + return win; + }, + + // Sets window location + setLocation: function(top, left) { + if (top < 0) + top = 0; + if (left < 0) + left= 0 + this.element.setStyle({top: top + 'px'}); + this.element.setStyle({left: left + 'px'}); + this.useLeft = true; + this.useTop = true; + }, + + // Gets window size + getSize: function() { + return {width: this.width, height: this.height}; + }, + + // Sets window size + setSize: function(width, height) { + width = parseFloat(width); + height = parseFloat(height); + + // Check min and max size + if (width < this.options.minWidth) + width = this.options.minWidth; + + if (height < this.options.minHeight) + height = this.options.minHeight; + + if (this.options. maxHeight && height > this.options. maxHeight) + height = this.options. maxHeight; + + if (this.options. maxWidth && width > this.options. maxWidth) + width = this.options. maxWidth; + + this.width = width; + this.height = height; + this.element.setStyle({width: width + this.widthW + this.widthE + "px"}) + this.element.setStyle({height: height + this.heightN + this.heightS + "px"}) + + // Update content height + var content = $(this.element.id + '_content') + content.setStyle({height: height + 'px'}); + content.setStyle({width: width + 'px'}); + }, + + updateHeight: function() { + this.setSize(this.width, this.content.scrollHeight) + }, + + updateWidth: function() { + this.setSize(this.content.scrollWidth, this.height) + }, + + // Brings window to front + toFront: function() { + this.setZIndex(Windows.maxZIndex + 20); + Windows.notify("onFocus", this); + }, + + // Displays window modal state or not + show: function(modal) { + if (modal) { + WindowUtilities.disableScreen(this.options.className, 'overlay_modal', this.getId()); + this.modal = true; + this.setZIndex(Windows.maxZIndex + 20); + Windows.unsetOverflow(this); + Event.observe(document, "keypress", this.eventKeyPress); + } + + // To restore overflow if need be + if (this.oldStyle) + this.getContent().setStyle({overflow: this.oldStyle}); + + if (! this.width || !this.height) { + var size = WindowUtilities._computeSize(this.content.innerHTML, this.content.id, this.width, this.height, 0) + if (this.height) + this.width = size + 5 + else + this.height = size + 5 + } + + this.setSize(this.width, this.height); + if (this.centered) + this._center(this.centerTop, this.centerLeft); + + if (this.options.showEffect != Element.show && this.options.showEffectOptions ) + this.options.showEffect(this.element, this.options.showEffectOptions); + else + this.options.showEffect(this.element); + + this._checkIEOverlapping(); + Windows.notify("onShow", this); + }, + + // Displays window modal state or not at the center of the page + showCenter: function(modal, top, left) { + this.centered = true; + this.centerTop = top; + this.centerLeft = left; + + this.show(modal); + }, + + isVisible: function() { + return this.element.visible(); + }, + + _center: function(top, left) { + var windowScroll = WindowUtilities.getWindowScroll(); + var pageSize = WindowUtilities.getPageSize(); + + if (!top) + top = (pageSize.windowHeight - (this.height + this.heightN + this.heightS))/2; + top += windowScroll.top + + if (!left) + left = (pageSize.windowWidth - (this.width + this.widthW + this.widthE))/2; + left += windowScroll.left + + this.setLocation(top, left); + this.toFront(); + }, + + _recenter: function(event) { + if (this.modal) { + var pageSize = WindowUtilities.getPageSize(); + // set height of Overlay to take up whole page and show + if ($('overlay_modal')) { + $('overlay_modal').style.height = (pageSize.pageHeight + 'px'); + $('overlay_modal').style.width = (pageSize.pageWidth + 'px'); + } + if (this.centered) + this._center(this.centerTop, this.centerLeft); + } + }, + + // Hides window + hide: function() { + if (this.modal) { + WindowUtilities.enableScreen(); + Windows.resetOverflow(); + Event.stopObserving(document, "keypress", this.eventKeyPress); + } + // To avoid bug on scrolling bar + this.oldStyle = this.getContent().getStyle('overflow') || "auto" + this.getContent().setStyle({overflow: "hidden"}); + + this.options.hideEffect(this.element, this.options.hideEffectOptions); + + if(this.iefix) + this.iefix.hide(); + Windows.notify("onHide", this); + }, + + minimize: function() { + var r2 = $(this.getId() + "_row2"); + var dh = r2.getDimensions().height; + + if (r2.visible()) { + var h = this.element.getHeight() - dh + r2.hide() + this.element.setStyle({height: h + "px"}) + if (! this.useTop) { + var bottom = parseFloat(this.element.getStyle('bottom')); + this.element.setStyle({bottom: (bottom + dh) + 'px'}); + } + } + else { + var h = this.element.getHeight() + dh; + this.element.setStyle({height: h + "px"}) + if (! this.useTop) { + var bottom = parseFloat(this.element.getStyle('bottom')); + this.element.setStyle({bottom: (bottom - dh) + 'px'}); + } + r2.show(); + + this.toFront(); + } + Windows.notify("onMinimize", this); + + // Store new location/size if need be + this._saveCookie() + }, + + maximize: function() { + if (this.storedLocation != null) { + this._restoreLocation(); + if(this.iefix) + this.iefix.hide(); + } + else { + this._storeLocation(); + Windows.unsetOverflow(this); + + var windowScroll = WindowUtilities.getWindowScroll(); + var pageSize = WindowUtilities.getPageSize(); + + this.element.setStyle(this.useLeft ? {left: windowScroll.left} : {right: windowScroll.left}); + this.element.setStyle(this.useTop ? {top: windowScroll.top} : {bottom: windowScroll.top}); + + this.setSize(pageSize.windowWidth - this.widthW - this.widthE, pageSize.windowHeight - this.heightN - this.heightS) + this.toFront(); + if (this.iefix) + this._fixIEOverlapping(); + } + Windows.notify("onMaximize", this); + + // Store new location/size if need be + this._saveCookie() + }, + + isMinimized: function() { + var r2 = $(this.getId() + "_row2"); + return !r2.visible(); + }, + + isMaximized: function() { + return (this.storedLocation != null); + }, + + setOpacity: function(opacity) { + if (Element.setOpacity) + Element.setOpacity(this.element, opacity); + }, + + setZIndex: function(zindex) { + this.element.setStyle({zIndex: zindex}); + Windows.updateZindex(zindex, this); + }, + + setTitle: function(newTitle) { + if (!newTitle || newTitle == "") + newTitle = " "; + + Element.update(this.element.id + '_top', newTitle); + }, + + setStatusBar: function(element) { + var statusBar = $(this.getId() + "_bottom"); + + if (typeof(element) == "object") { + if (this.bottombar.firstChild) + this.bottombar.replaceChild(element, this.bottombar.firstChild); + else + this.bottombar.appendChild(element); + } + else + this.bottombar.innerHTML = element; + }, + + _checkIEOverlapping: function() { + if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (navigator.userAgent.indexOf('Opera')<0) && (this.element.getStyle('position')=='absolute')) { + new Insertion.After(this.element.id, ''); + this.iefix = $(this.element.id+'_iefix'); + } + if(this.iefix) + setTimeout(this._fixIEOverlapping.bind(this), 50); + }, + + _fixIEOverlapping: function() { + Position.clone(this.element, this.iefix); + this.iefix.style.zIndex = this.element.style.zIndex - 1; + this.iefix.show(); + }, + + _getWindowBorderSize: function(event) { + // Hack to get real window border size!! + var div = this._createHiddenDiv(this.options.className + "_n") + this.heightN = Element.getDimensions(div).height; + div.parentNode.removeChild(div) + + var div = this._createHiddenDiv(this.options.className + "_s") + this.heightS = Element.getDimensions(div).height; + div.parentNode.removeChild(div) + + var div = this._createHiddenDiv(this.options.className + "_e") + this.widthE = Element.getDimensions(div).width; + div.parentNode.removeChild(div) + + var div = this._createHiddenDiv(this.options.className + "_w") + this.widthW = Element.getDimensions(div).width; + div.parentNode.removeChild(div); + // Safari size fix + if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + this.setSize(this.width, this.height); + if (this.doMaximize) + this.maximize(); + if (this.doMinimize) + this.minimize(); + }, + + _createHiddenDiv: function(className) { + var objBody = document.getElementsByTagName("body").item(0); + var win = document.createElement("div"); + win.setAttribute('id', this.element.id+ "_tmp"); + win.className = className; + win.style.display = 'none' + win.innerHTML = '' + objBody.insertBefore(win, objBody.firstChild) + return win + }, + + _storeLocation: function() { + if (this.storedLocation == null) { + this.storedLocation = {useTop: this.useTop, useLeft: this.useLeft, + top: this.element.getStyle('top'), bottom: this.element.getStyle('bottom'), + left: this.element.getStyle('left'), right: this.element.getStyle('right'), + width: this.width, height: this.height }; + } + }, + + _restoreLocation: function() { + if (this.storedLocation != null) { + this.useLeft = this.storedLocation.useLeft; + this.useTop = this.storedLocation.useTop; + + this.element.setStyle(this.useLeft ? {left: this.storedLocation.left} : {right: this.storedLocation.right}); + this.element.setStyle(this.useTop ? {top: this.storedLocation.top} : {bottom: this.storedLocation.bottom}); + this.setSize(this.storedLocation.width, this.storedLocation.height); + + Windows.resetOverflow(); + this._removeStoreLocation(); + } + }, + + _removeStoreLocation: function() { + this.storedLocation = null; + }, + + _saveCookie: function() { + if (this.cookie) { + var value = ""; + if (this.useLeft) + value += "l:" + (this.storedLocation ? this.storedLocation.left : this.element.getStyle('left')) + else + value += "r:" + (this.storedLocation ? this.storedLocation.right : this.element.getStyle('right')) + if (this.useTop) + value += ",t:" + (this.storedLocation ? this.storedLocation.top : this.element.getStyle('top')) + else + value += ",b:" + (this.storedLocation ? this.storedLocation.bottom :this.element.getStyle('bottom')) + + value += "," + (this.storedLocation ? this.storedLocation.width : this.width); + value += "," + (this.storedLocation ? this.storedLocation.height : this.height); + value += "," + this.isMinimized(); + value += "," + this.isMaximized(); + WindowUtilities.setCookie(value, this.cookie) + } + } +}; + +// Windows containers, register all page windows +var Windows = { + windows: [], + observers: [], + focusedWindow: null, + maxZIndex: 0, + + addObserver: function(observer) { + this.removeObserver(observer); + this.observers.push(observer); + }, + + removeObserver: function(observer) { + this.observers = this.observers.reject( function(o) { return o==observer }); + }, + + notify: function(eventName, win) { // onStartResize(), onEndResize(), onStartMove(), onEndMove(), onClose(), onDestroy(), onMinimize(), onMaximize(), onHide(), onShow(), onFocus() + this.observers.each( function(o) {if(o[eventName]) o[eventName](eventName, win);}); + }, + + // Gets window from its id + getWindow: function(id) { + return this.windows.detect(function(d) { return d.getId() ==id }); + }, + + // Gets the last focused window + getFocusedWindow: function() { + return this.focusedWindow; + }, + + // Registers a new window (called by Windows constructor) + register: function(win) { + this.windows.push(win); + }, + + // Unregisters a window (called by Windows destructor) + unregister: function(win) { + this.windows = this.windows.reject(function(d) { return d==win }); + }, + + // Closes a window with its id + close: function(id) { + var win = this.getWindow(id); + // Asks delegate if exists + if (win) { + if (win.getDelegate() && ! win.getDelegate().canClose(win)) + return; + if ($(id + "_close")) + $(id + "_close").onclick = null; + if ($(id + "_minimize")) + $(id + "_minimize").onclick = null; + if ($(id + "_maximize")) + $(id + "_maximize").onclick = null; + + this.notify("onClose", win); + win.hide(); + } + }, + + // Closes all windows + closeAll: function() { + this.windows.each( function(w) {Windows.close(w.getId())} ); + }, + + // Minimizes a window with its id + minimize: function(id) { + var win = this.getWindow(id) + if (win) + win.minimize(); + }, + + // Maximizes a window with its id + maximize: function(id) { + var win = this.getWindow(id) + if (win) + win.maximize(); + }, + + unsetOverflow: function(except) { + this.windows.each(function(d) { d.oldOverflow = d.getContent().getStyle("overflow") || "auto" ; d.getContent().setStyle({overflow: "hidden"}) }); + if (except && except.oldOverflow) + except.getContent().setStyle({overflow: except.oldOverflow}); + }, + + resetOverflow: function() { + this.windows.each(function(d) { if (d.oldOverflow) d.getContent().setStyle({overflow: d.oldOverflow}) }); + }, + + updateZindex: function(zindex, win) { + if (zindex > this.maxZIndex) + this.maxZIndex = zindex; + this.focusedWindow = win; + } +}; + +var Dialog = { + dialogId: null, + win: null, + onCompleteFunc: null, + callFunc: null, + parameters: null, + + confirm: function(content, parameters) { + // Get Ajax return before + if (typeof content != "string") { + Dialog._runAjaxRequest(content, parameters, Dialog.confirm); + return + } + + parameters = parameters || {}; + var okLabel = parameters.okLabel ? parameters.okLabel : "Ok"; + var cancelLabel = parameters.cancelLabel ? parameters.cancelLabel : "Cancel"; + + var windowParam = parameters.windowParameters || {}; + windowParam.className = windowParam.className || "alert"; + + okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'" + cancelButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " cancel_button'" + var content = "\ +
" + content + "
\ +
\ + \ + \ +
\ + "; + this._openDialog(content, parameters) + return this.win + }, + + alert: function(content, parameters) { + // Get Ajax return before + if (typeof content != "string") { + Dialog._runAjaxRequest(content, parameters, Dialog.alert); + return + } + + parameters = parameters || {}; + var okLabel = parameters.okLabel ? parameters.okLabel : "Ok"; + + var windowParam = parameters.windowParameters || {}; + windowParam.className = windowParam.className || "alert"; + + okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'" + var content = "\ +
" + content + "
\ +
\ + \ +
"; + return this._openDialog(content, parameters) + }, + + info: function(content, parameters) { + // Get Ajax return before + if (typeof content != "string") { + Dialog._runAjaxRequest(content, parameters, Dialog.info); + return + } + + parameters = parameters || {}; + parameters.windowParameters = parameters.windowParameters || {}; + + var className = parameters.windowParameters.className || "alert"; + + var content = ""; + if (parameters.showProgress) + content += ""; + + parameters.windowParameters.ok = null; + parameters.windowParameters.cancel = null; + parameters.windowParameters.className = className; + + return this._openDialog(content, parameters) + }, + + setInfoMessage: function(message) { + $('modal_dialog_message').update(message); + }, + + closeInfo: function() { + Windows.close(this.dialogId); + }, + + _openDialog: function(content, parameters) { + // remove old dialog + if (this.win) + this.win.destroy(); + + if (! parameters.windowParameters.height && ! parameters.windowParameters.width) { + parameters.windowParameters.width = WindowUtilities.getPageSize().pageWidth / 2; + } + this.dialogId = parameters.id ? parameters.id : 'modal_dialog' + + // compute height or width if need be + if (! parameters.windowParameters.height || ! parameters.windowParameters.width) { + var size = WindowUtilities._computeSize(content, this.dialogId, parameters.windowParameters.width, parameters.windowParameters.height) + if (parameters.windowParameters.height) + parameters.windowParameters.width = size + 5 + else + parameters.windowParameters.height = size + 5 + } + var windowParam = parameters && parameters.windowParameters ? parameters.windowParameters : {}; + windowParam.resizable = windowParam.resizable || false; + + windowParam.effectOptions = windowParam.effectOptions || {duration: 1}; + windowParam.minimizable = false; + windowParam.maximizable = false; + windowParam.closable = false; + this.win = new Window(this.dialogId, windowParam); + this.win.getContent().innerHTML = content; + this.win.showCenter(true, parameters.top, parameters.left); + + this.win.cancelCallback = parameters.cancel; + this.win.okCallback = parameters.ok; + + return this.win; + }, + + _getAjaxContent: function(originalRequest) { + Dialog.callFunc(originalRequest.responseText, Dialog.parameters) + }, + + _runAjaxRequest: function(message, parameters, callFunc) { + if (message.options == null) + message.options ={} + Dialog.onCompleteFunc = message.options.onComplete; + Dialog.parameters = parameters; + Dialog.callFunc = callFunc; + + message.options.onComplete = Dialog._getAjaxContent; + new Ajax.Request(message.url, message.options); + }, + + okCallback: function() { + if (!this.win.okCallback || this.win.okCallback(this.win)) + this.win.hide(); + }, + + cancelCallback: function() { + this.win.hide(); + if (this.win.cancelCallback) + this.win.cancelCallback(this.win); + } +} +/* + Based on Lightbox JS: Fullsize Image Overlays + by Lokesh Dhakar - http://www.huddletogether.com + + For more information on this script, visit: + http://huddletogether.com/projects/lightbox/ + + Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/ + (basically, do anything you want, just leave my name and link) +*/ + +var isIE = navigator.appVersion.match(/MSIE/) == "MSIE"; + +var WindowUtilities = { + // From script.aculo.us + getWindowScroll: function() { + var w = window; + var T, L, W, H; + with (w.document) { + if (w.document.documentElement && documentElement.scrollTop) { + T = documentElement.scrollTop; + L = documentElement.scrollLeft; + } else if (w.document.body) { + T = body.scrollTop; + L = body.scrollLeft; + } + if (w.innerWidth) { + W = w.innerWidth; + H = w.innerHeight; + } else if (w.document.documentElement && documentElement.clientWidth) { + W = documentElement.clientWidth; + H = documentElement.clientHeight; + } else { + W = body.offsetWidth; + H = body.offsetHeight + } + } + return { top: T, left: L, width: W, height: H }; + + }, + // + // getPageSize() + // Returns array with page width, height and window width, height + // Core code from - quirksmode.org + // Edit for Firefox by pHaez + // + getPageSize: function(){ + var xScroll, yScroll; + + if (window.innerHeight && window.scrollMaxY) { + xScroll = document.body.scrollWidth; + yScroll = window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac + xScroll = document.body.scrollWidth; + yScroll = document.body.scrollHeight; + } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari + xScroll = document.body.offsetWidth; + yScroll = document.body.offsetHeight; + } + + var windowWidth, windowHeight; + + if (self.innerHeight) { // all except Explorer + windowWidth = self.innerWidth; + windowHeight = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode + windowWidth = document.documentElement.clientWidth; + windowHeight = document.documentElement.clientHeight; + } else if (document.body) { // other Explorers + windowWidth = document.body.clientWidth; + windowHeight = document.body.clientHeight; + } + var pageHeight, pageWidth; + + // for small pages with total height less then height of the viewport + if(yScroll < windowHeight){ + pageHeight = windowHeight; + } else { + pageHeight = yScroll; + } + + // for small pages with total width less then width of the viewport + if(xScroll < windowWidth){ + pageWidth = windowWidth; + } else { + pageWidth = xScroll; + } + + return {pageWidth: pageWidth ,pageHeight: pageHeight , windowWidth: windowWidth, windowHeight: windowHeight}; + }, + + disableScreen: function(className, overlayId, contentId) { + WindowUtilities.initLightbox(overlayId, className); + var objBody = document.getElementsByTagName("body").item(0); + + // prep objects + var objOverlay = $(overlayId); + + var pageSize = WindowUtilities.getPageSize(); + + // Hide select boxes as they will 'peek' through the image in IE + if (contentId && isIE) { + $$('select').each(function(element) {element.style.visibility = "hidden"}); + $$('#'+contentId+' select').each(function(element) {element.style.visibility = "visible"}); + } + + // set height of Overlay to take up whole page and show + objOverlay.style.height = (pageSize.pageHeight + 'px'); + objOverlay.style.width = (pageSize.windowWidth + 'px'); + objOverlay.style.display = 'block'; + }, + + enableScreen: function(id) { + id = id || 'overlay_modal' + var objOverlay = $(id); + if (objOverlay) { + // hide lightbox and overlay + objOverlay.style.display = 'none'; + + // make select boxes visible + if (isIE) { + $$('select').each(function(element) {element.style.visibility = "visible"}); + } + objOverlay.parentNode.removeChild(objOverlay); + } + }, + + // initLightbox() + // Function runs on window load, going through link tags looking for rel="lightbox". + // These links receive onclick events that enable the lightbox display for their targets. + // The function also inserts html markup at the top of the page which will be used as a + // container for the overlay pattern and the inline image. + initLightbox: function(id, className) { + // Already done, just update zIndex + if ($(id)) { + Element.setStyle(id, {zIndex: Windows.maxZIndex + 10}); + } + // create overlay div and hardcode some functional styles (aesthetic styles are in CSS file) + else { + var objBody = document.getElementsByTagName("body").item(0); + var objOverlay = document.createElement("div"); + objOverlay.setAttribute('id', id); + objOverlay.className = "overlay_" + className + objOverlay.style.display = 'none'; + objOverlay.style.position = 'absolute'; + objOverlay.style.top = '0'; + objOverlay.style.left = '0'; + objOverlay.style.zIndex = Windows.maxZIndex + 10; + objOverlay.style.width = '100%'; + objBody.insertBefore(objOverlay, objBody.firstChild); + } + }, + + setCookie: function(value, parameters) { + document.cookie= parameters[0] + "=" + escape(value) + + ((parameters[1]) ? "; expires=" + parameters[1].toGMTString() : "") + + ((parameters[2]) ? "; path=" + parameters[2] : "") + + ((parameters[3]) ? "; domain=" + parameters[3] : "") + + ((parameters[4]) ? "; secure" : ""); + }, + + getCookie: function(name) { + var dc = document.cookie; + var prefix = name + "="; + var begin = dc.indexOf("; " + prefix); + if (begin == -1) { + begin = dc.indexOf(prefix); + if (begin != 0) return null; + } else { + begin += 2; + } + var end = document.cookie.indexOf(";", begin); + if (end == -1) { + end = dc.length; + } + return unescape(dc.substring(begin + prefix.length, end)); + }, + + _computeSize: function(content, id, width, height, margin) { + if (margin == null) + margin = 5; + + var objBody = document.getElementsByTagName("body").item(0); + var tmpObj = document.createElement("div"); + tmpObj.setAttribute('id', id); + + if (height) + tmpObj.style.height = height + "px" + else + tmpObj.style.width = width + "px" + + tmpObj.style.position = 'absolute'; + tmpObj.style.top = '0'; + tmpObj.style.left = '0'; + tmpObj.style.display = 'none'; + + tmpObj.innerHTML = content; + objBody.insertBefore(tmpObj, objBody.firstChild); + + var size; + if (height) + size = $(id).getDimensions().width + margin; + else + size = $(id).getDimensions().height + margin; + objBody.removeChild(tmpObj); + + return size; + } +} + + diff --git a/data/msfweb/public/stylesheets/msfweb.css b/data/msfweb/public/stylesheets/msfweb.css index 5fada11332..f42b374580 100644 --- a/data/msfweb/public/stylesheets/msfweb.css +++ b/data/msfweb/public/stylesheets/msfweb.css @@ -15,18 +15,49 @@ body { background: #444444 url(/images/metasploit-graf.jpg) fixed center no-repeat; } +/* inspired by http://alistapart.com/articles/dropdowns/ */ +#topmenu { + margin:0; + padding:0; + width: 100%; + position: absolute; + list-style-type:none; + height: 31px; + background-color:#f4f4f4; + font-size: 8pt; +} + +#topmenu ul { + padding: 0; + margin: 0; + list-style: none; +} + +#topmenu li { + float: left; + position: relative; + white-space: nowrap; + padding: 8px; + font: menu; + color: WindowText; +} + +#topmenu li:hover { + background-color: blue; + cursor: pointer; + _cursor: hand; + background-color: Highlight; + color: HighlightText; +} + #maincontent { position: relative; min-height: 100%; height: 100%; } -#topmenu { - -} - .desktop-tip { - margin-top: 1em; + margin-top: 6em; margin-left: 1em; font-family: Trebuchet, Sans, Arial; font-size: 90%; diff --git a/data/msfweb/public/stylesheets/window-themes/default.css b/data/msfweb/public/stylesheets/window-themes/default.css new file mode 100644 index 0000000000..47d3f3c2ca --- /dev/null +++ b/data/msfweb/public/stylesheets/window-themes/default.css @@ -0,0 +1,146 @@ +.overlay_dialog { + background-color: #666666; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.overlay___invisible__ { + background-color: #666666; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; +} + +.dialog_nw { + width: 9px; + height: 23px; + background: transparent url(default/top_left.gif) no-repeat 0 0; +} + +.dialog_n { + background: transparent url(default/top_mid.gif) repeat-x 0 0; + height: 23px; +} + +.dialog_ne { + width: 9px; + height: 23px; + background: transparent url(default/top_right.gif) no-repeat 0 0; +} + +.dialog_e { + width: 2px; + background: transparent url(default/center_right.gif) repeat-y 0 0; +} + +.dialog_w { + width: 2px; + background: transparent url(default/center_left.gif) repeat-y 0 0; +} + +.dialog_sw { + width: 9px; + height: 19px; + background: transparent url(default/bottom_left.gif) no-repeat 0 0; +} + +.dialog_s { + background: transparent url(default/bottom_mid.gif) repeat-x 0 0; + height: 19px; +} + +.dialog_se { + width: 9px; + height: 19px; + background: transparent url(default/bottom_right.gif) no-repeat 0 0; +} + +.dialog_sizer { + width: 9px; + height: 19px; + background: transparent url(default/sizer.gif) no-repeat 0 0; + cursor:se-resize; +} + +.dialog_close { + width: 14px; + height: 14px; + background: transparent url(default/close.gif) no-repeat 0 0; + position:absolute; + top:5px; + left:8px; + cursor:pointer; + z-index:2000; +} + +.dialog_minimize { + width: 14px; + height: 15px; + background: transparent url(default/minimize.gif) no-repeat 0 0; + position:absolute; + top:5px; + left:28px; + cursor:pointer; + z-index:2000; +} + +.dialog_maximize { + width: 14px; + height: 15px; + background: transparent url(default/maximize.gif) no-repeat 0 0; + position:absolute; + top:5px; + left:49px; + cursor:pointer; + z-index:2000; +} + +.dialog_title { + float:left; + height:14px; + font-size:12px; + text-align:center; + width:100%; + color:#000; +} + +.dialog_content { + overflow:auto; + color: #DDD; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background-color:#123; +} + +.top_draggable, .bottom_draggable { + cursor:move; +} + +.status_bar { + font-size:12px; +} +.status_bar input{ + font-size:12px; +} +/* DO NOT CHANGE THESE VALUES*/ +.dialog { + display: block; + position: absolute; +} + +.dialog table.table_window { + border-collapse: collapse; + border-spacing: 0; + width: 100%; + margin: 0px; + padding:0px; +} + +.dialog table.table_window td , .dialog table.table_window th { + padding: 0; +} + +.dialog .title_window { + -moz-user-select:none; +} diff --git a/data/msfweb/public/stylesheets/window-themes/default/bottom_left.gif b/data/msfweb/public/stylesheets/window-themes/default/bottom_left.gif new file mode 100644 index 0000000000..4c73d35635 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/bottom_left.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/bottom_mid.gif b/data/msfweb/public/stylesheets/window-themes/default/bottom_mid.gif new file mode 100644 index 0000000000..9205d30190 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/bottom_mid.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/bottom_right.gif b/data/msfweb/public/stylesheets/window-themes/default/bottom_right.gif new file mode 100644 index 0000000000..8d002eeb82 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/bottom_right.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/bottom_right_resize.gif b/data/msfweb/public/stylesheets/window-themes/default/bottom_right_resize.gif new file mode 100644 index 0000000000..649b0d870d Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/bottom_right_resize.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/center_left.gif b/data/msfweb/public/stylesheets/window-themes/default/center_left.gif new file mode 100644 index 0000000000..79e7a1cca6 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/center_left.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/center_right.gif b/data/msfweb/public/stylesheets/window-themes/default/center_right.gif new file mode 100644 index 0000000000..554c55c864 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/center_right.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/clear.gif b/data/msfweb/public/stylesheets/window-themes/default/clear.gif new file mode 100644 index 0000000000..c10b166944 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/clear.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/close.gif b/data/msfweb/public/stylesheets/window-themes/default/close.gif new file mode 100644 index 0000000000..31ef5a3948 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/close.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/inspect.gif b/data/msfweb/public/stylesheets/window-themes/default/inspect.gif new file mode 100644 index 0000000000..ebeeb02f69 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/inspect.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/maximize.gif b/data/msfweb/public/stylesheets/window-themes/default/maximize.gif new file mode 100644 index 0000000000..892a0f08c9 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/maximize.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/minimize.gif b/data/msfweb/public/stylesheets/window-themes/default/minimize.gif new file mode 100644 index 0000000000..a7214167b7 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/minimize.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/overlay.png b/data/msfweb/public/stylesheets/window-themes/default/overlay.png new file mode 100644 index 0000000000..648e71ed69 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/overlay.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/resize.gif b/data/msfweb/public/stylesheets/window-themes/default/resize.gif new file mode 100644 index 0000000000..c44070259c Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/resize.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/sizer.gif b/data/msfweb/public/stylesheets/window-themes/default/sizer.gif new file mode 100644 index 0000000000..649b0d870d Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/sizer.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/top_left.gif b/data/msfweb/public/stylesheets/window-themes/default/top_left.gif new file mode 100644 index 0000000000..774538ac6a Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/top_left.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/top_mid.gif b/data/msfweb/public/stylesheets/window-themes/default/top_mid.gif new file mode 100644 index 0000000000..6124e78bd3 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/top_mid.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/default/top_right.gif b/data/msfweb/public/stylesheets/window-themes/default/top_right.gif new file mode 100644 index 0000000000..fbc94bf2b9 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/default/top_right.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x.css b/data/msfweb/public/stylesheets/window-themes/mac_os_x.css new file mode 100644 index 0000000000..77dc12c585 --- /dev/null +++ b/data/msfweb/public/stylesheets/window-themes/mac_os_x.css @@ -0,0 +1,161 @@ +.overlay_mac_os_x { + background-color: #85BBEF; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.mac_os_x_nw { + background: transparent url(mac_os_x/TL_Main.png) no-repeat 0 0; + width:24px; + height:30px; +} + +.mac_os_x_n { + background: transparent url(mac_os_x/T_Main.png) repeat-x 0 0; + height:30px; +} + +.mac_os_x_ne { + background: transparent url(mac_os_x/TR_Main.png) no-repeat 0 0; + width:31px; + height:30px; +} + +.mac_os_x_w { + background: transparent url(mac_os_x/L_Main.png) repeat-y top left; + width:16px; +} + +.mac_os_x_e { + background: transparent url(mac_os_x/R_Main.png) repeat-y top right; + width:16px; +} + +.mac_os_x_sw { + background: transparent url(mac_os_x/BL_Main.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_s { + background: transparent url(mac_os_x/B_Main.png) repeat-x 0 0; + height:40px; +} + +.mac_os_x_se, .mac_os_x_sizer { + background: transparent url(mac_os_x/BR_Main.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_sizer { + cursor:se-resize; +} + +.mac_os_x_close { + width: 19px; + height: 19px; + background: transparent url(mac_os_x/close.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:25px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_minimize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x/minimize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:45px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_maximize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x/maximize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:65px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_title { + float:left; + height:14px; + font-size:12px; + text-align:center; + margin-top:8px; + width:100%; + color:#000; +} + +.mac_os_x_content { + overflow:auto; + color: #222; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background:#FFF; +} + +/* FOR IE */ +* html .mac_os_x_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL_Main.png", sizingMethod="crop"); +} + +* html .mac_os_x_n { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T_Main.png", sizingMethod="scale"); +} + +* html .mac_os_x_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR_Main.png", sizingMethod="crop"); +} + +* html .mac_os_x_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L_Main.png", sizingMethod="scale"); +} + +* html .mac_os_x_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R_Main.png", sizingMethod="scale"); +} + +* html .mac_os_x_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL_Main.png", sizingMethod="crop"); +} + +* html .mac_os_x_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B_Main.png", sizingMethod="scale"); +} + +* html .mac_os_x_se { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop"); +} + +* html .mac_os_x_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop"); +} + diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/B.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/B.png new file mode 100644 index 0000000000..9d771ceae0 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/B.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/BL.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BL.png new file mode 100644 index 0000000000..fdca3eb98b Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BL.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/BL_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BL_Main.png new file mode 100644 index 0000000000..4b34136d12 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BL_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/BR.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BR.png new file mode 100644 index 0000000000..7c1cf2cef3 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BR.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/BR_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BR_Main.png new file mode 100644 index 0000000000..9fb248163a Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/BR_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/B_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/B_Main.png new file mode 100644 index 0000000000..6dc404117a Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/B_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/L.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/L.png new file mode 100644 index 0000000000..6882cc50f7 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/L.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/L_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/L_Main.png new file mode 100644 index 0000000000..f3a8322cc6 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/L_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/R.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/R.png new file mode 100644 index 0000000000..8080ad86d5 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/R.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/R_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/R_Main.png new file mode 100644 index 0000000000..890bcd64ab Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/R_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/T.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/T.png new file mode 100644 index 0000000000..63c265cb4e Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/T.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/TL.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TL.png new file mode 100644 index 0000000000..5fbd409ebc Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TL.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/TL_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TL_Main.png new file mode 100644 index 0000000000..dd21126050 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TL_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/TR.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TR.png new file mode 100644 index 0000000000..aff657d615 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TR.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/TR_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TR_Main.png new file mode 100644 index 0000000000..3bde7f9d62 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/TR_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/T_Main.png b/data/msfweb/public/stylesheets/window-themes/mac_os_x/T_Main.png new file mode 100644 index 0000000000..0efba3d4f9 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/T_Main.png differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/close.gif b/data/msfweb/public/stylesheets/window-themes/mac_os_x/close.gif new file mode 100644 index 0000000000..31ef5a3948 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/close.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/maximize.gif b/data/msfweb/public/stylesheets/window-themes/mac_os_x/maximize.gif new file mode 100644 index 0000000000..892a0f08c9 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/maximize.gif differ diff --git a/data/msfweb/public/stylesheets/window-themes/mac_os_x/minimize.gif b/data/msfweb/public/stylesheets/window-themes/mac_os_x/minimize.gif new file mode 100644 index 0000000000..a7214167b7 Binary files /dev/null and b/data/msfweb/public/stylesheets/window-themes/mac_os_x/minimize.gif differ