⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bookmarkedit.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;0,0,1,19,24,27,30,47,50,53,77;;0,23,28,31;0,14,19,22;;0,8,11,21;0,0,0,0,0,58,65,66,90;;6,7,20;;;0,0,0,0,62,72,73,97;12,29;; 2219908d_manila.luac 

require("class")
require("scrollphysics")
require("internetpush_svc")
require("io_svc")
require("theme")
require("checkboxcontrol")
OperaUserDataRoot = "\\Windows\\Opera9"
OperaImagesRoot = OperaUserDataRoot .. "\\Images"
OperaFavoritesFilePath = OperaUserDataRoot .. "\\opera6.adr"
OperaLaunchFavoriteUIArg = "/Bookmarks"
OperaLaunchHomeArg = "/home"
MaxFavoritesListLength = 25
FavoriteLoader = OperaFavoriteLoader(OperaFavoritesFilePath)
IsEnterFolder = false
HandleItemCreated = function(l_1_0, l_1_1)
   local l_1_2 = l_1_1.Namespace
   l_1_0.IsRealized = true
   l_1_1.Tag = l_1_0
   l_1_1.Focusable = true
   l_1_1.OnSelected:connect(HandleItemSelected)
   l_1_1.OnDeselected:connect(HandleItemDeselected)
   l_1_1.onKeyDown:connect(HandleItemKeyDown)
   local l_1_3 = l_1_2:FindName("Seperator")
   l_1_3.Position.y = -79
   local l_1_4 = l_1_2:FindName("OperatorLinkGroup")
   local l_1_5 = l_1_2:FindName("UserFavoriteGroup")
   local l_1_6 = l_1_2:FindName("CheckBoxComponent")
   if l_1_0.IsFolder == false then
      l_1_6._visible = true
      l_1_6.Duration = 40
      InitializeCheckbox(l_1_6, l_1_0.Instance.Checked)
   end
   l_1_4._visible = false
   l_1_5._visible = true
   l_1_5._visible = true
   l_1_5.Duration = 40
   local l_1_7 = l_1_2:FindName("FavoriteText")
   local l_1_8 = l_1_2:FindName("FavoriteUrl")
   local l_1_9 = l_1_2:FindName("FavoriteImage")
   if l_1_0.Text ~= nil and l_1_7 ~= nil then
      l_1_7.String = l_1_0.Text
   end
   if l_1_0.DisplayUrl ~= nil and l_1_8 ~= nil then
      l_1_8.String = l_1_0.DisplayUrl
   end
   if l_1_0.IsFolder == true then
      l_1_8.String = l_1_0.ItemCount .. " items"
   end
   local l_1_10 = l_1_2:FindName("DownLoadStatus")
   if l_1_0.IsFolder == true and l_1_0.ItemCount ~= 0 then
      l_1_10:SetTextureRef("Arrow")
      l_1_10._visible = true
      l_1_10.Size.width = 19
      l_1_10.Size.height = 31
      l_1_10.Position.y = -24.5
   else
      l_1_10._visible = false
   end
   if l_1_0.Instance.InBookmarkList == true then
      l_1_5.Opacity.value = 50
   else
   end
  l_1_7.Color = GetMainTextUnselectedColor()
  l_1_8.Color = GetSubTextUnselectedColor()
  if l_1_0.IsFolder ~= true then
     l_1_9:SetTextureRef("FavoriteLinkImageDn")
  else
     l_1_9:SetTextureRef("FavoriteFolderImage")
  end
  l_1_0.Selector = l_1_2:FindName("Selector")
  if l_1_0.Selector ~= nil then
     l_1_0.Selector._visible = false
  end
  if l_1_0.Instance.InBookmarkList == true then
     l_1_0.Selector = nil
  end
end

HandleItemDestroyed = function(l_2_0)
   l_2_0.OnSelected:disconnect(HandleItemSelected)
   l_2_0.OnDeselected:disconnect(HandleItemDeselected)
   l_2_0.onKeyDown:disconnect(HandleItemKeyDown)
end

HandleItemSelected = function(l_3_0)
   if l_3_0.Tag.Instance.InBookmarkList == true then
      return 
   end
   if l_3_0.Tag.Selector ~= nil then
      l_3_0.Tag.Selector._visible = true
      trace("HandleItemSelected \n")
      DisableSelectorTimer:Stop()
      DisableSelectorTimer:Start()
   end
   local l_3_1 = l_3_0.Namespace
   if l_3_1 ~= nil then
      local l_3_2 = l_3_1:FindName("UserFavoriteGroup")
      local l_3_3 = l_3_1:FindName("FavoriteImage")
      if l_3_2._visible == true then
        local ft = l_3_1:FindName("FavoriteText")
        local fu = l_3_1:FindName("FavoriteUrl")        
        ft.Color = GetMainTextSelectedColor()
        fu.Color = GetSubTextSelectedColor()
      end
      if l_3_2._visible == true and l_3_3 ~= nil then
         if l_3_0.Tag.IsFolder then
         else
           l_3_3:SetTextureRef("FavoriteLinkImageUp")
         end
      end
   end
end

HandleItemDeselected = function(l_4_0)
   if l_4_0.Tag.Instance.InBookmarkList == true then
      return 
   end
   if l_4_0.Tag.Selector ~= nil then
      l_4_0.Tag.Selector._visible = false
   end
   local l_4_1 = l_4_0.Namespace
   if l_4_1 ~= nil then
      local l_4_2 = l_4_1:FindName("UserFavoriteGroup")
      local l_4_3 = l_4_1:FindName("FavoriteImage")
      if l_4_2._visible == true then
        local ft = l_4_1:FindName("FavoriteText")
        local fu = l_4_1:FindName("FavoriteUrl")        
        ft.Color = GetMainTextUnselectedColor()
        fu.Color = GetSubTextUnselectedColor()
      end
      if l_4_2._visible == true and l_4_3 ~= nil then
         if l_4_0.Tag.IsFolder then
         else
           l_4_3:SetTextureRef("FavoriteLinkImageDn")
         end
      end
   end
end

HandleItemKeyDown = function(l_5_0, l_5_1)
   if (l_5_1.Code == KeyCode_Return or l_5_1.Code == KeyCode_Space) then
     if l_5_0.Tag ~= nil then
       HandleLinkPressed(l_5_0.Tag)
     end
   else
     trace("HandleItemKeyDown \n")
     DisableSelectorTimer:Stop()
     DisableSelectorTimer:Start()
   end
end

HandleListSelection = function(l_6_0)
   trace("HandleListSelection index = " .. l_6_0)
   local l_6_1 = GizmoListView:GetGenerator()
   local l_6_2 = l_6_1:GetItem(l_6_0)
   if l_6_2.Tag.Instance.InBookmarkList == true then
      return 
   end
   local l_6_3 = l_6_2.Namespace:FindName("CheckBoxComponent")
   if l_6_2.Tag.IsFolder ~= true then
      l_6_2.Tag.Instance.Checked = not l_6_2.Tag.Instance.Checked
      ToggleCheckbox(l_6_3)
   end
   HandleLinkPressed(l_6_1:GetDataByRealizedIndex(l_6_0))
end

OpenFolder = function(l_7_0)
   IsEnterFolder = true
   if CountOfFavorites ~= nil and CountOfFavorites > 0 then
      for i = 1, CountOfFavorites do
         GizmoListCollection:pop_back()
      end
   end
   CountOfFavorites = 0
   favorites = FavoriteLoader:LoadbyFolder(l_7_0, true)
   if favorites ~= nil then
      CountOfFavorites = favorites:GetCount()
      trace("Got " .. tostring(CountOfFavorites) .. " favorites.\n")
      if GizmoListCollection:GetCount() == 1 and l_7_0 == 0 then
         GizmoListCollection:pop_back()
      end
      for i = 0, CountOfFavorites - 1 do
         local l_7_5 = favorites:GetItem(i)
         if l_7_5 ~= nil then
            local l_7_6 = WebURL(l_7_5.Url):GetServer()
            local l_7_7 = false
            if l_7_5.IsFolder == false then
               l_7_7 = FavoriteLoader:IsInBookmarkList(l_7_5.Url, l_7_5.Name)
            end
            l_7_5.Checked = l_7_7
            l_7_5.InBookmarkList = l_7_7
            local l_7_8 = {Text = l_7_5.Name, Url = l_7_5.Url, DisplayUrl = l_7_6, Id = l_7_5.Id, IsFolder = l_7_5.IsFolder, Instance = l_7_5, ItemCount = l_7_5.ItemCount}
            GizmoListCollection:push_back(l_7_8)
         end
      end
   end
   _application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_DONE"), HandleLeftSoftkey))
   _application:SetRightSoftkey(Softkey(Locale:GetString("IDS_BACK"), HandleRightSoftkey))
end

HandleLinkPressed = function(l_8_0)
   if l_8_0 == nil then
      return 
   end
   if l_8_0.IsFolder ~= true or l_8_0.ItemCount ~= 0 then
       -- Warning: missing end command somewhere! Added here
   end
end

HandleLeftSoftkey = function()
   trace("Save Fav")
   local l_9_0 = favorites:GetCount()
   local l_9_1 = false
   local l_9_2 = nil
   for i = 0, l_9_0 - 1 do
      trace("+++++++++++ add 22222")
      l_9_2 = favorites:GetItem(i)
      trace("+++++++++++ add 22222 Checked = " .. tostring(l_9_2.Checked) .. " InBookmarkList = " .. tostring(l_9_2.InBookmarkList))
      if l_9_2.Checked ~= l_9_2.InBookmarkList then
         trace("+++++++++++ add 3333")
         if l_9_2.InBookmarkList and not l_9_2.Checked then
           l_9_1 = true
         elseif not l_9_2.InBookmarkList and l_9_2.Checked then
           trace("+++++++++++ add 11111111")
           FavoriteLoader:SaveCheckedBookMark(l_9_2.Url, l_9_2.Name)
         end
      end
   end
   if l_9_1 then
      _InternetSetUtil.ExactlyDeleteLink.Value = 1
   end
   _application.Navigation:NavigateBack()
end

HandleRightSoftkey = function()
   trace("Press back!!!!!")
   if IsEnterFolder == true then
      local f = FavoriteLoader:GetLastLevelId(0)
      trace("Last_id=" .. tostring(f))
      OpenFolder(f)
      if f == 0 then
        IsEnterFolder =  false
      end
   else
      _application.Navigation:NavigateBack()
   end
end

HandleVisibilityChanged = function()
   if _application.Visibility == true then
      DisableSelector()
      if FavoriteLoader:IsDataStaleSinceLoad() == true then
         RebuildFavoriteList(GizmoListView:GetGenerator().Collection)
      end
   end
end

RebuildFavoriteList = function()
   if CountOfFavorites ~= nil and CountOfFavorites > 0 then
      for i = 1, CountOfFavorites do
         GizmoListCollection:pop_back()
      end
   end
   CountOfFavorites = 0
   favorites = FavoriteLoader:Load(false, MaxFavoritesListLength)
   CountOfFavorites = favorites:GetCount()
   if 0 < CountOfFavorites then
     favorites = FavoriteLoader:LoadbyFolder(0, true)
     if favorites ~= nil then
        CountOfFavorites = favorites:GetCount()
        trace("Got " .. tostring(CountOfFavorites) .. " favorites.\n")
        trace("++++++++++++3333")
        for i = 0, CountOfFavorites - 1 do
           local l_12_4 = favorites:GetItem(i)
           trace("++++++++++++2222")
           if l_12_4 ~= nil then
              local l_12_5 = WebURL(l_12_4.Url):GetServer()
              local l_12_6 = false
              if l_12_4.IsFolder == false then
                 l_12_6 = FavoriteLoader:IsInBookmarkList(l_12_4.Url, l_12_4.Name)
              end
              l_12_4.Checked = l_12_6
              l_12_4.InBookmarkList = l_12_6
              local l_12_7 = {Text = l_12_4.Name, Url = l_12_4.Url, DisplayUrl = l_12_5, Id = l_12_4.Id, IsFolder = l_12_4.IsFolder, Instance = l_12_4, ItemCount = l_12_4.ItemCount}
              GizmoListCollection:push_back(l_12_7)
           end
        end
     end
   end
end

InitializeList = function()
   GizmoListCollection = VectorNotifyLuaObject()
   _application.OnVisibilityChanged:connect(HandleVisibilityChanged)
   RebuildFavoriteList()
   local l_13_0 = SequentialLayout()
   l_13_0:SetItemSize(MainCamera.Viewport.width, 80, 0)
   local l_13_1 = SequentialLibraryGeneratorLuaObject(GizmoListCollection, GizmoListView:GetMovie(), GizmoListView.ComponentLibraryName, GizmoListView.ComponentLibraryID)
   GizmoListView:SetLayout(l_13_0)
   GizmoListScrollPhysics = ScrollPhysics(GizmoListView, GizmoListView, HandleListSelection)
   GizmoListScrollPhysics:ConnectMouseEvents()
   l_13_1.ItemCreated:connect(HandleItemCreated)
   l_13_1.ItemDestroyed:connect(HandleItemDestroyed)
   l_13_1.RecycleItems = true
   GizmoListView:SetGenerator(l_13_1)
   GizmoListView:ForceLayout()
   GizmoListView:Focus()
end

_InternetSetUtil = InternetSetUtil()
GizmoListView.Viewport.y = 636
InitializeList()
_application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_DONE"), HandleLeftSoftkey))
_application:SetRightSoftkey(Softkey(Locale:GetString("IDS_CANCEL"), HandleRightSoftkey))
DisableSelector = function()
   DisableSelectorTimer:Stop()
   GizmoListView:GetGenerator().SelectedIndex = -1
   trace("Set GizmoListView.selectedIndex = -1\n")
end

DisableSelectorTimer = timer(5)
DisableSelectorTimer:Stop()
DisableSelectorTimer.OnElapsed:connect(DisableSelector)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -