Skip to content

Commit acbe59f

Browse files
author
joelibaceta
committed
rename func
1 parent a6acdab commit acbe59f

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# If you find yourself ignoring temporary files generated by your text editor
44
# or operating system, you probably want to add a global ignore instead:
55
# git config --global core.excludesfile '~/.gitignore_global'
6+
.DS_Store
7+
git-redate.sh
68

79
# Ignore bundler config.
810
/.bundle

app/views/snippets/stream.html.erb

+15-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</div>
6666
<textarea name="code" id="raw_code" type="hidden" style="display: none;"><%= @snippet.code %></textarea>
6767
<div id="filesbar">
68-
<div> <input value="untitled" /> </div>
68+
<div> <input onfocus="savePrevious(this)" onchange="renameFile(this)" value="untitled" /> </div>
6969
</div>
7070
<div id="mainConainter">
7171
<div id="editor"></div>
@@ -111,6 +111,7 @@
111111

112112
var fb_access_token = "";
113113
var fb_user_id = "";
114+
var filename = "";
114115

115116
var flag_changing = false;
116117
var flag_selection_changing = false;
@@ -170,6 +171,19 @@
170171
}
171172
});
172173

174+
function savePrevious(element) {
175+
filename = this.value;
176+
}
177+
178+
function renameFile(element) {
179+
self = this;
180+
socket.emit('rename_file', {
181+
"hashcode": "<%=@snippet.slug%>",
182+
"previous_name": filename,
183+
"new_name": self.value
184+
})
185+
}
186+
173187
function save()
174188
{
175189
App.snippet.send(build_payload(null, true))

config/environments/development.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Verifies that versions and hashed value of the package contents in the project's package.json
33

44
# Settings specified here will take precedence over those in config/application.rb.
5-
config.force_ssl = true
5+
66
# In the development environment your application's code is reloaded on
77
# every request. This slows down response time but is perfect for development
88
# since you don't have to restart the web server when you make code changes.

middleware

0 commit comments

Comments
 (0)