mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
commit
f4a511749b
@ -25,18 +25,15 @@ class ChromeTabs
|
|||||||
tabs.forEach (tab) =>
|
tabs.forEach (tab) =>
|
||||||
@_dirtyTabs[tab.id] = tab.id
|
@_dirtyTabs[tab.id] = tab.id
|
||||||
@onUpdated tab.id, {}, tab if tab.active
|
@onUpdated tab.id, {}, tab if tab.active
|
||||||
if chrome.action.setPopup?
|
title = if @_canSetPopup() then action.title else action.shortTitle
|
||||||
chrome.action.setTitle({title: action.title})
|
chrome.action.setTitle({title: title})
|
||||||
else
|
|
||||||
chrome.action.setTitle({title: action.shortTitle})
|
|
||||||
@setIcon(action.icon)
|
@setIcon(action.icon)
|
||||||
|
|
||||||
onUpdated: (tabId, changeInfo, tab) ->
|
onUpdated: (tabId, changeInfo, tab) ->
|
||||||
if @_dirtyTabs.hasOwnProperty(tab.id)
|
if @_dirtyTabs.hasOwnProperty(tab.id)
|
||||||
delete @_dirtyTabs[tab.id]
|
delete @_dirtyTabs[tab.id]
|
||||||
else if not changeInfo.url?
|
else if not changeInfo.url? and changeInfo.status == "complete"
|
||||||
if changeInfo.status? and changeInfo.status != 'loading'
|
return
|
||||||
return
|
|
||||||
@processTab(tab, changeInfo)
|
@processTab(tab, changeInfo)
|
||||||
|
|
||||||
processTab: (tab, changeInfo) ->
|
processTab: (tab, changeInfo) ->
|
||||||
@ -58,10 +55,8 @@ class ChromeTabs
|
|||||||
@clearIcon tab.id
|
@clearIcon tab.id
|
||||||
return
|
return
|
||||||
@setIcon(action.icon, tab.id)
|
@setIcon(action.icon, tab.id)
|
||||||
if chrome.action.setPopup?
|
title = if @_canSetPopup() then action.title else action.shortTitle
|
||||||
chrome.action.setTitle({title: action.title, tabId: tab.id})
|
return chrome.action.setTitle({title: title, tabId: tab.id})
|
||||||
else
|
|
||||||
chrome.action.setTitle({title: action.shortTitle, tabId: tab.id})
|
|
||||||
).catch((e) ->
|
).catch((e) ->
|
||||||
console.log('error:', e)
|
console.log('error:', e)
|
||||||
)
|
)
|
||||||
@ -77,17 +72,15 @@ class ChromeTabs
|
|||||||
|
|
||||||
setIcon: (icon, tabId) ->
|
setIcon: (icon, tabId) ->
|
||||||
return unless icon?
|
return unless icon?
|
||||||
if tabId?
|
params = {
|
||||||
params = {
|
imageData: icon
|
||||||
imageData: icon
|
}
|
||||||
tabId: tabId
|
params.tabId = tabId if tabId?
|
||||||
}
|
|
||||||
else
|
|
||||||
params = {
|
|
||||||
imageData: icon
|
|
||||||
}
|
|
||||||
@_chromeSetIcon(params)
|
@_chromeSetIcon(params)
|
||||||
|
|
||||||
|
_canSetPopup: ->
|
||||||
|
chrome.action.setPopup?
|
||||||
|
|
||||||
_chromeSetIcon: (params) ->
|
_chromeSetIcon: (params) ->
|
||||||
try
|
try
|
||||||
chrome.action.setIcon?(params, @ignoreError)
|
chrome.action.setIcon?(params, @ignoreError)
|
||||||
|
@ -87,6 +87,10 @@ li > a {
|
|||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.dropdown-menu {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
li .dropdown-menu {
|
li .dropdown-menu {
|
||||||
position: static;
|
position: static;
|
||||||
top: initial;
|
top: initial;
|
||||||
|
@ -52,7 +52,7 @@ html(lang='en' ng-controller='MasterCtrl' ng-csp)
|
|||||||
= ' '
|
= ' '
|
||||||
span {{'options_newProfile' | tr}}
|
span {{'options_newProfile' | tr}}
|
||||||
li.divider
|
li.divider
|
||||||
li.nav-header Actions
|
li.nav-header {{'options_navHeader_actions' | tr}}
|
||||||
li
|
li
|
||||||
a.btn-default.btn.align-initial(role='button' ng-click='applyOptions()'
|
a.btn-default.btn.align-initial(role='button' ng-click='applyOptions()'
|
||||||
ng-class='{"btn-success": optionsDirty}')
|
ng-class='{"btn-success": optionsDirty}')
|
||||||
|
@ -37,4 +37,4 @@ div(ng-controller='PacProfileCtrl')
|
|||||||
p.alert.alert-danger.width-limit(ng-show='profile.pacUrl && !profile.lastUpdate')
|
p.alert.alert-danger.width-limit(ng-show='profile.pacUrl && !profile.lastUpdate')
|
||||||
| {{'options_pacScriptObsolete' | tr}}
|
| {{'options_pacScriptObsolete' | tr}}
|
||||||
textarea.monospace.form-control.width-limit(ng-model='profile.pacScript' rows=20
|
textarea.monospace.form-control.width-limit(ng-model='profile.pacScript' rows=20
|
||||||
ng-disabled='pacUrlCtrl.ctrl.$invalid || !!profile.pacUrl')
|
ng-readonly='pacUrlCtrl.ctrl.$invalid || !!profile.pacUrl')
|
||||||
|
@ -28,5 +28,5 @@ div(ng-controller='RuleListProfileCtrl')
|
|||||||
ladda='updatingProfile[profile.name]' data-spinner-color="#000000")
|
ladda='updatingProfile[profile.name]' data-spinner-color="#000000")
|
||||||
| #[span.glyphicon.glyphicon-download-alt] {{'options_downloadProfileNow' | tr}}
|
| #[span.glyphicon.glyphicon-download-alt] {{'options_downloadProfileNow' | tr}}
|
||||||
textarea.monospace.form-control.width-limit(ng-model='profile.ruleList' rows=20
|
textarea.monospace.form-control.width-limit(ng-model='profile.ruleList' rows=20
|
||||||
ng-disabled='!!profile.sourceUrl')
|
ng-readonly='!!profile.sourceUrl')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user