Commits

Anonymous committed 5a8c4da

znowu dziala ustawianie pervariantow

Comments (0)

Files changed (5)

smtuning/content/about.xul

 <groupbox align="center" orient="horizontal">
 <vbox>
   <text value="SchemingMind Tuning" style="font-weight: bold; font-size: x-large;"/>
-  <text value="&version; 1.6.2"/>
+  <text value="&version; 1.6.3"/>
   <separator class="thin"/>
   <text value="&createdBy;" style="font-weight: bold;"/>
   <text value="Marcin Kasperski"/>

smtuning/content/options.xul

     >
     <!-- descriptions have to be broken up in parts to avoid oversizing the dialog -->
     <description class="header">
-      SchemingMind Tuning extension for Mozilla Firefox - version 1.6.2
+      SchemingMind Tuning extension for Mozilla Firefox - version 1.6.3
     </description>
     <separator class="groove-thin"/>
     <description>

smtuning/content/piecedetails.js

 function initializePiecesPane() {
 
     // Iterujemy warianty, dla każdego:
-    // - dodajemy deklarację preferencji
     // - dodajemy linijkę prezentującą go
     var piecesTable = document.getElementById("pieces_table");
-    var setsPreferences = document.getElementById("sets_preferences");
+    // var setsPreferences = document.getElementById("sets_preferences");
 
     var size = getCurrentSize();
 
     for(var i=0, variant; variant=smtvariants.variantList[i]; i++) {
-        // Dodajemy preferencję
-        setsPreferences.appendChild(
-            smtext.xulCreatePreference("set_" + variant.internalName, "string"));
+        // setsPreferences.appendChild(
+        //    smtext.xulCreatePreference("set_" + variant.internalName, "string"));
         piecesTable.appendChild(
             createPiecesRow(variant.internalName, variant.publicName, size));
     }
     gfxBox.setAttribute("id", variantName);
     newRow.appendChild(gfxBox);
 
-    // Ukryte pole powiązane z preferencjami
-    var tBox = document.createElement("textbox");
-    tBox.setAttribute("id", variantName + "_set_name");
-    tBox.setAttribute("preference", "pref_set_" + variantName);
-    tBox.setAttribute("preference-editable", "true");
-    tBox.setAttribute("onsyncfrompreference",
-                      "return onPieceSetFromPref('" + variantName + "')");
-    tBox.setAttribute("onsynctopreference",
-                      "return onPieceSetToPref('" + variantName + "')");
-    //tBox.setAttribute("size", 8);
-    tBox.setAttribute("hidden", "true");
-    newRow.appendChild(tBox);
+//     // Ukryte pole powiązane z preferencjami
+//     var tBox = document.createElement("textbox");
+//     tBox.setAttribute("id", variantName + "_set_name");
+//     tBox.setAttribute("preference", "pref_set_" + variantName);
+//     tBox.setAttribute("preference-editable", "true");
+//     tBox.setAttribute("onsyncfrompreference",
+//                       "return onPieceSetFromPref('" + variantName + "')");
+//     tBox.setAttribute("onsynctopreference",
+//                       "return onPieceSetToPref('" + variantName + "')");
+//     //tBox.setAttribute("size", 8);
+//     tBox.setAttribute("hidden", "true");
+//     newRow.appendChild(tBox);
 
     return newRow;
 }
 
-function onPieceSetFromPref(variantName) {
-    //var x = updateSetInfo(variantName).name;
-    smtext.dump("setfrompref: " + variantName + ": " + x);
-    return x;
-}
+// function onPieceSetFromPref(variantName) {
+//     //var x = updateSetInfo(variantName).name;
+//     smtext.dump("setfrompref: " + variantName + ": " + x);
+//     return x;
+// }
 
-function onPieceSetToPref(variantName) {
-    var x = document.getElementById(variantName + "_set_name").value;
-    smtext.dump("settopref: " + variantName + ": " + x);
-    return x;
-}
+// function onPieceSetToPref(variantName) {
+//     var x = document.getElementById(variantName + "_set_name").value;
+//     smtext.dump("settopref: " + variantName + ": " + x);
+//     return x;
+// }
 
 function onSizeChanged() {
     // Nie ma co kombinować z robieniem updateSetInfo dla wszystkich po kolei.
 // Updates displayed name and sample images according to the current size
 // and set. Returns setObj as it may be of some use
 function updateSetInfo(variantName, specName, specSize) {
-    var setObj = getCurrentSetFor(variantName, 1, specName);
+    var setObj = getCurrentSetFor(variantName, specName);
     var size = getCurrentSize(specSize);
 
     // ToDo: jeśli ani set ani rozmiar się nie zmienił, nic nie robić
 
 function populatePieceSelector(variantName) {
     var size = getCurrentSize();
-    var setObj = getCurrentSetFor(variantName, 1);
+    var setObj = getCurrentSetFor(variantName);
 
     var variantPublicName = smtvariants.variantPublicByInternal(variantName);
 
 
     var setsPane = document.getElementById("panePieceSets");
 
-    var dsn = document.getElementById(variantName + "_set_name");
-    dsn.value=setName;
-    setsPane.userChangedValue(dsn);
+    //var dsn = document.getElementById(variantName + "_set_name");
+    //dsn.value=setName;
+    //setsPane.userChangedValue(dsn);
 
-    smtext.prefman.setValue(variantName + "_set_name", setName);
+    smtext.prefman.setValue("set_" + variantName, setName);
 
     updateSetInfo(variantName, setName);
 
 //
 // Parametry:
 // - nazwa wariantu (obowiązkowy)
-// - flaga czy szukać w obiektach <preference> (1/0)
 // - zadana explicite nazwa (używane przy wyborach) (albo nic)
-function getCurrentSetFor(variantName, searchInWindow, specName) {
+function getCurrentSetFor(variantName, specName) {
     //smtext.dump("Searching set for " + variantName);
     var setName;
     if (specName) {
         //smtext.dump("Using specified: " + specName);
         setName = specName;
     }
-    if (! setName && searchInWindow) {
-        var pref = document.getElementById("pref_set_" + variantName);
-        if (pref) {
-            setName = pref.value;
-            if (setName) {
-                //smtext.dump("using window item: " + setName);
-            }
-        }
-    }
+//     if (! setName && searchInWindow) {
+//         var pref = document.getElementById("pref_set_" + variantName);
+//         if (pref) {
+//             setName = pref.value;
+//             if (setName) {
+//                 //smtext.dump("using window item: " + setName);
+//             }
+//         }
+//     }
     if (! setName) {
         setName = smtext.prefman.getValue("set_" + variantName);
         //smtext.dump("using preference set_" + variantName + ": " + setName);

smtuning/install.rdf

     <em:homepageURL>http://mekk.waw.pl/mk/eng/chess/art/smtuning</em:homepageURL>
     <em:updateURL>http://mekk.waw.pl/download/smtuning/update.rdf</em:updateURL>
     <em:id>smtuning@mekk.waw.pl</em:id>
-    <em:version>1.6.2</em:version>
+    <em:version>1.6.3</em:version>
 
     <em:aboutURL>chrome://smtuning/content/about.xul</em:aboutURL>
     <em:optionsURL>chrome://smtuning/content/options.xul</em:optionsURL>

smtuning/update.rdf

     <r:Seq>
       <r:li>
         <r:Description>
-          <version>1.6.2</version>
+          <version>1.6.3</version>
           <targetApplication>
             <r:Description>
               <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
       </r:li>
     </r:Seq>
   </updates>
-  <version>1.6.2</version>
+  <version>1.6.3</version>
   <updateLink>http://mekk.waw.pl/download/smtuning/smtuning.xpi</updateLink>
 </r:Description>
 </r:RDF>