making wiki work easier
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 27 Nov 2005 05:22:17 +0000 (05:22 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 27 Nov 2005 05:22:17 +0000 (05:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2120 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/util/fm_view.xul

index 4b44429..ddbd561 100644 (file)
@@ -42,6 +42,8 @@
                                        _treechildren.appendChild( _ti );
                                        _ti.setAttribute('fm_class',hint);
                                        _ti.setAttribute('fm_field',j);
+                                       _ti.setAttribute('fm_virtual',o.fields[j].virtual);
+                                       _ti.setAttribute('fm_position',o.fields[j].position);
                                        var _tr = window.document.createElement( 'treerow' );
                                        _ti.appendChild( _tr );
                                        var _tc = window.document.createElement( 'treecell' );
@@ -75,6 +77,7 @@
                                                );
                                                tb.value += text;
                                        }
+                                       dump(tb.value + '\n');
                                }, 0
                        );
                }
                                                );
                                                tb.value += text;
                                        }
+                                       dump(tb.value + '\n');
                                }, 0
                        );
                }
 
+               function gen_wikitable() {
+                       var data_url = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><?xml-stylesheet href="chrome://global/skin" type="text/css"?><vbox flex="1"><textbox id="desc" multiline="true" flex="1"/></vbox></window>';
+                       var w = mw.SafeWindowOpen(data_url,'paged_tree cols','chrome,resizable,width=800,height=600');
+                       var css = '<?xml-stylesheet href="data:text/css,#a{-moz-box-flex:1;}"?>';
+                       var treeitems = mw.get_list_from_tree_selection( tree );
+                       setTimeout(
+                               function() {
+                                       var tb = w.document.getElementById('desc');
+                                       for (var i = 0; i < treeitems.length; i++) {
+                                               var hint = treeitems[i].getAttribute('fm_class');
+                                               var field = treeitems[i].getAttribute('fm_field');
+                                               var text = (
+                                                       '|' + hint + '|' + field
+                                               );
+                                       
+                                               if (treeitems[i].getAttribute('fm_virtual') == '1') text += ' * ';
+                                               text += '|\n'
+                                               tb.value += text;
+                                       }
+                                       dump(tb.value + '\n');
+                               }, 0
+                       );
+               }
+
+
        ]]>
        </script>
 
                        <hbox>
                                <button label="Generate paged_tree cols for selected fields" accesskey="G" oncommand="gen_cols();"/>
                                <button label="Generate string bundle properties for selected fields" accesskey="P" oncommand="gen_properties();"/>
+                               <button label="Generate dokuwiki table for selected fields" accesskey="P" oncommand="gen_wikitable();"/>
                        </hbox>
                        <tree id="t" flex="1">
                                <treecols>