8 raise ArgumentError.new("List index #{n} must be an integer")
10 raise ArgumentError.new("List index #{n} must be greater than or equal to 1")
12 raise ArgumentError.new("A box string can't contain more then 4")
15 new_list = list.clone.to_a
20 new_list[1] = new_list[0]
21 new_list[2] = new_list[0]
22 new_list[3] = new_list[0]
24 new_list[2] = new_list[0]
25 new_list[3] = new_list[1]
27 new_list[3] = new_list[1]
31 new_list.to_a[n.to_i - 1]
35 Sass::Script::Number.new(value.to_i)
38 # Returns a background-image property for a specified images for the theme
39 def theme_image(theme, path, without_url = false, relative = false)
42 without_url = (without_url.class == FalseClass) ? without_url : without_url.value
44 relative_path = "../images/"
47 if relative.class == Sass::Script::String
48 relative_path = relative.value
50 elsif relative.class == FalseClass || relative.class == TrueClass
53 relative = relative.value
60 image_path = File.join(relative_path, theme, path)
62 images_path = File.join($ext_path, 'resources', 'themes', 'images', theme)
63 image_path = File.join(images_path, path)
67 url = "url('#{image_path}')"
72 Sass::Script::String.new(url)
75 def theme_image_exists(path)
78 where_to_look = path.value.gsub('../../resources', 'resources')
80 if where_to_look && FileTest.exists?("#{where_to_look}")
84 return Sass::Script::Bool.new(result)
91 module Sass::Script::Functions
92 include ExtJS4::SassExtensions::Functions::Utils