Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

Commit

Permalink
Some bugs correction; nothing working yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Seraf Dos Santos committed Feb 29, 2012
1 parent 6d26dde commit 1b4f1e7
Showing 1 changed file with 44 additions and 24 deletions.
68 changes: 44 additions & 24 deletions src/scripts/my/KitScript.coffee
Expand Up @@ -9,7 +9,7 @@
# extension. # extension.





# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #




class window.M_KitScriptPreferencesModel extends Backbone.Model class window.M_KitScriptPreferencesModel extends Backbone.Model
Expand All @@ -29,7 +29,7 @@ class window.V_KitScriptPreferencesPanel extends Backbone.View
@ @




# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #




class window.V_GlobalSettingsPanel extends Backbone.View class window.V_GlobalSettingsPanel extends Backbone.View
Expand All @@ -45,7 +45,7 @@ class window.V_GlobalSettingsPanel extends Backbone.View
$(@el).css "height", PanelContainer.getAvailContentHeight()+"px" $(@el).css "height", PanelContainer.getAvailContentHeight()+"px"





# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #




class window.V_UserScriptManagerPanel extends Backbone.View class window.V_UserScriptManagerPanel extends Backbone.View
Expand All @@ -61,7 +61,7 @@ class window.V_UserScriptManagerPanel extends Backbone.View
$(@el).css "height", PanelContainer.getAvailContentHeight()+"px" $(@el).css "height", PanelContainer.getAvailContentHeight()+"px"





# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #




class window.V_UserScriptSettingsPanel extends Backbone.View class window.V_UserScriptSettingsPanel extends Backbone.View
Expand All @@ -77,7 +77,7 @@ class window.V_UserScriptSettingsPanel extends Backbone.View
$(@el).css "height", PanelContainer.getAvailContentHeight()+"px" $(@el).css "height", PanelContainer.getAvailContentHeight()+"px"





# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #




class window.V_NewUserScriptPanel extends Backbone.View class window.V_NewUserScriptPanel extends Backbone.View
Expand All @@ -93,7 +93,7 @@ class window.V_NewUserScriptPanel extends Backbone.View
$(@el).css "height", PanelContainer.getAvailContentHeight()+"px" $(@el).css "height", PanelContainer.getAvailContentHeight()+"px"





# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #




class window.V_AboutKitScriptPanel extends Backbone.View class window.V_AboutKitScriptPanel extends Backbone.View
Expand All @@ -109,17 +109,18 @@ class window.V_AboutKitScriptPanel extends Backbone.View
$(@el).css "height", PanelContainer.getAvailContentHeight()+"px" $(@el).css "height", PanelContainer.getAvailContentHeight()+"px"




# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #





class window.O_PanelsCollection
class window.O_PanelsCollection extends Backbone.Collection


initialize: -> constructor: (@views) ->




getPanelInstanceById: (panelId) => getPanelInstanceById: (panelId) =>
for _p in @models for _v in @views
_p if _p.id is panelId return _v if _v.id is panelId



# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


Expand All @@ -141,15 +142,16 @@ class window.V_PanelContainer extends Backbone.View
$('#'+@prevNavItemId).removeClass 'active' $('#'+@prevNavItemId).removeClass 'active'
$('#'+@currNavItemId).addClass 'active' $('#'+@currNavItemId).addClass 'active'
@setTabTitle() @setTabTitle()
PanelsCollection.getPanelInstanceById(@currPanelId).render() _p = PanelsCollection.getPanelInstanceById @currPanelId
PanelsCollection.getPanelInstanceById(NavBarContainer.id).render() _p.render()
NavBarContainer.render()
@ @


setTabTitle: () => setTabTitle: () =>
document.title = KSApp.getDictKeyValue('app','name')+' | '+KSApp.getDictKeyValue(@currPanelId,'title') document.title = KSApp.getLocaleDictKey('app','name')+' | '+KSApp.getLocaleDictKey(@currPanelId,'title')


transitTo: (toPanelId) => transitTo: (toPanelId) =>
@pop 1 @pop "transitTo"
@prevPanelId = @currPanelId @prevPanelId = @currPanelId
@currPanelId = toPanelId @currPanelId = toPanelId
@prevNavItemId = @currNavItemId @prevNavItemId = @currNavItemId
Expand All @@ -158,10 +160,10 @@ class window.V_PanelContainer extends Backbone.View


getAvailContentHeight: => getAvailContentHeight: =>
_offset = $(@el).offset() _offset = $(@el).offset()
KSApp.windowHeight-_offset.top-@topOffset-@bottomOffset KSApp.getWindowHeight()-_offset.top-@topOffset-@bottomOffset





# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #




class window.V_NavBarContainer extends Backbone.View class window.V_NavBarContainer extends Backbone.View
Expand All @@ -171,13 +173,13 @@ class window.V_NavBarContainer extends Backbone.View


render: => render: =>
templata = templata =
app_name: KSApp.getDictKeyValue 'app', 'name' app_name: KSApp.getLocaleDictKey 'app', 'name'
app_version: KSApp.getDictKeyValue 'app', 'version' app_version: KSApp.getLocaleDictKey 'app', 'version'
gs_link_face: KSApp.getDictKeyValue GlobalSettingsPanel.id, 'name' gs_link_face: KSApp.getLocaleDictKey GlobalSettingsPanel.id, 'name'
usm_link_face: KSApp.getDictKeyValue UserScriptManagerPanel.id, 'name' usm_link_face: KSApp.getLocaleDictKey UserScriptManagerPanel.id, 'name'
nus_link_face: KSApp.getDictKeyValue NewUserScriptPanel.id, 'name' nus_link_face: KSApp.getLocaleDictKey NewUserScriptPanel.id, 'name'
pref_link_face: KSApp.getDictKeyValue KSPreferencesPanel.id, 'name' pref_link_face: KSApp.getLocaleDictKey KSPreferencesPanel.id, 'name'
aks_link_face: KSApp.getDictKeyValue AboutKSPanel.id, 'name' aks_link_face: KSApp.getLocaleDictKey AboutKSPanel.id, 'name'
$(@el).Macho templata $(@el).Macho templata
@ @


Expand Down Expand Up @@ -214,6 +216,24 @@ class window.V_KitScriptApp extends Backbone.View


getCurrentLocaleId: => getCurrentLocaleId: =>
@initLocaleId @initLocaleId

getCurrentPanelId: =>
@initPanelId

getCurrentFile: =>
@initFile

getWindowHeight: =>
@windowHeight

getWindowWidth: =>
@windowWidth

getScreenHeight: =>
@screenHeight

getScreenWidth: =>
@screenWidth




# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Expand Down

0 comments on commit 1b4f1e7

Please sign in to comment.