svn: /web/doc-editor/trunk/js/ui/component/ PendingCommitGrid.js StaleFileGrid.js

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Sat, 21 Nov 2009 14:52:31 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=291114

Log:
Need update module : open the module to modify the file in NeedCommit when you double click on a file instide of just view it

Changed paths:
    U   web/doc-editor/trunk/js/ui/component/PendingCommitGrid.js
    U   web/doc-editor/trunk/js/ui/component/StaleFileGrid.js
svn-diffs-291114.txt (text/x-diff, 13.6 KB)
Modified: web/doc-editor/trunk/js/ui/component/PendingCommitGrid.js
===================================================================
--- web/doc-editor/trunk/js/ui/component/PendingCommitGrid.js	2009-11-21 12:09:39 UTC (rev 291113)
+++ web/doc-editor/trunk/js/ui/component/PendingCommitGrid.js	2009-11-21 14:52:31 UTC (rev 291114)
@@ -451,7 +451,20 @@
                 tmp;

             if (FileType === 'update') {
-                ui.component.RepositoryTree.getInstance().openFile(FilePath, FileName);
+
+                // Find the rowIndex in this store
+                tmp = FilePath.split('/');
+                tmp.shift();
+
+                FilePath = "/" + tmp.join('/');
+
+                ui.component.StaleFileGrid.getInstance().store.each(function(row) {
+
+                    if( (row.data['path']) === FilePath && row.data['name'] === FileName ) {
+                        ui.component.StaleFileGrid.getInstance().openFile(row.data.id);
+                    }
+                });
+
             }

             if (FileType === 'delete') {

Modified: web/doc-editor/trunk/js/ui/component/StaleFileGrid.js
===================================================================
--- web/doc-editor/trunk/js/ui/component/StaleFileGrid.js	2009-11-21 12:09:39 UTC (rev 291113)
+++ web/doc-editor/trunk/js/ui/component/StaleFileGrid.js	2009-11-21 14:52:31 UTC (rev 291114)
@@ -185,7 +185,7 @@
         {
             var FilePath = grid.store.getAt(rowIndex).data.path,
                 FileName = grid.store.getAt(rowIndex).data.name,
-				tmp;
+                tmp;

             grid.getSelectionModel().selectRow(rowIndex);

@@ -201,121 +201,126 @@
         },
         rowdblclick : function(grid, rowIndex, e)
         {
-            var storeRecord = grid.store.getAt(rowIndex),
-                FilePath    = storeRecord.data.path,
-                FileName    = storeRecord.data.name,
-                en_revision = storeRecord.data.en_revision,
-                revision    = storeRecord.data.revision,
-                FileID      = Ext.util.md5('FNU-' + phpDoc.userLang + FilePath + FileName),
-                diff        = '';
+            this.openFile(grid.store.getAt(rowIndex).data.id);
+        }
+    },

-            // Render only if this tab don't exist yet
-            if (!Ext.getCmp('main-panel').findById('FNU-' + FileID)) {
+    openFile : function(rowId) {

-                if (phpDoc.userConf.conf_needupdate_diff === "using-viewvc") {
-                    diff = ui.component.ViewVCDiff;
-                } else if (phpDoc.userConf.conf_needupdate_diff === "using-exec") {
-                    diff = ui.component.ExecDiff;
-                }
+        var storeRecord = this.store.getById(rowId),
+            FilePath    = storeRecord.data.path,
+            FileName    = storeRecord.data.name,
+            en_revision = storeRecord.data.en_revision,
+            revision    = storeRecord.data.revision,
+            FileID      = Ext.util.md5('FNU-' + phpDoc.userLang + FilePath + FileName),
+            diff        = '';

-                Ext.getCmp('main-panel').add(
-                {
-                    id             : 'FNU-' + FileID,
-                    layout         : 'border',
-                    title          : FileName,
-                    originTitle    : FileName,
-                    iconCls        : 'iconTabNeedUpdate',
-                    closable       : true,
-                    defaults       : { split : true },
-                    tabTip         : String.format(
-                        _('Need Update: in {0}'), FilePath
-                    ),
-                    items : [
-                        new diff({
-                            region      : 'north',
-                            collapsible : true,
-                            prefix      : 'FNU',
-                            fid         : FileID,
-                            fpath       : FilePath,
-                            fname       : FileName,
-                            rev1        : revision,
-                            rev2        : en_revision
-                        }), {
-                            region      : 'west',
-                            xtype       : 'panel',
-                            title       : _('VCSLog'),
-                            collapsible : true,
-                            collapsed   : true,
-                            layout      : 'fit',
-                            bodyBorder  : false,
-                            width       : 375,
-                            items       : {
-                                xtype       : 'tabpanel',
-                                activeTab   : 0,
-                                tabPosition : 'bottom',
-                                defaults    : { autoScroll: true },
-                                items       : [
-                                    new ui.component.VCSLogGrid({
-                                        layout    : 'fit',
-                                        title     : phpDoc.userLang,
-                                        prefix    : 'FNU-LANG',
-                                        fid       : FileID,
-                                        fpath     : phpDoc.userLang + FilePath,
-                                        fname     : FileName,
-                                        loadStore : (phpDoc.userConf.conf_needupdate_displaylog === "true")
-                                    }),
-                                    new ui.component.VCSLogGrid({
-                                        layout    : 'fit',
-                                        title     : 'en',
-                                        prefix    : 'FNU-EN',
-                                        fid       : FileID,
-                                        fpath     : 'en' + FilePath,
-                                        fname     : FileName,
-                                        loadStore : (phpDoc.userConf.conf_needupdate_displaylog === "true")
-                                    })
-                                ]
-                            }
-                        }, new ui.component.FilePanel(
-                        {
-                            id             : 'FNU-LANG-PANEL-' + FileID,
-                            region         : 'center',
-                            title          : String.format(_('{0} File: '), phpDoc.userLang) + FilePath + FileName,
-                            prefix         : 'FNU',
-                            ftype          : 'LANG',
-                            fid            : FileID,
-                            fpath          : FilePath,
-                            fname          : FileName,
-                            lang           : phpDoc.userLang,
-                            parser         : 'xml',
-                            storeRecord    : storeRecord,
-                            syncScrollCB   : true,
-                            syncScroll     : true,
-                            syncScrollConf : 'conf_needupdate_scrollbars'
-                        }), new ui.component.FilePanel(
-                        {
-                            id             : 'FNU-EN-PANEL-' + FileID,
-                            region         : 'east',
-                            width          : 575,
-                            title          : _('en File: ') + FilePath + FileName,
-                            prefix         : 'FNU',
-                            ftype          : 'EN',
-                            fid            : FileID,
-                            fpath          : FilePath,
-                            fname          : FileName,
-                            lang           : 'en',
-                            parser         : 'xml',
-                            storeRecord    : storeRecord,
-                            syncScroll     : true,
-                            syncScrollConf : 'conf_needupdate_scrollbars'
-                        })
-                    ]
-                });
-                Ext.getCmp('main-panel').setActiveTab('FNU-' + FileID);
+        // Render only if this tab don't exist yet
+        if (!Ext.getCmp('main-panel').findById('FNU-' + FileID)) {

-            } else {
-                // This tab already exist. We focus it.
-                Ext.getCmp('main-panel').setActiveTab('FNU-' + FileID);
+            if (phpDoc.userConf.conf_needupdate_diff === "using-viewvc") {
+                diff = ui.component.ViewVCDiff;
+            } else if (phpDoc.userConf.conf_needupdate_diff === "using-exec") {
+                diff = ui.component.ExecDiff;
             }
+
+            Ext.getCmp('main-panel').add(
+            {
+                id             : 'FNU-' + FileID,
+                layout         : 'border',
+                title          : FileName,
+                originTitle    : FileName,
+                iconCls        : 'iconTabNeedUpdate',
+                closable       : true,
+                defaults       : { split : true },
+                tabTip         : String.format(
+                    _('Need Update: in {0}'), FilePath
+                ),
+                items : [
+                    new diff({
+                        region      : 'north',
+                        collapsible : true,
+                        prefix      : 'FNU',
+                        fid         : FileID,
+                        fpath       : FilePath,
+                        fname       : FileName,
+                        rev1        : revision,
+                        rev2        : en_revision
+                    }), {
+                        region      : 'west',
+                        xtype       : 'panel',
+                        title       : _('VCSLog'),
+                        collapsible : true,
+                        collapsed   : true,
+                        layout      : 'fit',
+                        bodyBorder  : false,
+                        width       : 375,
+                        items       : {
+                            xtype       : 'tabpanel',
+                            activeTab   : 0,
+                            tabPosition : 'bottom',
+                            defaults    : { autoScroll: true },
+                            items       : [
+                                new ui.component.VCSLogGrid({
+                                    layout    : 'fit',
+                                    title     : phpDoc.userLang,
+                                    prefix    : 'FNU-LANG',
+                                    fid       : FileID,
+                                    fpath     : phpDoc.userLang + FilePath,
+                                    fname     : FileName,
+                                    loadStore : (phpDoc.userConf.conf_needupdate_displaylog === "true")
+                                }),
+                                new ui.component.VCSLogGrid({
+                                    layout    : 'fit',
+                                    title     : 'en',
+                                    prefix    : 'FNU-EN',
+                                    fid       : FileID,
+                                    fpath     : 'en' + FilePath,
+                                    fname     : FileName,
+                                    loadStore : (phpDoc.userConf.conf_needupdate_displaylog === "true")
+                                })
+                            ]
+                        }
+                    }, new ui.component.FilePanel(
+                    {
+                        id             : 'FNU-LANG-PANEL-' + FileID,
+                        region         : 'center',
+                        title          : String.format(_('{0} File: '), phpDoc.userLang) + FilePath + FileName,
+                        prefix         : 'FNU',
+                        ftype          : 'LANG',
+                        fid            : FileID,
+                        fpath          : FilePath,
+                        fname          : FileName,
+                        lang           : phpDoc.userLang,
+                        parser         : 'xml',
+                        storeRecord    : storeRecord,
+                        syncScrollCB   : true,
+                        syncScroll     : true,
+                        syncScrollConf : 'conf_needupdate_scrollbars'
+                    }), new ui.component.FilePanel(
+                    {
+                        id             : 'FNU-EN-PANEL-' + FileID,
+                        region         : 'east',
+                        width          : 575,
+                        title          : _('en File: ') + FilePath + FileName,
+                        prefix         : 'FNU',
+                        ftype          : 'EN',
+                        fid            : FileID,
+                        fpath          : FilePath,
+                        fname          : FileName,
+                        lang           : 'en',
+                        parser         : 'xml',
+                        storeRecord    : storeRecord,
+                        syncScroll     : true,
+                        syncScrollConf : 'conf_needupdate_scrollbars'
+                    })
+                ]
+            });
+            Ext.getCmp('main-panel').setActiveTab('FNU-' + FileID);
+
+        } else {
+            // This tab already exist. We focus it.
+            Ext.getCmp('main-panel').setActiveTab('FNU-' + FileID);
         }
     },

@@ -386,8 +391,8 @@
 {
     if (!ui.component._StaleFileGrid.instance) {
         if (!config) {
-			config = {};
-		}
+           config = {};
+        }
         ui.component._StaleFileGrid.instance = new ui.component.StaleFileGrid(config);
     }
     return ui.component._StaleFileGrid.instance;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.