provide formatters for translation grid cells; move some inline js to the end, as...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 5 Mar 2010 16:58:40 +0000 (16:58 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 5 Mar 2010 16:58:40 +0000 (16:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15714 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/conify/global/config/copy_status.html
Open-ILS/web/conify/global/config/marc_code_maps.html
Open-ILS/web/conify/global/config/marc_code_maps.js
Open-ILS/web/conify/global/permission/perm_list.html

index b385ef0..2fa14c9 100644 (file)
 
         <script type="text/javascript">
 <![CDATA[
-            var highlighter= {};
-            highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
-            highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
-
             var dirtyStore = [];
 
             var _status_list = pCRUD.retrieveAll('ccs', { order_by : { ccs : 'name' } });
                                                                                { name : ccs_strings.TRANSLATION,
                                                                                  width : "10em",
                                                                                  height : "2em",
+                                          formatter: function (row) {
+                                                                                               return '<span class="status_grid_trans_cell_'+row+'"></span>';
+                                          },
                                                                                  get : function (row) {
                                                                                        if (!window.status_rows) window.status_rows = [];
                                                                                        var r = window.status_data_model.getRow(row);
                                                                                                                'status_grid.rowHeightChanged('+row+')',
                                                                                                        0
                                                                                                );
-                                                                                               return '<span class="status_grid_trans_cell_'+row+'"></span>';
+                                                                                               return row;
                                                                                        }
                                                                                        return '';
                                                                                  }
                        </div>
                </div>
        
+        <script type="text/javascript">
+            var highlighter= {};
+            highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
+            highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
+        </script>
        </body>
 </html>
index 7974a45..7501bdc 100644 (file)
@@ -81,6 +81,9 @@
                             { name : cam_strings.LABEL_TRANSLATION,
                               width : "10em",
                               height : "2em",
+                              formatter : function (row) {
+                                    return '<span class="cam_value_'+row+'"></span>';
+                              },
                               get : function (row) {
                                 if (!grid_row_object_cache.cam) grid_row_object_cache.cam = [];
                                 var r = this.grid.model.getRow(row);
@@ -96,7 +99,7 @@
                                     );
                                     var oldnode = dojo.byId('value_translation_cam_' + row);
                                     if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-                                    return '<span class="cam_value_'+row+'"></span>';
+                                    return row;
                                 }
                                 return '';
                               }
                             { name : cam_strings.LABEL_TRANSLATION,
                               width : "10em",
                               height : "2em",
+                              formatter : function (row) {
+                                    return '<span class="cam_description_'+row+'"></span>';
+                              },
                               get : function (row) {
                                 if (!grid_row_object_cache.cam) grid_row_object_cache.cam = [];
                                 var r = this.grid.model.getRow(row);
                                     );
                                     var oldnode = dojo.byId('description_translation_cam_' + row);
                                     if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-                                    return '<span class="cam_description_'+row+'"></span>';
+                                    return row;
                                 }
                                 return '';
                               }
                                                                        { name : cam_strings.LABEL_TRANSLATION,
                                                                              width : "10em",
                                                                                  height : "2em",
+                                          formatter : function (row) {
+                                                                   return '<span class="'+classname+'_value_'+row+'"></span>';
+                                          },
                                              get : function (row) {
                                                    if (!grid_row_object_cache[classname]) grid_row_object_cache[classname] = [];
                                                        var r = this.grid.model.getRow(row);
                                                        );
                                                                                                var oldnode = dojo.byId('value_translation_' + classname + '_' + row);
                                                                                                if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-                                                                   return '<span class="'+classname+'_value_'+row+'"></span>';
+                                                                   return row;
                                                                    }
                                                                        return '';
                                                                          }
index 8cc2306..4589a98 100644 (file)
@@ -41,7 +41,7 @@ console.log('loading marc_code_maps.js');
 // some handy globals
 var cgi = new CGI();
 var ses = dojo.cookie('ses') || cgi.param('ses');
-var pCRUD = new openils.PermaCrudopenils.PermaCrud({authtoken:ses});
+var pCRUD = new openils.PermaCrud({authtoken:ses});
 
 console.log('initialized pcrud session');
 
index a5cf65a..480d7e5 100644 (file)
                <script type="text/javascript" src="perm_list.js"></script>
 
                <script type="text/javascript"><![CDATA[
-                       var highlighter= {};
-                       highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
-                       highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
-
                        var dirtyStore = [];
                        var perm_rows = [];
 
             var _perm_data = ppl.toStoreData( _perm_list, 'code' );
             var perm_store = new dojo.data.ItemFileWriteStore({ data : _perm_data });
 
+
             perm_store.onSet = function (item, attr, o, n) {
                 if (attr == 'ischanged') return;
                 if (n == o) return;
                 this.setValue( item, 'ischanged', 1);
             };
-                       var perm_data_model = new dojox.grid.data.DojoData({ store: perm_store, query: { code : '*' } });
+
 
                        var perm_grid_layout = [
                                {       cells : [
@@ -91,6 +88,9 @@
                                                        { name : ppl_strings.LABEL_TRANSLATION,
                                                          width : "10em",
                                                          height : "2em",
+                                                         formatter : function (value) {
+                                return '<span class="perm_grid_trans_desc_'+value+'"></span>';
+                              },
                                                          get : function (row) {
                                                                var r = perm_data_model.getRow(row);
                                                                if (r) {
                                                                        );
                                                                        var oldnode = dojo.byId('description_translation_' + row);
                                                                        if (oldnode) dijit.byNode(oldnode).destroyRecursive();
-                                                                       return '<span class="perm_grid_trans_desc_'+row+'"></span>';
+                                                                       return row;
                                                                }
                                                                return '';
                                                          }
 
                 perm_store.fetch({
                     query : { ischanged : 1 },
-                    onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyStore.push( item ); } catch (e) { /* meh */ } },
+                    onItem : function (item, req) { try { if (this.isItem( item )) dirtyStore.push( item ); } catch (e) { /* meh */ } },
                     scope : perm_store
                 });
 
 
                     if (confirmation) {
                         for (var i in dirtyStore) {
-                            window.current_perm = dirtyStore[i];
+                            current_perm = dirtyStore[i];
                             save_perm(true);
                         }
                     }
                            });
     
                        var err = false;
-                           pCRUD.create(new_fm_objnew_fm_obj, {
+                           pCRUD.create(new_fm_obj, {
                                onerror : function (r) {
                                highlighter.red.play();
                                    status_update( ppl_strings.ERROR_CALLING_METHOD_PPL );
                        </div>
 
                        <div dojoType="dijit.layout.ContentPane" style="width:100%; height:100%;" layoutAlign="client">
+                <div dojoType="dojox.grid.data.DojoData" id="perm_data_model" jsId="perm_data_model" store="perm_store" query="{ code : '*' }">
+                </div>
                                <div id="perm_grid" dojoType="dojox.Grid" model="perm_data_model" structure="perm_grid_layout" jsId="perm_grid">
-                                       <!--
-                                       <script type="dojo/connect" event="onSet" args="item,attr,oldVal,newVal">
-                                       </script>
-                                       -->
                                </div>
                        </div>
 
                        </div>
                </div>
        
+        <script type="text/javascript">
+            var highlighter= {};
+               highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } );
+               highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } );
+        </script>
+
        </body>
 </html>