Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117880850
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/lib/viewers/text/file_editor.js b/lib/viewers/text/file_editor.js
index 72d2a66..4a9449c 100644
--- a/lib/viewers/text/file_editor.js
+++ b/lib/viewers/text/file_editor.js
@@ -1,48 +1,49 @@
function file_editor()
{
this.editable = true;
this.printable = true;
this.init = function(ed, mode, href)
{
this.href = href;
this.editor = ace.edit(ed);
this.session = this.editor.getSession();
this.editor.focus();
this.editor.setReadOnly(true);
this.session.setMode('ace/mode/' + mode);
};
// switch editor into read-write mode
this.enable = function()
{
this.editor.setReadOnly(false);
};
// switch editor into read-only mode
this.disable = function()
{
this.editor.setReadOnly(true);
};
this.getContent = function()
{
return this.editor.getValue();
};
// print file content
this.print = function()
{
// There's no print function in Ace Editor
// it's also not possible to print the page as is
// we'd copy the content to a hidden iframe
var iframe = document.createElement('iframe');
+ iframe.style.display = 'none';
iframe.onload = function() { iframe.focus(); iframe.contentWindow.print(); };
iframe.src = this.href + '&force-type=text/plain';
document.body.appendChild(iframe);
};
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Apr 5, 11:32 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18831580
Default Alt Text
(1 KB)
Attached To
Mode
rC chwala
Attached
Detach File
Event Timeline