mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 21:38:10 +00:00
AS3 instruction documentation improvements
Generate doc from commandline HTML document with all AS3 instructions
This commit is contained in:
@@ -32,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
public class AddDIns extends InstructionDefinition {
|
||||
|
||||
public AddDIns() {
|
||||
super(0x9B, "add_d", new int[]{}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
|
||||
super(0x9B, "add_d", new int[]{}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNDOCUMENTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
package com.jpexs.decompiler.flash.docs;
|
||||
|
||||
import com.jpexs.decompiler.flash.ApplicationInfo;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.helpers.Cache;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
import java.util.TreeSet;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Generator for AVM2 instruction set documentation.
|
||||
@@ -65,28 +75,74 @@ public class As3PCodeDocs {
|
||||
return identName.toString();
|
||||
}
|
||||
|
||||
public static String getDocsForIns(String insName, boolean showDataSize, boolean ui) {
|
||||
public static String getDocsForIns(String insName, boolean showDataSize, boolean ui, boolean withStyle) {
|
||||
if (!nameToDef.containsKey(insName)) {
|
||||
return null;
|
||||
}
|
||||
return getDocsForIns(nameToDef.get(insName), showDataSize, ui);
|
||||
return getDocsForIns(nameToDef.get(insName), showDataSize, ui, withStyle);
|
||||
}
|
||||
|
||||
private static String getProperty(String name) {
|
||||
if (prop.containsKey(name)) {
|
||||
return prop.getString(name);
|
||||
return Helper.escapeHTML(prop.getString(name));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDocsForIns(InstructionDefinition def, boolean showDataSize, boolean ui) {
|
||||
final String cacheKey = def.instructionName + "|" + (showDataSize ? 1 : 0) + "|" + (ui ? 1 : 0);
|
||||
private static String htmlFooter() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("</html>");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private static String meta(String name, String content) {
|
||||
return "\t\t<meta name=\"" + name + "\" content=\"" + content + "\">" + NEWLINE;
|
||||
}
|
||||
|
||||
private static String metaProp(String name, String content) {
|
||||
return "\t\t<meta property=\"" + name + "\" content=\"" + content + "\">" + NEWLINE;
|
||||
}
|
||||
|
||||
private static String meta(String name, Date content) {
|
||||
return "\t\t<meta name=\"" + name + "\" content=\"" + getISO8601StringForDate(content) + "\">" + NEWLINE;
|
||||
}
|
||||
|
||||
private static String htmlHeader(String js, String style) {
|
||||
Date dateGenerated = new Date();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("<!DOCTYPE html>").append(NEWLINE).
|
||||
append("<html>").append(NEWLINE).
|
||||
append("\t<head>").append(NEWLINE);
|
||||
if (style != null && !style.isEmpty()) {
|
||||
sb.append("\t\t<style>").append(style).append("</style>").append(NEWLINE);
|
||||
}
|
||||
if (js != null && !js.isEmpty()) {
|
||||
sb.append("\t\t<script>").append(js).append("</script>").append(NEWLINE);
|
||||
}
|
||||
sb.append("\t\t<meta charset=\"UTF-8\">").append(NEWLINE).
|
||||
append(meta("generator", ApplicationInfo.applicationVerName)).
|
||||
append(meta("description", getProperty("ui.list.pageDescription"))).
|
||||
append(metaProp("og:title", getProperty("ui.list.pageTitle"))).
|
||||
append(metaProp("og:type", "article")).
|
||||
append(metaProp("og:description", getProperty("ui.list.pageDescription"))).
|
||||
append(meta("date", dateGenerated)).
|
||||
append("\t\t<title>").append(getProperty("ui.list.documentTitle")).append("</title>").append(NEWLINE).
|
||||
append("\t</head>").append(NEWLINE);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String getDocsForIns(InstructionDefinition def, boolean showDataSize, boolean ui, boolean standalone) {
|
||||
final String cacheKey = def.instructionName + "|" + (showDataSize ? 1 : 0) + "|" + (ui ? 1 : 0) + "|" + (standalone ? 1 : 0);
|
||||
String v = docsCache.get(cacheKey);
|
||||
if (v != null) {
|
||||
return v;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (standalone) {
|
||||
sb.append(htmlHeader("", getStyle()));
|
||||
}
|
||||
String insName = def.instructionName;
|
||||
|
||||
String insShortDescription = getProperty("instruction." + insName + ".shortDescription");
|
||||
@@ -103,16 +159,31 @@ public class As3PCodeDocs {
|
||||
} else {
|
||||
stackAfter = getProperty("ui.stack.before") + stackAfter;
|
||||
}
|
||||
String stack = def.hasFlag(AVM2InstructionFlag.UNKNOWN_STACK) ? getProperty("ui.unknown") : stackBefore + " => " + stackAfter;
|
||||
stackBefore = "<span class=\"stack-before\">" + stackBefore + "</span>";
|
||||
stackAfter = "<span class=\"stack-after\">" + stackAfter + "</span>";
|
||||
|
||||
String stack = def.hasFlag(AVM2InstructionFlag.UNKNOWN_STACK) ? getProperty("ui.unknown") : stackBefore + "<span class=\"stack-to\">" + getProperty("ui.stack.to") + "</span>" + stackAfter;
|
||||
String operandsDoc = def.hasFlag(AVM2InstructionFlag.UNKNOWN_OPERANDS) ? getProperty("ui.unknown") : getProperty("instruction." + insName + ".operands");
|
||||
|
||||
sb.append(String.format("0x%02X", def.instructionCode)).append(" <font color=\"blue\"><b>").append(insName).append("</b></font>").append(" ");
|
||||
sb.append("<");
|
||||
sb.append(standalone ? "body" : "div");
|
||||
sb.append(" class=\"instruction");
|
||||
|
||||
for (AVM2InstructionFlag fl : def.flags) {
|
||||
sb.append(" instruction-flag-").append(makeIdent(fl.toString()));
|
||||
}
|
||||
sb.append("\">");
|
||||
|
||||
sb.append("<div class=\"instruction-signature\"><span class=\"instruction-code\">").append(String.format("0x%02X", def.instructionCode)).append("</span> <strong class=\"instruction-name\">").append(insName).append("</strong>");
|
||||
|
||||
if (def.hasFlag(AVM2InstructionFlag.UNKNOWN_OPERANDS)) {
|
||||
sb.append(getProperty("ui.unknown")).append(NEWLINE);
|
||||
sb.append(" ").append(getProperty("ui.unknown")).append(NEWLINE);
|
||||
} else {
|
||||
String[] operandsDocs = operandsDoc.split(", ?");
|
||||
boolean first = true;
|
||||
if (def.operands.length > 0) {
|
||||
sb.append(" ");
|
||||
}
|
||||
for (int i = 0; i < def.operands.length; i++) {
|
||||
int op = def.operands[i];
|
||||
String opDoc = operandsDocs[i];
|
||||
@@ -154,67 +225,138 @@ public class As3PCodeDocs {
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append(NEWLINE);
|
||||
sb.append("</div>").append(NEWLINE);
|
||||
}
|
||||
|
||||
sb.append(insShortDescription).append(NEWLINE);
|
||||
sb.append("<div class=\"short-description\">").append(insShortDescription).append("</div>").append(NEWLINE);
|
||||
|
||||
if (!insDescription.trim().isEmpty()) {
|
||||
sb.append(insDescription).append(NEWLINE);
|
||||
sb.append("<div class=\"description\">").append("<strong class=\"description-title\">").append(getProperty("ui.description")).append("</strong>").append(insDescription).append("</div>").append(NEWLINE);
|
||||
}
|
||||
|
||||
sb.append("<b>").append(getProperty("ui.stack")).append("</b>").append(stack).append(NEWLINE);
|
||||
sb.append("<div class=\"stack\"><strong class=\"stack-title\">").append(getProperty("ui.stack")).append("</strong><span class=\"stack-values " + (def.hasFlag(AVM2InstructionFlag.UNKNOWN_STACK) ? " unknown" : "") + "\">").append(stack).append("</span>").append("</div>").append(NEWLINE);
|
||||
boolean flagsPrinted = false;
|
||||
|
||||
AVM2InstructionFlag flags[] = def.flags.clone();
|
||||
Arrays.sort(flags, Enum::compareTo);
|
||||
|
||||
for (AVM2InstructionFlag fl : flags) {
|
||||
if (fl != AVM2InstructionFlag.UNKNOWN_OPERANDS && fl != AVM2InstructionFlag.UNKNOWN_STACK) {
|
||||
if (!flagsPrinted) {
|
||||
flagsPrinted = true;
|
||||
sb.append("<b>").append(getProperty("ui.flags")).append("</b>").append(NEWLINE);
|
||||
}
|
||||
sb.append(getProperty("ui.flags.beginning")).append(flagDescriptions.get(fl)).append(NEWLINE);
|
||||
if (!flagsPrinted) {
|
||||
flagsPrinted = true;
|
||||
sb.append("<strong class=\"flags-title\">").append(getProperty("ui.flags")).append("</strong>").append("<br />").append(NEWLINE).append("<ul class=\"flags\">").append(NEWLINE);
|
||||
}
|
||||
sb.append("\t<li class=\"flag flag-").append(makeIdent(fl.toString())).append("\">").append(flagDescriptions.get(fl));
|
||||
if (fl == AVM2InstructionFlag.DEPRECATED) {
|
||||
String depDetail = getProperty("instruction." + insName + ".deprecated");
|
||||
if (depDetail != null) {
|
||||
sb.append(": <span class=\"flag-deprecated-detail\">").append(depDetail).append("</span>");
|
||||
}
|
||||
}
|
||||
sb.append("</li>").append(NEWLINE);
|
||||
}
|
||||
if (flagsPrinted) {
|
||||
sb.append("</ul>").append(NEWLINE);
|
||||
}
|
||||
sb.append("</");
|
||||
sb.append(standalone ? "body" : "div"); //.instruction
|
||||
sb.append(">").append(NEWLINE);
|
||||
if (standalone) {
|
||||
sb.append(htmlFooter());
|
||||
}
|
||||
String r = sb.toString();
|
||||
docsCache.put(cacheKey, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static String getAllInstructionDocs() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String style = "li {list-style:none; padding:10px;border:1px solid black; border-bottom:none; border-collapse:collapse; } " + NEWLINE
|
||||
+ "ul {padding-left:0; display:table; border-bottom:1px solid black;}" + NEWLINE;
|
||||
public static String getStyle() {
|
||||
String cached = docsCache.get("__style");
|
||||
if (cached != null) {
|
||||
return cached;
|
||||
}
|
||||
String style = "";
|
||||
try {
|
||||
InputStream is = As3PCodeDocs.class.getResourceAsStream("/com/jpexs/decompiler/flash/docs/docs.css");
|
||||
if (is == null) {
|
||||
Logger.getLogger(As3PCodeDocs.class.getName()).log(Level.SEVERE, "docs.css needed for documentation not found");
|
||||
} else {
|
||||
style = new String(Helper.readStream(is), "UTF-8");
|
||||
}
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
//ignore
|
||||
}
|
||||
docsCache.put("__style", style);
|
||||
return style;
|
||||
}
|
||||
|
||||
sb.append("<!DOCTYPE html>").append(NEWLINE).
|
||||
append("<html>").append(NEWLINE).
|
||||
append("<head>").append(NEWLINE).
|
||||
append("<style>").append(style).append("</style>").append(NEWLINE).
|
||||
append("<meta charset=\"UTF-8\">").append(NEWLINE).
|
||||
append("<title>").append(getProperty("ui.list.pageTitle")).append("</title>").append(NEWLINE).
|
||||
append("</head>").append(NEWLINE).
|
||||
append("<body>").append(NEWLINE);
|
||||
sb.append("<h1>").append(getProperty("ui.list.heading")).append("</h1>").append(NEWLINE);
|
||||
sb.append("<ul>").append(NEWLINE);
|
||||
public static String getJs() {
|
||||
String cached = docsCache.get("__js");
|
||||
if (cached != null) {
|
||||
return cached;
|
||||
}
|
||||
String js = "";
|
||||
try {
|
||||
InputStream is = As3PCodeDocs.class.getResourceAsStream("/com/jpexs/decompiler/flash/docs/docs.js");
|
||||
if (is == null) {
|
||||
Logger.getLogger(As3PCodeDocs.class.getName()).log(Level.SEVERE, "docs.js needed for documentation not found");
|
||||
} else {
|
||||
js = new String(Helper.readStream(is), "UTF-8");
|
||||
}
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
//ignore
|
||||
}
|
||||
docsCache.put("__js", js);
|
||||
return js;
|
||||
}
|
||||
|
||||
private static String getISO8601StringForDate(Date date) {
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
return dateFormat.format(date);
|
||||
}
|
||||
|
||||
public static String getAllInstructionDocs() {
|
||||
|
||||
String jsData = "";
|
||||
jsData += "var txt_filter_hide = \"" + getProperty("ui.filter.hide") + "\";" + NEWLINE;
|
||||
jsData += "var txt_filter_byname = \"" + getProperty("ui.filter.byname") + "\";" + NEWLINE;
|
||||
jsData += "var txt_filter_order = \"" + getProperty("ui.filter.order") + "\";" + NEWLINE;
|
||||
jsData += "var txt_filter_order_code = \"" + getProperty("ui.filter.order.code") + "\";" + NEWLINE;
|
||||
jsData += "var txt_filter_order_name = \"" + getProperty("ui.filter.order.name") + "\";" + NEWLINE;
|
||||
|
||||
jsData += "var order_set = \"name\";";
|
||||
jsData += "var flags_set = {};" + NEWLINE;
|
||||
jsData += "var flags = {};" + NEWLINE;
|
||||
for (AVM2InstructionFlag f : AVM2InstructionFlag.values()) {
|
||||
jsData += "flags[\"" + makeIdent(f.toString()) + "\"] = \"" + Helper.escapeJavaString(flagDescriptions.get(f)) + "\";" + NEWLINE;
|
||||
jsData += "flags_set[\"" + makeIdent(f.toString()) + "\"] = false;" + NEWLINE;
|
||||
}
|
||||
|
||||
AVM2InstructionFlag[] hideFlags = new AVM2InstructionFlag[]{AVM2InstructionFlag.NO_FLASH_PLAYER};
|
||||
for (AVM2InstructionFlag f : hideFlags) {
|
||||
jsData += "flags_set[\"" + makeIdent(f.toString()) + "\"] = true;" + NEWLINE;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(htmlHeader(jsData + getJs(), getStyle()));
|
||||
sb.append("\t\t<h1>").append(getProperty("ui.list.heading")).append("</h1>").append(NEWLINE);
|
||||
sb.append("<span id=\"js-switcher\" class=\"js\"></span>");
|
||||
sb.append("\t\t<ul class=\"instruction-list\">").append(NEWLINE);
|
||||
Set<String> s = new TreeSet<>(nameToDef.keySet());
|
||||
for (String name : s) {
|
||||
InstructionDefinition def = nameToDef.get(name);
|
||||
if (def == null) {
|
||||
continue;
|
||||
}
|
||||
sb.append("<li>").append(NEWLINE);
|
||||
sb.append(getDocsForIns(def, true, false).replace(NEWLINE, "<br />" + NEWLINE));
|
||||
sb.append("</li>").append(NEWLINE);
|
||||
sb.append("\t\t\t<li class=\"instruction-item\">").append(NEWLINE);
|
||||
sb.append("\t\t\t\t").append(getDocsForIns(def, true, false, false).trim().replace(NEWLINE, NEWLINE + "\t\t\t\t")).append(NEWLINE);
|
||||
sb.append("\t\t\t</li>").append(NEWLINE);
|
||||
}
|
||||
sb.append("</ul>").append(NEWLINE);
|
||||
sb.append("</body>").append(NEWLINE);
|
||||
sb.append("</html>").append(NEWLINE);
|
||||
sb.append("\t\t</ul>").append(NEWLINE);
|
||||
sb.append("\t</body>").append(NEWLINE);
|
||||
sb.append(htmlFooter());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||
System.out.println(getAllInstructionDocs());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
html, body {margin:0px; padding: 0px;}
|
||||
.instruction {background-color: #f5f5b5; color:black;}
|
||||
li.instruction-item {list-style:none; padding:0px;border:1px solid black; border-bottom:none; border-collapse:collapse; }
|
||||
ul.instruction-list {padding-left:0; display:table; border-bottom:1px solid black;}
|
||||
strong.instruction-name {font-weight: bold; color: blue;}
|
||||
strong.stack-title {font-weight: bold;}
|
||||
strong.flags-title {font-weight: bold;}
|
||||
.hidden {display:none}
|
||||
.filter-flag-title {display:inline-block; width: 50ex;}
|
||||
.instruction {padding:5px;}
|
||||
.instruction.instruction-flag-noFlashPlayer {background-color: #ccc;}
|
||||
body {font-family: serif;}
|
||||
h1, h2, h3, h4, h5 {font-family: sans-serif;}
|
||||
.instruction-signature {font-family: "Courier New", monospace; font-size: 1.05em;}
|
||||
.filter {font-family: sans-serif; }
|
||||
152
libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/docs/docs.js
Normal file
152
libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/docs/docs.js
Normal file
@@ -0,0 +1,152 @@
|
||||
function bind(el, evt, func) {
|
||||
if (el.addEventListener){
|
||||
el.addEventListener(evt, func, false);
|
||||
} else if (el.attachEvent) {
|
||||
el.attachEvent('on' + evt, func);
|
||||
}
|
||||
}
|
||||
|
||||
function showhide(e,show){
|
||||
var cls = " "+e.className+" ";
|
||||
if(show && cls.indexOf(" hidden ") > -1){
|
||||
cls = cls.replace(" hidden "," ");
|
||||
}else if(!show && cls.indexOf(" hidden ") == -1 ){
|
||||
cls = cls + "hidden ";
|
||||
}
|
||||
cls = cls.trim();
|
||||
e.className = cls;
|
||||
}
|
||||
|
||||
function hideNoName(name){
|
||||
var lis = document.getElementsByTagName("li");
|
||||
loopi:for(var i=0;i<lis.length;i++) {
|
||||
if(lis[i].className == "instruction-item"){
|
||||
if ((typeof name) != "undefined" && name.trim()!="") {
|
||||
var ss = lis[i].getElementsByTagName("strong");
|
||||
for(var s=0;s<ss.length;s++){
|
||||
if(ss[s].className=="instruction-name")
|
||||
{
|
||||
var insName = ss[s].innerHTML;
|
||||
if(insName.toLowerCase().indexOf(name.toLowerCase())!=0){ //does not start with desired name
|
||||
showhide(lis[i],false);
|
||||
continue loopi;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showFlags(show,flagType){
|
||||
var lis = document.getElementsByTagName("div");
|
||||
loopi:for(var i=0;i<lis.length;i++){
|
||||
var cls = " "+lis[i].className+" ";
|
||||
if ((typeof flagType) != "undefined"){
|
||||
if(cls.indexOf("instruction-flag-"+flagType) == -1){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
showhide(lis[i].parentNode,show);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sortInstructions(order){
|
||||
var newUl = document.createElement("ul");
|
||||
newUl.className = "instruction-list";
|
||||
|
||||
|
||||
var smallestItem = null;
|
||||
var smallestVal = null;
|
||||
var originalUl = null;
|
||||
|
||||
do {
|
||||
smallestItem = null;
|
||||
smallestVal = null;
|
||||
var lis = document.getElementsByTagName("li");
|
||||
loopi:for(var i=0;i<lis.length;i++) {
|
||||
var cls = " "+lis[i].className+" ";
|
||||
if(cls.indexOf(" instruction-item ") != -1) {
|
||||
var ss = lis[i].getElementsByTagName(order == "code"?"span":"strong");
|
||||
for(var s=0;s<ss.length;s++){
|
||||
if(ss[s].className=="instruction-"+order)
|
||||
{
|
||||
var checkedVal = ss[s].innerHTML;
|
||||
if(smallestVal == null || smallestVal > checkedVal)
|
||||
{
|
||||
smallestItem = lis[i];
|
||||
smallestVal = checkedVal;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(smallestItem != null){
|
||||
originalUl = smallestItem.parentNode;
|
||||
originalUl.removeChild(smallestItem);
|
||||
newUl.appendChild(smallestItem);
|
||||
}
|
||||
}while(smallestItem != null);
|
||||
originalUl.parentNode.replaceChild(newUl,originalUl);
|
||||
|
||||
}
|
||||
|
||||
function applyFilter() {
|
||||
var order_new = document.getElementById("filter_order").value;
|
||||
if(order_set != order_new) {
|
||||
order_set = order_new;
|
||||
sortInstructions(order_new);
|
||||
}
|
||||
showFlags(true);
|
||||
hideNoName(document.getElementById("filter-byname").value);
|
||||
var inputs = document.getElementsByTagName("input");
|
||||
for(var i=0;i<inputs.length;i++){
|
||||
if(inputs[i].type == "checkbox" && inputs[i].className == "filter" && inputs[i].hasAttribute("data-flag")){
|
||||
var flag = inputs[i].getAttribute("data-flag");
|
||||
if(inputs[i].checked){
|
||||
showFlags(false,flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function init(){
|
||||
var js_switcher = document.getElementById("js-switcher");
|
||||
if(!js_switcher){
|
||||
return;
|
||||
}
|
||||
var t = "";
|
||||
t += "<div class=\"filter\">";
|
||||
|
||||
t += "<div class=\"filter-item\">";
|
||||
t += "<label for=\"filter-byname\"><strong class=\"filter-byname-title\">"+txt_filter_byname+"</strong></label>";
|
||||
t += "<input onkeydown=\"applyFilter();\" onkeyup=\"applyFilter();\" onkeypress=\"applyFilter();\" type=\"text\" id=\"filter-byname\" size=\"15\" />";
|
||||
t += "</div>";
|
||||
|
||||
t += "<div class=\"filter-item\">";
|
||||
t += "<strong class=\"filter-hide-title\">"+txt_filter_hide+"</strong><br />";
|
||||
for(var flag in flags){
|
||||
var flagDesc = flags[flag];
|
||||
var flagSet = flags_set[flag];
|
||||
t+= '<input class="filter" data-flag="'+flag+'" onchange="applyFilter();" type="checkbox"'+(flagSet?' checked="checked"':'')+' id="flag-'+flag+'-switch"/><label for="flag-'+flag+'-switch">'+flagDesc+'</label><br />';
|
||||
}
|
||||
|
||||
t += "<div class=\"filter-item\">";
|
||||
t += "<label for=\"filter-order\"><strong class=\"filter-order-title\">"+txt_filter_order+"</strong></label>";
|
||||
t += "<select id=\"filter_order\" onchange=\"applyFilter();\">";
|
||||
t += "<option value=\"code\""+(order_set=="code"?' selected="selected"':'')+">"+txt_filter_order_code+"</option>";
|
||||
t += "<option value=\"name\""+(order_set=="name"?' selected="selected"':'')+">"+txt_filter_order_name+"</option>";
|
||||
t += "</select>";
|
||||
t += "</div>";
|
||||
t += "</div>";
|
||||
|
||||
t += "</div>"; //.filter
|
||||
|
||||
|
||||
js_switcher.innerHTML = t;
|
||||
applyFilter();
|
||||
}
|
||||
|
||||
bind(window,"load",init);
|
||||
@@ -16,14 +16,22 @@
|
||||
#String for whole list generation
|
||||
ui.list.heading = AVM2 Instruction list
|
||||
ui.list.pageTitle = AVM2 Instruction list
|
||||
ui.list.documentTitle = AVM2 Instruction list
|
||||
ui.list.pageDescription = List of all known ActionScript 3 - AVM2 instructions with their operands and stack values
|
||||
|
||||
#various strings in UI:
|
||||
ui.unknown = ???
|
||||
ui.stack = Stack:\u0020
|
||||
ui.stack.before = ...,\u0020
|
||||
ui.stack.before.empty = ...
|
||||
ui.stack.to = \u0020\u279e\u0020
|
||||
ui.flags = Flags:\u0020
|
||||
ui.flags.beginning = \u0020-\u0020
|
||||
ui.description = Description:\u0020
|
||||
ui.filter.hide = Hide:\u0020
|
||||
ui.filter.byname = Find by name:\u0020
|
||||
ui.filter.order = Order by:\u0020
|
||||
ui.filter.order.code = code
|
||||
ui.filter.order.name = name
|
||||
|
||||
|
||||
#----------------------- Flags of the instructions
|
||||
@@ -917,7 +925,7 @@ instruction.coerce.stackBefore = value
|
||||
instruction.coerce.stackAfter = coercedValue
|
||||
instruction.coerce.operands = type
|
||||
|
||||
instruction.coerce_b.shortDescription = Coerce value to boolean [Deprecated]
|
||||
instruction.coerce_b.shortDescription = Coerce value to boolean
|
||||
instruction.coerce_b.description =
|
||||
instruction.coerce_b.stackBefore = value
|
||||
instruction.coerce_b.stackAfter = booleanValue
|
||||
@@ -1056,8 +1064,8 @@ instruction.inclocal_p.operands = numberContext, localRegister
|
||||
|
||||
instruction.decrement_p.shortDescription = Decrement value using number context
|
||||
instruction.decrement_p.description =
|
||||
instruction.decrement_p.stackBefore =
|
||||
instruction.decrement_p.stackAfter =
|
||||
instruction.decrement_p.stackBefore = value
|
||||
instruction.decrement_p.stackAfter = decrementedValue
|
||||
instruction.decrement_p.operands = numberContext
|
||||
|
||||
instruction.declocal_p.shortDescription = Decrement local register using number context
|
||||
@@ -1194,32 +1202,32 @@ instruction.in.operands =
|
||||
|
||||
instruction.add_p.shortDescription = Add two values using number context
|
||||
instruction.add_p.description =
|
||||
instruction.add_p.stackBefore =
|
||||
instruction.add_p.stackAfter =
|
||||
instruction.add_p.stackBefore = value1, value2
|
||||
instruction.add_p.stackAfter = value3
|
||||
instruction.add_p.operands = numberContext
|
||||
|
||||
instruction.subtract_p.shortDescription = Subtract two values using number context
|
||||
instruction.subtract_p.description =
|
||||
instruction.subtract_p.stackBefore =
|
||||
instruction.subtract_p.stackAfter =
|
||||
instruction.subtract_p.stackBefore = value1, value2
|
||||
instruction.subtract_p.stackAfter = value3
|
||||
instruction.subtract_p.operands = numberContext
|
||||
|
||||
instruction.multiply_p.shortDescription = Multiply two values using number context
|
||||
instruction.multiply_p.description =
|
||||
instruction.multiply_p.stackBefore =
|
||||
instruction.multiply_p.stackAfter =
|
||||
instruction.multiply_p.stackBefore = value1, value2
|
||||
instruction.multiply_p.stackAfter = value3
|
||||
instruction.multiply_p.operands = numberContext
|
||||
|
||||
instruction.divide_p.shortDescription = Divide two values using number context
|
||||
instruction.divide_p.description =
|
||||
instruction.divide_p.stackBefore =
|
||||
instruction.divide_p.stackAfter =
|
||||
instruction.divide_p.stackBefore = value1, value2
|
||||
instruction.divide_p.stackAfter = value3
|
||||
instruction.divide_p.operands = numberContext
|
||||
|
||||
instruction.modulo_p.shortDescription = Modulo divide two values using number context
|
||||
instruction.modulo_p.description =
|
||||
instruction.modulo_p.stackBefore =
|
||||
instruction.modulo_p.stackAfter =
|
||||
instruction.modulo_p.stackBefore = value1, value2
|
||||
instruction.modulo_p.stackAfter = value3
|
||||
instruction.modulo_p.operands = numberContext
|
||||
|
||||
instruction.increment_i.shortDescription = Increment integer value
|
||||
|
||||
@@ -16,22 +16,29 @@
|
||||
#String for whole list generation
|
||||
ui.list.heading = Seznam AVM2 instrukc\u00ed
|
||||
ui.list.pageTitle = Seznam AVM2 instrukc\u00ed
|
||||
ui.list.documentTitle = Seznam AVM2 instrukc\u00ed
|
||||
ui.list.pageDescription = Seznam v\u0161ech zn\u00e1m\u00fdch ActionScript 3 - AVM2 instrukc\u00ed s jejich operandy a hodnotami na z\u00e1sobn\u00edku
|
||||
|
||||
#various strings in UI:
|
||||
ui.unknown = ???
|
||||
ui.stack = Z\u00e1sobn\u00edk:\u0020
|
||||
ui.stack.before = ...,\u0020
|
||||
ui.stack.before.empty = ...
|
||||
ui.stack.to = \u0020\u279e\u0020
|
||||
ui.flags = P\u0159\u00edznaky:\u0020
|
||||
ui.flags.beginning = \u0020-\u0020
|
||||
|
||||
ui.description = Popis:\u0020
|
||||
ui.filter.hide = Skr\u00fdt:\u0020
|
||||
ui.filter.byname = Hledat podle n\u00e1zvu:\u0020
|
||||
ui.filter.order = Se\u0159adit podle:\u0020
|
||||
ui.filter.order.code = k\u00f3du
|
||||
ui.filter.order.name = n\u00e1zvu
|
||||
|
||||
#----------------------- Flags of the instructions
|
||||
instructionFlag.undocumented = Nedokumentovan\u00e9
|
||||
instructionFlag.unknownStack = Nezn\u00e1m\u00fd z\u00e1sobn\u00edk
|
||||
instructionFlag.es4NumericsMinor = ES4 numerika (ABC minor 17)
|
||||
instructionFlag.floatMajor = Float hodnoty (ABC major 47)
|
||||
instructionFlag.unknownOperands = Nezn\u00e1me operandy
|
||||
instructionFlag.unknownOperands = Nezn\u00e1m\u00e9 operandy
|
||||
instructionFlag.noFlashPlayer = Nen\u00ed v standardn\u00edm Flash Playeru
|
||||
instructionFlag.deprecated = P\u0159ekonan\u00e9
|
||||
instructionFlag.domainMemory = Operace s dom\u00e9novou pam\u011bt\u00ed
|
||||
|
||||
Reference in New Issue
Block a user