Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F256861
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
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
Tue, Jun 10, 2:07 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
196917
Default Alt Text
(1 KB)
Attached To
Mode
R26 chwala
Attached
Detach File
Event Timeline
Log In to Comment