davrosull / ti-alloy-related Goto Github PK
View Code? Open in Web Editor NEWA quick way to open a controllers related View and TSS file for Ti Alloy Projects for the Atom editor.
License: MIT License
A quick way to open a controllers related View and TSS file for Ti Alloy Projects for the Atom editor.
License: MIT License
not sure if this would be an option or not:
if that's fine, here is the code:
module.exports =
activate: ->
atom.workspaceView.command "ti-alloy-related:openRelated", => @openRelated()
openRelated: ->
editor = atom.workspace.getActiveEditor()
return unless editor?
previousActivePane = atom.workspace.getActivePane()
uri = "#{editor.getPath()}"
if uri.indexOf('.js') > 0
view = uri.replace('/controllers/', '/views/')
view = view.replace('.js', '.xml')
style = uri.replace('/controllers/', '/styles/')
style = style.replace('.js', '.tss')
else if uri.indexOf('.xml') > 0
view = uri.replace('/views/', '/controllers/')
view = view.replace('.xml', '.js')
style = uri.replace('/views/', '/styles/')
style = style.replace('.xml', '.tss')
else if uri.indexOf('.tss') > 0
view = uri.replace('/styles/', '/views/')
view = view.replace('.tss', '.xml')
style = uri.replace('/styles/', '/controllers/')
style = style.replace('.tss', '.js')
atom.workspaceView.getActivePane().splitRight()
atom.workspace.open(view)
atom.workspaceView.getActivePane().splitDown()
atom.workspace.open(style)
I've asked this on discuss: https://discuss.atom.io/t/reuse-splitted-pane/17426
Would be nice to reuse the existing split. But I don't know how to do this yet. Still trying...
Hi,
you still need to push the updated version in order to remove the deprecation warning.
also update the package.json from
"activationEvents": [
"ti-alloy-related:openRelated"
]
to
"activationCommands": {
"atom-workspace": ["ti-alloy-related:openRelated"],
"atom-text-editor": ["ti-alloy-related:openRelated"]
}
then it should still run in 1.0!
Plugin got deprecated :(
can't test it at the moment but I think these parts need to be like this:
...
atom.commands.add 'atom-workspace', "ti-alloy-related:openRelated", => @openRelated()
...
atom.workspace.getActivePane().splitRight()
...
atom.workspace.getActivePane().splitDown()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.