~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/browser/__init__.py

  • Committer: mattgiuca
  • Date: 2008-02-27 10:15:01 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:597
Major refactor of actions in File browser.

listing.js: Calls update_actions when selecting a file. This is the new method
in browser.js which updates the actions along the top.
(Currently Listing still produces actions on the side, because the top actions
don't work properly yet and I don't want to break the build).

browser.js: 
    Added update_actions which applies properties to the actions buttons on
    the top. (Enables/disables them, etc).
    Added handle_moreactions - event handler for selecting an item in
    moreactions. Currently sets things up properly but doesn't execute any
    actions.
    Added Refresh function (new user action).

browser/__init__.py: Misc changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
    This is always exactly the same - the JavaScript will customize it later.
127
127
    """
128
128
    req.write("""    <a id="act_open" class="disabled">Open</a> :
129
 
    <a id="act_serve" class="disabled">Serve</a> :
 
129
    <a id="act_serve"
 
130
        title="View this file on the web, running your code if this is a CGI file"
 
131
        class="disabled">Serve</a> :
130
132
    <a id="act_run" title="Run the selected Python file in the console"
131
133
        class="disabled">Run</a> :
132
134
    <a id="act_download" class="choice">Download</a> :
133
135
    <a title="Refresh the current page" onclick="refresh()"
134
136
        class="choice">Refresh</a> :
135
 
    <select id="moreactions">
136
 
      <option class="moreactions">More actions...</option>
 
137
    <select id="moreactions" onchange="handle_moreactions()"
 
138
        onblur="handle_moreactions()">
 
139
      <option class="moreactions" value="top"
 
140
        selected="selected">More actions...</option>
137
141
 
138
142
      <option class="heading" disabled="disabled">Publishing</option>
139
143
      <option id="act_publish" class="disabled" disabled="disabled"
159
163
        value="cut">Cut</option>
160
164
 
161
165
      <option class="heading" disabled="disabled">Directory actions</option>
162
 
      <option id="act_paste" class="disabled" disabled="disabled"
 
166
      <option id="act_paste" class="choice"
163
167
        title="Paste the copied or cut files to the current directory"
164
168
        value="paste">Paste</option>
165
 
      <option id="act_newfile" class="disabled" disabled="disabled"
 
169
      <option id="act_newfile" class="choice"
166
170
        title="Open a new file for editing in the current directory"
167
171
        value="newfile">New File</option>
168
 
      <option id="act_mkdir" class="disabled" disabled="disabled"
 
172
      <option id="act_mkdir" class="choice"
169
173
        title="Make a new subdirectory in the current directory"
170
174
        value="mkdir">New Directory</option>
171
 
      <option id="act_upload" class="disabled" disabled="disabled"
 
175
      <option id="act_upload" class="choice"
172
176
        title="Upload a file to the current directory"
173
177
        value="upload">Upload File</option>
174
178
 
181
185
        value="svnrevert">Revert</option>
182
186
      <option id="act_svncommit" class="disabled" disabled="disabled"
183
187
        title="Commit any changes to the permanent repository"
184
 
        value="publish">Commit</option>
 
188
        value="svncommit">Commit</option>
185
189
    </select>
186
190
""")
187
191