Skip to content

Commit b9c5b98

Browse files
author
manickampr
committed
first commit
0 parents  commit b9c5b98

File tree

5 files changed

+71
-0
lines changed

5 files changed

+71
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0 - First Release
2+
* Every feature added
3+
* Every bug fixed

LICENSE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2015 <Your name here>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# open-unsupported-files package
2+
3+
Open Unsupported formats with thier default editor. For eg. word,excel.
4+
5+
Config
6+
7+
Default : XLS,DOC,DOCX has been maintained. you could add other formats(comma separated).

lib/open-unsupported-files.coffee

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{BufferedProcess} = require 'atom'
2+
{requirePackages} = require 'atom-utils'
3+
module.exports =
4+
config:
5+
extensions:
6+
title: 'extensions'
7+
type: 'string'
8+
default: 'doc,docx,xls,pdf'
9+
10+
activate: ->
11+
@cmd = if process.platform is 'win32' then 'cmd' else 'open'
12+
@extensions = atom.config.get('open-unsupported-files.extensions')?.split(',')
13+
requirePackages('tree-view').then ([treeView]) =>
14+
if tv = treeView.treeView
15+
@originalEntryClicked = tv.entryClicked
16+
tv.entryClicked = (e) =>
17+
entry = e.currentTarget
18+
return @originalEntryClicked.call(tv,e) unless entry.constructor.name is 'tree-view-file'
19+
filepath = e.target.attributes['data-path'].nodeValue
20+
filename = e.target.attributes['data-name'].nodeValue
21+
if filename?.substring(filename.indexOf('.') + 1 ) in @extensions
22+
args = [filepath]
23+
new BufferedProcess({@cmd,args})
24+
return false
25+
else
26+
@originalEntryClicked.call(tv,e)

package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "open-unsupported-files",
3+
"main": "./lib/open-unsupported-files",
4+
"version": "0.0.0",
5+
"description": "Open Unsupported File Format",
6+
"keywords": [
7+
],
8+
"repository": "https://github.com/skandasoft/open-unsupported-files",
9+
"license": "MIT",
10+
"engines": {
11+
"atom": ">=1.0.0 <2.0.0"
12+
},
13+
"dependencies": {
14+
}
15+
}

0 commit comments

Comments
 (0)