rename API => appAPI && coding standard

pull/1/head
yann300 8 years ago
parent 3ea043f2f1
commit 53ecc0c146
  1. 2
      src/app/analysis-tab.js
  2. 2
      src/app/debugger-tab.js
  3. 2
      src/app/files-tab.js
  4. 35
      src/app/righthand-panel.js
  5. 4
      src/app/tabbed-menu.js

@ -21,7 +21,7 @@ var css = csjs`
module.exports = analysisTab
function analysisTab (container, API, events, opts) {
function analysisTab (container, appAPI, events, opts) {
var el = yo`
<div class="${css.analysisTabView} "id="staticanalysisView">
</div>

@ -11,7 +11,7 @@ var css = csjs`
module.exports = debuggerTab
function debuggerTab (container, API, events, opts) {
function debuggerTab (container, appAPI, events, opts) {
var el = yo` <div class="${css.debuggerTabView} "id="debugView"><div id="debugger"></div></div>`
container.appendChild(el)
}

@ -20,7 +20,7 @@ var css = csjs`
module.exports = filesTab
function filesTab (container, API, events, opts) {
function filesTab (container, appAPI, events, opts) {
var el = yo`
<div class="${css.filesTabView}" id="publishView">
<div class="${css.crow}">

@ -1,4 +1,3 @@
var csjs = require('csjs-inject')
var yo = require('yo-yo')
var $ = require('jquery')
@ -13,8 +12,7 @@ var filesTab = require('./files-tab')
module.exports = RighthandPanel
function RighthandPanel (container, API, events, opts) {
function RighthandPanel (container, appAPI, events, opts) {
var optionViews = yo`<div id="optionViews" class="settingsView"></div>`
var element = yo`
<div id="righthand-panel">
@ -34,11 +32,11 @@ function RighthandPanel (container, API, events, opts) {
</div>
</div>
`
contractTab(optionViews, API, events, opts)
settingsTab(optionViews, API, events, opts)
analysisTab(optionViews, API, events, opts)
debuggerTab(optionViews, API, events, opts)
filesTab(optionViews, API, events, opts)
contractTab(optionViews, appAPI, events, opts)
settingsTab(optionViews, appAPI, events, opts)
analysisTab(optionViews, appAPI, events, opts)
debuggerTab(optionViews, appAPI, events, opts)
filesTab(optionViews, appAPI, events, opts)
container.appendChild(element)
// ----------------- toggle right hand panel -----------------
@ -46,7 +44,7 @@ function RighthandPanel (container, API, events, opts) {
var hidingRHP = false
$('.toggleRHP').click(function () {
hidingRHP = !hidingRHP
setEditorSize(hidingRHP ? 0 : API.config.get(EDITOR_WINDOW_SIZE))
setEditorSize(hidingRHP ? 0 : appAPI.config.get(EDITOR_WINDOW_SIZE))
$('.toggleRHP i').toggleClass('fa-angle-double-right', !hidingRHP)
$('.toggleRHP i').toggleClass('fa-angle-double-left', hidingRHP)
})
@ -54,14 +52,14 @@ function RighthandPanel (container, API, events, opts) {
// ----------------- tabbed menu -----------------
var tabbedMenuAPI = {
warnCompilerLoading: function (msg) {
API.renderer.clear()
appAPI.renderer.clear()
if (msg) {
API.renderer.error(msg, $('#output'), {type: 'warning'})
appAPI.renderer.error(msg, $('#output'), {type: 'warning'})
}
}
}
// load tabbed menu component
var tabContainer = undefined // @TODO
var tabContainer // @TODO
var tabEvents = {compiler: events.compiler, app: events.app}
tabbedMenu(tabContainer, tabbedMenuAPI, tabEvents, {})
@ -91,7 +89,7 @@ function RighthandPanel (container, API, events, opts) {
function setEditorSize (delta) {
$('#righthand-panel').css('width', delta)
$('#editor').css('right', delta)
API.onResize()
appAPI.onResize()
}
function getEditorSize () {
@ -106,15 +104,14 @@ function RighthandPanel (container, API, events, opts) {
dragging = false
delta = (delta < 50) ? 50 : delta
setEditorSize(delta)
API.config.set(EDITOR_WINDOW_SIZE, delta)
API.reAdjust()
appAPI.config.set(EDITOR_WINDOW_SIZE, delta)
appAPI.reAdjust()
}
})
if (API.config.exists(EDITOR_WINDOW_SIZE)) {
setEditorSize(API.config.get(EDITOR_WINDOW_SIZE))
if (appAPI.config.exists(EDITOR_WINDOW_SIZE)) {
setEditorSize(appAPI.config.get(EDITOR_WINDOW_SIZE))
} else {
API.config.set(EDITOR_WINDOW_SIZE, getEditorSize())
appAPI.config.set(EDITOR_WINDOW_SIZE, getEditorSize())
}
}

@ -3,7 +3,7 @@ var loadingSpinner = require('./loading-spinner')
module.exports = tabbedMenu
function tabbedMenu (container, API, events, opts) {
function tabbedMenu (container, appAPI, events, opts) {
$('#options li').click(function (ev) {
var $el = $(this)
selectTab($el)
@ -24,7 +24,7 @@ function tabbedMenu (container, API, events, opts) {
var spinner = loadingSpinner()
settingsTab.appendChild(spinner)
API.warnCompilerLoading('Solidity compiler is currently loading. Please wait a moment...')
appAPI.warnCompilerLoading('Solidity compiler is currently loading. Please wait a moment...')
events.compiler.register('compilerLoaded', finish)
function finish () {
events.compiler.unregister('compilerLoaded', finish)

Loading…
Cancel
Save