Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
JockiHendry committed Dec 23, 2012
1 parent d0da7ee commit 2ae6ca8
Show file tree
Hide file tree
Showing 12,768 changed files with 1,104,368 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 11 additions & 0 deletions browser.extensions/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>browser.extensions</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
60 changes: 60 additions & 0 deletions browser.extensions/debugger.aptana.com/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<project name="Debugger" default="compile" basedir=".">
<description>Base build file for the Aptana debugger</description>

<property environment="env" />
<property name="build_dir" value="${basedir}/build" />

<!-- Build all projects -->
<target name="compile" description="compile the xpi" depends="clean">

<echo message="*******************************" level="info" />
<echo message="** Compiling deploy version **" level="info" />
<echo message="*******************************" level="info" />

<antcall target="replace"></antcall>

<mkdir dir="${build_dir}" />

<zip destfile="${build_dir}/aptanadebugger.jar" basedir="${basedir}" update="true" compress="false"
includes="content/**, locale/**, skin/**" excludes="**/.*"/>

<zip destfile="${build_dir}/aptanadebugger.xpi" update="true" compress="true">
<zipfileset dir="${build_dir}" prefix="chrome" includes="aptanadebugger.jar"/>
<zipfileset dir="${basedir}" prefix="" includes="install.rdf, chrome.manifest, components/**"/>
</zip>
<copy file="${basedir}/update.rdf" todir="${build_dir}"/>

</target>

<!-- Replace versions -->
<target name="replace" description="replace file versions" if="build.revision">

<exec executable="chmod"><arg line="a+w install.rdf" /></exec>
<exec executable="chmod"><arg line="a+w update.rdf" /></exec>
<exec executable="chmod"><arg line="a+w content/aptanadebugger/aptanaCommon.js" /></exec>

<replace file="install.rdf" token=".qualifier" value=".${build.revision}" />
<replace file="update.rdf" token=".qualifier" value=".${build.revision}" />
<replace file="content/aptanadebugger/aptanaCommon.js" token=".qualifier" value=".${build.revision}" />

<!-- make files read-only -->
<exec executable="chmod"><arg line="a-w install.rdf" /></exec>
<exec executable="chmod"><arg line="a-w update.rdf" /></exec>
<exec executable="chmod"><arg line="a-w content/aptanadebugger/aptanaCommon.js" /></exec>

</target>

<!-- removes the temporary target files -->
<target name="clean">
<echo message="**********************" level="info" />
<echo message="** Cleaning Build **" level="info" />
<echo message="**********************" level="info" />

<delete file="${build_dir}/aptanadebugger.jar" verbose="true" />
<delete file="${build_dir}/aptanadebugger.xpi" verbose="true" />
<delete file="${build_dir}/update.rdf" verbose="true" />
<delete dir="${build_dir}" />

</target>

</project>
6 changes: 6 additions & 0 deletions browser.extensions/debugger.aptana.com/chrome.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
content aptanadebugger jar:chrome/aptanadebugger.jar!/content/aptanadebugger/ xpcnativewrappers=yes
skin aptanadebugger classic/1.0 jar:chrome/aptanadebugger.jar!/skin/classic/
locale aptanadebugger en-US jar:chrome/aptanadebugger.jar!/locale/en-US/

overlay chrome://browser/content/browser.xul chrome://aptanadebugger/content/browserOverlay.xul
overlay chrome://firebug/content/firebug.xul chrome://aptanadebugger/content/firebugOverlay.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
content aptanadebugger content/aptanadebugger/
skin aptanadebugger classic/1.0 skin/classic/
locale aptanadebugger en-US locale/en-US/

overlay chrome://browser/content/browser.xul chrome://aptanadebugger/content/browserOverlay.xul
overlay chrome://firebug/content/firebug.xul chrome://aptanadebugger/content/firebugOverlay.xul
213 changes: 213 additions & 0 deletions browser.extensions/debugger.aptana.com/components/jaxer-debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
/* ***** BEGIN LICENSE BLOCK *****
* Aptana Studio
* Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions).
* Please see the license.html included with this distribution for details.
* Any modifications to this file must keep this entire header intact.
*
* Contributor(s):
* Max Stepanov (Appcelerator, Inc.)
*
* ***** END LICENSE BLOCK ***** */

const CC = Components.classes;
const CI = Components.interfaces;
const CR = Components.results;
const CU = Components.utils;

CU.import("resource://gre/modules/XPCOMUtils.jsm");

const EVENT_RequestStart = "jaxerEvent.RequestStart";
const EVENT_HTMLParseStart = "jaxerEvent.HTMLParseStart";
const EVENT_RequestComplete = "jaxerEvent.RequestComplete";
const EVENT_ScriptCompile = "jaxerEvent.ScriptCompile";

const DEBUGGER_PORT_EXPRESSION = new RegExp("([0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]:)?([0-9]+)");
const FILENAME_EXPRESSION = new RegExp("^/\\* (.+\\.js) \\*/");

try {
const Jaxer = CC['@aptana.com/jaxer/global;1'].getService(CI.aptIJaxerGlobal).getObject();
const Log = CC['@aptana.com/log;1'].getService(CI.aptICoreLog);

const eINFO = CI.aptICoreLog.eINFO;
const eWARN = CI.aptICoreLog.eWARN;
const eERROR = CI.aptICoreLog.eERROR;
const eFATAL = CI.aptICoreLog.eFATAL;
const eNOTICE = CI.aptICoreLog.eNOTICE;

} catch(exc) {
/* not Jaxer */
}

const scope = {};
var logListener;
var lastEvalScriptId = 0;

function initDebugger(param) {
scope.launchParam = param;
try {
CC["@mozilla.org/moz/jssubscript-loader;1"]
.getService(CI.mozIJSSubScriptLoader)
.loadSubScript("chrome://aptanadebugger/content/aptanaServer.js", scope);
Jaxer.private.hasDebugger = true;
scope.Jaxer = Jaxer;

logListener = {
observe: function(type, message) {
if (type >= eINFO && Jaxer.private.hasDebugger && scope.AptanaDebugger) {
var logType = "out";
if (type == eWARN) {
logType = "warn";
} else if (type == eERROR || type == eFATAL) {
logType = "err";
}
scope.AptanaDebugger.log(logType, message);
}
}
};
Log.registerListener(logListener);
} catch(exc) {
var message;
if ( typeof(exc) == 'object' && "fileName" in exc && "lineNumber" in exc ) {
message = ""+exc+" at "+exc.fileName+":"+exc.lineNumber;
} else {
message = exc.toString();
}
Log.error("Error while loading debugger: " + message);
}
}

function terminateJaxer() {
Log.unregisterListener(logListener);
CC["@aptana.com/httpdocumentfetcher;1"]
.getService(CI.aptIDocumentFetcherService)
.exit();
}

function JaxerDebugger() { }

JaxerDebugger.prototype = {
// properties required for XPCOM registration:
classDescription: "Jaxer Debugger",
classID: Components.ID("{C747E37D-91AF-4769-A444-206DE1712F38}"),
contractID: "@aptana.com/jaxer-debugger;1",

_xpcom_categories: [
{ category: EVENT_RequestStart },
{ category: EVENT_HTMLParseStart },
{ category: EVENT_RequestComplete },
{ category: EVENT_ScriptCompile }
],

_xpcom_factory: {
_instance: null,
createInstance: function (outer, iid) {
if (outer != null)
throw CR.NS_ERROR_NO_AGGREGATION;
if (this._instance == null)
this._instance = new JaxerDebugger();
return this._instance.QueryInterface(iid);
}
},

// nsISupports
QueryInterface: XPCOMUtils.generateQI([
CI.nsIObserver
]),

// nsIObserver
observe: function (aEventObj, aTopic, aData)
{
switch(aTopic) {
/* Ordered by the frequency of appearance */
case EVENT_ScriptCompile:
var event = aEventObj.QueryInterface(CI.aptIEventScriptCompile);
if (Jaxer.private.hasDebugger && scope.AptanaDebugger) {
event.scriptURI = normalizeScriptURI(event.scriptURI, event.scriptText);
scope.AptanaDebugger.onScriptCompile(event.scriptURI, event.lineNo, event.scriptText);
}
break;
case EVENT_RequestStart:
var event = aEventObj.QueryInterface(CI.aptIEventRequestStart);
var req = event.Request;
var method = req.method.toUpperCase();
if (method == "OPTIONS") {
handleOPTIONS(req, event.Response);
}
break;
case EVENT_HTMLParseStart:
var event = aEventObj.QueryInterface(CI.aptIEventHTMLParseStart);
if (Jaxer.private.hasDebugger && scope.AptanaDebugger) {
scope.AptanaDebugger.onRequestStart(event.Request);
}
break;
case EVENT_RequestComplete:
var event = aEventObj.QueryInterface(CI.aptIEventRequestComplete);
if (Jaxer.private.hasDebugger && scope.AptanaDebugger) {
scope.AptanaDebugger.onRequestComplete(event.Response);
}
break;
}
}
};

function handleOPTIONS(req, resp)
{
try {
var headerCount = req.GetHeaderCount();
for (var i = 0; i < headerCount; ++i) {
var name = req.GetHeaderName(i);
if (name == "Compliance") {
var value = req.GetValueByOrd(i);
if (value.match(/^server=jaxer;debug$/)) {
resp.addHeader(name, value, false);
}
} else if (name == "Jaxer-Debug") {
var value = req.GetValueByOrd(i);
if (!Jaxer.private.hasDebugger && DEBUGGER_PORT_EXPRESSION.test(value)) {
var match = DEBUGGER_PORT_EXPRESSION.exec(value);
var debugPort = match[0];
/* TODO: override with server fixed port if required */

var jaxerId = "";
var managerCmdService = CC["@aptana.com/managercmdservice;1"]
.getService(CI.aptIManagerCmdService);
managerCmdService.execNeedRespCmd("getme jaxerdebugid",
function responseCmdCallback(resp) {
if (!resp.failed) {
while(resp.hasMore) {
jaxerId += resp.data;
}
} else {
Log.error("execNeedRespCmd(getme jaxerdebugid): ERROR_CODE=" + resp.errorCode + " ERROR:" + resp.errorText);
}
}, false);
if (jaxerId.match(/^[-0-9]+$/)) {
initDebugger(debugPort);
resp.addHeader(name, value, false);
resp.addHeader("Jaxer-ID", jaxerId, false);
}
}
}
}
} catch (e) {
Log.warning("Error handling OPTIONS request: " + e);
}
}

function normalizeScriptURI(scriptURI, scriptText)
{
if (scriptURI === '<JaxerEval>' || scriptURI.substr(0,11) == 'javascript:') {
if (FILENAME_EXPRESSION.test(scriptText)) {
var match = FILENAME_EXPRESSION.exec(scriptText);
scriptURI = 'dbgsource://'+match[1];
} else {
scriptURI = 'dbgsource://eval'+(++lastEvalScriptId)+'.js';
}
}
return scriptURI;
}

if (typeof(Jaxer) != 'undefined') {
NSGetModule = XPCOMUtils.generateNSGetModule([JaxerDebugger]);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0"?>

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://aptanadebugger/content/aptana.css" type="text/css"?>

<!DOCTYPE window SYSTEM "chrome://aptanadebugger/locale/aptanadebugger.dtd" >
<dialog buttons="accept,extra1"
buttonlabelextra1="&ad.prefs.label;"
onaccept="close();"
ondialogextra1="openPreferences();"
onload="onLoad(); sizeToContent();"
title="&ad.about.title;"
id="aptabadebugger-about-dialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/x-javascript" src="chrome://aptanadebugger/content/aptanaCommon.js"/>
<script><![CDATA[
function onLoad() {
var label = document.getElementById("ad-about-extensionVersion");
label.value += AptanaDebugger.VERSION;
document.documentElement.getButton("extra1").style.marginRight = "10px";
moveToAlertPosition();
}
function openPreferences() {
openDialog("chrome://aptanadebugger/content/preferences.xul", "", "chrome,dependent");
}
]]></script>

<image align="center" src="chrome://aptanadebugger/skin/about.png" />
<vbox id="ad-about-dialogArea">
<vbox id="ad-about-clientBox">
<description id="ad-about-extensionDescription" value="&ad.about.description;"/>
<label id="ad-about-extensionVersion" crop="right" value="&ad.about.version.label; "/>

<label flex="1" crop="right" value=""/>
<vbox id="ad-about-creatorBox" style="padding-top: 0px;">
<label id="ad-about-extensionCreator" flex="1" crop="right" value="&ad.about.copyright;"/>
<hbox>
<label class="text" style="margin-right: 0px; margin-top: 2px;" value="&ad.about.homepage.label; "/>
<label class="text-link" style="margin-left: 0px; -moz-user-focus: ignore;" value="&ad.about.homepage.href;" href="&ad.about.homepage.href;"/>
</hbox>
</vbox>

</vbox>

<separator id="groove" class="groove"/>
</vbox>
</dialog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

@import "chrome://aptanadebugger/skin/aptana.css";
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* ***** BEGIN LICENSE BLOCK *****
* Aptana Studio
* Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions).
* Please see the license.html included with this distribution for details.
* Any modifications to this file must keep this entire header intact.
*
* Contributor(s):
* Max Stepanov (Appcelerator, Inc.)
*
* ***** END LICENSE BLOCK ***** */

function AptanaDebugger() {}

(function() {

// ************************************************************************************************

const APTANA_DEBUGGER_VERSION = '1.7.2';
const DEBUG = true;

this.VERSION = APTANA_DEBUGGER_VERSION;
this.DEBUG = DEBUG;

// ************************************************************************************************

}).apply(AptanaDebugger);
Loading

0 comments on commit 2ae6ca8

Please sign in to comment.