From bcd4670136cd9842a651886e4d764e205f40c54a Mon Sep 17 00:00:00 2001 From: riccio82 Date: Thu, 17 Oct 2024 16:28:01 +0200 Subject: [PATCH 01/24] Update Sentry config --- package.json | 2 +- plugins/translated | 2 +- yarn.lock | 122 ++++++++++++++++++++++----------------------- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index c1c6e1e32f..6317975edd 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@babel/plugin-transform-runtime": "^7.23.7", "@babel/preset-env": "^7.23.8", "@babel/preset-react": "^7.23.3", - "@sentry/webpack-plugin": "2.22.4", + "@sentry/webpack-plugin": "2.22.5", "@testing-library/dom": "^10.1.0", "@testing-library/jest-dom": "^6.2.0", "@testing-library/react": "^16.0.0", diff --git a/plugins/translated b/plugins/translated index a3f8b4ec0e..68b63519f1 160000 --- a/plugins/translated +++ b/plugins/translated @@ -1 +1 @@ -Subproject commit a3f8b4ec0e5d50e1d5b4ffbad0dc1cc084523987 +Subproject commit 68b63519f1a4b6afac6f715674ac6ef3e7954dda diff --git a/yarn.lock b/yarn.lock index d35c0baa9c..99893ebad9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2239,10 +2239,10 @@ "@sentry/types" "7.119.2" "@sentry/utils" "7.119.2" -"@sentry/babel-plugin-component-annotate@2.22.4": - version "2.22.4" - resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.4.tgz#c5adef7201a799c971cdccc5ba11c97d4609b1a2" - integrity sha512-hbSq067KwmeKIEkmyzkTNJbmbtx2KRqvpiy9Q/DynI5Z46Nko/ppvgIfyFXK9DelwvEPOqZic4WXTIhO4iv3DA== +"@sentry/babel-plugin-component-annotate@2.22.5": + version "2.22.5" + resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.5.tgz#494978f4dfd741006368f74fefee2d1858a9c3af" + integrity sha512-+93qwB9vTX1nj4hD8AMWowXZsZVkvmP9OwTqSh5d4kOeiJ+dZftUk4+FKeKkAX9lvY2reyHV8Gms5mo67c27RQ== "@sentry/browser@^7.40.0": version "7.119.2" @@ -2258,59 +2258,59 @@ "@sentry/types" "7.119.2" "@sentry/utils" "7.119.2" -"@sentry/bundler-plugin-core@2.22.4": - version "2.22.4" - resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.4.tgz#e2c4efc713436b5a38dbbc4be510769c1c548cca" - integrity sha512-25NiyV3v6mdqOXlpzbbJnq0FHdAu1uTEDr+DU8CzNLjIXlq2Sr2CFZ/mhRcR6daM8OAretJdQ34lu0yHUVeE4Q== +"@sentry/bundler-plugin-core@2.22.5": + version "2.22.5" + resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.5.tgz#ca92e8145921fc5d4498bfd18168cad2c3376659" + integrity sha512-nfvTthV0aNM9/MwgnCi1WjAlCtau1I4kw6+oZIDOwJRDqGNziz517mYRXSsvCUebtGxDZtPcF7hSEBMSHjpncA== dependencies: "@babel/core" "^7.18.5" - "@sentry/babel-plugin-component-annotate" "2.22.4" - "@sentry/cli" "^2.33.1" + "@sentry/babel-plugin-component-annotate" "2.22.5" + "@sentry/cli" "^2.36.1" dotenv "^16.3.1" find-up "^5.0.0" glob "^9.3.2" magic-string "0.30.8" unplugin "1.0.1" -"@sentry/cli-darwin@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.34.1.tgz#5106ab7eae3fc8218ddcc4d5da209390b4b7edbe" - integrity sha512-SqlCunwhweMDJNKVf3kabiN6FwpvCIffn2cjfaZD0zqZQ3M1tWMJ/kSA0TGfe7lWu9JloNmVm+ArcudGitvX3w== - -"@sentry/cli-linux-arm64@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.34.1.tgz#60ccbd029c63861e45a007026b88c97d8a134205" - integrity sha512-iSl/uNWjKbVPb6ll12SmHG9iGcC3oN8jjzdycm/mD3H/d8DLMloEiaz8lHQnsYCaPiNKwap1ThKlPvnKOU4SNg== - -"@sentry/cli-linux-arm@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.34.1.tgz#b52880718df35c99972dc870aefd9ef49b63d6cd" - integrity sha512-CDhtFbUs16CoU10wEbxnn/pEuenFIMosTcxI7v0gWp3Wo0B2h0bOsLEk9dlT0YsqRTAldKUzef9AVX82m5Svwg== - -"@sentry/cli-linux-i686@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.34.1.tgz#5ff75602350a6b803d9e9b8d20abb55d230de009" - integrity sha512-jq5o49pgzJFv/CQtvx4FLVO1xra22gzP76FtmvPwEhZQhJT6QduW9fpnvVDnOaY8YLzC7GAeszUV6sqZ0MZUqg== - -"@sentry/cli-linux-x64@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.34.1.tgz#e620a5bfe46479df37ea96760679fd8e8e85cc80" - integrity sha512-O99RAkrcMErWLPRdza6HaG7kmHCx9MYFNDX6FLrAgSP3oz+X3ral1oDTIrMs4hVbPDK287ZGAqCJtk+1iOjEBg== - -"@sentry/cli-win32-i686@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.34.1.tgz#0d1897f74dc7318bbf5cbac3865208ca0cb77d03" - integrity sha512-yEeuneEVmExCbWlnSauhIg8wZDfKxRaou8XRfM6oPlSBu0XO5HUI3uRK5t2xT0zX8Syzh2kCZpdVE1KLavVeKA== - -"@sentry/cli-win32-x64@2.34.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.34.1.tgz#40a5f9aba47c1e3b20dd10982643004f89b0d918" - integrity sha512-mU48VpDTwRgt7/Pf3vk/P87m4kM3XEXHHHfq9EvHCTspFF6GtMfL9njZ7+5Z+7ko852JS4kpunjZtsxmoP4/zA== - -"@sentry/cli@^2.33.1": - version "2.34.1" - resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.34.1.tgz#5c68db72deb6a00438be46e0d3d58ba02db6bace" - integrity sha512-hAHvu+XH1kn1ee2NUWvuqAZenK/MrxqQzeIrIYATqF2XGjtSOr7irjAKWjd97/vXdLHA6TBnMW1wHwLcuJK2tg== +"@sentry/cli-darwin@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.37.0.tgz#9c890c68abf30ceaad27826212a0963b125b8bbf" + integrity sha512-CsusyMvO0eCPSN7H+sKHXS1pf637PWbS4rZak/7giz/z31/6qiXmeMlcL3f9lLZKtFPJmXVFO9uprn1wbBVF8A== + +"@sentry/cli-linux-arm64@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.37.0.tgz#2070155bade6d72d6b706807c6f365c65f9b82ea" + integrity sha512-2vzUWHLZ3Ct5gpcIlfd/2Qsha+y9M8LXvbZE26VxzYrIkRoLAWcnClBv8m4XsHLMURYvz3J9QSZHMZHSO7kAzw== + +"@sentry/cli-linux-arm@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.37.0.tgz#a08c2133e8e2566074fd6fe4f68e9ffd0c85664a" + integrity sha512-Dz0qH4Yt+gGUgoVsqVt72oDj4VQynRF1QB1/Sr8g76Vbi+WxWZmUh0iFwivYVwWxdQGu/OQrE0tx946HToCRyA== + +"@sentry/cli-linux-i686@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.37.0.tgz#53fff0e7f232b656b0ee3413b66006ee724a4abf" + integrity sha512-MHRLGs4t/CQE1pG+mZBQixyWL6xDZfNalCjO8GMcTTbZFm44S3XRHfYJZNVCgdtnUP7b6OHGcu1v3SWE10LcwQ== + +"@sentry/cli-linux-x64@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.37.0.tgz#2fbaf51ef3884bd6561c987f01ac98f544457150" + integrity sha512-k76ClefKZaDNJZU/H3mGeR8uAzAGPzDRG/A7grzKfBeyhP3JW09L7Nz9IQcSjCK+xr399qLhM2HFCaPWQ6dlMw== + +"@sentry/cli-win32-i686@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.37.0.tgz#fa195664da27ce8c40fdb6db1bf1d125cdf587d9" + integrity sha512-FFyi5RNYQQkEg4GkP2f3BJcgQn0F4fjFDMiWkjCkftNPXQG+HFUEtrGsWr6mnHPdFouwbYg3tEPUWNxAoypvTw== + +"@sentry/cli-win32-x64@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.37.0.tgz#84fa4d070b8a4a115c46ab38f42d29580143fd26" + integrity sha512-nSMj4OcfQmyL+Tu/jWCJwhKCXFsCZW1MUk6wjjQlRt9SDLfgeapaMlK1ZvT1eZv5ZH6bj3qJfefwj4U8160uOA== + +"@sentry/cli@^2.36.1": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.37.0.tgz#dd01e933cf1caed7d7b6abab5a96044fe1c9c7a1" + integrity sha512-fM3V4gZRJR/s8lafc3O07hhOYRnvkySdPkvL/0e0XW0r+xRwqIAgQ5ECbsZO16A5weUiXVSf03ztDL1FcmbJCQ== dependencies: https-proxy-agent "^5.0.0" node-fetch "^2.6.7" @@ -2318,13 +2318,13 @@ proxy-from-env "^1.1.0" which "^2.0.2" optionalDependencies: - "@sentry/cli-darwin" "2.34.1" - "@sentry/cli-linux-arm" "2.34.1" - "@sentry/cli-linux-arm64" "2.34.1" - "@sentry/cli-linux-i686" "2.34.1" - "@sentry/cli-linux-x64" "2.34.1" - "@sentry/cli-win32-i686" "2.34.1" - "@sentry/cli-win32-x64" "2.34.1" + "@sentry/cli-darwin" "2.37.0" + "@sentry/cli-linux-arm" "2.37.0" + "@sentry/cli-linux-arm64" "2.37.0" + "@sentry/cli-linux-i686" "2.37.0" + "@sentry/cli-linux-x64" "2.37.0" + "@sentry/cli-win32-i686" "2.37.0" + "@sentry/cli-win32-x64" "2.37.0" "@sentry/core@7.119.2": version "7.119.2" @@ -2366,12 +2366,12 @@ dependencies: "@sentry/types" "7.119.2" -"@sentry/webpack-plugin@2.22.4": - version "2.22.4" - resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.22.4.tgz#0102e83c77a6a4415344e7141f4aebc586d625da" - integrity sha512-Y7+RBrXBZlEuvoC0SbuClHZ8VC0nM0wZXroFuY/157EfUFtWr0J8f3b8+mzNshDGaCWV/UzFn6092M/BlAXCQA== +"@sentry/webpack-plugin@2.22.5": + version "2.22.5" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.22.5.tgz#aafb3e526954b72759bae38bb34edecf55e68142" + integrity sha512-D8irs8H0IuLZbCS0Te5zsYGu9sABmMJTfCCkRkf7fV8S0BQZQmxnQGf9cVxcTj07RWAgnhhUtsRQzkK7MLuIwg== dependencies: - "@sentry/bundler-plugin-core" "2.22.4" + "@sentry/bundler-plugin-core" "2.22.5" unplugin "1.0.1" uuid "^9.0.0" From d4761abcbec47122d472f63e8db5c42c83da95c6 Mon Sep 17 00:00:00 2001 From: riccio82 Date: Fri, 18 Oct 2024 16:08:42 +0200 Subject: [PATCH 02/24] Improve webpack --- package.json | 2 +- webpack.config.js | 42 +++++++++++++++++++++++++++++------------- yarn.lock | 28 ++++++++++++++-------------- 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 6317975edd..2fb780b190 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@babel/plugin-transform-runtime": "^7.23.7", "@babel/preset-env": "^7.23.8", "@babel/preset-react": "^7.23.3", - "@sentry/webpack-plugin": "2.22.5", + "@sentry/webpack-plugin": "2.22.6", "@testing-library/dom": "^10.1.0", "@testing-library/jest-dom": "^6.2.0", "@testing-library/react": "^16.0.0", diff --git a/webpack.config.js b/webpack.config.js index 73dc35f398..1d8fad6fcd 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -105,6 +105,7 @@ const matecatConfig = async ({env}, {mode}) => { pluginConfig.sentryWebpackPlugin.release = JSON.stringify( config.BUILD_NUMBER, ) + console.log('Sentry release', pluginConfig.sentryWebpackPlugin.release) } return { target: 'web', @@ -394,40 +395,52 @@ const matecatConfig = async ({env}, {mode}) => { xhtml: true, }), new HtmlWebPackPlugin({ - filename: path.resolve(__dirname, './lib/View/activity_log_not_found.html'), + filename: path.resolve( + __dirname, + './lib/View/activity_log_not_found.html', + ), template: path.resolve( - __dirname, - './lib/View/templates/_activity_log_not_found.html', + __dirname, + './lib/View/templates/_activity_log_not_found.html', ), chunks: ['commonCss'], publicPath: '/public/build/', xhtml: true, }), new HtmlWebPackPlugin({ - filename: path.resolve(__dirname, './lib/View/oauth_response_handler.html'), + filename: path.resolve( + __dirname, + './lib/View/oauth_response_handler.html', + ), template: path.resolve( - __dirname, - './lib/View/templates/_oauth_response_handler.html', + __dirname, + './lib/View/templates/_oauth_response_handler.html', ), chunks: [], publicPath: '/public/build/', xhtml: true, }), new HtmlWebPackPlugin({ - filename: path.resolve(__dirname, './lib/View/redirectFailurePage.html'), + filename: path.resolve( + __dirname, + './lib/View/redirectFailurePage.html', + ), template: path.resolve( - __dirname, - './lib/View/templates/_redirectFailurePage.html', + __dirname, + './lib/View/templates/_redirectFailurePage.html', ), chunks: [], publicPath: '/public/build/', xhtml: true, }), new HtmlWebPackPlugin({ - filename: path.resolve(__dirname, './lib/View/redirectSuccessPage.html'), + filename: path.resolve( + __dirname, + './lib/View/redirectSuccessPage.html', + ), template: path.resolve( - __dirname, - './lib/View/templates/_redirectSuccessPage.html', + __dirname, + './lib/View/templates/_redirectSuccessPage.html', ), chunks: [], publicPath: '/public/build/', @@ -475,7 +488,10 @@ const matecatConfig = async ({env}, {mode}) => { }), new HtmlWebPackPlugin({ filename: path.resolve(__dirname, './lib/View/badConfiguration.html'), - template: path.resolve(__dirname, './lib/View/templates/_badConfiguration.html'), + template: path.resolve( + __dirname, + './lib/View/templates/_badConfiguration.html', + ), chunks: ['commonCss'], publicPath: '/public/build/', xhtml: true, diff --git a/yarn.lock b/yarn.lock index 99893ebad9..9fbe25a6df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2239,10 +2239,10 @@ "@sentry/types" "7.119.2" "@sentry/utils" "7.119.2" -"@sentry/babel-plugin-component-annotate@2.22.5": - version "2.22.5" - resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.5.tgz#494978f4dfd741006368f74fefee2d1858a9c3af" - integrity sha512-+93qwB9vTX1nj4hD8AMWowXZsZVkvmP9OwTqSh5d4kOeiJ+dZftUk4+FKeKkAX9lvY2reyHV8Gms5mo67c27RQ== +"@sentry/babel-plugin-component-annotate@2.22.6": + version "2.22.6" + resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.6.tgz#829d6caf2c95c1c46108336de4e1049e6521435e" + integrity sha512-V2g1Y1I5eSe7dtUVMBvAJr8BaLRr4CLrgNgtPaZyMT4Rnps82SrZ5zqmEkLXPumlXhLUWR6qzoMNN2u+RXVXfQ== "@sentry/browser@^7.40.0": version "7.119.2" @@ -2258,13 +2258,13 @@ "@sentry/types" "7.119.2" "@sentry/utils" "7.119.2" -"@sentry/bundler-plugin-core@2.22.5": - version "2.22.5" - resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.5.tgz#ca92e8145921fc5d4498bfd18168cad2c3376659" - integrity sha512-nfvTthV0aNM9/MwgnCi1WjAlCtau1I4kw6+oZIDOwJRDqGNziz517mYRXSsvCUebtGxDZtPcF7hSEBMSHjpncA== +"@sentry/bundler-plugin-core@2.22.6": + version "2.22.6" + resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.6.tgz#a1ea1fd43700a3ece9e7db016997e79a2782b87d" + integrity sha512-1esQdgSUCww9XAntO4pr7uAM5cfGhLsgTK9MEwAKNfvpMYJi9NUTYa3A7AZmdA8V6107Lo4OD7peIPrDRbaDCg== dependencies: "@babel/core" "^7.18.5" - "@sentry/babel-plugin-component-annotate" "2.22.5" + "@sentry/babel-plugin-component-annotate" "2.22.6" "@sentry/cli" "^2.36.1" dotenv "^16.3.1" find-up "^5.0.0" @@ -2366,12 +2366,12 @@ dependencies: "@sentry/types" "7.119.2" -"@sentry/webpack-plugin@2.22.5": - version "2.22.5" - resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.22.5.tgz#aafb3e526954b72759bae38bb34edecf55e68142" - integrity sha512-D8irs8H0IuLZbCS0Te5zsYGu9sABmMJTfCCkRkf7fV8S0BQZQmxnQGf9cVxcTj07RWAgnhhUtsRQzkK7MLuIwg== +"@sentry/webpack-plugin@2.22.6": + version "2.22.6" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.22.6.tgz#8c9d27d5cd89153a5b6e08cc9dcb3048b122ffbc" + integrity sha512-BiLhAzQYAz/9kCXKj2LeUKWf/9GBVn2dD0DeYK89s+sjDEaxjbcLBBiLlLrzT7eC9QVj2tUZRKOi6puCfc8ysw== dependencies: - "@sentry/bundler-plugin-core" "2.22.5" + "@sentry/bundler-plugin-core" "2.22.6" unplugin "1.0.1" uuid "^9.0.0" From 4fa49a924b0b574160d594b0a627b8a9f2f56dcd Mon Sep 17 00:00:00 2001 From: riccio82 Date: Fri, 18 Oct 2024 16:26:28 +0200 Subject: [PATCH 03/24] Update webpack --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b2532de0e7..7f7c12d3f1 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "sass-loader": "16.0.2", "style-loader": "4.0.0", "undici": "^5.28.2", - "webpack": "5.94.0", + "webpack": "5.95.0", "webpack-cli": "5.1.4", "webpack-concat-files-plugin": "^0.5.2", "whatwg-fetch": "^3.6.20" diff --git a/yarn.lock b/yarn.lock index 9cea9a36e5..b23b58a511 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8063,10 +8063,10 @@ webpack-virtual-modules@^0.5.0: resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz#362f14738a56dae107937ab98ea7062e8bdd3b6c" integrity sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw== -webpack@5.94.0: - version "5.94.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f" - integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg== +webpack@5.95.0: + version "5.95.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.95.0.tgz#8fd8c454fa60dad186fbe36c400a55848307b4c0" + integrity sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q== dependencies: "@types/estree" "^1.0.5" "@webassemblyjs/ast" "^1.12.1" From 6a7fd8dd86c6e80e74406ba5a67e0c76190fa982 Mon Sep 17 00:00:00 2001 From: riccio82 Date: Mon, 21 Oct 2024 17:02:24 +0200 Subject: [PATCH 04/24] Webpack optimizations --- package.json | 5 +-- webpack.config.js | 12 +++++-- yarn.lock | 90 +++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 100 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 5c59a8e46c..7f22328b07 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "classnames": "^2.2.6", "diff-match-patch": "^1.0.5", "draft-js": "^0.11.4", + "file-saver": "^2.0.5", "flux": "^4.0.1", "immutability-helper": "^3.1.1", "immutable": "^4.0.0-rc.12", @@ -43,8 +44,7 @@ "react-tagsinput": "^3.19.0", "react-transition-group": "^4.2.2", "react-virtual": "^2.10.4", - "sprintf-js": "^1.1.2", - "file-saver": "^2.0.5" + "sprintf-js": "^1.1.2" }, "devDependencies": { "@babel/core": "7.25.2", @@ -84,6 +84,7 @@ "style-loader": "4.0.0", "undici": "^5.28.2", "webpack": "5.95.0", + "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "5.1.4", "webpack-concat-files-plugin": "^0.5.2", "whatwg-fetch": "^3.6.20" diff --git a/webpack.config.js b/webpack.config.js index aa04c80c2b..9f53c80163 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,6 +9,8 @@ const {sentryWebpackPlugin} = require('@sentry/webpack-plugin') const https = require('https') const fs = require('fs') const ini = require('ini') +// const BundleAnalyzerPlugin = +// require('webpack-bundle-analyzer').BundleAnalyzerPlugin const buildPath = './public/build/' const lxqDownload = './public/buildResources/' @@ -127,6 +129,9 @@ const matecatConfig = async ({env}, {mode}) => { optimization: { moduleIds: 'deterministic', runtimeChunk: 'single', + splitChunks: { + chunks: 'all', + }, }, module: { rules: [ @@ -257,14 +262,12 @@ const matecatConfig = async ({env}, {mode}) => { errorPage: [path.resolve(__dirname, 'public/css/sass/upload-main.scss')], }, plugins: [ + // new BundleAnalyzerPlugin({analyzerMode: 'static'}), new webpack.DefinePlugin({ 'process.env._ENV': JSON.stringify(config.ENV), 'process.env.version': JSON.stringify(config.BUILD_NUMBER), 'process.env.MODE': JSON.stringify(mode), }), - !isDev && - pluginConfig.sentryWebpackPlugin && - sentryWebpackPlugin(pluginConfig.sentryWebpackPlugin), new WebpackConcatPlugin({ bundles: [ { @@ -567,6 +570,9 @@ const matecatConfig = async ({env}, {mode}) => { publicPath: '/public/build/', xhtml: true, }), + !isDev && + pluginConfig.sentryWebpackPlugin && + sentryWebpackPlugin(pluginConfig.sentryWebpackPlugin), ], devtool: isDev ? 'inline-source-map' : 'source-map', } diff --git a/yarn.lock b/yarn.lock index b23b58a511..b5bc8972b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1480,7 +1480,7 @@ "@types/tough-cookie" "^4.0.5" tough-cookie "^4.1.4" -"@discoveryjs/json-ext@^0.5.0": +"@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.0": version "0.5.7" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== @@ -1979,6 +1979,11 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@polka/url@^1.0.0-next.24": + version "1.0.0-next.28" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.28.tgz#d45e01c4a56f143ee69c54dd6b12eade9e270a73" + integrity sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw== + "@radix-ui/primitive@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.1.0.tgz#42ef83b3b56dccad5d703ae8c42919a68798bbe2" @@ -2867,11 +2872,23 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== +acorn-walk@^8.0.0: + version "8.3.4" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" + acorn-walk@^8.0.2: version "8.3.2" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== +acorn@^8.0.4, acorn@^8.11.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.13.0.tgz#2a30d670818ad16ddd6a35d3842dacec9e5d7ca3" + integrity sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w== + acorn@^8.1.0, acorn@^8.7.1, acorn@^8.8.1, acorn@^8.8.2: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" @@ -3529,6 +3546,11 @@ commander@^2.20.0, commander@^2.20.3: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" @@ -3718,6 +3740,11 @@ date-fns@^3.6.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz#f20ca4fe94f8b754951b24240676e8618c0206bf" integrity sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww== +debounce@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5" + integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug== + debug@4, debug@^4.1.0: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -3919,6 +3946,11 @@ draft-js@^0.11.4: immutable "~3.7.4" object-assign "^4.1.1" +duplexer@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" @@ -4824,6 +4856,13 @@ graphql@^16.8.1: resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f" integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw== +gzip-size@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" + integrity sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q== + dependencies: + duplexer "^0.1.2" + has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -4887,7 +4926,7 @@ html-encoding-sniffer@^3.0.0: dependencies: whatwg-encoding "^2.0.0" -html-escaper@^2.0.0: +html-escaper@^2.0.0, html-escaper@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== @@ -6238,6 +6277,11 @@ moment@^2.29.4: resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== +mrmime@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-2.0.0.tgz#151082a6e06e59a9a39b46b3e14d5cfe92b3abb4" + integrity sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw== + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -6437,6 +6481,11 @@ onetime@^7.0.0: dependencies: mimic-function "^5.0.0" +opener@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + optionator@^0.9.3: version "0.9.4" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" @@ -7325,6 +7374,15 @@ signal-exit@^4.0.1, signal-exit@^4.1.0: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== +sirv@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-2.0.4.tgz#5dd9a725c578e34e449f332703eb2a74e46a29b0" + integrity sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ== + dependencies: + "@polka/url" "^1.0.0-next.24" + mrmime "^2.0.0" + totalist "^3.0.0" + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -7686,6 +7744,11 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== + tough-cookie@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" @@ -8008,6 +8071,24 @@ webidl-conversions@^7.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== +webpack-bundle-analyzer@^4.10.2: + version "4.10.2" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.2.tgz#633af2862c213730be3dbdf40456db171b60d5bd" + integrity sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw== + dependencies: + "@discoveryjs/json-ext" "0.5.7" + acorn "^8.0.4" + acorn-walk "^8.0.0" + commander "^7.2.0" + debounce "^1.2.1" + escape-string-regexp "^4.0.0" + gzip-size "^6.0.0" + html-escaper "^2.0.2" + opener "^1.5.2" + picocolors "^1.0.0" + sirv "^2.0.3" + ws "^7.3.1" + webpack-cli@5.1.4: version "5.1.4" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" @@ -8223,6 +8304,11 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" +ws@^7.3.1: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + ws@^8.11.0: version "8.17.1" resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" From b59cc193e30da00fee58eedac5d0fcc326fba92e Mon Sep 17 00:00:00 2001 From: riccio82 Date: Mon, 21 Oct 2024 18:16:59 +0200 Subject: [PATCH 05/24] Sentry: set release name --- webpack.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 9f53c80163..77ad5968df 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -104,9 +104,9 @@ const matecatConfig = async ({env}, {mode}) => { pluginConfig = {...pluginConfig, ...pluginWebpackConfig} }) if (pluginConfig.sentryWebpackPlugin) { - pluginConfig.sentryWebpackPlugin.release = JSON.stringify( - config.BUILD_NUMBER, - ) + pluginConfig.sentryWebpackPlugin.release = { + name: JSON.stringify(config.BUILD_NUMBER), + } console.log('Sentry release', pluginConfig.sentryWebpackPlugin.release) } return { From 61cb7e55726398638a926fab6862c7a26916f478 Mon Sep 17 00:00:00 2001 From: riccio82 Date: Tue, 22 Oct 2024 15:44:48 +0200 Subject: [PATCH 06/24] Clean common.scss --- lib/View/templates/_upload.html | 2 - lib/View/templates/_xliffToTarget.html | 2 - public/css/sass/activity-log-main.scss | 1 - public/css/sass/cattool.scss | 184 - public/css/sass/common-main.scss | 1 + public/css/sass/common-modals.scss | 56 - public/css/sass/common.scss | 3333 +---------------- public/css/sass/commons/_analyze.scss | 74 - public/css/sass/commons/_icons.scss | 21 - public/css/sass/commons/_manage.scss | 71 - public/css/sass/components/CattolFooter.scss | 11 + public/css/sass/components/Footer.scss | 78 + .../css/sass/components/header/FilesMenu.scss | 13 - public/css/sass/editlog.scss | 3 +- public/css/sass/legacy-misc.scss | 65 - public/css/sass/mbc-style.scss | 2 - public/css/sass/modals/split_modal.scss | 11 - public/css/sass/popup.scss | 61 +- public/css/sass/quality-report.scss | 6 - public/css/sass/style.scss | 308 +- public/css/sass/upload-main.scss | 65 +- public/css/sass/upload-page.scss | 46 - .../es6/components/header/ActionMenu.js | 3 - .../segments/SegmentPlaceholderLite.js | 9 - .../components/segments/SegmentsContainer.js | 9 - public/js/lib/jquery.tablesorter.js | 2727 -------------- public/js/lib/jquery.tablesorter.min.js | 4 - public/js/lib/jquery.tablesorter.widgets.js | 2963 --------------- public/js/upload_main.js | 1 - 29 files changed, 191 insertions(+), 9939 deletions(-) create mode 100644 public/css/sass/components/Footer.scss delete mode 100644 public/js/lib/jquery.tablesorter.js delete mode 100644 public/js/lib/jquery.tablesorter.min.js delete mode 100644 public/js/lib/jquery.tablesorter.widgets.js diff --git a/lib/View/templates/_upload.html b/lib/View/templates/_upload.html index 87cafb8838..dcfb7525ee 100755 --- a/lib/View/templates/_upload.html +++ b/lib/View/templates/_upload.html @@ -585,8 +585,6 @@
-
-
diff --git a/lib/View/templates/_xliffToTarget.html b/lib/View/templates/_xliffToTarget.html index 7f42173acd..bc67138f3b 100644 --- a/lib/View/templates/_xliffToTarget.html +++ b/lib/View/templates/_xliffToTarget.html @@ -372,8 +372,6 @@
-
-
diff --git a/public/css/sass/activity-log-main.scss b/public/css/sass/activity-log-main.scss index 6448c2c3dc..8a75b6c8cc 100644 --- a/public/css/sass/activity-log-main.scss +++ b/public/css/sass/activity-log-main.scss @@ -1,4 +1,3 @@ -@import 'variables'; @import 'upload-main'; .activity-log-content { diff --git a/public/css/sass/cattool.scss b/public/css/sass/cattool.scss index 0e463512b9..3915a2cf67 100644 --- a/public/css/sass/cattool.scss +++ b/public/css/sass/cattool.scss @@ -45,190 +45,6 @@ body.cattool { } } - .stats-foo { - //height: 44px; - background-color: $white; - width: 100%; - //position: fixed; - bottom: 0; - left: 0; - z-index: 2; - display: grid; - min-width: 1024px; - - /* .footer-body { - display: grid; - position: relative; - grid-column-gap: 10px; - grid-template-columns: - minmax(80px, 120px) minmax(80px, 420px) minmax(140px, 350px) - minmax(172px, 0.2fr) minmax(116px, 0.2fr) minmax(316px, 0.4fr); - align-items: center; - padding: 0 12px 0 14px; - height: 44px; - - .item { - position: relative; - font-size: 14px; - font-weight: bold; - font-style: normal; - font-stretch: normal; - line-height: 1.5; - color: black; - - .common-tooltip { - font-weight: normal; - span { - max-width: none; - } - } - - p { - margin: 0; - float: none; - - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - #job_id { - text-align: left; - } - - &.language { - display: grid; - justify-self: end; - } - - .to-arrow { - font-size: 14px; - font-weight: bold; - color: #999999; - } - - #stat-todo { - font-weight: bold; - font-size: 14px; - - span { - color: black; - text-decoration: underline; - &:hover { - text-decoration: none; - } - } - } - - #job_id { - font-weight: 200; - font-size: 14px; - } - - .statistics-core { - font-size: 14px; - font-weight: 200; - - a { - span { - color: black; - text-decoration: underline; - &:hover { - text-decoration: none; - } - } - } - } - } - - .progress-bar .progr { - position: relative; - display: grid; - grid-template-columns: 1fr 44px; - grid-column-gap: 8px; - - .percent { - font-weight: 600; - } - - .common-tooltip { - left: calc(50% - 22px); - span { - max-width: none; - } - } - - .meter { - margin: 0 !important; - height: auto; - - @-webkit-keyframes move-bg { - from { - -webkit-transform: translateX(0); - } - to { - -webkit-transform: translateX(46px); - } - } - - @keyframes move-bg { - from { - transform: translateX(0); - } - to { - transform: translateX(46px); - } - } - - .bg-loader { - position: absolute; - left: -46px; - right: 0; - top: 0; - bottom: 0; - z-index: 1; - - background: -webkit-repeating-linear-gradient( - 110deg, - #e8e8e8 0px, - #e8e8e8 10px, - #d8d8d8 0px, - #d8d8d8 20px - ); - background: repeating-linear-gradient( - 110deg, - #e8e8e8 0px, - #e8e8e8 10px, - #d8d8d8 0px, - #d8d8d8 20px - ); - - -webkit-animation-name: move-bg; - -webkit-animation-duration: 0.8s; - -webkit-animation-timing-function: linear; - -webkit-animation-iteration-count: infinite; - - animation-name: move-bg; - animation-duration: 0.8s; - animation-timing-function: linear; - animation-iteration-count: infinite; - } - - a { - &:after { - background-image: none; - } - } - } - } - .statistics-details { - display: grid; - grid-template-columns: minmax(144px, 0.4fr) minmax(168px, 0.6fr); - grid-column-gap: 4px; - justify-self: end; - } - } */ - } .pointer-first-segment { height: 36px; width: 36px; diff --git a/public/css/sass/common-main.scss b/public/css/sass/common-main.scss index 46871adc5d..b52a3b94a2 100644 --- a/public/css/sass/common-main.scss +++ b/public/css/sass/common-main.scss @@ -1,6 +1,7 @@ @import 'commons/colors'; @import "commons/typography"; @import 'commons/matecat_fonts'; + @import 'popup'; @import 'common-modals'; @import 'notifications'; diff --git a/public/css/sass/common-modals.scss b/public/css/sass/common-modals.scss index ca981ead20..1a7a92cae9 100644 --- a/public/css/sass/common-modals.scss +++ b/public/css/sass/common-modals.scss @@ -232,8 +232,6 @@ a.ui.primary.right.floated.button.tiny.register-ok { color: $linkBlue; } -.preferences-modal input[type='text'], -.preferences-modal input[type='password'], .dqf-modal input[type='text'], .dqf-modal input[type='password'], .login-container-left input, @@ -300,15 +298,6 @@ a.ui.primary.right.floated.button.tiny.register-ok { padding: 20px 0; } -.preferences-modal input:disabled { - color: #999; - cursor: not-allowed; - background: $grey2; -} - -.preferences-modal .reset-password { - margin-right: 20px; -} .forgot-password-modal { background: url(/public/img/matecat_watch-left-border.png) no-repeat -34px 136px; @@ -327,19 +316,6 @@ a.ui.primary.right.floated.button.tiny.register-ok { width: 80%; } -.register-modal { - padding: 25px 15%; - text-align: center; -} - -.register-modal h2 { - padding: 10px 0 10px 0; -} - -.register-modal .google-login-button { - margin-bottom: 0; -} - .preference-modal-message { box-shadow: 0 2px 2px #e2e2e2; border-radius: 2px; @@ -560,17 +536,6 @@ a.ui.primary.right.floated.button.tiny.register-ok { } } -.preferences-modal { - text-align: left; -} - -.preferences-modal h2 { - margin: 0; - padding: 0 0 0 15px; - font-size: 20px; - font-family: 'Calibri', 'Helvetica Neue', Arial, Helvetica, sans-serif; -} - .user-link { float: left; clear: both; @@ -607,16 +572,6 @@ a.ui.primary.right.floated.button.tiny.register-ok { border: 1px solid #666; } -.matecat-modal-content .btn-confirm-medium:hover, -.matecat-modal-content .btn-confirm-small:hover { - cursor: pointer; - box-shadow: - 0 0 0 #e0e0e0, - 0 0 2px rgba(0, 0, 0, 0.12), - 0 2px 4px rgba(0, 0, 0, 0.24) !important; - color: #ffffff; -} - .matecat-modal-content .btn-confirm-medium:active { box-shadow: none !important; } @@ -965,17 +920,6 @@ a.ui.primary.right.floated.button.tiny.register-ok { } } -.register-modal { - .form-divider { - margin-top: 25px; - margin-bottom: 10px; - } - - .condition-google { - font-size: 12px; - } -} - .form-divider { width: 100%; margin: 0 auto; diff --git a/public/css/sass/common.scss b/public/css/sass/common.scss index 5bbce9f73c..c1d2cd02f5 100644 --- a/public/css/sass/common.scss +++ b/public/css/sass/common.scss @@ -61,2803 +61,118 @@ ul { margin-left: 13px; } -.normal-foo { - background-color: $grey4; - min-width: 992px; - width: 100%; - .footer-body { - display: grid; - position: relative; - grid-column-gap: 24px; - padding: 12px 64px; - //grid-template-columns: minmax(auto,440px) auto; - grid-template-columns: minmax(auto, 440px) auto minmax(auto, 440px); - align-items: center; - .info { - display: grid; - align-items: center; - grid-template-columns: 40px auto; - grid-column-gap: 8px; - .image { - display: flex; - align-items: center; - } - .logo { - background-position: center; - background-size: cover; - } - .description { - color: $grey1; - font-weight: 100; - font-size: 12px; - text-align: left; - line-height: 14px; - .link { - color: #00aee4; - text-decoration: underline; - } - } - } - } - .side-info { - margin-top: 4px; - display: flex; - align-items: center; - box-shadow: none; - justify-content: center; - .item { - padding: 0 20px; - display: flex; - gap: 5px; - a { - margin: 0; - color: $grey1; - text-align: left; - font-size: 16px; - font-weight: bold; - text-decoration: none; - display: flex; - align-items: center; - &.email-link { - color: #fff; - background-color: $grey1; - padding: 6px 24px; - border-radius: 2px; - &:hover { - background-color: $grey6; - } - } - } - } - } - .footer-logo { - display: flex; - justify-content: end; - a { - display: flex; - align-items: center; - } - } -} - -footer p { - margin: 0 5px 0 0; - padding: 0; - float: left; -} - -footer ul { - margin: -5px 0 0 0; - padding: 0; - float: left; - /* border-right: 1px solid #333; */ -} - -footer nav ul, -footer ul.external-links { - border-right: none; -} - -footer nav ul li { - margin-left: 4px; -} -footer .wrapper nav ul li:last-child { - border-right: none; -} - -footer li { - margin: 0 0px 0 0; - padding: 5px 5px; - float: left; -} -footer nav li, -footer ul.external-links li { - height: 18px; - padding-top: 0px; - border-right: 1px solid #fff; - margin-top: 5px; -} - -ul.statistics-details { - margin: 0 auto; - overflow: hidden; - width: 33%; - float: none; - border: none; - height: unset; -} - -ul.statistics-details li { - border-right: 1px solid #fff; - border-left: 1px solid #fff; - padding-top: 0px; - height: 16px; -} - -ul.statistics-details li:first-child { - border-right: none; -} - -a[class^='edit_'] span { - text-decoration: underline; -} - -a[class^='edit_'] { - text-decoration: none; -} - -a.edit_1:before { - color: $translatedBlue; -} - -a.edit_2:before { - color: #ffcc00; -} - -a.edit_3:before { - color: #ff5656; -} - -a[class^='edit_']:before { - content: 'a'; - content: ' \25CF'; - text-decoration: none; - padding-right: 3px; -} - -footer nav li:first-child { - border-left: none; -} - -footer ul.external-links li:last-child { - border-right: none; -} - -footer nav { - float: right; -} - -footer a, -footer #stat-todo span { - text-shadow: none; - font-weight: 100; - cursor: pointer; - color: black; -} -#stat-eqwords strong { - font-weight: bold; -} - -footer a:hover { - text-decoration: none; - //color: #ffffff; -} - -/*footer .wrapper -{ - text-align: right; -}*/ - -.editlog { - margin-right: 23px; -} - -/*stats*/ -footer #statistics { -} - -#stat-quality { - margin-left: 10px; -} - -#stat-quality .quality { - color: rgb(255, 87, 75); -} - -.pull-left { - float: left !important; -} - -.pull-right { - float: right !important; -} - -.stats { - display: none; - width: 460px; - height: 220px; - background-color: #fff; - z-index: 99999999; - position: fixed; - bottom: 33px; - right: 60px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border: 1px solid #000; - text-align: left; - padding: 0; - text-shadow: none; - font-size: 14px; - -moz-box-shadow: 0 0 5px #888; - -webkit-box-shadow: 0 0 5px #000; - box-shadow: 0 0 5px #000; - color: #000; -} - -.iepopup.nobrowser { - width: 1200px; - margin: 0 auto; - overflow: hidden; - box-shadow: none; - border: none; -} - -.iepopup .logoblack { - background-size: 200px auto; - width: 200px; - height: 50px; -} - -.titleie h1 { - font-size: 44px; - margin: 0px; -} - -.titleie h2 { - margin: 0px; - font-weight: normal; -} - -.iepopup.nobrowser ul li { - display: inline-block; - margin: 20px; -} - -.iepopup .col-2 { - width: 46%; - padding: 0%; - margin-top: 50px; - min-height: 400px; - margin-right: 4%; - line-height: 40px; - box-shadow: 0px 2px 3px #e9e9e9; - border-radius: 2px; - border: 1px solid #ccc; -} - -.iepopup .col-2:last-child { - margin-right: 0px; -} - -.iepopup .col-2:hover { - border: 1px solid #3aa9dd; - box-shadow: 0px 0px 3px #3aa9dd; -} - -.button-learn { - width: 100% !important; - padding: 2% 4%; - font-size: 28px !important; - background: #3aa9dd; - border: none !important; - border-radius: 4px; - text-decoration: none; - color: #fff !important; - border-bottom: 3px solid #1b5d7b !important; -} - -.button-learn-2 { - background: none repeat scroll 0% 0% #f4f4f4; - position: relative; - border-width: 1px 1px 3px !important; - border-style: solid !important; - border-color: #e4e4e4 #e4e4e4 #ccc !important; - -moz-border-top-colors: none !important; - -moz-border-right-colors: none !important; - -moz-border-bottom-colors: none !important; - -moz-border-left-colors: none !important; - border-image: none !important; - color: #333 !important; - font-size: 28px !important; - text-decoration: none; - width: 280px !important; - padding: 20px 75px; - height: 30px; - border-radius: 4px; -} - -.col-b .button-learn-2:hover { - color: #3aa9dd !important; -} - -.col-2.col-b .button-learn-2 img { - width: 100px; - position: absolute; - top: -110px; - right: 0px; -} - -.col-b h3 { - margin-bottom: 125px; -} - -.iepopup { - width: 800px; - margin: 30px auto; - padding: 30px 0 30px 0; - display: block; - z-index: 999999; - background: #fff; - box-shadow: 0px 0px 5px #ccc; - border-radius: 2px; - font-size: 18px; - border: 1px solid #ccc; -} - -.iepopup img { - border: 0; -} - -.iepopup ul a { - padding: 0px 0 0 0; - color: #39699a; - text-decoration: underline; -} - -.iepopup a:hover { - text-decoration: none; -} - -.logoblack { - border: 0; - background: url(../../img/logo_matecat_big.svg) 0px 2px no-repeat; - display: block; - width: 145px; - height: 31px; - background-size: 130px 28px; - clear: both; - margin: 0 auto 10px auto; -} - -.nobrowser #outer, -.nobrowser header, -.nobrowser footer, -.nobrowser .wrapper { - display: none !important; -} - -.iepopup p { - line-height: 27px; -} - -/* mgmt panel */ - -.mgmt-panel-tm .tablestats, -.mgmt-panel.gl { - display: block; -} - -/*end mgmt panel */ - -/* dropdown menu profile */ - -.wrapper-dropdown-5.logged { - padding: 8px 20px 20px 10px; -} - -.logged .dropdown-icon img { - border: 1px solid #555; -} - -.userinfo { - padding: 0; - border-bottom: 1px solid #999; - color: #ccc; - margin: 0 auto; - overflow: hidden; -} - -.userinfo a { - border-bottom: none !important; - font-weight: bold; - float: left; - color: #333 !important; - margin-right: 4px; -} - -.dropdown span { - margin-right: 11px; - margin-top: 2px; - float: left; - position: relative; -} - -.dropdown .cancel span { - margin-right: 13px; -} - -.deleteTM span { - margin-right: 11px; - font-size: 16px; - margin-left: 2px; -} - -#loginlink { - color: #fff; -} - -.login-info { - padding: 6px 0; - color: #fff; -} - -.dropdown-icon { - /* Little arrow */ - width: 23px; - height: 21px; -} - -.dropdown-icon .icon-paw { - font-size: 1.5em; - margin-right: 10px; -} - -.dropdown .icon-stack-exchange { - font-size: 1.1em; - margin-top: -1px; -} - -/* No CSS3 support */ - -.no-opacity .wrapper-dropdown-1 .dropdown, -.no-pointerevents .wrapper-dropdown-1 .dropdown { - display: none; - opacity: 1; /* If opacity support but no pointer-events support */ - pointer-events: auto; /* If pointer-events support but no pointer-events support */ -} - -.no-opacity .wrapper-dropdown-1.active .dropdown, -.no-pointerevents .wrapper-dropdown-1.active .dropdown { - display: block; -} - -.needtobelogged { - height: 150px; - text-align: center; - padding: 15px 5px; - color: #333; -} - -/*end dropdown menu profile */ - -/*.topMenu ul li { - box-shadow: 0 0 0 #e0e0e0, 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.24) !important; - background: #fff; -}*/ - -.topMenu ul li a { - text-decoration: none; - color: #333; - padding: 13px 10px 10px 22px; - display: block; - background-size: 24px; - -webkit-transition: all 100ms ease-in; - -moz-transition: all 100ms ease-in; -} - -.topMenu ul li.current a { - font-weight: bold; - border-left: 3px solid #ffcc00; -} - -.topMenu ul li a:hover { - background: #f2f4f7; -} - -.tooltip { - cursor: help; - position: absolute; - border: 1px solid #717171; - border-radius: 20px; - width: 13px !important; - font-size: 13px; - height: 11px; - font-weight: bold; - padding-left: 0px; - padding-top: 2px; - margin-top: -3px; - line-height: 11px; - background: #fbf3aa; - margin-left: 5px; - color: #717171; - box-shadow: 1px 1px 1px #999; -} - -.tooltip:hover span { - opacity: 1; - top: -90px; -} - -.tooltip span { - width: 200px; - height: auto; - line-height: 22px; - color: #333; - padding: 10px; - left: -98px; - font-weight: 400; - font-size: 15px; - text-align: center; - border: 1px solid #727272; - background: #fff8ba; - text-indent: 0px; - border-radius: 5px; - position: absolute; - pointer-events: none; - top: -110px; - opacity: 0; - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4); - -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4); - -moz-box-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4); - -webkit-transition: all 0.3s ease-in-out; - -moz-transition: all 0.3s ease-in-out; - -o-transition: all 0.3s ease-in-out; - -ms-transition: all 0.3s ease-in-out; - transition: all 0.3s ease-in-out; - z-index: 1000000000000000; -} - -.tooltip span:before, -.tooltip span:after { - content: ''; - position: absolute; - bottom: -11px; - left: 43%; - width: 0; - height: 0; - border-left: 10px solid transparent; - border-right: 10px solid transparent; - border-top: 10px solid #727272; -} - -.tooltip span:after { - bottom: -10px; - margin-left: -1px; - border-top: 10px solid #fff8ba; -} - -.mgmt-table-tm .boxed { - border-radius: 4px; - border: 1px dashed #ccc; - padding: 10px; - margin-bottom: 20px; - background: #f7f7f7; -} - -#editlog-boxed { - border-radius: 4px; - border: 1px dashed #ccc; - padding: 10px; - margin-bottom: 10px; - margin-top: 15px; - background: #f7f7f7; - font-size: 17px; -} - -#contextMenu { - position: absolute; - display: none; - background: white; - z-index: 999; - border: 1px solid #999; - width: 200px; - padding: 3px; -} - -#contextMenu li { - text-align: left; - padding: 3px; - font-size: 80%; -} - -#contextMenu li:hover { - background: #eee; - cursor: pointer; -} - -#contextMenu .shortcut { - float: right; -} - -/*popup*/ -.modal[data-type='view'] { - display: none; -} - -.popup-outer { - background: #000; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 12; - opacity: 0.4; -} - -.popup { - overflow: hidden; - line-height: 30px; - border-radius: 0 0 4px 4px; - color: #000 !important; - /*margin: -200px 0 0 -250px;*/ - padding: 0 0px 20px 0px; - /*position: fixed;*/ - top: 50%; - left: 50%; - z-index: 999999999999999999999999999; -} - -.popup.popup-alert:hover { - background-color: #fff; -} - -.modal .popup p.waiting { - background: url(../../img/loading.gif) 38% 3px no-repeat !important; - background-size: 24px !important; -} - -/********** TM panel **********/ - -.slide-panel { - height: 100% !important; - width: 1024px; - margin: 0 auto; - overflow-x: hidden; - overflow-y: auto; - position: fixed; - z-index: 12; - top: 0; - right: -1100px; - background: #fff; -} - -.mymemory-descr { - margin-left: 7px; - width: 100%; - color: #666; -} - -.dqf-settings { - font-weight: bold; - text-decoration: underline; - cursor: pointer; -} - -/********** TM panel End **********/ - -span.notify { - margin-top: 10px; -} - -.action .dropdown a.disabled { - opacity: 1 !important; - color: #b5b5b5 !important; - border: none; - border-bottom: 1px solid #e6e8ea !important; - background: #f1f1f1 !important; -} - -td.addtmxtd { - width: 804px; -} - -input.email-export { - width: 180px; - margin-left: 10px !important; -} - -.downloading .uploadloader { - display: block; - z-index: 10; -} - -.downloading .uploadloader { - right: 130px; - margin-top: -2px; - background-size: 15px; - background-color: #d6d6d6; -} - -.uploadloader { - background: url(../../img/loader.gif) center center no-repeat; - width: 20px; - height: 20px; - float: right; - margin-top: 3px; - position: absolute; - right: 233px; - background-size: 20px 20px; -} - -.pending .uploadloader { - display: block !important; - position: relative; - float: left; - top: inherit; - margin-top: 0; - right: inherit; -} - -.continuebtn, -.continuebtn:hover { - background: #7eaf3e; -} - -.mgmt-table-mt td.action .btn { - border-radius: 2px; -} - -.mgmt-table-mt th.description { - width: 40%; -} - -th.enable-mt { - width: 190px; -} - -/*#inactivetm td.action .addtmx { - display: none; -}*/ -#activetm tr:hover td { - background: #f1f8fc; -} - -#inactivetm tr:hover td { - background: #f8f8f8; -} - -form.add-TM-Form { - display: inline; - padding: 5px 0 10px; - margin: 0 0 0 10px; -} - -#uploadCallback { - display: none; -} - -#activetm tr.new .error { - display: none; - float: left; - width: 80%; - color: #f00; - position: relative; -} - -.notify td { - background: #fffa8b !important; - padding: 5px 25px; - text-align: right; -} - -#activetm tr.new .error span { - display: none; - width: 100%; - line-height: 100%; - float: left; - margin-bottom: 6px; -} - -.tm-error-key, -.tm-error-grants { - height: auto; - line-height: 22px; - padding: 10px; - font-weight: 400; - font-size: 15px; - text-align: center; - border: 4px solid #fff; - background: rgba(255, 255, 255, 1); - text-indent: 0px; - opacity: 0.9; - border-radius: 5px; - position: absolute; - pointer-events: none; - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4); - -webkit-transition: all 0.3s ease-in-out; - -moz-transition: all 0.3s ease-in-out; - -o-transition: all 0.3s ease-in-out; - -ms-transition: all 0.3s ease-in-out; - transition: all 0.3s ease-in-out; -} - -.tm-error-grants { - width: 200px !important; - left: -175px; - top: -130px; -} - -.tm-error-key { - width: 200px; - left: -5px; - top: -50px; -} - -.tm-error-key:before, -.tm-error-key:after, -.tm-error-grants:before, -.tm-error-grants:after { - content: ''; - position: absolute; - width: 0; - height: 0; - border-left: 10px solid transparent; - border-right: 10px solid transparent; - border-top: 10px solid rgba(0, 0, 0, 0.1); -} - -.tm-error-key:before, -.tm-error-key:after { - bottom: -15px; - left: 43%; -} - -.tm-error-grants:before, -.tm-error-grants:after { - bottom: -15px; - left: 43%; -} - -.tm-error-grants:after { - bottom: -14px; - margin-left: -1px; - border-top: 10px solid #fff; -} - -.tm-error-key:after { - bottom: -14px; - margin-left: -1px; - border-top: 10px solid #fff; -} - -.popup p { - font-size: 18px; -} - -.popup h1, -.popup-tm h1, -.popup-languages.slide h1, -.slide-panel h1 { - overflow: visible; - max-height: inherit; - font-size: 24px; - background: #002b5c url(../../img/logo_matecat_small_white.svg) 16px 12px - no-repeat; - padding: 10px 10px 7px 68px; - background-size: 40px; - /*border-bottom: 1px solid #000;*/ - color: #fff; - margin: 0 !important; - text-align: left; -} - -.popup-tm h1, -.popup-languages.slide h1 { - height: 60px; - padding: 10px 13px 7px 58px; -} - -.popup h2 { - font-weight: normal; - font-size: 24px; - color: black; - display: block; - margin: 20px 0 20px 0; -} - -.popup a.anonymous { - font-size: 12px; -} - -.popup a.anonymous:visited, -.popup a.anonymous:active { - color: black; -} - -.popup-confirm .btn-ok { - /* TODO REVIEW this rule breaks the popup button alignment in confirm change language after file conversion */ - /*float: left;*/ - margin-left: 10px; -} - -.popup .inner { - width: 45px; - border-right: 1px solid #003366; - border-radius: 0 0 0 6px; -} - -.popup .login-button { - width: 330px; - font-weight: normal; - padding: 8px 0 8px 45px; - text-align: center; - color: #fff; - font-size: 16px !important; - text-shadow: 0 -1px 0 #003366; - background: transparent; - border: none; - cursor: pointer; -} - -.popup .x-popup, -.mgmt-panel .x-popup, -.slide-panel .x-popup { - color: #fff; - text-decoration: none; - display: block; - height: 30px; - font-size: 20px; - padding-top: 2px; - float: right; - margin: 0; - background-size: 22px; -} - -.popup .x-popup:hover, -.slide-panel .x-popup:hover, -.x-popup2:hover { - color: $darkBlueTransparent; -} - -.x-popup:hover { - color: $darkBlueTransparent; -} - -.mgmt-panel .x-popup { - right: 130px; - margin-top: 10px; -} - -.uploadtm.disabled { - background: $translatedBlue !important; -} - -.popup .btn-ok, -.popup .btn-cancel { - padding: 1px 18px; - margin: 16px 0 16px 20px; - display: inline-block; -} - -.mgmt-panel-tm .btn-ok, -.mgmt-panel-gl .btn-ok, -.popup .btn-ok, -.popup .btn-cancel, -.slide-panel .btn-ok, -.slide-panel .btn-cancel, -.uploadtm.disabled, -.download-manage.btn-ok { - color: #fff; - background: $translatedBlue; - //border: 1px solid #797979; - font-weight: bold; - text-decoration: none; - padding: 8px 18px; - border-radius: 2px; - font-size: 18px; - cursor: pointer; - border: 0; - line-height: 18px; -} - -.btn-cancel.in-popup { - padding: 7px 18px !important; -} - -.hide { - display: none; -} - -.slide-panel.open tr.hide { - display: none !important; -} - -.btn-grey { - font-weight: bold; - text-decoration: none; - padding: 8px 18px; - margin: 0 5px; - border-radius: 2px; - font-size: 18px; - color: #333; - background: #f6f6f6; - background: -webkit-gradient( - linear, - left top, - left bottom, - from(#f6f6f6), - to(#e2e3e5) - ); - background: -moz-linear-gradient(top, #f6f6f6, #e2e3e5); - background: linear-gradient(top, #f6f6f6, #e2e3e5); - line-height: 20px; -} - -#sign-in-o, -#sign-in-o-mt { - padding: 10px 10px 0px; - margin: 0 auto; - width: 200px; - text-align: center; - float: none !important; -} - -#sign-in-o-mt { - width: 290px; -} - -.popup .btnsplit .btn-cancel { - margin: 0; -} - -.popup .btn-cancel, -.btn-grey, -.slide-panel .btn-cancel, -.btn-grey { - color: $grey2; - background: white; - //background: -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e2e3e5)); - //background: -moz-linear-gradient(top, #f6f6f6, #e2e3e5); - //background: linear-gradient(top, #f6f6f6, #e2e3e5); -} - -.dont_show + label { - font-size: 16px; -} - -.slide-panel h1 .btn-ok, -.slide-panel h1 .btn-cancel { - padding: 0px 18px; -} - -.mgmt-panel-tm .btn-ok:hover, -.mgmt-panel-gl .btn-ok:hover, -.popup .btn-ok:hover, -.popup .btn-cancel:hover, -.slide-panel .btn-ok:hover, -.slide-panel .btn-cancel:hover { - background-color: $translatedBlueHover; - //box-shadow: 0 0 0 #e0e0e0, 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.24) !important; - //border: 1px solid #797979; -} - -.mgmt-panel-gl .btn-ok:active, -.mgmt-panel-tm .btn-ok:active, -.popup .btn-ok:active, -.popup .btn-cancel:active, -.slide-panel .btn-ok:active, -.slide-panel .btn-cancel:active { - //-moz-box-shadow: inset 0 0 1px 1px #888; - //-webkit-box-shadow: inset 0 0 1px 1px #888; - //box-shadow: inset 0 0 1px 1px #888; -} - -.popup .btn-ok.right, -.popup .btn-cancel.right, -.popup-tm .btn-ok.right, -.popup-tm .btn-cancel.right, -.popup-languages.slide .btn-ok.right, -.popup-languages.slide .btn-cancel.right { - float: right; -} - -#chooseMultilang, -#cancelMultilang { - padding: 4px 18px; - margin-left: 10px; -} - -#cancelMultilang:hover { - padding: 4px 18px; - margin-left: 10px; - color: #333333; -} - -.mgmt-panel-tm .nav-tabs { - background: #002b5c; - display: block; -} - -.mgmt-add-tm, -.mgmt-add-gl, -.addrow-tm, -.addrow-gl, -.dataTables_paginate { - display: none; -} - -.add-tm span { - margin: 2px 8px 0 0; -} - -.notlogged { - color: #ccc !important; -} - -.mgmt-add-tm .source { - clear: both; -} - -div.mgmt-container { - margin: 0 auto; - overflow: hidden; - width: 998px; - padding-top: 20px; - padding-bottom: 150px; - text-align: left; - min-height: 400px; - .insert-tm { - ul { - list-style: circle; - padding-left: 25px; - padding-top: 6px; - } - .provider-field.checkbox .checkbox-label { - margin-top: 4px; - } - .info-icon { - background: url(../../img/info.png); - background-size: 18px; - width: 18px; - height: 18px; - margin-left: 4px; - margin-bottom: 4px; - cursor: pointer; - } - .provider-field.checkbox { - display: flex; - justify-content: flex-start; - align-items: center; - } - .provider-field.checkbox.first { - margin-top: 10px; - } - } -} - -.mgmt-tm .priority { - /*width:5%!important;*/ -} - -.mgmt-tm .privatekey { - width: 150px !important; - font-size: 13px; -} - -.mgmt-tm .new td.privatekey { - width: 195px !important; -} - -td.description, -th.description { - width: 491px !important; -} - -th.owner, -td.owner { - width: 46px !important; -} - -.mgmt-tm .langpair { - /*width:14%!important;*/ - width: 144px !important; -} - -.mgmt-tm .check { - /*width:6%!important;*/ - width: 55px !important; - text-align: center; -} - -.mgmt-table-mt td { - padding: 10px !important; -} - -.mgmt-mt .action { - /*width:22%!important;*/ - width: 95px !important; - text-align: center; -} - -.mgmt-tm th.action, -.mgmt-tm td.action { - width: 186px !important; -} - -th.activate, -td.activate { - width: 55px !important; - text-align: center; -} - -#inactivetm th.check, -#inactivetm th.privatekey, -#inactivetm th.owner, -#inactivetm th.action, -#activetm th.privatekey, -#activetm th.owner #ativetm th.action { - visibility: hidden; -} - -#inactivetm .check.lookup input, -#inactivetm .check.update input { - visibility: hidden; -} - -#inactivetm tbody { - background: #f3f3f3; -} - -.icon-owner.icon-owner-private, -.icon-owner.icon-owner-shared, -.icon-owner.icon-owner-public { - color: #6f6f6f; - text-decoration: none; - cursor: default; -} - -.icon-owner.icon-owner-private { - padding: 2px 0px 2px 6px; -} - -.icon-owner.icon-owner-shared { - padding: 2px 2px; -} - -.share-button { - width: 50px; - text-align: center; - margin-right: 15px; -} - -.message-share-tmx { - font-size: 14px; - float: left; - width: 485px; - padding-left: 12px; - line-height: 34px; -} - -input.message-share-tmx-input-email { - margin-top: 2px; - float: left; - margin-left: 15px; - width: 290px; - height: 24px; - font-size: 14px; - padding-left: 4px; - background-color: #fbfbfb; - border: 1px solid #ccc; - border-radius: 2px; -} - -span.message-share-tmx-email, -.message-share-tmx-openemailpopup { - text-decoration: underline; - cursor: pointer; -} - -/* -.new .privatekey { - width: 110px!important; -padding: 15px 31px 10px 10px; -}*/ - -select#mt_engine_int { - font-size: 18px; - height: 30px; - margin: 20px 0; - width: 90%; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-image: url('../../img/icons/icon-down.svg'); - background-position: right 10px top 50%; - background-repeat: no-repeat; -} - -.mgmt-tm .progress { - display: block; - height: 15px; - background: #d0d1d1; - border: 1px solid #ccc; - position: relative; - border-radius: 4px; - float: left; - margin-right: 10px; - margin-left: 10px; - width: 120px; -} - -.new td.fileupload { - width: 99px; -} - -.back-mgmt { - padding: 20px; - margin-right: 20px; -} - -.memory-mgmt.btn { - width: auto; -} - -.slide-panel-body { - margin: 2%; -} - -.slide-panel table, -.mgmt-gl, -.mgmt-tm-nested { - font-size: 15px; - width: 100%; - margin-bottom: 20px; - border: 1px solid #ccc; - border-spacing: 0; -} - -.privatekey .btn-ok { - margin: 0 !important; -} - -.btn-grey.uploadtm { - clear: right; -} - -span.asterisk { - line-height: 10px; - vertical-align: bottom; -} - -span.text-or { - text-align: center; - width: 21px; -} - -span.text-req { - /* margin-top: 0px; */ - clear: left; - color: #bbb; -} - -.file_upload_error, -.error { - color: #ff3300; -} - -.file_upload_warning { - color: $warning; -} - -.error { - float: left; -} - -input.error { - border: 1px solid red !important; - font-size: inherit; -} - -.mgmt-tm .btn-grey { - padding: 5px 0px !important; -} - -.mgmt-tm .btn-ok, -.mgmt-tm .btn-grey { - cursor: pointer !important; - font-size: 14px; -} - -.canceladdtmx, -.canceladdglossary { - margin: 0; - cursor: pointer; -} - -.mgmt-tm .btn-ok { - padding: 6px 5px !important; - width: 119px; - margin-left: 5px; -} - -div.mt-error-key { - display: none; - color: red; - padding: 5px 0 10px; - margin-left: 7px; - clear: both; -} - -.mgmt-table-mt .uploadtm.btn-ok { - margin: 15px 0 15px 20px; -} - -.mgmt-tm .btn-grey:last-child { - margin: 0 !important; -} - -.action .notify { - border-top: none; - box-shadow: none; - float: left; -} - -body.cattool .mgmt-tm.mine thead, -.mgmt-tm.new thead, -.mgmt-tm.anonymous thead { - display: none; -} - -#activetm tr.ownergroup td, -#activetm tr.anonymous td { - color: #999; -} - -td.share-tmx-container, -td.download-container, -td.download-glossary-container, -td.uploadfile { - color: black !important; -} - -.btn-grey .text, -.canceladdtmx.btn-grey .text, -.canceladdglossary.btn-grey .text, -.addtmxfile.btn-ok .text, -.addglossaryfile.btn-ok .text, -.uploadtm.btn-ok .text { - display: block; - text-align: center; -} - -.canceladdtmx.btn-grey .text, -.canceladdglossary.btn-grey .text, -.addtmxfile.btn-ok .text, -.addglossaryfile.btn-ok .text, -.uploadtm.btn-ok .text { - /*width: 90px;*/ -} - -.mgmt-tm .btn-grey .text { - width: 33px !important; -} - -.canceladdtmx.btn-grey .text, -.canceladdglossary.btn-grey .text, -.addtmxfile.btn-ok .text, -.addglossaryfile.btn-ok .text, -.uploadtm.btn-ok .text { - color: #fff; -} - -.addtmxfile.btn-ok, -.addglossaryfile.btn-ok { - display: none; -} - -.canceladdtmx.btn-grey, -.canceladdglossary.btn-grey, -.cancelsharetmx.btn-grey { - background: #f26522; -} - -.popup-tm td.description .edit-desc, -.popup-tm td.engine-name .edit-desc { - height: 18px; - width: 450px !important; - padding: 2px 4px; - border-radius: 2px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - box-shadow: 0 0 0 1px #e2e2e2; -} - -.popup-tm td.engine-name .edit-desc { - max-width: 350px !important; -} - -.popup-tm tr.mine td.description .edit-desc[contenteditable='true'], -.popup-tm td.engine-name .edit-desc[contenteditable='true'] { - border: 1px solid #999; - background: #fff; - height: auto; - outline: 0; - box-shadow: inset 0 1px 2px #ddd; - -webkit-box-shadow: inset 0 1px 2px #ddd; - white-space: initial; - overflow: initial; - text-overflow: initial; -} - -.popup-tm tr.mine td.description .edit-desc:hover { - box-shadow: 0px 0px 0px 1px #ccc; - cursor: text; -} - -.canceladdtmx.btn-grey:hover, -.canceladdglossary.btn-grey:hover { - background: #d1581c; -} - -.addtmxfile.btn-ok:hover, -.addglossaryfile.btn-ok:hover { - background: $translatedBlue; -} - -td.uploadfile input[type='file'] { - margin-right: 20px; -} - -td.uploadfile .error { - float: left; - margin-right: 14px; - color: red; -} - -td.uploadfile .uploadprogress .error { - float: left; - margin-right: 0px; -} - -.canceladdtmx:hover, -.canceladdglossary:hover { - color: red; -} - -.filter-box { - position: relative; - margin-top: 5px; -} - -.filter-box span { - position: absolute; - top: 2px; - color: #ccc; -} - -.filter-box input { - padding: 3px 10px 3px 30px; - border-radius: 2px; - border: 1px solid #ccc; - color: #999; - width: 108px; - margin-right: 9px; -} - -.dataTables_length, -.dataTables_info { - display: none; -} - -.dataTables_filter { - float: right; - margin-top: 10px; -} - -.check.sorting:after, -.action.sorting:after { - display: none; -} - -.sorting_asc:after { - content: '\f0dd'; - float: right; - margin-top: -4px; -} - -.sorting_desc:after { - content: '\f0de'; - float: right; - line-height: 1px !important; - margin-top: 10px; -} - -.sorting:after { - content: '\f0dc'; - float: right; -} - -.dataTables_paginate { - float: right; - margin-top: 10px; -} - -/* -#activetm {margin-bottom: 15px;} -*/ -#activetm thead { - /* display: table-header-group !important;*/ - background: #6d6e71; -} - -#activetm tbody { - display: block; - background: #e4f2fb; -} - -tr.tm-error, -td.tm-error { - border: 1px solid red !important; -} - -tr.mymemory td.dragrow .status { - display: none !important; -} - -#activetm tr:not(.new), -#inactivetm tr:not(.new) { - display: block; -} - -#activetm td.uploadfile, -#inactivetm td.uploadfile { - display: block; - background: #fff; - padding: 10px 17px 20px 5px; - height: 20px; - width: initial !important; - border-top: 1px solid #e1e1e1; - box-shadow: inset 0px 2px 5px 0px #e4e4e4; - position: relative; - box-sizing: content-box; -} - -span.email-export-email-sent, -span.email-export-email-error, -.message-glossary-export-completed, -.mgmt-tm .message-glossary-export-error, -#activetm td.uploadfile .msg, -#inactivetm td.uploadfile .msg { - float: right; - margin-top: 5px; - margin-right: 20px; - color: green; - text-align: right; -} - -.mgmt-tm .upload-file-msg-success, -.mgmt-tm .upload-file-msg-error { - color: green; - float: right; - margin-top: 7px; - margin-right: 4px; - display: none; -} - -.mgmt-tm .message-glossary-export-error, -.mgmt-tm .upload-file-msg-error { - color: red; - margin-right: 20px; - max-width: 310px; -} - -#activetm td.dragrow { - position: relative; - padding: 5px 5px 5px 5px !important; -} - -#inactivetm th.dragrow { - width: 10px !important; -} - -td.uploadfile p { - margin: 0 10px; -} - -#activetm td.dragrow .status { - cursor: move; - margin: 0 auto; - width: 2px; - border: 2px dotted #ccc; - border-top: 0; - border-bottom: 0; - display: block; - position: absolute; - right: 0; - left: 0; - height: 67%; - bottom: 15%; - top: 17%; -} - -#activetm tr.owner td { - background: #fff !important; - color: #999 !important; -} - -#activetm tr.anonymous td { - background: #f6f6f6 !important; -} - -/* Export TMX container */ -#activetm td.download-container, -#inactivetm td.download-container, -#activetm td.download-glossary-container, -#inactivetm td.download-glossary-container, -#activetm td.share-tmx-container, -#inactivetm td.share-tmx-container { - display: block; - background: #fff; - padding: 10px 17px 20px 5px; - height: 53px; - border-top: 1px solid #e1e1e1; - box-shadow: inset 0px 2px 5px 0px #e4e4e4; - position: relative; -} - -td.download-container, -.mgmt-tm .download-glossary-container { - line-height: 30px; -} - -.message-export, -.message-export-success { - float: left; - margin-left: 11px; -} - -input.email-export { - float: left; - margin-left: 14px; - margin-top: 3px !important; -} - -.export-button-label:before { - content: '\f00c'; - padding-right: 7px; - vertical-align: text-top; -} - -.export-button-label { - width: 90px !important; - display: block; - text-align: center; - color: white !important; -} - -.mgmt-tm .btn-ok.export-button { - margin-right: 9px; -} - -/*** New Buttons ***/ - -.btn-orange-small, -.btn-orange-medium { - background: #f26522; - width: 35px; - height: 35px; - border: 1px solid #848689; - border-radius: 2px; - color: white; - text-align: center; - font-weight: bold; - cursor: pointer; - text-decoration: none; - line-height: 35px; -} - -.btn-orange-medium { - background: #f26522; - width: 35px; - height: 35px; - border: 1px solid #848689; - border-radius: 2px; - color: white; - text-align: center; - font-weight: bold; - cursor: pointer; - text-decoration: none; - line-height: 35px; -} - -.btn-orange-medium:hover, -.btn-orange-small:hover { - background: #d1581c; - cursor: pointer; - -webkit-box-shadow: 0 1px 2px #ccc; - box-shadow: 0 1px 2px #ccc; - border: 1px solid #000; -} - -.btn-orange-medium .text:before, -.btn-orange-small .text:before { - content: '\f00d'; - vertical-align: text-top; -} - -.btn-orange-medium .text, -.btn-orange-small .text { - color: #fff; -} - -.btn-confirm-small { - /* color: #fff; */ - background: $translatedBlue; - //border: 1px solid #797979; - font-weight: bold; - text-decoration: none; - border-radius: 2px; - font-size: 15px; - margin-right: 3px; - box-sizing: border-box; - width: 120px; - height: 35px; - text-align: center; - left: 6px; - position: relative; - /* top: -4px; */ - /* vertical-align: middle; */ -} - -.btn-confirm-small:hover { - background-color: $translatedBlueHover; - //box-shadow: 0 0 0 #e0e0e0, 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.24) !important; - //border: 1px solid #797979; -} - -.btn-confirm-small .text:before { - content: '\f00c'; - padding-right: 7px; - vertical-align: text-top; -} - -.btn-confirm-small .text { - color: #fff; -} - -.cancel-tm-key-delete.cancelDelete { - margin-left: 7px; - margin-right: -4px; - position: relative; - width: 33px; - height: 33px; - line-height: 35px; -} - -.btn-orange-small.continueDletingMT { - top: 7px; - position: relative; -} - -.btn-confirm-medium { - color: #fff; - background: $translatedBlue; - border: 1px solid #848689; - font-weight: bold; - text-decoration: none; - padding: 8px 18px; - border-radius: 2px; - font-size: 18px; - background: -webkit-gradient( - linear, - left top, - left bottom, - from($translatedBlue), - to(#119ec4) - ); - background: -moz-linear-gradient(top, $translatedBlue, #119ec4); - background: linear-gradient(top, $translatedBlue, #119ec4); - margin: 16px 0 16px 20px; - display: inline-block; - text-align: center; - position: relative; -} - -.btn-confirm-medium:hover, -.btn-confirm-small:hover { - cursor: pointer; - -webkit-box-shadow: 0 1px 2px #ccc; - box-shadow: 0 1px 2px #ccc; - border: 1px solid #000; -} - -.btn-confirm-medium:active, -.btn-confirm-small:active { - -moz-box-shadow: inset 0 0 1px 1px #888; - -webkit-box-shadow: inset 0 0 1px 1px #888; - box-shadow: inset 0 0 1px 1px #888; -} - -/*******************/ -td.download-glossary-container .uploadloader { - top: 13px; - right: 85px; -} - -.download-container .uploadloader { - right: 200px; - top: 13px; - display: none; -} - -.export-button.disabled { - cursor: default; - pointer-events: none; -} - -span.email-export-email-sent, -span.email-export-email-error, -.mgmt-tm .message-glossary-export-error, -.message-glossary-export-completed { - float: right; - margin-top: 1px; - display: none; -} - -span.email-export-email-error { - color: red; - margin-left: 21px; - line-height: 14px; - text-align: center; - margin-right: 28px; -} - -.btn-grey.canceladd-export { - background: #f26522; - width: 35px; - margin: 0px; - text-align: center; - color: #fff; - &:hover { - background: #c1511c; - } -} - -.canceladd-export:before { - content: '\f00d'; - vertical-align: text-top; -} - -.mgmt-tm tr.tm-key-deleting { - pointer-events: none; - border: 1px solid #f9f903; -} - -/************************/ -.anonymous td.dragrow { - background-image: none !important; - cursor: initial; -} - -/* -#activetm th.privatekey, #inactivetm th.privatekey { - padding-left:15px; - padding-right: 6px; -} -*/ - -.mine .downloadtmx { - display: block !important; -} - -.mgmt-tm .downloadtmx { - /*display: none !important; */ -} - -tr.mine.ui-sortable-helper { - border-bottom: 1px solid #ccc; - border-left: 1px solid #ccc; - border-right: 1px solid #ccc; -} - -/* provvisorio */ -.disabletm { - display: none; -} - -#inactivetm { - cursor: initial; - float: left; -} - -td.no-gutter { - padding: 0 !important; -} - -.dataTables_empty { - width: 1042px; -} - -#inactivetm tbody, -#inactivetm thead { - display: block; -} - -#inactivetm thead { - background: #6d6e71; -} - -.mgmt-container .icon-search { - margin-top: 3px; - margin-left: 8px; -} - -.mgmt-container .search { - padding: 2px; - margin-right: 2px; - display: block; - float: right; - margin-bottom: 10px; -} - -#activetm td, -.activemt td { - background: #e4f2fb !important; -} - -#activetm tr.ownergroup td { - background: #f4f4f4; - color: #999; -} - -#activetm tr.ownergroup td.dragrow .status { - border: none; - cursor: auto; -} - -#activetm tr.uploadfile td { - background: #fff; -} - -#inactivetm td, -table.mgmt-mt td { - background: #f3f3f3; -} - -.mgmt-tm th, -.mgmt-mt th { - padding: 8px 5px; - background: #fff; -} - -#activetm tr.mymemory td, -#activetm tr.ownergroup td { - background-color: #f8f8f8 !important; - right: 0; -} - -.slide-panel td { - padding: 10px 0 10px 10px; - background: #fff; - vertical-align: middle; - border-top: 1px solid #ccc; - box-shadow: inset 0 1px 0 0 #fff; -} - -td.engine-name, -td.enable-mt { - overflow: hidden; -} - -.mgmt-tm td { - /* padding: 10px 0 10px 10px; - vertical-align: middle;*/ - box-sizing: border-box; -} - -.mgmt-tm th { - box-sizing: border-box; -} - -.addtmxrow td, -.new td { - background: #fff !important; -} - -.mgmt-panel select { - width: 230px; - height: 20px; - padding: 5px; - font-size: 13px; - border: 1px solid #ccc; - margin: 1px 0 5px 0; -} - -.btn-confirm { - margin-top: 25px !important; -} - -span.newrow.text-center { - width: 100%; - display: block; -} - -.mgmt-panel h3 { - margin: 0 11px 10px; - font-size: 20px; -} - -.addrow { - width: 100%; -} - -.addrow label { - float: left; -} - -.mgmt-panel p { - line-height: 28px; -} - -p.required { - margin-bottom: -3px; -} - -.mgmt-add-tm input, -.mgmt-add-gl input { - font-size: 12px !important; - height: 22px; - color: #999999; - float: left; - padding: 5px 10px; - border: 1px solid #abadb3; - -webkit-transition: all 100ms ease-in; - -moz-transition: all 100ms ease-in; -} - -#inactivetm.filtering tbody tr:not(.found) { - display: none !important; -} - -.mgmt-table-mt .icon-info { - font-size: 18px; -} - -.mgmt-table-mt .icon-info:hover #more-info { - display: block !important; -} - -.more-info-tip { - width: auto; - position: absolute; - float: left; - background: #fff; - height: auto; - margin-left: 9%; - margin-top: -35px; - line-height: 20px; - font-size: 14px; - text-align: left; - vertical-align: middle; - border: 1px solid #e0e0e0; - padding: 10px 18px; - border-radius: 6px; -} - -.more-info-tip:after, -.more-info-tip:before { - border: solid transparent; - content: ' '; - height: 0; - width: 0; - margin-left: -36px; - margin-top: -37px; - position: absolute; - z-index: 1; - pointer-events: none; - border-right-color: #fff; - border-width: 9px; -} - -.more-info-tip:before { - border-right-color: #ccc; - margin-left: -37px; - margin-top: 3px; -} - -.insert-tm .canceladdtmx, -.insert-tm .canceladdglossary { - margin: 21px 0; -} - -.nonumber { - display: none; -} - -.disabled .nonumber { - display: block !important; -} - -.disabled .number { - display: none; -} - -.resource { - margin-bottom: -7px; -} - -tr.disabled td { - background: #f3f3f3 !important; -} - -.provider-field.disabled, -.provider-field.disabled:hover { - border: initial; - background: initial; -} - -.mgmt-add-gl input { - width: 225px; - margin-right: 12px; -} - -.clear { - clear: both; -} - -.offline span.msg span { - vertical-align: middle; -} - -.slide-panel table th, -.mgmt-gl th { - background: #6d6e71; - color: #fff; - height: 20px; - line-height: 15px; -} - -.wrapper-dropdown-5 { - position: relative; - outline: none; - background: #dcdedf; - width: 12px; - -webkit-transition: all 100ms ease-in; - -moz-transition: all 100ms ease-in; - cursor: pointer; - border: 1px solid #666; - border-left: none; - border-radius: 0 2px 2px 0; - text-decoration: none; - text-align: center; - padding: 4px 16px !important; +.pull-left { + float: left !important; } -.wrapper-dropdown-5:after { - /* Little arrow */ - content: ''; - width: 0; - height: 0; - position: absolute; - top: 50%; - right: 10px; - margin-top: -3px; - border-width: 6px 6px 0 6px; - border-style: solid; - border-color: #666 transparent; +.pull-right { + float: right !important; } -.wrapper-dropdown-5 .dropdown { - position: absolute; - top: 102%; - left: -131px; - width: auto; - right: 0; - margin-top: 1px; - border-radius: 0; - border-bottom: none; - transition: all 0.3s ease-out; - max-height: 0; +.iepopup.nobrowser { + width: 1200px; + margin: 0 auto; overflow: hidden; - z-index: 3; - box-shadow: - 0 0 0 #e0e0e0, - 0 0 2px rgba(0, 0, 0, 0.12), - 0 2px 4px rgba(0, 0, 0, 0.24) !important; -} - -.wrapper-dropdown-5:hover { - /*-moz-box-shadow: 0 1px 1px #666;*/ - /*-webkit-box-shadow: 0 1px 1px #666;*/ - /*box-shadow: 0 1px 1px #666;*/ -} - -.header-menu .dropdown form span { - color: #666; - padding: 5px 0px 5px 5px; - margin-right: 3px; -} - -.wrapper-dropdown-5:active { - -moz-box-shadow: inset 0 0 1px 1px #888; - -webkit-box-shadow: inset 0 0 1px 1px #888; - box-shadow: inset 0 0 1px 1px #888; -} - -.wrapper-dropdown-5 .dropdown li, -.dropdown input { - width: 100%; -} - -.header-menu .wrapper-dropdown-5 .dropdown li { - padding: 0 !important; - height: auto !important; -} - -.wrapper-dropdown-5 .dropdown li a, -.dropdown input { - display: block; - text-decoration: none; - background: #fff !important; - color: #666; - text-align: left; - padding: 6px 0px 6px 5px; - transition: all 0.3s ease-out; - border-bottom: 1px solid #e6e8ea; - font-weight: normal; - font-size: 16px; -} - -.wrapper-dropdown-5 .dropdown li a:hover { - background: #f7f8f9; -} - -.wrapper-dropdown-5 .dropdown li:last-of-type a { - border: none; -} - -.wrapper-dropdown-5 .dropdown li i { - margin-right: 5px; - color: inherit; - vertical-align: middle; -} - -/* Hover state */ - -.wrapper-dropdown-5 .dropdown li:hover a, -.wrapper-dropdown-5 .dropdown li:hover input { - color: black; - background: #efefef !important; -} - -/* Active state */ - -.wrapper-dropdown-5.active, -.wrapper-dropdown-5.activeMenu { box-shadow: none; - color: black; -} - -.wrapper-dropdown-5.active:after, -.wrapper-dropdown-5.activeMenu:after { - border-color: black transparent; -} - -.wrapper-dropdown-5.active .dropdown, -.wrapper-dropdown-5.activeMenu .dropdown { - max-height: 400px; - /* width: 149px; - margin-left: 15px;*/ + border: none; } -.mgmt-panel .mgmt-tm label, -.mgmt-panel .mgmt-mt label { - text-transform: none; - padding-bottom: 5px; - font-weight: bold; +.iepopup .logoblack { + background-size: 200px auto; + width: 200px; + height: 50px; } -.insert-tm label { - font-size: 16px; +.iepopup.nobrowser ul li { display: inline-block; - margin-top: 20px; - margin-bottom: 5px; - width: 100%; - padding-left: 9px; - &.checkbox-label { - width: auto; - } + margin: 20px; } -.insert-tm input { +.iepopup { + width: 800px; + margin: 30px auto; + padding: 30px 0 30px 0; + display: block; + z-index: 999999; background: #fff; - outline: 0; - white-space: initial; - overflow: initial; - text-overflow: initial; - width: 100%; - padding: 8px 8px; + box-shadow: 0px 0px 5px #ccc; border-radius: 2px; - -webkit-box-shadow: inset 0 1px 3px #ddd; - box-shadow: inset 0 1px 3px #ddd; - border: 1px solid rgba(34, 36, 38, 0.15); - box-sizing: border-box; -} - -.insert-tm input:hover { - border-color: rgba(34, 36, 38, 0.35); -} - -.insert-tm input:focus { - border-color: #96c8da !important; - box-shadow: none; - outline: none; -} - -.insert-tm input[type='checkbox'] { - width: 13px; - height: 13px; -} - -.insert-tm { - margin: 0 auto; - overflow: hidden; - margin-bottom: 30px; -} - -.insert-tm h4 { font-size: 18px; - margin: 15px 0 25px; -} - -.contact-box { - border: 1px dashed #ccc; - height: 90px; - border-radius: 4px; - margin-top: 20px; - padding: 2%; -} - -.step1 { - width: 100%; - border-bottom: 1px solid #e1e1e1; + border: 1px solid #ccc; } -.step2 { - width: 49%; +.iepopup img { + border: 0; } -.step2 a#add-mt-provider-confirm.disabled { - box-shadow: none !important; +.iepopup ul a { + padding: 0px 0 0 0; + color: #39699a; + text-decoration: underline; } -.step3 { - width: 48%; - background: #f3f3f3; - display: inline-block; - box-sizing: border-box; - float: left; - margin-left: 29px; - padding: 15px; - margin-top: 20px; +.iepopup a:hover { + text-decoration: none; } -.step3 .continuebtn { +.logoblack { + border: 0; + background: url(../../img/logo_matecat_big.svg) 0px 2px no-repeat; display: block; - text-align: center; - margin: 15px 0 0px !important; - background: #7eaf3e !important; -} - -.mgmt-table-mt select { -} - -td.mt-provider { - width: 170px; -} - -td.action .btn { - cursor: pointer; - height: 22px; - min-height: 22px; - color: #333 !important; - width: 84px !important; - background: #dcdedf !important; - border-radius: 2px 0 0 2px; - padding: 5px 20px 0 20px !important; - box-sizing: content-box; - text-align: center; - border: 1px solid #848689 !important; -} - -td.action .btn:hover { - -moz-box-shadow: 0 1px 2px #ccc; - -webkit-box-shadow: 0 1px 2px #ccc; - box-shadow: 0 1px 2px #ccc; - box-sizing: content-box; - padding: 5px 20px 0 20px !important; - text-align: center; -} - -a.btn.pull-left.addtmx.tmx-import-slider { - padding-right: 36px !important; - padding-left: 36px !important; - margin-left: 6px; -} - -td.action .btn .text { - margin: 0 !important; -} - -a.memory-mgmt.pull-right { - margin-top: 35px; - padding: 0 0 5px 18px; - margin-bottom: 5px; -} - -/* Tabs */ - -.nav-tabs { - border-bottom: 1px solid #ddd; - float: left; + width: 145px; + height: 31px; + background-size: 130px 28px; clear: both; - width: 100%; -} - -.nav-tabs > li { - float: left; - position: relative; - border-radius: 4px 4px 0 0; - background-color: #cdd4de; + margin: 0 auto 10px auto; } -.nav > li { - display: block; +.nobrowser #outer, +.nobrowser header, +.nobrowser footer, +.nobrowser .wrapper { + display: none !important; } -.nav > li > a { - position: relative; - text-decoration: none; - padding: 10px 15px; +.iepopup p { + line-height: 27px; } -.nav-tabs > li.active > a, -.nav-tabs > li.active > a:hover, -.nav-tabs > li.active > a:focus { - /* color: #555; */ - /* cursor: default; */ - /* background-color: #fff; */ - /* font-weight: bold; */ - /* margin-top: -5px; */ - /* border: 1px solid #ddd; */ - /* border-bottom-color: transparent; */ - background: #fff; - color: #666; - text-shadow: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - border-radius: 4px 4px 0 0; - margin: 0px 0 -1px 0; - outline: none; - padding-top: 5px !important; +.hide { + display: none; } -.nav-tabs > li > a { - -webkit-transition: all 100ms ease-in; - -moz-transition: all 100ms ease-in; - padding: 4px 20px; - color: #939598; - float: left; +.btn-grey { font-weight: bold; text-decoration: none; - border-right: 1px solid #666; -} - -.text-center { - text-align: center !important; -} - -.mgmt-input { - width: 90%; - padding: 2px 5px; - font-size: 15px !important; - margin-top: 0px; - margin-bottom: 0px; - -moz-border-radius: 2px; + padding: 8px 18px; + margin: 0 5px; border-radius: 2px; - border: 1px solid #999; -} - -.description .mgmt-input { - width: 430px; -} - -.mgmt-panel .block { - margin: 5px 0 10px 0; - text-align: right; - clear: both; - width: 100%; -} - -.addrow-gl { - padding: 0 25px; -} - -input#shared-tm-key { - width: 85%; - margin: 0 0 10px 0; -} - -#activetm input#shared-tm-key, -input.email-export { - width: 170px; - margin: 0; - box-shadow: inset 0 1px 2px #ddd; - -webkit-box-shadow: inset 0 1px 2px #ddd; -} - -input#shared-tm-key { - margin-right: 15px !important; -} - -input.email-export { - width: 200px; -} - -.badkey input#shared-tm-key { - outline: 2px solid red !important; -} - -tr.new.badgrants .fileupload { - border: 3px solid red; -} - -#inactivetm .dataTables_empty { - display: none; -} - -#activetm .startUploading, -#inactivetm .startUploading { - background: url(../../img/loading.gif) 77.5% 16px no-repeat !important; - background-size: 2% !important; -} - -#activetm .uploadprogress, -#inactivetm .uploadprogress { - display: none; - right: 8px; - top: 17px; - position: absolute; -} - -#activetm .uploadprogress .msgText, -#inactivetm .uploadprogress .msgText { - display: block; - float: left; -} - -#activetm .uploadprogress .progress .inner, -#inactivetm .uploadprogress .progress .inner { - display: block; - height: 15px; - margin-bottom: 5px; - width: 0%; - background: #58b551; - border-right: 1px solid #58b551 !important; - border-radius: 0; -} - -#activetm .uploadprogress .progress:after, -#inactivetm .uploadprogress .progress:after { - content: ''; - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - background-image: -webkit-gradient( + font-size: 18px; + color: #333; + background: #f6f6f6; + background: -webkit-gradient( linear, - 0 0, - 100% 100%, - color-stop(0.25, rgba(255, 255, 255, 0.2)), - color-stop(0.25, transparent), - color-stop(0.5, transparent), - color-stop(0.5, rgba(255, 255, 255, 0.2)), - color-stop(0.75, rgba(255, 255, 255, 0.2)), - color-stop(0.75, transparent), - to(transparent) - ); - background-image: -webkit-linear-gradient( - -45deg, - rgba(255, 255, 255, 0.2) 25%, - transparent 25%, - transparent 50%, - rgba(255, 255, 255, 0.2) 50%, - rgba(255, 255, 255, 0.2) 75%, - transparent 75%, - transparent - ); - background-image: -moz-linear-gradient( - -45deg, - rgba(255, 255, 255, 0.2) 25%, - transparent 25%, - transparent 50%, - rgba(255, 255, 255, 0.2) 50%, - rgba(255, 255, 255, 0.2) 75%, - transparent 75%, - transparent - ); - background-image: -ms-linear-gradient( - -45deg, - rgba(255, 255, 255, 0.2) 25%, - transparent 25%, - transparent 50%, - rgba(255, 255, 255, 0.2) 50%, - rgba(255, 255, 255, 0.2) 75%, - transparent 75%, - transparent - ); - background-image: -o-linear-gradient( - -45deg, - rgba(255, 255, 255, 0.2) 25%, - transparent 25%, - transparent 50%, - rgba(255, 255, 255, 0.2) 50%, - rgba(255, 255, 255, 0.2) 75%, - transparent 75%, - transparent + left top, + left bottom, + from(#f6f6f6), + to(#e2e3e5) ); - z-index: 1; - -webkit-background-size: 50px 50px; - -moz-background-size: 50px 50px; - background-size: 50px 50px; - -webkit-animation: move 2s linear infinite; - overflow: hidden; -} - -.description textarea { - padding: 3px 4px; - resize: none; - box-shadow: inset 0 1px 2px #ddd; - -webkit-box-shadow: inset 0 1px 2px #ddd; - margin-left: 0px; - margin-top: 4px !important; - width: 450px !important; -} - -tr.new { - vertical-align: top; -} - -tr.new .message { + background: -moz-linear-gradient(top, #f6f6f6, #e2e3e5); + background: linear-gradient(top, #f6f6f6, #e2e3e5); line-height: 20px; - margin-top: 12px; - float: left; - color: green; } -.addrow-tm .block, -.addrow-gl .block { - width: 46%; +.btn-grey, +.btn-grey { + color: $grey2; + background: white; } -.addrow-gl select { - height: 32px; - margin-bottom: 20px; +.clear { + clear: both; } +/* Tabs */ section mark { background: transparent; } @@ -2881,7 +196,9 @@ section.currSearchSegment mark.searchMarker { padding: 0; padding-top: 80px; } - +.offline span.msg span { + vertical-align: middle; +} .offline .claim { text-align: center; margin: 0 auto; @@ -3106,24 +423,7 @@ section.currSearchSegment mark.searchMarker { background: url(../../img/matecat_file_icons.png) 6px -1107px no-repeat !important; } -/* Google Sheet */ - -@media (max-height: 500px) { - .register-modal { - overflow-x: hidden; - height: 300px; - overflow-y: scroll; - } -} - -@media (max-height: 300px) { - .preferences-modal { - overflow-x: hidden; - height: 200px; - overflow-y: scroll; - } -} - + /* retina display query */ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), @@ -3287,83 +587,6 @@ section.currSearchSegment mark.searchMarker { } } -.active-tm-key-link { - cursor: pointer; - text-decoration: underline; - color: #39699a; -} - -/*.tm-error-message, -.tm-warning-message, -.tm-success-message { - display: none; - -moz-border-radius: 2px; - box-shadow: 0 2px 2px #e2e2e2; - border-radius: 2px; - border: 1px solid #ccc; - line-height: 20px; - padding: 10px 15px; - margin: 10px 0; - background: #fff; - -webkit-transition: 0.3s ease-in-out; - -moz-transition: 0.3s ease-in-out; - -ms-transition: 0.3s ease-in-out; - -o-transition: 0.3s ease-in-out; - transition: 0.3s ease-in-out; -} - -.mgmt-panel .notification-message { - margin-top: 70px !important; -} - -.tm-error-message { - border-top: 3px solid #ec3d3d; - background-color: rgb(251, 218, 218); -} - -.tm-warning-message { - border-top: 3px solid #f9f903; - background-color: rgb(255, 254, 216); -} - -p.tm-warning-message { - margin-top: 60px !important; -} - -.tm-success-message { - border-top: 3px solid #4f8a10; - background-color: #d1e0d1; -} - -.fixed-msg { - position: fixed; - top: -35px; - width: 966px; - z-index: 1; -} - -.mgmt-panel .tm-error-message, -.mgmt-panel .tm-warning-message, -.mgmt-panel .tm-success-message { - font-size: 15px; - vertical-align: middle; - line-height: 36px; -} - -.warning-message { - background: #fffa8b !important; - border-color: #6d6e71; - padding: 10px 0 10px 1%; - text-indent: 0; - width: 98.8%; - color: #000; -} - -.tm-warning-message, -.tm-error-message, -.tm-success-message { - margin: 0 0 15px !important; -}*/ @font-face { font-family: 'icomoon'; @@ -3383,10 +606,6 @@ p.tm-warning-message { /* TODO: add icons to main set */ -.icon-copy-key:before { - content: '\e92c'; -} - /* /* mbc extend iconmoon set with icons for matecat chat */ @@ -3399,51 +618,24 @@ icon-iconmoon:before, [class^="icon-"], [class*=" icon-"], .sorting_desc:after, .sorting_asc:after, -.add-tm:before, -.addtmx .text:before, -.disabletm .text:before, -.addtmxfile .text:before, -.addglossaryfile .text:before, -.usetm .text:before, -.downloadtmx .text:before, -.uploadkey:before, .open-popup-addtm-tr:before, -.tablesorter-headerDesc .tablesorter-header-inner:after, -.tablesorter-headerAsc .tablesorter-header-inner:after, -.privatekey.tablesorter-header .tablesorter-header-inner:after, -.owner.tablesorter-header .tablesorter-header-inner:after, -.description.tablesorter-header .tablesorter-header-inner:after, -.canceladdtmx.btn-grey .text:before, -.canceladdglossary.btn-grey .text:before, -.cancelsharetmx.btn-grey .text:before, -.deleteTM .text:before, .sorting:after, -.splitbtn:before, .x-popup:before, .x-popup2:before, .popup .x-popup:before, .mgmt-panel .x-popup:before, .popup-tm .x-popup:before, -.noticon:after, .sub-editor .gl-search .set-glossary:before, td.actions a:before, -a.cancel-project:before, a.archive-project:before, -a.resume-project:before, a.unarchive-project:before, -a.activity-log:before, a.unarchive-project:after, -a.resume-project:after, .splitpoint:before, -.mergebtn:before, -.subfile p:before, .notific:before, #clear-all-files:before, #clear-all-gdrive:before, #swaplang:after, .more:before, -.currSegment a:before, -#filterSwitch:before, .more.minus:before, .close:before, /* mbc chat */ @@ -3458,23 +650,18 @@ a.resume-project:after, #add-files:before, .splitpoint-delete:after, #point2seg:after, -.error-symbol:before, .warnings:before, /* mbc chat */ .mbc-warnings:before, /* mbc chat */ -.tab-switcher-al a:before, .text .alternatives:before, .autofillTag:before, header .filter:before, .editToolbar .uppercase:after, .editToolbar .lowercase:after, .editToolbar .capitalize:after, -.more-options:before, .export-button-label:before, -.canceladd-export:before, -.icon-copy-key:before, -.login-modal .login-container-right li:before { +.canceladd-export:before { font-family: 'icomoon'; speak: none; font-style: normal; @@ -3492,12 +679,6 @@ header .filter:before { content: '\f0b0'; } -.usetm .text:before { - content: '\f144'; - padding: 0 10px 0 0; - vertical-align: text-top; -} - .editToolbar .uppercase:after { content: '\ea6c'; font-size: 20px; @@ -3517,52 +698,12 @@ header .filter:before { display: block; } -.segment-options-container { - display: none; -} - -.splitpoint:before { - content: '\f03d'; -} - -.splitpoint:hover .splitpoint-delete:after { - content: '\f00d'; - color: red; - position: absolute; - font-size: 18px; - margin-left: -16px; - margin-top: 3px; -} - -.login-modal .login-container-right li:before { - content: '\ea10'; - margin-left: -40px; - padding: 11px; - color: #3aa9dd; -} - -.icon-tag-expand:before { - content: '...'; - margin-top: -5px; - float: left; -} - -.splitbtn:before { - content: '\f065'; - margin-right: 3px; -} - .sub-editor .gl-search .set-glossary:before { content: '\f055'; transform: rotate(180deg); display: inline-block; } -.mergebtn:before { - content: '\f066'; - margin-right: 3px; -} - .fileupload-buttonbar .fileinput-button:before, #add-files:before { content: '\f067'; @@ -3588,42 +729,24 @@ header .filter:before { font-size: 25px; } -.tab-switcher-al a:before, +.notific.error:before { + content: '\f071'; + font-size: 25px; +} + .warnings:before, .mbc-warnings:before, -.error-symbol:before, .text .alternatives:before { content: '\f071'; color: #d65959; margin-right: 10px; } -.tab-switcher-al a:before { - font-size: 14px; - color: $orangeDefault; -} - -.currSegment a:before { - content: '\f112'; - transform: rotate(180deg); - display: inline-block; - margin-right: 10px; -} - -.notific.error:before { - content: '\f071'; - font-size: 25px; -} - #point2seg:after { content: '\e903'; font-size: 24px; } -#filterSwitch:before { - content: '\f002'; -} - #clear-all-gdrive:before, #clear-all-files:before { content: '\f00d'; @@ -3636,22 +759,12 @@ header .filter:before { } .more:before, -.more.minus:before, -.more-options:before { +.more.minus:before{ margin-right: 5px; position: relative; top: 2px; } -.more-options:before { - content: '\e8b8'; -} - -.translate-box .more-options:before { - margin-top: -3px; - display: inline-block; -} - .graysmall:hover .trash:before { content: '\f014'; } @@ -3674,67 +787,12 @@ header .filter:before { font-family: Calibri, Arial, Helvetica, sans-serif; } -.more.minus:before { - content: '\f147'; -} - -.canceladdtmx.btn-grey .text:before, -.cancelsharetmx.btn-grey .text:before, -.canceladdglossary.btn-grey .text:before { - content: '\f00d'; - vertical-align: text-top; - color: white; -} - -.insert-tm .canceladdtmx.btn-grey .text:before, -.insert-tm .canceladdglossary.btn-grey .text:before { - padding-right: 8px; -} - -.step1 a#add-mt-provider-cancel .text { - width: unset; -} - -.step1 a#add-mt-provider-cancel .text:before { - padding-right: 0 !important; -} - -.deleteTM .text:before { - content: '\f014'; - padding-right: 5px; - vertical-align: text-top; -} - -.noticon:after { - content: '\e605'; - color: red; - font-size: 18px; - position: absolute; - left: -2px; - top: -1px; - transform: rotate(-45deg); -} - -a.cancel-project:before, -a.resume-project:before { - content: '\f014'; -} - -a.activity-log:before { - content: '\e900'; - font-size: 18px; - vertical-align: top; -} - -a.archive-project:before, a.unarchive-project:before { content: '\e606'; font-size: 14px; } -.noticon:after, -a.unarchive-project:after, -a.resume-project:after { +a.unarchive-project:after { content: '\e607'; color: red; font-size: 16px; @@ -3744,88 +802,12 @@ a.resume-project:after { transform: rotate(-45deg); } -.privatekey.tablesorter-header .tablesorter-header-inner:after, -.owner.tablesorter-header .tablesorter-header-inner:after, -.description.tablesorter-header .tablesorter-header-inner:after { - content: '\f0dc'; - float: right; -} - -.privatekey.tablesorter-headerDesc .tablesorter-header-inner:after, -.owner.tablesorter-headerDesc .tablesorter-header-inner:after, -.description.tablesorter-headerDesc .tablesorter-header-inner:after { - content: '\f0e0'; - float: right; -} - -.privatekey.tablesorter-headerAsc .tablesorter-header-inner:after, -.owner.tablesorter-headerAsc .tablesorter-header-inner:after, -.description.tablesorter-headerAsc .tablesorter-header-inner:after { - content: '\f0dd'; - float: right; -} - .x-popup:before, .x-popup2:before { content: '\f057'; } -.subfile p:before { - content: '\ea58'; - margin-right: 5px; - color: #555; -} - -.add-tm:before { - content: '\f067'; - padding: 0 10px 0 0; -} -.add-shared-tm { - margin-right: 10px; - .icon-owner-shared { - color: white; - padding-right: 8px; - } -} - -.uploadkey:before { - content: '\f00c'; - padding-right: 7px; - vertical-align: text-top; -} - -#inactivetm_filter input { - margin-left: 10px; -} - -th.privatekey.tablesorter-header:hover, -th.owner.tablesorter-header:hover, -th.description.tablesorter-header:hover { - box-shadow: inset 0px 0px 8px #333; - /* border-right: 1px solid #ccc; */ - cursor: pointer; -} - -.disabletm .text:before { - content: '\f056'; - padding-right: 5px; - vertical-align: text-top; -} - -.addtmxfile .text:before, -.addglossaryfile .text:before { - content: '\ea10'; - padding-right: 5px; - vertical-align: text-top; -} - -.addtmxfile .text:before, -.addglossaryfile .text:before { - padding-right: 7px; -} - -.open-popup-addtm-tr:before, -.downloadtmx .text:before { +.open-popup-addtm-tr:before { content: '\e602'; padding-right: 5px; vertical-align: text-top; @@ -3851,10 +833,6 @@ th.description.tablesorter-header:hover { content: '\e001'; } -.icon-format_color_fill:before { - content: '\e23a'; -} - .icon-power-cord:before { content: '\e291'; } @@ -3863,14 +841,6 @@ th.description.tablesorter-header:hover { content: '\e292'; } -.icon-file_download:before { - content: '\e2c4'; -} - -.icon-collections_bookmark:before { - content: '\e431'; -} - .icon-user22:before { content: '\e601'; } @@ -3963,10 +933,6 @@ th.description.tablesorter-header:hover { content: '\f06e'; } -.icon-navicon:before { - content: '\f0c9'; -} - .icon-google-plus-square2:before { content: '\f0d5'; } @@ -3982,11 +948,6 @@ th.description.tablesorter-header:hover { .icon-star-half-empty:before { content: '\f123'; } - -.icon-play-circle:before { - content: '\f144'; -} - .icon-users:before { content: '\e972'; } @@ -4139,9 +1100,6 @@ th.description.tablesorter-header:hover { content: '\f147'; } -.icon-stack-exchange:before { - content: '\f18d'; -} .icon-plus-square-o:before { content: '\f196'; @@ -4195,10 +1153,6 @@ th.description.tablesorter-header:hover { content: '\ea8e'; } -.icon-go-to-last:before { - content: '\ea8f'; -} - /* side-popup adjustments */ body.side-popup { overflow: hidden !important; @@ -4260,135 +1214,6 @@ body.side-popup { color: #3aa9dd; } -table.left-aligned tr td { - text-align: left; -} - -table.left-aligned tr th { - text-align: left; -} - -/* activity log */ - -.activity-log-page { - header { - .wrapper { - grid-template-columns: 1fr 120px; - } - } -} - -.activity-log-container { - width: 92%; - margin: 0 auto; - padding: 32px 0; -} - -.activity-log-container h1 { - text-align: left; - margin-top: 20px; -} - -.activity-log-container h1:first-child { - font-size: 40px; - margin-top: 30px; -} - -.activity-log-container table td, -.activity-log-container table th { - border-bottom: 1px solid #ccc; - border-left: 1px solid #ccc; - padding: 6px 8px; - margin: 1px 0; - text-align: left; - line-height: 25px; -} - -.activity-log-container table th { - font-size: 16px; - font-weight: bold; - background-color: #efefef; -} - -table.activitylog { - border-top: 1px solid #ccc; - border-right: 1px solid #ccc; -} - -.activity-log-page { - background: #fff; -} - -.activity-log-container table td { - font-size: 15px; -} - -.activity-log-container div.search-container { - float: right; - margin: 10px 0 10px 10px; -} - -.activity-log-container h3 { - display: inline; -} - -.activity-log-container span.search-label { - padding-right: 4px; - font-weight: bold; -} - -.activity-log-container h3 { - margin-bottom: 10px; - font-size: 20px; -} - -.activity-log-entry { - line-height: 20px; - padding: 2% 0 0% 0; - text-align: left; -} - -table.activitylog tr:hover { - background: #f7f8f9; -} - -.tablesorter .filtered { - display: none; -} - -table.activitylog th { - font-family: 'icomoon'; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -table.activitylog th.tablesorter-headerAsc .th-inner:after { - content: '\f0dc'; - float: right; -} - -table.activitylog th.tablesorter-headerDesc .th-inner:after { - content: '\f0de'; - float: right; -} - -table.activitylog th .th-inner:after { - content: '\f0dd'; - float: right; -} - -.th-inner span { - font-family: calibri, Arial, Helvetica, sans-serif; - font-weight: bold; -} - .ui.primary.button.button-modal.warning-button.orange.margin.left-10.right-20 { height: 43px; padding: 1px 10px; diff --git a/public/css/sass/commons/_analyze.scss b/public/css/sass/commons/_analyze.scss index 501079941f..aab8ccd1b4 100644 --- a/public/css/sass/commons/_analyze.scss +++ b/public/css/sass/commons/_analyze.scss @@ -202,11 +202,6 @@ body.analyze { text-decoration: none; } } - .custom { - &.popup { - min-width: 90%; - } - } } .word-raw, .matecat-raw { @@ -1077,75 +1072,6 @@ body.analyze { } } -/* Footer */ -.normal-foo { - background-color: $grey4; - min-width: 992px; - - width: 100%; - position: fixed; - bottom: 0; - left: 0; - z-index: 2; - .footer-body { - display: grid; - position: relative; - grid-column-gap: 24px; - grid-template-columns: 0.6fr 0.6fr 1fr; - align-items: center; - padding: 16px 64px; - height: 77px; - .info { - display: grid; - align-items: center; - grid-template-columns: 40px auto; - grid-column-gap: 8px; - .logo { - background-position: center; - background-size: cover; - } - .description { - color: $grey1; - font-weight: 100; - font-size: 12px; - text-align: left; - line-height: 14px; - .link { - color: #00aee4; - text-decoration: underline; - } - } - } - } - .side-info { - padding: 0 16px; - position: absolute; - display: grid; - align-items: center; - bottom: 0; - right: 0; - width: 419px; - height: 35px; - box-shadow: -2px -2px 12px 0 rgba(198, 198, 198, 0.5); - background-color: #ffffff; - .side-info-body { - display: grid; - grid-template-columns: 80px 80px 80px; - align-items: center; - .item { - a { - margin: 0; - padding: 0; - color: $grey1; - display: block; - text-decoration: underline; - text-align: left; - } - } - } - } -} - #action-manage { opacity: 0.8; &:hover { diff --git a/public/css/sass/commons/_icons.scss b/public/css/sass/commons/_icons.scss index eb3487ee47..f9d63444c8 100755 --- a/public/css/sass/commons/_icons.scss +++ b/public/css/sass/commons/_icons.scss @@ -30,9 +30,6 @@ .icon-go-to-first:before { content: '\ea8e'; } -.icon-go-to-last:before { - content: '\ea8f'; -} .icon-no-preview:before { content: '\ea8d'; } @@ -60,21 +57,12 @@ .icon-error_outline:before { content: '\e001'; } -.icon-format_color_fill:before { - content: '\e23a'; -} .icon-power-cord:before { content: '\e291'; } .icon-power-cord2:before { content: '\e292'; } -.icon-file_download:before { - content: '\e2c4'; -} -.icon-collections_bookmark:before { - content: '\e431'; -} .icon-user22:before { content: '\e601'; } @@ -144,9 +132,6 @@ .icon-eye2:before { content: '\f06e'; } -.icon-navicon:before { - content: '\f0c9'; -} .icon-google-plus-square2:before { content: '\f0d5'; } @@ -159,9 +144,6 @@ .icon-star-half-empty:before { content: '\f123'; } -.icon-play-circle:before { - content: '\f144'; -} .icon-notice:before { content: '\e903'; } @@ -1413,9 +1395,6 @@ .icon-minus-square-o:before { content: '\f147'; } -.icon-stack-exchange:before { - content: '\f18d'; -} .icon-plus-square-o:before { content: '\f196'; } diff --git a/public/css/sass/commons/_manage.scss b/public/css/sass/commons/_manage.scss index 470c7b5d54..e802815a5f 100644 --- a/public/css/sass/commons/_manage.scss +++ b/public/css/sass/commons/_manage.scss @@ -412,10 +412,6 @@ div#manage-container { transition: 0.3s ease; background-color: #ffffff; padding: 8px 15px; - - .outsource.modal .popup { - box-shadow: none; - } .job-id { float: left; min-width: 70px; @@ -882,73 +878,6 @@ div#manage-container { } } -.normal-foo { - background-color: $grey4; - min-width: 992px; - width: 100%; - position: fixed; - bottom: 0; - left: 0; - z-index: 2; - .footer-body { - display: grid; - position: relative; - grid-column-gap: 24px; - grid-template-columns: 0.6fr 0.6fr 1fr; - align-items: center; - padding: 16px 64px; - height: 77px; - .info { - display: grid; - align-items: center; - grid-template-columns: 40px auto; - grid-column-gap: 8px; - .logo { - background-position: center; - background-size: cover; - } - .description { - color: $grey1; - font-weight: 100; - font-size: 12px; - text-align: left; - line-height: 14px; - .link { - color: #00aee4; - text-decoration: underline; - } - } - } - } - .side-info { - padding: 0 16px; - position: absolute; - display: grid; - align-items: center; - bottom: 0; - right: 0; - width: 419px; - height: 35px; - box-shadow: -2px -2px 12px 0 rgba(198, 198, 198, 0.5); - background-color: #ffffff; - .side-info-body { - display: grid; - grid-template-columns: 80px 80px 80px; - align-items: center; - .item { - a { - margin: 0; - padding: 0; - color: $grey1; - display: block; - text-decoration: underline; - text-align: left; - } - } - } - } -} - .modal[data-type='view'] { display: none; } diff --git a/public/css/sass/components/CattolFooter.scss b/public/css/sass/components/CattolFooter.scss index 1362b63332..9f26dd2088 100644 --- a/public/css/sass/components/CattolFooter.scss +++ b/public/css/sass/components/CattolFooter.scss @@ -66,4 +66,15 @@ color: $black !important; } } + .stats-foo { + //height: 44px; + background-color: $white; + width: 100%; + //position: fixed; + bottom: 0; + left: 0; + z-index: 2; + display: grid; + min-width: 1024px; + } } diff --git a/public/css/sass/components/Footer.scss b/public/css/sass/components/Footer.scss new file mode 100644 index 0000000000..162b9c2c1d --- /dev/null +++ b/public/css/sass/components/Footer.scss @@ -0,0 +1,78 @@ +.normal-foo { + background-color: $grey4; + min-width: 992px; + width: 100%; + .footer-body { + display: grid; + position: relative; + grid-column-gap: 24px; + padding: 12px 64px; + //grid-template-columns: minmax(auto,440px) auto; + grid-template-columns: minmax(auto, 440px) auto minmax(auto, 440px); + align-items: center; + .info { + display: grid; + align-items: center; + grid-template-columns: 40px auto; + grid-column-gap: 8px; + .image { + display: flex; + align-items: center; + } + .logo { + background-position: center; + background-size: cover; + } + .description { + color: $grey1; + font-weight: 100; + font-size: 12px; + text-align: left; + line-height: 14px; + .link { + color: #00aee4; + text-decoration: underline; + } + } + } + } + .side-info { + margin-top: 4px; + display: flex; + align-items: center; + box-shadow: none; + justify-content: center; + .item { + padding: 0 20px; + display: flex; + gap: 5px; + a { + margin: 0; + color: $grey1; + text-align: left; + font-size: 16px; + font-weight: bold; + text-decoration: none; + display: flex; + align-items: center; + &.email-link { + color: #fff; + background-color: $grey1; + padding: 6px 24px; + border-radius: 2px; + &:hover { + background-color: $grey6; + } + } + } + } + } + .footer-logo { + display: flex; + justify-content: end; + a { + display: flex; + align-items: center; + } + } +} \ No newline at end of file diff --git a/public/css/sass/components/header/FilesMenu.scss b/public/css/sass/components/header/FilesMenu.scss index 75f8eda41a..168d4286a2 100644 --- a/public/css/sass/components/header/FilesMenu.scss +++ b/public/css/sass/components/header/FilesMenu.scss @@ -29,19 +29,6 @@ } } -/*scrollbar*/ -.topMenu ::-webkit-scrollbar { - width: 16px; -} - -.topMenu ::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); -} - -.topMenu ::-webkit-scrollbar-thumb { - -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5); -} - .job-menu-files { top: 50px; display: block; diff --git a/public/css/sass/editlog.scss b/public/css/sass/editlog.scss index bce7cac19f..9408080637 100644 --- a/public/css/sass/editlog.scss +++ b/public/css/sass/editlog.scss @@ -44,8 +44,7 @@ font-size: 18px; } -.translate-box select, -.mgmt-table-mt select { +.translate-box select { width: 257px; height: 37px; padding: 5px; diff --git a/public/css/sass/legacy-misc.scss b/public/css/sass/legacy-misc.scss index 5ffcf1b17b..005ee7050f 100644 --- a/public/css/sass/legacy-misc.scss +++ b/public/css/sass/legacy-misc.scss @@ -69,14 +69,6 @@ h3 { margin-bottom: 4px !important; } -.error-symbol { - position: absolute; - margin: 42px 0 0 -30px; - display: block; - width: 23px; - height: 23px; -} - .field { float: left; width: 35%; @@ -93,25 +85,6 @@ h3 { color: #000 !important; } -table .btn { - width: auto !important; - padding: 0px 20px 0 20px !important; -} - -th.header { - background: #efefef url(../../img/bg.gif) right center no-repeat !important; -} - -th.headerSortUp, -th.tablesorter-headerAsc { - background: #efefef url(../../img/asc.gif) right center no-repeat !important; -} - -th.headerSortDown, -th.tablesorter-headerDesc { - background: #efefef url(../../img/desc.gif) right center no-repeat !important; -} - .searchbox { margin-top: 18px !important; } @@ -691,44 +664,6 @@ blockquote { text-overflow: ellipsis; overflow: hidden; } -.pee-page .tablesorter-filter-row input { - width: 100%; -} -.pee-page tr.tablesorter-headerRow th { - padding: 15px 0 !important; -} -.pee-page th.tablesorter-headerUnSorted { - background: #efefef url(https://www.matecat.com/public/img/bg.gif) right - center no-repeat !important; -} - -.pee-page .tablesorter-filter-row { - background: #f4f4f4; -} - -.pee-page select { - width: 100%; - height: 23px; - background: #fff; -} - -.pee-page div.selectContainer { - width: 92%; - margin: 0 auto; -} - -.pee-page div.selectContainer .dropdown { - width: 200px !important; -} - -.pee-page .notfound { - width: 100%; - margin: 20px auto; - font-size: 26px; - font-style: italic; - color: #999; -} - .chart-container { width: 1200px; margin: 0 auto; diff --git a/public/css/sass/mbc-style.scss b/public/css/sass/mbc-style.scss index eec1a55ea0..e7d710ea31 100644 --- a/public/css/sass/mbc-style.scss +++ b/public/css/sass/mbc-style.scss @@ -693,7 +693,6 @@ article .mbc-comment-balloon-outer { */ #mbc-history { - /* #filterSwitch line 71 style.css */ cursor: pointer; font-size: 23px; height: 27px; @@ -712,7 +711,6 @@ article .mbc-comment-balloon-outer { } #mbc-history:hover { - /* #filterSwitch:hover line 86 style.css */ color: #ccc; } diff --git a/public/css/sass/modals/split_modal.scss b/public/css/sass/modals/split_modal.scss index bba5c1c4d9..78e79ffd16 100644 --- a/public/css/sass/modals/split_modal.scss +++ b/public/css/sass/modals/split_modal.scss @@ -327,17 +327,6 @@ background: #ccc !important; } - .uploadloader { - background: url(../../img/loader.gif) center center no-repeat; - width: 20px; - height: 20px; - float: right; - margin-top: 11px; - position: absolute; - right: 86px; - background-size: 20px 20px; - } - .btn-cancel { padding: 2px 15px !important; float: right; diff --git a/public/css/sass/popup.scss b/public/css/sass/popup.scss index b33ef4bc31..d3a2e319a0 100644 --- a/public/css/sass/popup.scss +++ b/public/css/sass/popup.scss @@ -1,16 +1,6 @@ /*popup*/ .modal, #modal { - .popup-outer { - background: #000; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 12; - opacity: 0.4; - } .popup { overflow: hidden; line-height: 30px; @@ -304,11 +294,6 @@ padding: 1% 0%; } - .onyourown a.uploadbtn.in-popup { - margin: 2% 2.5% 2% 2% !important; - width: 160px; - } - &.outsource.loading .delivery { background: url(../../img/loader.gif) #f6f6f6 center center no-repeat; background-size: 20px; @@ -637,14 +622,6 @@ font-family: 'Calibri', 'Helvetica Neue', Arial, Helvetica, sans-serif; } - .pricebox .continuebtn { - clear: both; - float: none; - width: 160px; - margin: 10px auto 0 auto !important; - overflow: hidden; - } - .paymentinfo p { font-size: 15px; } @@ -1416,17 +1393,6 @@ margin-top: 25px !important; margin-right: 35px; } - - a.btn-cancel.in-popup.cancelForceDelivery { - margin-right: 40px !important; - height: 15px; - } - - a.btn-cancel.in-popup.cancelForceDelivery:hover { - margin-right: 40px !important; - color: #333333; - } - .modal-outsource-datepicker .delivery-selected { color: #000 !important; } @@ -1692,10 +1658,7 @@ } /******** Outsource Modal *******/ - &.outsource .uploadbtn.in-popup, - &.outsource .continuebtn, - &.outsource .standardbtn, - &.outsource .send-to-translator-btn.in-popup { + &.outsource .standardbtn { background: $translatedBlue; font-weight: bold; -webkit-transition: all 100ms ease-in; @@ -1718,34 +1681,14 @@ width: 160px; } - &.outsource .send-to-translator-btn.in-popup { - margin-left: 30px; - } - &.outsource .uploadbtn:hover, - &.outsource .continuebtn:hover, - &.outsource .standardbtn:hover, - &.outsource .send-to-translator-btn.in-popup:hover { + &.outsource .standardbtn:hover { -moz-box-shadow: 0 1px 2px #666; -webkit-box-shadow: 0 1px 2px #666; box-shadow: 0 1px 2px #666; background: #12b4df; } - &.outsource .continuebtn { - clear: both; - float: none; - width: 160px; - margin: 10px auto 0 auto !important; - overflow: hidden; - background: #7eaf3e; - display: block; - } - - &.outsource .continuebtn:hover { - background: #7eaf3e; - } - &.outsource .more:before { content: '\f196'; margin-right: 7px; diff --git a/public/css/sass/quality-report.scss b/public/css/sass/quality-report.scss index bfa9837c50..9c41a1d0ba 100644 --- a/public/css/sass/quality-report.scss +++ b/public/css/sass/quality-report.scss @@ -1007,12 +1007,6 @@ header { } } -footer { - #statistics { - display: none; - } -} - .no-segments-found { text-align: center; margin: 15px 0; diff --git a/public/css/sass/style.scss b/public/css/sass/style.scss index 34192fba68..e5f4f00d03 100644 --- a/public/css/sass/style.scss +++ b/public/css/sass/style.scss @@ -94,7 +94,6 @@ header .wrapper { text-decoration: none; } -#filterSwitch, #advancedOptions { text-align: center; width: 45px; @@ -109,7 +108,6 @@ header .wrapper { color: #fff; } -#filterSwitch:hover, #point2seg:hover { color: #ccc; } @@ -983,8 +981,7 @@ article .approved:active { color: #fff !important; } -.draft, -.header-menu .wrapper-dropdown-5 { +.draft{ background: -webkit-gradient( linear, left top, @@ -996,74 +993,6 @@ article .approved:active { background: linear-gradient(top, #f5f5f5, #d3d4d5); } -/*buttons editor*/ - -.topmenu-drop { - height: 31px !important; - margin: 3px 0; - box-shadow: none; -} - -.topmenu-drop input, -.wrapper-dropdown-5 input { - border: none !important; - box-shadow: none; - cursor: pointer; -} - -.topmenu-drop input { - font-weight: normal; - border: 0; - padding: 5px 10px !important; - font-size: 17px !important; - text-align: center; - min-width: 130px; - height: 31px !important; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - border-radius: 0; - color: #403e3e; -} - -.topmenu-drop input.translated { - background: $translatedBlue; - color: #fff !important; -} - -.topmenu-drop input.translated, -.topmenu-drop input.approved { - width: auto !important; - border-radius: 2px 0 0 2px; - padding: 0 18px !important; - text-transform: uppercase; - margin: 0 !important; -} - -.topmenu-drop input.approved:hover { - background: #76bb70; -} - -.topmenu-drop input.translated:hover { - background: #12b4df; -} - -.topmenu-drop .text { - margin: 0; -} - -.wrapper-dropdown-5 input { - width: auto !important; - float: left; -} - -.header-menu .wrapper-dropdown-5 { - margin: 3px 0 !important; - box-shadow: none; - width: 13px; - padding: 6px 10px !important; -} - .header-menu li:first-child { margin-right: 15px; } @@ -1072,17 +1001,6 @@ article .approved:active { margin-right: 15px; } -.header-menu - .wrapper-dropdown-5 - .dropdown[data-download='false'] - li.downloadTranslation, -.header-menu - .wrapper-dropdown-5 - .dropdown[data-download='true'] - li.previewLink { - display: none; -} - .topmenu-drop form { margin-right: 0; } @@ -1244,8 +1162,6 @@ section .body > .text { float: left; }*/ -.popup-tm .text, -.popup-tm .text:hover, .header-menu .text, .header-menu .text:hover { background: transparent; @@ -1356,15 +1272,6 @@ ul.suggestion-item.graysmall:last-child { width: 100%; } -/*.submenu {*/ -/*display: none;*/ -/*}*/ - -.popup .submenu { - display: block; - padding-top: 20px; -} - .submenu:after { content: '.'; display: block; @@ -1546,23 +1453,11 @@ body .footer.showMatches .sub-editor.open { background-position-x: 49.8%; } -//.sub-editor.glossary .private-tm-key { -// float: left; -// padding-top: 12px; -// margin-left: 20px; -//} - .footer-message { margin-left: 20px; background: #ffde33 !important; padding: 2px 10px; } -// -//.sub-editor.glossary .gl-search.setting .set-glossary { -// background: url(../../img/loading.gif); -// background-size: 20px; -// cursor: pointer; -//} .sub-editor .gl-search .search-source, .sub-editor .gl-search .search-target, @@ -1606,78 +1501,6 @@ body .footer.showMatches .sub-editor.open { clear: both; } -//.sub-editor.glossary .gl-search .gl-comment { -// display: block; -//} -// -//.sub-editor .gl-search .set-glossary { -// float: left; -// height: 20px; -// font-size: 24px; -// width: 26px; -// margin: 21px 0 0 0; -// color: $grey1; -// cursor: pointer; -//} -// -//.sub-editor .gl-search .set-glossary.disabled, -//.sub-editor .gl-search .set-glossary.disabled:hover { -// border: none !important; -// opacity: 0.5 !important; -//} - -//.sub-editor .gl-search .comment { -// float: left; -// text-align: left; -// width: 96%; -// margin-bottom: 8px; -//} -// -//.sub-editor .gl-search .comment a, -//.sub-editor .glossary-add-comment a { -// float: left; -// margin: 0 1.5% 0 1.5%; -// text-decoration: none; -// color: $grey1; -// width: 50%; -// font-size: 80%; -// font-style: italic; -//} -// -//.sub-editor .gl-search .comment a:hover, -//.sub-editor .glossary-add-comment a:hover { -// color: #000; -//} -// -//.glossary-add-comment { -// float: left; -// text-align: left; -// width: 50%; -// margin-bottom: 8px; -//} -// -//.sub-editor .glossary-add-comment a { -// font-size: 90%; -// margin-bottom: 11px; -// margin-left: 29px; -//} -// -//.glossary-add-comment .input.gl-comment { -// width: 93%; -// margin-left: 30px; -//} - -//.content { -// float: left; -// clear: both; -// border: 1px solid #ccf; -// border-top: none; -// border-left: none; -// background: #eef; -// padding: 10px 20px 20px; -// width: 400px; -//} - .preview { font-family: Cambria, Arial, Helvetica, sans-serif !important; height: 300px; @@ -2607,34 +2430,6 @@ body.rtl-target .editor .editarea span { } } -.graysmall.notEditable:hover { - /*background: #999;*/ -} - -/*.graysmall:hover li span { - color: #000 !important -}*/ - -//.sub-editor.glossary .glossary-item { -// float: right; -// width: 100%; -// margin-top: 2px; -// padding: 3px 0px 3px 0; -// text-align: left; -// background: $grey2; -// border-top: 1px solid #999; -// border-bottom: 1px solid #999; -//} - -//.glossary .sugg-target { -// cursor: pointer; -//} -// -//.sub-editor.glossary .glossary-item span { -// margin-left: 20px; -// font-style: italic; -//} - .message:hover { background: #fbfbfb !important; cursor: auto; @@ -3370,8 +3165,7 @@ section.opened.editor .status { width: 43%; } - #notifbox, - #filterSwitch { + #notifbox { width: 45px; } @@ -3419,8 +3213,7 @@ section.opened.editor .status { } @media screen and (max-width: 1100px) { - #notifbox, - #filterSwitch { + #notifbox { width: 45px; } @@ -3541,32 +3334,6 @@ p.percent { section.modified .save-warning { display: none; } - -#advancedOptions .more-options { - font-size: 25px; -} - -#advancedOptions .more-options:hover { - color: $grey2; -} - -#advancedOptions .more-options:before { - margin-right: 0; -} - -#filterSwitch .numbererror { - display: none; - margin: -28px 0 0 30px !important; -} - -body.searchActive #filterSwitch .numbererror { - display: block; -} - -body.searchActive #filterSwitch .numbererror:empty { - display: none; -} - .tag-autocomplete { display: block; position: absolute; @@ -3722,7 +3489,6 @@ del.diff { */ } -section .toolbar .tagModeToggle, section .toolbar .autofillTag { float: left; font-size: 60%; @@ -3736,21 +3502,6 @@ section .toolbar span { margin-left: 1px; } -.tagModeToggle span:before { - float: left; -} - -.tagModeToggle.active { - padding: 2px 1px 2px 0; - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - background-color: #eee; - background-image: -webkit-linear-gradient(top, #eee, #e0e0e0); -} - -.tagModeToggle.active span { - font-size: 100% !important; -} - .autofillTag { display: block; float: left; @@ -3911,7 +3662,6 @@ section .toolbar .autofillTag { display: none; } -.tagModeToggle, .autofillTag { padding: 4px 2px 0px 2px; border: 1px solid #fff; @@ -3924,17 +3674,11 @@ section .toolbar .autofillTag { .tagLockCustomize:hover, .tagLockCustomize.active, -.tagModeToggle:hover, -.tagModeToggle.active, .autofillTag:hover, .autofillTag.active { color: #333 !important; } -.icon-tag-expand { - display: none; -} - section .toolbar { display: none; margin-left: -10px; @@ -3944,21 +3688,9 @@ section.editor .toolbar { display: block; } -.tagModeToggle span, .autofillTag span { float: left; } - -.tagModeToggle.active span.icon-chevron-right { - margin-left: 0px; -} - -.tagModeToggle.active .icon-tag-expand { - display: inline-block; - font-weight: bold; - padding-top: 6px; -} - .textarea-container .tagMode { position: absolute; display: none; @@ -3967,7 +3699,6 @@ section.editor .toolbar { margin-top: -23px; } -.tagModeToggle, .autofillTag, .tagLockCustomize { margin-right: 10px; @@ -3977,13 +3708,11 @@ body .editor.hasTags .textarea-container .tagMode { display: block; } -body .editor.hasTagsToggle .toolbar .tagModeToggle, body .editor.hasTagsToggle .toolbar .tagLockCustomize, body .editor.hasTagsAutofill .toolbar .autofillTag { display: block; } -body.tagmarkDisabled .toolbar .tagModeToggle, body.tagmarkDisabled .toolbar .autofillTag { display: none !important; } @@ -3992,14 +3721,6 @@ body.tagmarkDisabled .toolbar .autofillTag { content: '\e990'; } -.tagModeToggle span.icon-expand, -.tagModeToggle span.icon-compress { - -ms-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - transform: rotate(45deg); - display: inline-block; -} - .textarea-container .tagMode li { display: inline-block; width: 40px; @@ -4290,29 +4011,6 @@ body.tagmode-default-extended .textarea-container .tagMode li.extended, text-decoration: none; } -body.cattool table.mgmt-mt th.action { - display: none; -} - -body.cattool table.mgmt-mt tbody .action { - display: none; -} - -body.isAnonymous .add-mt-engine { - display: none; -} - -body.cattool .mgmt-table-mt .add-mt-engine { - display: none; -} - -body.cattool .mgmt-table-mt tbody tr { - opacity: 0.6; -} - -body.cattool .mgmt-table-mt .activemt { - opacity: 1 !important; -} .splitContainer { position: relative; diff --git a/public/css/sass/upload-main.scss b/public/css/sass/upload-main.scss index b5d95940c6..2981082ec0 100644 --- a/public/css/sass/upload-main.scss +++ b/public/css/sass/upload-main.scss @@ -7,15 +7,13 @@ @import 'commons/icons'; @import 'commons/nav-bar'; @import 'commons/team-member'; +@import 'commons/aria-label-tooltip'; +@import 'commons/tooltip'; @import 'common-main'; @import 'common'; -@import 'popup'; -@import 'commons/tooltip'; @import 'modals/language-selector'; -@import 'commons/aria-label-tooltip'; @import 'components/common/HomePageSection'; -@import 'common-components'; @import 'upload-page'; @import 'components/common/Select'; @import 'components/common/Dropdown'; @@ -30,6 +28,7 @@ @import 'components/common/SegmentedControl'; @import 'components/common/Accordion'; @import 'components/signin/OnBoarding'; +@import 'components/Footer'; @import 'settingsPanel'; @@ -168,25 +167,6 @@ display: inline-block; } } - div#add-tmx-option:hover, - div#add-multiple-lang:hover { - background: rgba(0, 0, 0, 0.05); - } - div#add-tmx-option, - div#add-multiple-lang { - cursor: pointer; - color: #39699a; - font-size: 14px; - margin: 0; - padding: 15px; - .icon { - float: right; - font-size: 24px; - margin-top: -3px; - margin-right: 1px; - color: #39699a; - } - } div.item { width: 100%; min-width: 128px; @@ -326,25 +306,6 @@ width: 150px; } } - div#add-tmx-option:hover, - div#add-multiple-lang:hover { - background: rgba(0, 0, 0, 0.05); - } - div#add-tmx-option, - div#add-multiple-lang { - cursor: pointer; - color: #39699a; - font-size: 14px; - margin: 0; - padding: 15px; - .icon { - float: right; - font-size: 24px; - margin-top: -3px; - margin-right: 1px; - color: #39699a; - } - } div.item { width: 100%; min-width: 128px; @@ -392,11 +353,6 @@ width: 140px; } } - .translate-box.settings { - .more-options { - margin: 0; - } - } .translate-box.tmx-select { margin-right: 0; } @@ -424,10 +380,10 @@ min-height: 200px; -moz-border-radius: 4px; background: #fff; - display: flex; - flex-direction: column; justify-content: center; align-items: stretch; + display: flex; + flex-direction: column; text-align: center; gap: 12px; @@ -442,6 +398,17 @@ } } +.uploadloader { + background: url(../../img/loader.gif) center center no-repeat; + width: 20px; + height: 20px; + float: right; + margin-top: 3px; + position: absolute; + right: 233px; + background-size: 20px 20px; +} + @media only screen and (min-width: 1600px) { .wrapper-upload { .translate-box { diff --git a/public/css/sass/upload-page.scss b/public/css/sass/upload-page.scss index ff48d64d96..0182b8c4ba 100644 --- a/public/css/sass/upload-page.scss +++ b/public/css/sass/upload-page.scss @@ -1313,25 +1313,6 @@ button.ui-button::-moz-focus-inner { max-height: none !important; overflow: hidden !important; } - div#add-tmx-option:hover, - div#add-multiple-lang:hover { - background: rgba(0, 0, 0, 0.05); - } - div#add-tmx-option, - div#add-multiple-lang { - cursor: pointer; - color: #39699a; - font-size: 14px; - margin: 0; - padding: 15px; - .icon { - float: right; - font-size: 24px; - margin-top: -3px; - margin-right: 1px; - color: #39699a; - } - } div.item { width: 100%; min-width: 150px; @@ -2002,10 +1983,6 @@ body { border-radius: 2px; } -.mgmt-table-mt select { - font-size: 14px; -} - .upload-input { padding: 3px 5px 3px 9px; font-size: 16px !important; @@ -2832,10 +2809,6 @@ header .open-more { z-index: -1000; } -.text-center { - text-align: center; -} - .zip_internal_file /*:before*/ { /*content: "\ea58";*/ /* margin-left: 15px;*/ @@ -2913,21 +2886,6 @@ div.continue-gdrive { display: none; } -.wrapper-dropdown-5 { - padding: 4px 16px !important; -} -.google-login-button { - box-sizing: content-box; -} - -#sign-in-o-mt { - width: 300px !important; -} - -.btn-confirm-small { - //height: 35px; -} - header .nav-bar .dropdown.select-org span.text { line-height: 32px; } @@ -2976,10 +2934,6 @@ select:focus { box-shadow: inset 0 1px 3px #ddd; } -a.pull-left.btn-grey.canceladdtmx { - margin-left: 4px; -} - a.pull-right.confirmDelete { margin-right: 3px; } diff --git a/public/js/cat_source/es6/components/header/ActionMenu.js b/public/js/cat_source/es6/components/header/ActionMenu.js index 2a7da83ba3..02f6f6aecb 100644 --- a/public/js/cat_source/es6/components/header/ActionMenu.js +++ b/public/js/cat_source/es6/components/header/ActionMenu.js @@ -131,9 +131,6 @@ export const ActionMenu = ({ > Shortcuts - {/*
  • */} - {/* Editing Log*/} - {/*
  • */} ) } diff --git a/public/js/cat_source/es6/components/segments/SegmentPlaceholderLite.js b/public/js/cat_source/es6/components/segments/SegmentPlaceholderLite.js index 21951168ac..fadfed0074 100644 --- a/public/js/cat_source/es6/components/segments/SegmentPlaceholderLite.js +++ b/public/js/cat_source/es6/components/segments/SegmentPlaceholderLite.js @@ -162,15 +162,6 @@ class SegmentPlaceholderLite extends React.Component { > QR - - - - - { > QR - - - - - // class from cssIcon - onRenderTemplate : null, // function( index, template ){ return template; }, // template is a string - onRenderHeader : null, // function( index ){}, // nothing to return - - // *** functionality - cancelSelection : true, // prevent text selection in the header - tabIndex : true, // add tabindex to header for keyboard accessibility - dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd' - sortMultiSortKey : 'shiftKey', // key used to select additional columns - sortResetKey : 'ctrlKey', // key used to remove sorting on a column - usNumberFormat : false, // false for German '1.234.567,89' or French '1 234 567,89' - delayInit : false, // if false, the parsed table contents will not update until the first sort - serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used. - resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed - - // *** sort options - headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc. - ignoreCase : true, // ignore case while sorting - sortForce : null, // column(s) first sorted; always applied - sortList : [], // Initial sort order; applied initially; updated when manually sorted - sortAppend : null, // column(s) sorted last; always applied - sortStable : false, // when sorting two rows with exactly the same content, the original sort order is maintained - - sortInitialOrder : 'asc', // sort direction on first click - sortLocaleCompare: false, // replace equivalent character (accented characters) - sortReset : false, // third click on the header will reset column to default - unsorted - sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns - - emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin - stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero - duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column - textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ){} - textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function) - textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText] - numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue ) - - // *** widget options - initWidgets : true, // apply widgets on tablesorter initialization - widgetClass : 'widget-{name}', // table class name template to match to include a widget - widgets : [], // method to add widgets, e.g. widgets: ['zebra'] - widgetOptions : { - zebra : [ 'even', 'odd' ] // zebra widget alternating row class names - }, - - // *** callbacks - initialized : null, // function( table ){}, - - // *** extra css class names - tableClass : '', - cssAsc : '', - cssDesc : '', - cssNone : '', - cssHeader : '', - cssHeaderRow : '', - cssProcessing : '', // processing icon applied to header during sort/filter - - cssChildRow : 'tablesorter-childRow', // class name indiciating that a row is to be attached to its parent - cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!) - cssNoSort : 'tablesorter-noSort', // class name added to element inside header; clicking on it won't cause a sort - cssIgnoreRow : 'tablesorter-ignoreRow', // header row to ignore; cells within this row will not be added to c.$headers - - cssIcon : 'tablesorter-icon', // if this class does not exist, the {icon} will not be added from the headerTemplate - cssIconNone : '', // class name added to the icon when there is no column sort - cssIconAsc : '', // class name added to the icon when the column has an ascending sort - cssIconDesc : '', // class name added to the icon when the column has a descending sort - - // *** events - pointerClick : 'click', - pointerDown : 'mousedown', - pointerUp : 'mouseup', - - // *** selectors - selectorHeaders : '> thead th, > thead td', - selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort - selectorRemove : '.remove-me', - - // *** advanced - debug : false, - - // *** Internal variables - headerList: [], - empties: {}, - strings: {}, - parsers: [] - - // removed: widgetZebra: { css: ['even', 'odd'] } - - }, - - // internal css classes - these will ALWAYS be added to - // the table and MUST only contain one class name - fixes #381 - css : { - table : 'tablesorter', - cssHasChild: 'tablesorter-hasChildRow', - childRow : 'tablesorter-childRow', - colgroup : 'tablesorter-colgroup', - header : 'tablesorter-header', - headerRow : 'tablesorter-headerRow', - headerIn : 'tablesorter-header-inner', - icon : 'tablesorter-icon', - processing : 'tablesorter-processing', - sortAsc : 'tablesorter-headerAsc', - sortDesc : 'tablesorter-headerDesc', - sortNone : 'tablesorter-headerUnSorted' - }, - - // labels applied to sortable headers for accessibility (aria) support - language : { - sortAsc : 'Ascending sort applied, ', - sortDesc : 'Descending sort applied, ', - sortNone : 'No sort applied, ', - sortDisabled : 'sorting is disabled', - nextAsc : 'activate to apply an ascending sort', - nextDesc : 'activate to apply a descending sort', - nextNone : 'activate to remove the sort' - }, - - regex : { - templateContent : /\{content\}/g, - templateIcon : /\{icon\}/g, - templateName : /\{name\}/i, - spaces : /\s+/g, - nonWord : /\W/g, - formElements : /(input|select|button|textarea)/i, - - // *** sort functions *** - // regex used in natural sort - // chunk/tokenize numbers & letters - chunk : /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, - // replace chunks @ ends - chunks : /(^\\0|\\0$)/, - hex : /^0x[0-9a-f]+$/i, - - // *** formatFloat *** - comma : /,/g, - digitNonUS : /[\s|\.]/g, - digitNegativeTest : /^\s*\([.\d]+\)/, - digitNegativeReplace : /^\s*\(([.\d]+)\)/, - - // *** isDigit *** - digitTest : /^[\-+(]?\d+[)]?$/, - digitReplace : /[,.'"\s]/g - - }, - - // digit sort, text location - string : { - max : 1, - min : -1, - emptymin : 1, - emptymax : -1, - zero : 0, - none : 0, - 'null' : 0, - top : true, - bottom : false - }, - - keyCodes : { - enter : 13 - }, - - // placeholder date parser data (globalize) - dates : {}, - - // These methods can be applied on table.config instance - instanceMethods : {}, - - /* - ▄█████ ██████ ██████ ██ ██ █████▄ - ▀█▄ ██▄▄ ██ ██ ██ ██▄▄██ - ▀█▄ ██▀▀ ██ ██ ██ ██▀▀▀ - █████▀ ██████ ██ ▀████▀ ██ - */ - - setup : function( table, c ) { - // if no thead or tbody, or tablesorter is already present, quit - if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) { - if ( c.debug ) { - if ( table.hasInitialized ) { - console.warn( 'Stopping initialization. Tablesorter has already been initialized' ); - } else { - console.error( 'Stopping initialization! No table, thead or tbody', table ); - } - } - return; - } - - var tmp = '', - $table = $( table ), - meta = $.metadata; - // initialization flag - table.hasInitialized = false; - // table is being processed flag - table.isProcessing = true; - // make sure to store the config object - table.config = c; - // save the settings where they read - $.data( table, 'tablesorter', c ); - if ( c.debug ) { - console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' ); - $.data( table, 'startoveralltimer', new Date() ); - } - - // removing this in version 3 (only supports jQuery 1.7+) - c.supportsDataObject = ( function( version ) { - version[ 0 ] = parseInt( version[ 0 ], 10 ); - return ( version[ 0 ] > 1 ) || ( version[ 0 ] === 1 && parseInt( version[ 1 ], 10 ) >= 4 ); - })( $.fn.jquery.split( '.' ) ); - // ensure case insensitivity - c.emptyTo = c.emptyTo.toLowerCase(); - c.stringTo = c.stringTo.toLowerCase(); - c.last = { sortList : [], clickedIndex : -1 }; - // add table theme class only if there isn't already one there - if ( !/tablesorter\-/.test( $table.attr( 'class' ) ) ) { - tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' ); - } - c.table = table; - c.$table = $table - .addClass( ts.css.table + ' ' + c.tableClass + tmp ) - .attr( 'role', 'grid' ); - c.$headers = $table.find( c.selectorHeaders ); - - // give the table a unique id, which will be used in namespace binding - if ( !c.namespace ) { - c.namespace = '.tablesorter' + Math.random().toString( 16 ).slice( 2 ); - } else { - // make sure namespace starts with a period & doesn't have weird characters - c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' ); - } - - c.$table.children().children( 'tr' ).attr( 'role', 'row' ); - c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ).attr({ - 'aria-live' : 'polite', - 'aria-relevant' : 'all' - }); - if ( c.$table.children( 'caption' ).length ) { - tmp = c.$table.children( 'caption' )[ 0 ]; - if ( !tmp.id ) { tmp.id = c.namespace.slice( 1 ) + 'caption'; } - c.$table.attr( 'aria-labelledby', tmp.id ); - } - c.widgetInit = {}; // keep a list of initialized widgets - // change textExtraction via data-attribute - c.textExtraction = c.$table.attr( 'data-text-extraction' ) || c.textExtraction || 'basic'; - // build headers - ts.buildHeaders( c ); - // fixate columns if the users supplies the fixedWidth option - // do this after theme has been applied - ts.fixColumnWidth( table ); - // add widgets from class name - ts.addWidgetFromClass( table ); - // add widget options before parsing (e.g. grouping widget has parser settings) - ts.applyWidgetOptions( table ); - // try to auto detect column type, and store in tables config - ts.setupParsers( c ); - // start total row count at zero - c.totalRows = 0; - // build the cache for the tbody cells - // delayInit will delay building the cache until the user starts a sort - if ( !c.delayInit ) { ts.buildCache( c ); } - // bind all header events and methods - ts.bindEvents( table, c.$headers, true ); - ts.bindMethods( c ); - // get sort list from jQuery data or metadata - // in jQuery < 1.4, an error occurs when calling $table.data() - if ( c.supportsDataObject && typeof $table.data().sortlist !== 'undefined' ) { - c.sortList = $table.data().sortlist; - } else if ( meta && ( $table.metadata() && $table.metadata().sortlist ) ) { - c.sortList = $table.metadata().sortlist; - } - // apply widget init code - ts.applyWidget( table, true ); - // if user has supplied a sort list to constructor - if ( c.sortList.length > 0 ) { - ts.sortOn( c, c.sortList, {}, !c.initWidgets ); - } else { - ts.setHeadersCss( c ); - if ( c.initWidgets ) { - // apply widget format - ts.applyWidget( table, false ); - } - } - - // show processesing icon - if ( c.showProcessing ) { - $table - .unbind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace ) - .bind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace, function( e ) { - clearTimeout( c.timerProcessing ); - ts.isProcessing( table ); - if ( e.type === 'sortBegin' ) { - c.timerProcessing = setTimeout( function() { - ts.isProcessing( table, true ); - }, 500 ); - } - }); - } - - // initialized - table.hasInitialized = true; - table.isProcessing = false; - if ( c.debug ) { - console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) ); - if ( c.debug && console.groupEnd ) { console.groupEnd(); } - } - $table.triggerHandler( 'tablesorter-initialized', table ); - if ( typeof c.initialized === 'function' ) { - c.initialized( table ); - } - }, - - bindMethods : function( c ) { - var $table = c.$table, - namespace = c.namespace, - events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' + - 'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' + - 'mouseleave ' ).split( ' ' ) - .join( namespace + ' ' ); - // apply easy methods that trigger bound events - $table - .unbind( events.replace( ts.regex.spaces, ' ' ) ) - .bind( 'sortReset' + namespace, function( e, callback ) { - e.stopPropagation(); - // using this.config to ensure functions are getting a non-cached version of the config - ts.sortReset( this.config, callback ); - }) - .bind( 'updateAll' + namespace, function( e, resort, callback ) { - e.stopPropagation(); - ts.updateAll( this.config, resort, callback ); - }) - .bind( 'update' + namespace + ' updateRows' + namespace, function( e, resort, callback ) { - e.stopPropagation(); - ts.update( this.config, resort, callback ); - }) - .bind( 'updateHeaders' + namespace, function( e, callback ) { - e.stopPropagation(); - ts.updateHeaders( this.config, callback ); - }) - .bind( 'updateCell' + namespace, function( e, cell, resort, callback ) { - e.stopPropagation(); - ts.updateCell( this.config, cell, resort, callback ); - }) - .bind( 'addRows' + namespace, function( e, $row, resort, callback ) { - e.stopPropagation(); - ts.addRows( this.config, $row, resort, callback ); - }) - .bind( 'updateComplete' + namespace, function() { - this.isUpdating = false; - }) - .bind( 'sorton' + namespace, function( e, list, callback, init ) { - e.stopPropagation(); - ts.sortOn( this.config, list, callback, init ); - }) - .bind( 'appendCache' + namespace, function( e, callback, init ) { - e.stopPropagation(); - ts.appendCache( this.config, init ); - if ( $.isFunction( callback ) ) { - callback( this ); - } - }) - // $tbodies variable is used by the tbody sorting widget - .bind( 'updateCache' + namespace, function( e, callback, $tbodies ) { - e.stopPropagation(); - ts.updateCache( this.config, callback, $tbodies ); - }) - .bind( 'applyWidgetId' + namespace, function( e, id ) { - e.stopPropagation(); - ts.applyWidgetId( this, id ); - }) - .bind( 'applyWidgets' + namespace, function( e, init ) { - e.stopPropagation(); - // apply widgets - ts.applyWidget( this, init ); - }) - .bind( 'refreshWidgets' + namespace, function( e, all, dontapply ) { - e.stopPropagation(); - ts.refreshWidgets( this, all, dontapply ); - }) - .bind( 'removeWidget' + namespace, function( e, name, refreshing ) { - e.stopPropagation(); - ts.removeWidget( this, name, refreshing ); - }) - .bind( 'destroy' + namespace, function( e, removeClasses, callback ) { - e.stopPropagation(); - ts.destroy( this, removeClasses, callback ); - }) - .bind( 'resetToLoadState' + namespace, function( e ) { - e.stopPropagation(); - // remove all widgets - ts.removeWidget( this, true, false ); - // restore original settings; this clears out current settings, but does not clear - // values saved to storage. - c = $.extend( true, ts.defaults, c.originalSettings ); - this.hasInitialized = false; - // setup the entire table again - ts.setup( this, c ); - }); - }, - - bindEvents : function( table, $headers, core ) { - table = $( table )[ 0 ]; - var tmp, - c = table.config, - namespace = c.namespace, - downTarget = null; - if ( core !== true ) { - $headers.addClass( namespace.slice( 1 ) + '_extra_headers' ); - tmp = $.fn.closest ? $headers.closest( 'table' )[ 0 ] : $headers.parents( 'table' )[ 0 ]; - if ( tmp && tmp.nodeName === 'TABLE' && tmp !== table ) { - $( tmp ).addClass( namespace.slice( 1 ) + '_extra_table' ); - } - } - tmp = ( c.pointerDown + ' ' + c.pointerUp + ' ' + c.pointerClick + ' sort keyup ' ) - .replace( ts.regex.spaces, ' ' ) - .split( ' ' ) - .join( namespace + ' ' ); - // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc) - $headers - // http://stackoverflow.com/questions/5312849/jquery-find-self; - .find( c.selectorSort ) - .add( $headers.filter( c.selectorSort ) ) - .unbind( tmp ) - .bind( tmp, function( e, external ) { - var $cell, cell, temp, - $target = $( e.target ), - // wrap event type in spaces, so the match doesn't trigger on inner words - type = ' ' + e.type + ' '; - // only recognize left clicks - if ( ( ( e.which || e.button ) !== 1 && !type.match( ' ' + c.pointerClick + ' | sort | keyup ' ) ) || - // allow pressing enter - ( type === ' keyup ' && e.which !== ts.keyCodes.enter ) || - // allow triggering a click event (e.which is undefined) & ignore physical clicks - ( type.match( ' ' + c.pointerClick + ' ' ) && typeof e.which !== 'undefined' ) ) { - return; - } - // ignore mouseup if mousedown wasn't on the same target - if ( type.match( ' ' + c.pointerUp + ' ' ) && downTarget !== e.target && external !== true ) { - return; - } - // set target on mousedown - if ( type.match( ' ' + c.pointerDown + ' ' ) ) { - downTarget = e.target; - // preventDefault needed or jQuery v1.3.2 and older throws an - // "Uncaught TypeError: handler.apply is not a function" error - temp = $target.jquery.split( '.' ); - if ( temp[ 0 ] === '1' && temp[ 1 ] < 4 ) { e.preventDefault(); } - return; - } - downTarget = null; - // prevent sort being triggered on form elements - if ( ts.regex.formElements.test( e.target.nodeName ) || - // nosort class name, or elements within a nosort container - $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 || - // elements within a button - $target.parents( 'button' ).length > 0 ) { - return !c.cancelSelection; - } - if ( c.delayInit && ts.isEmptyObject( c.cache ) ) { - ts.buildCache( c ); - } - // jQuery v1.2.6 doesn't have closest() - $cell = $.fn.closest ? $( this ).closest( 'th, td' ) : - /TH|TD/.test( this.nodeName ) ? $( this ) : $( this ).parents( 'th, td' ); - // reference original table headers and find the same cell - // don't use $headers or IE8 throws an error - see #987 - temp = $headers.index( $cell ); - c.last.clickedIndex = ( temp < 0 ) ? $cell.attr( 'data-column' ) : temp; - // use column index if $headers is undefined - cell = c.$headers[ c.last.clickedIndex ]; - if ( cell && !cell.sortDisabled ) { - ts.initSort( c, cell, e ); - } - }); - if ( c.cancelSelection ) { - // cancel selection - $headers - .attr( 'unselectable', 'on' ) - .bind( 'selectstart', false ) - .css({ - 'user-select' : 'none', - 'MozUserSelect' : 'none' // not needed for jQuery 1.8+ - }); - } - }, - - buildHeaders : function( c ) { - var $temp, icon, timer, indx; - c.headerList = []; - c.headerContent = []; - c.sortVars = []; - if ( c.debug ) { - timer = new Date(); - } - // children tr in tfoot - see issue #196 & #547 - // don't pass table.config to computeColumnIndex here - widgets (math) pass it to "quickly" index tbody cells - c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) ); - // add icon if cssIcon option exists - icon = c.cssIcon ? - '' : - ''; - // redefine c.$headers here in case of an updateAll that replaces or adds an entire header cell - see #683 - c.$headers = $( $.map( c.$table.find( c.selectorHeaders ), function( elem, index ) { - var configHeaders, header, column, template, tmp, - $elem = $( elem ); - // ignore cell (don't add it to c.$headers) if row has ignoreRow class - if ( $elem.parent().hasClass( c.cssIgnoreRow ) ) { return; } - // make sure to get header cell & not column indexed cell - configHeaders = ts.getColumnData( c.table, c.headers, index, true ); - // save original header content - c.headerContent[ index ] = $elem.html(); - // if headerTemplate is empty, don't reformat the header cell - if ( c.headerTemplate !== '' && !$elem.find( '.' + ts.css.headerIn ).length ) { - // set up header template - template = c.headerTemplate - .replace( ts.regex.templateContent, $elem.html() ) - .replace( ts.regex.templateIcon, $elem.find( '.' + ts.css.icon ).length ? '' : icon ); - if ( c.onRenderTemplate ) { - header = c.onRenderTemplate.apply( $elem, [ index, template ] ); - // only change t if something is returned - if ( header && typeof header === 'string' ) { - template = header; - } - } - $elem.html( '
    ' + template + '
    ' ); // faster than wrapInner - } - if ( c.onRenderHeader ) { - c.onRenderHeader.apply( $elem, [ index, c, c.$table ] ); - } - column = parseInt( $elem.attr( 'data-column' ), 10 ); - elem.column = column; - tmp = ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder; - // this may get updated numerous times if there are multiple rows - c.sortVars[ column ] = { - count : -1, // set to -1 because clicking on the header automatically adds one - order: ts.getOrder( tmp ) ? - [ 1, 0, 2 ] : // desc, asc, unsorted - [ 0, 1, 2 ], // asc, desc, unsorted - lockedOrder : false - }; - tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false; - if ( typeof tmp !== 'undefined' && tmp !== false ) { - c.sortVars[ column ].lockedOrder = true; - c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1, 1 ] : [ 0, 0, 0 ]; - } - // add cell to headerList - c.headerList[ index ] = elem; - // add to parent in case there are multiple rows - $elem - .addClass( ts.css.header + ' ' + c.cssHeader ) - .parent() - .addClass( ts.css.headerRow + ' ' + c.cssHeaderRow ) - .attr( 'role', 'row' ); - // allow keyboard cursor to focus on element - if ( c.tabIndex ) { - $elem.attr( 'tabindex', 0 ); - } - return elem; - }) ); - // cache headers per column - c.$headerIndexed = []; - for ( indx = 0; indx < c.columns; indx++ ) { - // colspan in header making a column undefined - if ( ts.isEmptyObject( c.sortVars[ indx ] ) ) { - c.sortVars[ indx ] = {}; - } - $temp = c.$headers.filter( '[data-column="' + indx + '"]' ); - // target sortable column cells, unless there are none, then use non-sortable cells - // .last() added in jQuery 1.4; use .filter(':last') to maintain compatibility with jQuery v1.2.6 - c.$headerIndexed[ indx ] = $temp.length ? - $temp.not( '.sorter-false' ).length ? - $temp.not( '.sorter-false' ).filter( ':last' ) : - $temp.filter( ':last' ) : - $(); - } - c.$table.find( c.selectorHeaders ).attr({ - scope: 'col', - role : 'columnheader' - }); - // enable/disable sorting - ts.updateHeader( c ); - if ( c.debug ) { - console.log( 'Built headers:' + ts.benchmark( timer ) ); - console.log( c.$headers ); - } - }, - - // Use it to add a set of methods to table.config which will be available for all tables. - // This should be done before table initialization - addInstanceMethods : function( methods ) { - $.extend( ts.instanceMethods, methods ); - }, - - /* - █████▄ ▄████▄ █████▄ ▄█████ ██████ █████▄ ▄█████ - ██▄▄██ ██▄▄██ ██▄▄██ ▀█▄ ██▄▄ ██▄▄██ ▀█▄ - ██▀▀▀ ██▀▀██ ██▀██ ▀█▄ ██▀▀ ██▀██ ▀█▄ - ██ ██ ██ ██ ██ █████▀ ██████ ██ ██ █████▀ - */ - setupParsers : function( c, $tbodies ) { - var rows, list, span, max, colIndex, indx, header, configHeaders, - noParser, parser, extractor, time, tbody, len, - table = c.table, - tbodyIndex = 0, - debug = {}; - // update table bodies in case we start with an empty table - c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ); - tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies; - len = tbody.length; - if ( len === 0 ) { - return c.debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : ''; - } else if ( c.debug ) { - time = new Date(); - console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' ); - } - list = { - extractors: [], - parsers: [] - }; - while ( tbodyIndex < len ) { - rows = tbody[ tbodyIndex ].rows; - if ( rows.length ) { - colIndex = 0; - max = c.columns; - for ( indx = 0; indx < max; indx++ ) { - header = c.$headerIndexed[ colIndex ]; - if ( header && header.length ) { - // get column indexed table cell - configHeaders = ts.getColumnData( table, c.headers, colIndex ); - // get column parser/extractor - extractor = ts.getParserById( ts.getData( header, configHeaders, 'extractor' ) ); - parser = ts.getParserById( ts.getData( header, configHeaders, 'sorter' ) ); - noParser = ts.getData( header, configHeaders, 'parser' ) === 'false'; - // empty cells behaviour - keeping emptyToBottom for backwards compatibility - c.empties[colIndex] = ( - ts.getData( header, configHeaders, 'empty' ) || - c.emptyTo || ( c.emptyToBottom ? 'bottom' : 'top' ) ).toLowerCase(); - // text strings behaviour in numerical sorts - c.strings[colIndex] = ( - ts.getData( header, configHeaders, 'string' ) || - c.stringTo || - 'max' ).toLowerCase(); - if ( noParser ) { - parser = ts.getParserById( 'no-parser' ); - } - if ( !extractor ) { - // For now, maybe detect someday - extractor = false; - } - if ( !parser ) { - parser = ts.detectParserForColumn( c, rows, -1, colIndex ); - } - if ( c.debug ) { - debug[ '(' + colIndex + ') ' + header.text() ] = { - parser : parser.id, - extractor : extractor ? extractor.id : 'none', - string : c.strings[ colIndex ], - empty : c.empties[ colIndex ] - }; - } - list.parsers[ colIndex ] = parser; - list.extractors[ colIndex ] = extractor; - span = header[ 0 ].colSpan - 1; - if ( span > 0 ) { - colIndex += span; - max += span; - while ( span + 1 > 0 ) { - // set colspan columns to use the same parsers & extractors - list.parsers[ colIndex - span ] = parser; - list.extractors[ colIndex - span ] = extractor; - span--; - } - } - } - colIndex++; - } - } - tbodyIndex += ( list.parsers.length ) ? len : 1; - } - if ( c.debug ) { - if ( !ts.isEmptyObject( debug ) ) { - console[ console.table ? 'table' : 'log' ]( debug ); - } else { - console.warn( ' No parsers detected!' ); - } - console.log( 'Completed detecting parsers' + ts.benchmark( time ) ); - if ( console.groupEnd ) { console.groupEnd(); } - } - c.parsers = list.parsers; - c.extractors = list.extractors; - }, - - addParser : function( parser ) { - var indx, - len = ts.parsers.length, - add = true; - for ( indx = 0; indx < len; indx++ ) { - if ( ts.parsers[ indx ].id.toLowerCase() === parser.id.toLowerCase() ) { - add = false; - } - } - if ( add ) { - ts.parsers[ ts.parsers.length ] = parser; - } - }, - - getParserById : function( name ) { - if ( name == 'false' ) { return false; } - var indx, - len = ts.parsers.length; - for ( indx = 0; indx < len; indx++ ) { - if ( ts.parsers[ indx ].id.toLowerCase() === ( name.toString() ).toLowerCase() ) { - return ts.parsers[ indx ]; - } - } - return false; - }, - - detectParserForColumn : function( c, rows, rowIndex, cellIndex ) { - var cur, $node, row, - indx = ts.parsers.length, - node = false, - nodeValue = '', - keepLooking = true; - while ( nodeValue === '' && keepLooking ) { - rowIndex++; - row = rows[ rowIndex ]; - // stop looking after 50 empty rows - if ( row && rowIndex < 50 ) { - if ( row.className.indexOf( ts.cssIgnoreRow ) < 0 ) { - node = rows[ rowIndex ].cells[ cellIndex ]; - nodeValue = ts.getElementText( c, node, cellIndex ); - $node = $( node ); - if ( c.debug ) { - console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' + - cellIndex + ': "' + nodeValue + '"' ); - } - } - } else { - keepLooking = false; - } - } - while ( --indx >= 0 ) { - cur = ts.parsers[ indx ]; - // ignore the default text parser because it will always be true - if ( cur && cur.id !== 'text' && cur.is && cur.is( nodeValue, c.table, node, $node ) ) { - return cur; - } - } - // nothing found, return the generic parser (text) - return ts.getParserById( 'text' ); - }, - - getElementText : function( c, node, cellIndex ) { - if ( !node ) { return ''; } - var tmp, - extract = c.textExtraction || '', - // node could be a jquery object - // http://jsperf.com/jquery-vs-instanceof-jquery/2 - $node = node.jquery ? node : $( node ); - if ( typeof extract === 'string' ) { - // check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow! - // http://www.kellegous.com/j/2013/02/27/innertext-vs-textcontent/ - if ( extract === 'basic' && typeof ( tmp = $node.attr( c.textAttribute ) ) !== 'undefined' ) { - return $.trim( tmp ); - } - return $.trim( node.textContent || $node.text() ); - } else { - if ( typeof extract === 'function' ) { - return $.trim( extract( $node[ 0 ], c.table, cellIndex ) ); - } else if ( typeof ( tmp = ts.getColumnData( c.table, extract, cellIndex ) ) === 'function' ) { - return $.trim( tmp( $node[ 0 ], c.table, cellIndex ) ); - } - } - // fallback - return $.trim( $node[ 0 ].textContent || $node.text() ); - }, - - // centralized function to extract/parse cell contents - getParsedText : function( c, cell, colIndex, txt ) { - if ( typeof txt === 'undefined' ) { - txt = ts.getElementText( c, cell, colIndex ); - } - // if no parser, make sure to return the txt - var val = '' + txt, - parser = c.parsers[ colIndex ], - extractor = c.extractors[ colIndex ]; - if ( parser ) { - // do extract before parsing, if there is one - if ( extractor && typeof extractor.format === 'function' ) { - txt = extractor.format( txt, c.table, cell, colIndex ); - } - // allow parsing if the string is empty, previously parsing would change it to zero, - // in case the parser needs to extract data from the table cell attributes - val = parser.id === 'no-parser' ? '' : - // make sure txt is a string (extractor may have converted it) - parser.format( '' + txt, c.table, cell, colIndex ); - if ( c.ignoreCase && typeof val === 'string' ) { - val = val.toLowerCase(); - } - } - return val; - }, - - /* - ▄████▄ ▄████▄ ▄████▄ ██ ██ ██████ - ██ ▀▀ ██▄▄██ ██ ▀▀ ██▄▄██ ██▄▄ - ██ ▄▄ ██▀▀██ ██ ▄▄ ██▀▀██ ██▀▀ - ▀████▀ ██ ██ ▀████▀ ██ ██ ██████ - */ - buildCache : function( c, callback, $tbodies ) { - var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row, - cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData, - colMax, span, cacheIndex, hasParser, max, len, index, - table = c.table, - parsers = c.parsers; - // update tbody variable - c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ); - $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies, - c.cache = {}; - c.totalRows = 0; - // if no parsers found, return - it's an empty table. - if ( !parsers ) { - return c.debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : ''; - } - if ( c.debug ) { - cacheTime = new Date(); - } - // processing icon - if ( c.showProcessing ) { - ts.isProcessing( table, true ); - } - for ( tbodyIndex = 0; tbodyIndex < $tbody.length; tbodyIndex++ ) { - colMax = []; // column max value per tbody - cache = c.cache[ tbodyIndex ] = { - normalized: [] // array of normalized row data; last entry contains 'rowData' above - // colMax: # // added at the end - }; - - totalRows = ( $tbody[ tbodyIndex ] && $tbody[ tbodyIndex ].rows.length ) || 0; - for ( rowIndex = 0; rowIndex < totalRows; ++rowIndex ) { - rowData = { - // order: original row order # - // $row : jQuery Object[] - child: [], // child row text (filter widget) - raw: [] // original row text - }; - /** Add the table data to main data array */ - $row = $( $tbody[ tbodyIndex ].rows[ rowIndex ] ); - cols = []; - // if this is a child row, add it to the last row's children and continue to the next row - // ignore child row class, if it is the first row - if ( $row.hasClass( c.cssChildRow ) && rowIndex !== 0 ) { - len = cache.normalized.length - 1; - prevRowData = cache.normalized[ len ][ c.columns ]; - prevRowData.$row = prevRowData.$row.add( $row ); - // add 'hasChild' class name to parent row - if ( !$row.prev().hasClass( c.cssChildRow ) ) { - $row.prev().addClass( ts.css.cssHasChild ); - } - // save child row content (un-parsed!) - $cells = $row.children( 'th, td' ); - len = prevRowData.child.length; - prevRowData.child[ len ] = []; - // child row content does not account for colspans/rowspans; so indexing may be off - cacheIndex = 0; - max = c.columns; - for ( colIndex = 0; colIndex < max; colIndex++ ) { - cell = $cells[ colIndex ]; - if ( cell ) { - prevRowData.child[ len ][ colIndex ] = ts.getParsedText( c, cell, colIndex ); - span = $cells[ colIndex ].colSpan - 1; - if ( span > 0 ) { - cacheIndex += span; - max += span; - } - } - cacheIndex++; - } - // go to the next for loop - continue; - } - rowData.$row = $row; - rowData.order = rowIndex; // add original row position to rowCache - cacheIndex = 0; - max = c.columns; - for ( colIndex = 0; colIndex < max; ++colIndex ) { - cell = $row[ 0 ].cells[ colIndex ]; - if ( cell && cacheIndex < c.columns ) { - hasParser = typeof parsers[ cacheIndex ] !== 'undefined'; - if ( !hasParser && c.debug ) { - console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex + - '; cell containing: "' + $(cell).text() + '"; does it have a header?' ); - } - val = ts.getElementText( c, cell, cacheIndex ); - rowData.raw[ cacheIndex ] = val; // save original row text - // save raw column text even if there is no parser set - txt = ts.getParsedText( c, cell, cacheIndex, val ); - cols[ cacheIndex ] = txt; - if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) { - // determine column max value (ignore sign) - colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 ); - } - // allow colSpan in tbody - span = cell.colSpan - 1; - if ( span > 0 ) { - index = 0; - while ( index <= span ) { - // duplicate text (or not) to spanned columns - // instead of setting duplicate span to empty string, use textExtraction to try to get a value - // see http://stackoverflow.com/q/36449711/145346 - txt = c.duplicateSpan || index === 0 ? - val : - typeof c.textExtraction !== 'string' ? - ts.getElementText( c, cell, cacheIndex + index ) || '' : - ''; - rowData.raw[ cacheIndex + index ] = txt; - cols[ cacheIndex + index ] = txt; - index++; - } - cacheIndex += span; - max += span; - } - } - cacheIndex++; - } - // ensure rowData is always in the same location (after the last column) - cols[ c.columns ] = rowData; - cache.normalized[ cache.normalized.length ] = cols; - } - cache.colMax = colMax; - // total up rows, not including child rows - c.totalRows += cache.normalized.length; - - } - if ( c.showProcessing ) { - ts.isProcessing( table ); // remove processing icon - } - if ( c.debug ) { - len = Math.min( 5, c.cache[ 0 ].normalized.length ); - console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows + - ' rows (showing ' + len + ' rows in log)' + ts.benchmark( cacheTime ) ); - val = {}; - for ( colIndex = 0; colIndex < c.columns; colIndex++ ) { - for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) { - if ( !val[ 'row: ' + cacheIndex ] ) { - val[ 'row: ' + cacheIndex ] = {}; - } - val[ 'row: ' + cacheIndex ][ c.$headerIndexed[ colIndex ].text() ] = - c.cache[ 0 ].normalized[ cacheIndex ][ colIndex ]; - } - } - console[ console.table ? 'table' : 'log' ]( val ); - if ( console.groupEnd ) { console.groupEnd(); } - } - if ( $.isFunction( callback ) ) { - callback( table ); - } - }, - - getColumnText : function( table, column, callback, rowFilter ) { - table = $( table )[0]; - var tbodyIndex, rowIndex, cache, row, tbodyLen, rowLen, raw, parsed, $cell, result, - hasCallback = typeof callback === 'function', - allColumns = column === 'all', - data = { raw : [], parsed: [], $cell: [] }, - c = table.config; - if ( ts.isEmptyObject( c ) ) { - if ( c.debug ) { - console.warn( 'No cache found - aborting getColumnText function!' ); - } - } else { - tbodyLen = c.$tbodies.length; - for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) { - cache = c.cache[ tbodyIndex ].normalized; - rowLen = cache.length; - for ( rowIndex = 0; rowIndex < rowLen; rowIndex++ ) { - row = cache[ rowIndex ]; - if ( rowFilter && !row[ c.columns ].$row.is( rowFilter ) ) { - continue; - } - result = true; - parsed = ( allColumns ) ? row.slice( 0, c.columns ) : row[ column ]; - row = row[ c.columns ]; - raw = ( allColumns ) ? row.raw : row.raw[ column ]; - $cell = ( allColumns ) ? row.$row.children() : row.$row.children().eq( column ); - if ( hasCallback ) { - result = callback({ - tbodyIndex : tbodyIndex, - rowIndex : rowIndex, - parsed : parsed, - raw : raw, - $row : row.$row, - $cell : $cell - }); - } - if ( result !== false ) { - data.parsed[ data.parsed.length ] = parsed; - data.raw[ data.raw.length ] = raw; - data.$cell[ data.$cell.length ] = $cell; - } - } - } - // return everything - return data; - } - }, - - /* - ██ ██ █████▄ █████▄ ▄████▄ ██████ ██████ - ██ ██ ██▄▄██ ██ ██ ██▄▄██ ██ ██▄▄ - ██ ██ ██▀▀▀ ██ ██ ██▀▀██ ██ ██▀▀ - ▀████▀ ██ █████▀ ██ ██ ██ ██████ - */ - setHeadersCss : function( c ) { - var $sorted, indx, column, - list = c.sortList, - len = list.length, - none = ts.css.sortNone + ' ' + c.cssNone, - css = [ ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc ], - cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ], - aria = [ 'ascending', 'descending' ], - // find the footer - $headers = c.$table - .find( 'tfoot tr' ) - .children( 'td, th' ) - .add( $( c.namespace + '_extra_headers' ) ) - .removeClass( css.join( ' ' ) ); - // remove all header information - c.$headers - .removeClass( css.join( ' ' ) ) - .addClass( none ) - .attr( 'aria-sort', 'none' ) - .find( '.' + ts.css.icon ) - .removeClass( cssIcon.join( ' ' ) ) - .addClass( cssIcon[ 2 ] ); - for ( indx = 0; indx < len; indx++ ) { - // direction = 2 means reset! - if ( list[ indx ][ 1 ] !== 2 ) { - // multicolumn sorting updating - see #1005 - // .not(function(){}) needs jQuery 1.4 - // filter(function(i, el){}) <- el is undefined in jQuery v1.2.6 - $sorted = c.$headers.filter( function( i ) { - // only include headers that are in the sortList (this includes colspans) - var include = true, - $el = c.$headers.eq( i ), - col = parseInt( $el.attr( 'data-column' ), 10 ), - end = col + c.$headers[ i ].colSpan; - for ( ; col < end; col++ ) { - include = include ? include || ts.isValueInArray( col, c.sortList ) > -1 : false; - } - return include; - }); - - // choose the :last in case there are nested columns - $sorted = $sorted - .not( '.sorter-false' ) - .filter( '[data-column="' + list[ indx ][ 0 ] + '"]' + ( len === 1 ? ':last' : '' ) ); - if ( $sorted.length ) { - for ( column = 0; column < $sorted.length; column++ ) { - if ( !$sorted[ column ].sortDisabled ) { - $sorted - .eq( column ) - .removeClass( none ) - .addClass( css[ list[ indx ][ 1 ] ] ) - .attr( 'aria-sort', aria[ list[ indx ][ 1 ] ] ) - .find( '.' + ts.css.icon ) - .removeClass( cssIcon[ 2 ] ) - .addClass( cssIcon[ list[ indx ][ 1 ] ] ); - } - } - // add sorted class to footer & extra headers, if they exist - if ( $headers.length ) { - $headers - .filter( '[data-column="' + list[ indx ][ 0 ] + '"]' ) - .removeClass( none ) - .addClass( css[ list[ indx ][ 1 ] ] ); - } - } - } - } - // add verbose aria labels - len = c.$headers.length; - for ( indx = 0; indx < len; indx++ ) { - ts.setColumnAriaLabel( c, c.$headers.eq( indx ) ); - } - }, - - // nextSort (optional), lets you disable next sort text - setColumnAriaLabel : function( c, $header, nextSort ) { - if ( $header.length ) { - var column = parseInt( $header.attr( 'data-column' ), 10 ), - tmp = $header.hasClass( ts.css.sortAsc ) ? - 'sortAsc' : - $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone', - txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ]; - if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) { - txt += ts.language.sortDisabled; - } else { - nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ]; - // if nextSort - txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; - } - $header.attr( 'aria-label', txt ); - } - }, - - updateHeader : function( c ) { - var index, isDisabled, $header, col, - table = c.table, - len = c.$headers.length; - for ( index = 0; index < len; index++ ) { - $header = c.$headers.eq( index ); - col = ts.getColumnData( table, c.headers, index, true ); - // add 'sorter-false' class if 'parser-false' is set - isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false'; - ts.setColumnSort( c, $header, isDisabled ); - } - }, - - setColumnSort : function( c, $header, isDisabled ) { - var id = c.table.id; - $header[ 0 ].sortDisabled = isDisabled; - $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' ) - .attr( 'aria-disabled', '' + isDisabled ); - // disable tab index on disabled cells - if ( c.tabIndex ) { - if ( isDisabled ) { - $header.removeAttr( 'tabindex' ); - } else { - $header.attr( 'tabindex', '0' ); - } - } - // aria-controls - requires table ID - if ( id ) { - if ( isDisabled ) { - $header.removeAttr( 'aria-controls' ); - } else { - $header.attr( 'aria-controls', id ); - } - } - }, - - updateHeaderSortCount : function( c, list ) { - var col, dir, group, indx, primary, temp, val, order, - sortList = list || c.sortList, - len = sortList.length; - c.sortList = []; - for ( indx = 0; indx < len; indx++ ) { - val = sortList[ indx ]; - // ensure all sortList values are numeric - fixes #127 - col = parseInt( val[ 0 ], 10 ); - // prevents error if sorton array is wrong - if ( col < c.columns ) { - - // set order if not already defined - due to colspan header without associated header cell - // adding this check prevents a javascript error - if ( !c.sortVars[ col ].order ) { - order = c.sortVars[ col ].order = ts.getOrder( c.sortInitialOrder ) ? [ 1, 0, 2 ] : [ 0, 1, 2 ]; - c.sortVars[ col ].count = 0; - } - - order = c.sortVars[ col ].order; - dir = ( '' + val[ 1 ] ).match( /^(1|d|s|o|n)/ ); - dir = dir ? dir[ 0 ] : ''; - // 0/(a)sc (default), 1/(d)esc, (s)ame, (o)pposite, (n)ext - switch ( dir ) { - case '1' : case 'd' : // descending - dir = 1; - break; - case 's' : // same direction (as primary column) - // if primary sort is set to 's', make it ascending - dir = primary || 0; - break; - case 'o' : - temp = order[ ( primary || 0 ) % ( c.sortReset ? 3 : 2 ) ]; - // opposite of primary column; but resets if primary resets - dir = temp === 0 ? 1 : temp === 1 ? 0 : 2; - break; - case 'n' : - dir = order[ ( ++c.sortVars[ col ].count ) % ( c.sortReset ? 3 : 2 ) ]; - break; - default : // ascending - dir = 0; - break; - } - primary = indx === 0 ? dir : primary; - group = [ col, parseInt( dir, 10 ) || 0 ]; - c.sortList[ c.sortList.length ] = group; - dir = $.inArray( group[ 1 ], order ); // fixes issue #167 - c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % ( c.sortReset ? 3 : 2 ); - } - } - }, - - updateAll : function( c, resort, callback ) { - var table = c.table; - table.isUpdating = true; - ts.refreshWidgets( table, true, true ); - ts.buildHeaders( c ); - ts.bindEvents( table, c.$headers, true ); - ts.bindMethods( c ); - ts.commonUpdate( c, resort, callback ); - }, - - update : function( c, resort, callback ) { - var table = c.table; - table.isUpdating = true; - // update sorting (if enabled/disabled) - ts.updateHeader( c ); - ts.commonUpdate( c, resort, callback ); - }, - - // simple header update - see #989 - updateHeaders : function( c, callback ) { - c.table.isUpdating = true; - ts.buildHeaders( c ); - ts.bindEvents( c.table, c.$headers, true ); - ts.resortComplete( c, callback ); - }, - - updateCell : function( c, cell, resort, callback ) { - if ( ts.isEmptyObject( c.cache ) ) { - // empty table, do an update instead - fixes #1099 - ts.updateHeader( c ); - ts.commonUpdate( c, resort, callback ); - return; - } - c.table.isUpdating = true; - c.$table.find( c.selectorRemove ).remove(); - // get position from the dom - var tmp, indx, row, icell, cache, len, - $tbodies = c.$tbodies, - $cell = $( cell ), - // update cache - format: function( s, table, cell, cellIndex ) - // no closest in jQuery v1.2.6 - tbodyIndex = $tbodies - .index( $.fn.closest ? $cell.closest( 'tbody' ) : $cell.parents( 'tbody' ).filter( ':first' ) ), - tbcache = c.cache[ tbodyIndex ], - $row = $.fn.closest ? $cell.closest( 'tr' ) : $cell.parents( 'tr' ).filter( ':first' ); - cell = $cell[ 0 ]; // in case cell is a jQuery object - // tbody may not exist if update is initialized while tbody is removed for processing - if ( $tbodies.length && tbodyIndex >= 0 ) { - row = $tbodies.eq( tbodyIndex ).find( 'tr' ).index( $row ); - cache = tbcache.normalized[ row ]; - len = $row[ 0 ].cells.length; - if ( len !== c.columns ) { - // colspan in here somewhere! - icell = 0; - tmp = false; - for ( indx = 0; indx < len; indx++ ) { - if ( !tmp && $row[ 0 ].cells[ indx ] !== cell ) { - icell += $row[ 0 ].cells[ indx ].colSpan; - } else { - tmp = true; - } - } - } else { - icell = $cell.index(); - } - tmp = ts.getElementText( c, cell, icell ); // raw - cache[ c.columns ].raw[ icell ] = tmp; - tmp = ts.getParsedText( c, cell, icell, tmp ); - cache[ icell ] = tmp; // parsed - cache[ c.columns ].$row = $row; - if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) { - // update column max value (ignore sign) - tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 ); - } - tmp = resort !== 'undefined' ? resort : c.resort; - if ( tmp !== false ) { - // widgets will be reapplied - ts.checkResort( c, tmp, callback ); - } else { - // don't reapply widgets is resort is false, just in case it causes - // problems with element focus - ts.resortComplete( c, callback ); - } - } else { - if ( c.debug ) { - console.error( 'updateCell aborted, tbody missing or not within the indicated table' ); - } - c.table.isUpdating = false; - } - }, - - addRows : function( c, $row, resort, callback ) { - var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order, - cacheIndex, rowData, cells, cell, span, - // allow passing a row string if only one non-info tbody exists in the table - valid = typeof $row === 'string' && c.$tbodies.length === 1 && / 0 ) { - cacheIndex += span; - } - cacheIndex++; - } - // add the row data to the end - cells[ c.columns ] = rowData; - // update cache - c.cache[ tbodyIndex ].normalized[ order ] = cells; - } - // resort using current settings - ts.checkResort( c, resort, callback ); - } - }, - - updateCache : function( c, callback, $tbodies ) { - // rebuild parsers - if ( !( c.parsers && c.parsers.length ) ) { - ts.setupParsers( c, $tbodies ); - } - // rebuild the cache map - ts.buildCache( c, callback, $tbodies ); - }, - - // init flag (true) used by pager plugin to prevent widget application - // renamed from appendToTable - appendCache : function( c, init ) { - var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime, - table = c.table, - wo = c.widgetOptions, - $tbodies = c.$tbodies, - rows = [], - cache = c.cache; - // empty table - fixes #206/#346 - if ( ts.isEmptyObject( cache ) ) { - // run pager appender in case the table was just emptied - return c.appender ? c.appender( table, rows ) : - table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532 - } - if ( c.debug ) { - appendTime = new Date(); - } - for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { - $tbody = $tbodies.eq( tbodyIndex ); - if ( $tbody.length ) { - // detach tbody for manipulation - $curTbody = ts.processTbody( table, $tbody, true ); - parsed = cache[ tbodyIndex ].normalized; - totalRows = parsed.length; - for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) { - rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row; - // removeRows used by the pager plugin; don't render if using ajax - fixes #411 - if ( !c.appender || ( c.pager && ( !c.pager.removeRows || !wo.pager_removeRows ) && !c.pager.ajax ) ) { - $curTbody.append( parsed[ rowIndex ][ c.columns ].$row ); - } - } - // restore tbody - ts.processTbody( table, $curTbody, false ); - } - } - if ( c.appender ) { - c.appender( table, rows ); - } - if ( c.debug ) { - console.log( 'Rebuilt table' + ts.benchmark( appendTime ) ); - } - // apply table widgets; but not before ajax completes - if ( !init && !c.appender ) { - ts.applyWidget( table ); - } - if ( table.isUpdating ) { - c.$table.triggerHandler( 'updateComplete', table ); - } - }, - - commonUpdate : function( c, resort, callback ) { - // remove rows/elements before update - c.$table.find( c.selectorRemove ).remove(); - // rebuild parsers - ts.setupParsers( c ); - // rebuild the cache map - ts.buildCache( c ); - ts.checkResort( c, resort, callback ); - }, - - /* - ▄█████ ▄████▄ █████▄ ██████ ██ █████▄ ▄████▄ - ▀█▄ ██ ██ ██▄▄██ ██ ██ ██ ██ ██ ▄▄▄ - ▀█▄ ██ ██ ██▀██ ██ ██ ██ ██ ██ ▀██ - █████▀ ▀████▀ ██ ██ ██ ██ ██ ██ ▀████▀ - */ - initSort : function( c, cell, event ) { - if ( c.table.isUpdating ) { - // let any updates complete before initializing a sort - return setTimeout( function(){ - ts.initSort( c, cell, event ); - }, 50 ); - } - - var arry, indx, headerIndx, dir, temp, tmp, $header, - notMultiSort = !event[ c.sortMultiSortKey ], - table = c.table, - len = c.$headers.length, - // get current column index - col = parseInt( $( cell ).attr( 'data-column' ), 10 ), - order = c.sortVars[ col ].order; - - // Only call sortStart if sorting is enabled - c.$table.triggerHandler( 'sortStart', table ); - // get current column sort order - c.sortVars[ col ].count = - event[ c.sortResetKey ] ? 2 : ( c.sortVars[ col ].count + 1 ) % ( c.sortReset ? 3 : 2 ); - // reset all sorts on non-current column - issue #30 - if ( c.sortRestart ) { - for ( headerIndx = 0; headerIndx < len; headerIndx++ ) { - $header = c.$headers.eq( headerIndx ); - tmp = parseInt( $header.attr( 'data-column' ), 10 ); - // only reset counts on columns that weren't just clicked on and if not included in a multisort - if ( col !== tmp && ( notMultiSort || $header.hasClass( ts.css.sortNone ) ) ) { - c.sortVars[ tmp ].count = -1; - } - } - } - // user only wants to sort on one column - if ( notMultiSort ) { - // flush the sort list - c.sortList = []; - c.last.sortList = []; - if ( c.sortForce !== null ) { - arry = c.sortForce; - for ( indx = 0; indx < arry.length; indx++ ) { - if ( arry[ indx ][ 0 ] !== col ) { - c.sortList[ c.sortList.length ] = arry[ indx ]; - } - } - } - // add column to sort list - dir = order[ c.sortVars[ col ].count ]; - if ( dir < 2 ) { - c.sortList[ c.sortList.length ] = [ col, dir ]; - // add other columns if header spans across multiple - if ( cell.colSpan > 1 ) { - for ( indx = 1; indx < cell.colSpan; indx++ ) { - c.sortList[ c.sortList.length ] = [ col + indx, dir ]; - // update count on columns in colSpan - c.sortVars[ col + indx ].count = $.inArray( dir, order ); - } - } - } - // multi column sorting - } else { - // get rid of the sortAppend before adding more - fixes issue #115 & #523 - c.sortList = $.extend( [], c.last.sortList ); - - // the user has clicked on an already sorted column - if ( ts.isValueInArray( col, c.sortList ) >= 0 ) { - // reverse the sorting direction - for ( indx = 0; indx < c.sortList.length; indx++ ) { - tmp = c.sortList[ indx ]; - if ( tmp[ 0 ] === col ) { - // order.count seems to be incorrect when compared to cell.count - tmp[ 1 ] = order[ c.sortVars[ col ].count ]; - if ( tmp[1] === 2 ) { - c.sortList.splice( indx, 1 ); - c.sortVars[ col ].count = -1; - } - } - } - } else { - // add column to sort list array - dir = order[ c.sortVars[ col ].count ]; - if ( dir < 2 ) { - c.sortList[ c.sortList.length ] = [ col, dir ]; - // add other columns if header spans across multiple - if ( cell.colSpan > 1 ) { - for ( indx = 1; indx < cell.colSpan; indx++ ) { - c.sortList[ c.sortList.length ] = [ col + indx, dir ]; - // update count on columns in colSpan - c.sortVars[ col + indx ].count = $.inArray( dir, order ); - } - } - } - } - } - // save sort before applying sortAppend - c.last.sortList = $.extend( [], c.sortList ); - if ( c.sortList.length && c.sortAppend ) { - arry = $.isArray( c.sortAppend ) ? c.sortAppend : c.sortAppend[ c.sortList[ 0 ][ 0 ] ]; - if ( !ts.isEmptyObject( arry ) ) { - for ( indx = 0; indx < arry.length; indx++ ) { - if ( arry[ indx ][ 0 ] !== col && ts.isValueInArray( arry[ indx ][ 0 ], c.sortList ) < 0 ) { - dir = arry[ indx ][ 1 ]; - temp = ( '' + dir ).match( /^(a|d|s|o|n)/ ); - if ( temp ) { - tmp = c.sortList[ 0 ][ 1 ]; - switch ( temp[ 0 ] ) { - case 'd' : - dir = 1; - break; - case 's' : - dir = tmp; - break; - case 'o' : - dir = tmp === 0 ? 1 : 0; - break; - case 'n' : - dir = ( tmp + 1 ) % ( c.sortReset ? 3 : 2 ); - break; - default: - dir = 0; - break; - } - } - c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ]; - } - } - } - } - // sortBegin event triggered immediately before the sort - c.$table.triggerHandler( 'sortBegin', table ); - // setTimeout needed so the processing icon shows up - setTimeout( function() { - // set css for headers - ts.setHeadersCss( c ); - ts.multisort( c ); - ts.appendCache( c ); - c.$table.triggerHandler( 'sortBeforeEnd', table ); - c.$table.triggerHandler( 'sortEnd', table ); - }, 1 ); - }, - - // sort multiple columns - multisort : function( c ) { - var tbodyIndex, sortTime, colMax, rows, - table = c.table, - dir = 0, - textSorter = c.textSorter || '', - sortList = c.sortList, - sortLen = sortList.length, - len = c.$tbodies.length; - if ( c.serverSideSorting || ts.isEmptyObject( c.cache ) ) { - // empty table - fixes #206/#346 - return; - } - if ( c.debug ) { sortTime = new Date(); } - for ( tbodyIndex = 0; tbodyIndex < len; tbodyIndex++ ) { - colMax = c.cache[ tbodyIndex ].colMax; - rows = c.cache[ tbodyIndex ].normalized; - - rows.sort( function( a, b ) { - var sortIndex, num, col, order, sort, x, y; - // rows is undefined here in IE, so don't use it! - for ( sortIndex = 0; sortIndex < sortLen; sortIndex++ ) { - col = sortList[ sortIndex ][ 0 ]; - order = sortList[ sortIndex ][ 1 ]; - // sort direction, true = asc, false = desc - dir = order === 0; - - if ( c.sortStable && a[ col ] === b[ col ] && sortLen === 1 ) { - return a[ c.columns ].order - b[ c.columns ].order; - } - - // fallback to natural sort since it is more robust - num = /n/i.test( ts.getSortType( c.parsers, col ) ); - if ( num && c.strings[ col ] ) { - // sort strings in numerical columns - if ( typeof ( ts.string[ c.strings[ col ] ] ) === 'boolean' ) { - num = ( dir ? 1 : -1 ) * ( ts.string[ c.strings[ col ] ] ? -1 : 1 ); - } else { - num = ( c.strings[ col ] ) ? ts.string[ c.strings[ col ] ] || 0 : 0; - } - // fall back to built-in numeric sort - // var sort = $.tablesorter['sort' + s]( a[col], b[col], dir, colMax[col], table ); - sort = c.numberSorter ? c.numberSorter( a[ col ], b[ col ], dir, colMax[ col ], table ) : - ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ], b[ col ], num, colMax[ col ], col, c ); - } else { - // set a & b depending on sort direction - x = dir ? a : b; - y = dir ? b : a; - // text sort function - if ( typeof textSorter === 'function' ) { - // custom OVERALL text sorter - sort = textSorter( x[ col ], y[ col ], dir, col, table ); - } else if ( typeof textSorter === 'object' && textSorter.hasOwnProperty( col ) ) { - // custom text sorter for a SPECIFIC COLUMN - sort = textSorter[ col ]( x[ col ], y[ col ], dir, col, table ); - } else { - // fall back to natural sort - sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ], b[ col ], col, c ); - } - } - if ( sort ) { return sort; } - } - return a[ c.columns ].order - b[ c.columns ].order; - }); - } - if ( c.debug ) { - console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) ); - } - }, - - resortComplete : function( c, callback ) { - if ( c.table.isUpdating ) { - c.$table.triggerHandler( 'updateComplete', c.table ); - } - if ( $.isFunction( callback ) ) { - callback( c.table ); - } - }, - - checkResort : function( c, resort, callback ) { - var sortList = $.isArray( resort ) ? resort : c.sortList, - // if no resort parameter is passed, fallback to config.resort (true by default) - resrt = typeof resort === 'undefined' ? c.resort : resort; - // don't try to resort if the table is still processing - // this will catch spamming of the updateCell method - if ( resrt !== false && !c.serverSideSorting && !c.table.isProcessing ) { - if ( sortList.length ) { - ts.sortOn( c, sortList, function() { - ts.resortComplete( c, callback ); - }, true ); - } else { - ts.sortReset( c, function() { - ts.resortComplete( c, callback ); - ts.applyWidget( c.table, false ); - } ); - } - } else { - ts.resortComplete( c, callback ); - ts.applyWidget( c.table, false ); - } - }, - - sortOn : function( c, list, callback, init ) { - var table = c.table; - c.$table.triggerHandler( 'sortStart', table ); - // update header count index - ts.updateHeaderSortCount( c, list ); - // set css for headers - ts.setHeadersCss( c ); - // fixes #346 - if ( c.delayInit && ts.isEmptyObject( c.cache ) ) { - ts.buildCache( c ); - } - c.$table.triggerHandler( 'sortBegin', table ); - // sort the table and append it to the dom - ts.multisort( c ); - ts.appendCache( c, init ); - c.$table.triggerHandler( 'sortBeforeEnd', table ); - c.$table.triggerHandler( 'sortEnd', table ); - ts.applyWidget( table ); - if ( $.isFunction( callback ) ) { - callback( table ); - } - }, - - sortReset : function( c, callback ) { - c.sortList = []; - ts.setHeadersCss( c ); - ts.multisort( c ); - ts.appendCache( c ); - if ( $.isFunction( callback ) ) { - callback( c.table ); - } - }, - - getSortType : function( parsers, column ) { - return ( parsers && parsers[ column ] ) ? parsers[ column ].type || '' : ''; - }, - - getOrder : function( val ) { - // look for 'd' in 'desc' order; return true - return ( /^d/i.test( val ) || val === 1 ); - }, - - // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed) - // this function will only accept strings, or you'll see 'TypeError: undefined is not a function' - // I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall - sortNatural : function( a, b ) { - if ( a === b ) { return 0; } - var aNum, bNum, aFloat, bFloat, indx, max, - regex = ts.regex; - // first try and sort Hex codes - if ( regex.hex.test( b ) ) { - aNum = parseInt( a.match( regex.hex ), 16 ); - bNum = parseInt( b.match( regex.hex ), 16 ); - if ( aNum < bNum ) { return -1; } - if ( aNum > bNum ) { return 1; } - } - // chunk/tokenize - aNum = a.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' ); - bNum = b.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' ); - max = Math.max( aNum.length, bNum.length ); - // natural sorting through split numeric strings and default strings - for ( indx = 0; indx < max; indx++ ) { - // find floats not starting with '0', string or 0 if not defined - aFloat = isNaN( aNum[ indx ] ) ? aNum[ indx ] || 0 : parseFloat( aNum[ indx ] ) || 0; - bFloat = isNaN( bNum[ indx ] ) ? bNum[ indx ] || 0 : parseFloat( bNum[ indx ] ) || 0; - // handle numeric vs string comparison - number < string - (Kyle Adams) - if ( isNaN( aFloat ) !== isNaN( bFloat ) ) { return isNaN( aFloat ) ? 1 : -1; } - // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' - if ( typeof aFloat !== typeof bFloat ) { - aFloat += ''; - bFloat += ''; - } - if ( aFloat < bFloat ) { return -1; } - if ( aFloat > bFloat ) { return 1; } - } - return 0; - }, - - sortNaturalAsc : function( a, b, col, c ) { - if ( a === b ) { return 0; } - var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ]; - if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; } - if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; } - return ts.sortNatural( a, b ); - }, - - sortNaturalDesc : function( a, b, col, c ) { - if ( a === b ) { return 0; } - var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ]; - if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; } - if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; } - return ts.sortNatural( b, a ); - }, - - // basic alphabetical sort - sortText : function( a, b ) { - return a > b ? 1 : ( a < b ? -1 : 0 ); - }, - - // return text string value by adding up ascii value - // so the text is somewhat sorted when using a digital sort - // this is NOT an alphanumeric sort - getTextValue : function( val, num, max ) { - if ( max ) { - // make sure the text value is greater than the max numerical value (max) - var indx, - len = val ? val.length : 0, - n = max + num; - for ( indx = 0; indx < len; indx++ ) { - n += val.charCodeAt( indx ); - } - return num * n; - } - return 0; - }, - - sortNumericAsc : function( a, b, num, max, col, c ) { - if ( a === b ) { return 0; } - var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ]; - if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; } - if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; } - if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); } - if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); } - return a - b; - }, - - sortNumericDesc : function( a, b, num, max, col, c ) { - if ( a === b ) { return 0; } - var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ]; - if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; } - if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; } - if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); } - if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); } - return b - a; - }, - - sortNumeric : function( a, b ) { - return a - b; - }, - - /* - ██ ██ ██ ██ █████▄ ▄████▄ ██████ ██████ ▄█████ - ██ ██ ██ ██ ██ ██ ██ ▄▄▄ ██▄▄ ██ ▀█▄ - ██ ██ ██ ██ ██ ██ ██ ▀██ ██▀▀ ██ ▀█▄ - ███████▀ ██ █████▀ ▀████▀ ██████ ██ █████▀ - */ - addWidget : function( widget ) { - if ( widget.id && !ts.isEmptyObject( ts.getWidgetById( widget.id ) ) ) { - console.warn( '"' + widget.id + '" widget was loaded more than once!' ); - } - ts.widgets[ ts.widgets.length ] = widget; - }, - - hasWidget : function( $table, name ) { - $table = $( $table ); - return $table.length && $table[ 0 ].config && $table[ 0 ].config.widgetInit[ name ] || false; - }, - - getWidgetById : function( name ) { - var indx, widget, - len = ts.widgets.length; - for ( indx = 0; indx < len; indx++ ) { - widget = ts.widgets[ indx ]; - if ( widget && widget.id && widget.id.toLowerCase() === name.toLowerCase() ) { - return widget; - } - } - }, - - applyWidgetOptions : function( table ) { - var indx, widget, - c = table.config, - len = c.widgets.length; - if ( len ) { - for ( indx = 0; indx < len; indx++ ) { - widget = ts.getWidgetById( c.widgets[ indx ] ); - if ( widget && widget.options ) { - c.widgetOptions = $.extend( true, {}, widget.options, c.widgetOptions ); - } - } - } - }, - - addWidgetFromClass : function( table ) { - var len, indx, - c = table.config, - // look for widgets to apply from table class - // don't match from 'ui-widget-content'; use \S instead of \w to include widgets - // with dashes in the name, e.g. "widget-test-2" extracts out "test-2" - regex = '^' + c.widgetClass.replace( ts.regex.templateName, '(\\S+)+' ) + '$', - widgetClass = new RegExp( regex, 'g' ), - // split up table class (widget id's can include dashes) - stop using match - // otherwise only one widget gets extracted, see #1109 - widgets = ( table.className || '' ).split( ts.regex.spaces ); - if ( widgets.length ) { - len = widgets.length; - for ( indx = 0; indx < len; indx++ ) { - if ( widgets[ indx ].match( widgetClass ) ) { - c.widgets[ c.widgets.length ] = widgets[ indx ].replace( widgetClass, '$1' ); - } - } - } - }, - - applyWidgetId : function( table, id, init ) { - table = $(table)[0]; - var applied, time, name, - c = table.config, - wo = c.widgetOptions, - widget = ts.getWidgetById( id ); - if ( widget ) { - name = widget.id; - applied = false; - // add widget name to option list so it gets reapplied after sorting, filtering, etc - if ( $.inArray( name, c.widgets ) < 0 ) { - c.widgets[ c.widgets.length ] = name; - } - if ( c.debug ) { time = new Date(); } - - if ( init || !( c.widgetInit[ name ] ) ) { - // set init flag first to prevent calling init more than once (e.g. pager) - c.widgetInit[ name ] = true; - if ( table.hasInitialized ) { - // don't reapply widget options on tablesorter init - ts.applyWidgetOptions( table ); - } - if ( typeof widget.init === 'function' ) { - applied = true; - if ( c.debug ) { - console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' ); - } - widget.init( table, widget, c, wo ); - } - } - if ( !init && typeof widget.format === 'function' ) { - applied = true; - if ( c.debug ) { - console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' ); - } - widget.format( table, c, wo, false ); - } - if ( c.debug ) { - if ( applied ) { - console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) ); - if ( console.groupEnd ) { console.groupEnd(); } - } - } - } - }, - - applyWidget : function( table, init, callback ) { - table = $( table )[ 0 ]; // in case this is called externally - var indx, len, names, widget, time, - c = table.config, - widgets = []; - // prevent numerous consecutive widget applications - if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) { - return; - } - if ( c.debug ) { time = new Date(); } - ts.addWidgetFromClass( table ); - // prevent "tablesorter-ready" from firing multiple times in a row - clearTimeout( c.timerReady ); - if ( c.widgets.length ) { - table.isApplyingWidgets = true; - // ensure unique widget ids - c.widgets = $.grep( c.widgets, function( val, index ) { - return $.inArray( val, c.widgets ) === index; - }); - names = c.widgets || []; - len = names.length; - // build widget array & add priority as needed - for ( indx = 0; indx < len; indx++ ) { - widget = ts.getWidgetById( names[ indx ] ); - if ( widget && widget.id ) { - // set priority to 10 if not defined - if ( !widget.priority ) { widget.priority = 10; } - widgets[ indx ] = widget; - } else if ( c.debug ) { - console.warn( '"' + names[ indx ] + '" widget code does not exist!' ); - } - } - // sort widgets by priority - widgets.sort( function( a, b ) { - return a.priority < b.priority ? -1 : a.priority === b.priority ? 0 : 1; - }); - // add/update selected widgets - len = widgets.length; - if ( c.debug ) { - console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' ); - } - for ( indx = 0; indx < len; indx++ ) { - widget = widgets[ indx ]; - if ( widget && widget.id ) { - ts.applyWidgetId( table, widget.id, init ); - } - } - if ( c.debug && console.groupEnd ) { console.groupEnd(); } - // callback executed on init only - if ( !init && typeof callback === 'function' ) { - callback( table ); - } - } - c.timerReady = setTimeout( function() { - table.isApplyingWidgets = false; - $.data( table, 'lastWidgetApplication', new Date() ); - c.$table.triggerHandler( 'tablesorter-ready' ); - }, 10 ); - if ( c.debug ) { - widget = c.widgets.length; - console.log( 'Completed ' + - ( init === true ? 'initializing ' : 'applying ' ) + widget + - ' widget' + ( widget !== 1 ? 's' : '' ) + ts.benchmark( time ) ); - } - }, - - removeWidget : function( table, name, refreshing ) { - table = $( table )[ 0 ]; - var index, widget, indx, len, - c = table.config; - // if name === true, add all widgets from $.tablesorter.widgets - if ( name === true ) { - name = []; - len = ts.widgets.length; - for ( indx = 0; indx < len; indx++ ) { - widget = ts.widgets[ indx ]; - if ( widget && widget.id ) { - name[ name.length ] = widget.id; - } - } - } else { - // name can be either an array of widgets names, - // or a space/comma separated list of widget names - name = ( $.isArray( name ) ? name.join( ',' ) : name || '' ).toLowerCase().split( /[\s,]+/ ); - } - len = name.length; - for ( index = 0; index < len; index++ ) { - widget = ts.getWidgetById( name[ index ] ); - indx = $.inArray( name[ index ], c.widgets ); - // don't remove the widget from config.widget if refreshing - if ( indx >= 0 && refreshing !== true ) { - c.widgets.splice( indx, 1 ); - } - if ( widget && widget.remove ) { - if ( c.debug ) { - console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' ); - } - widget.remove( table, c, c.widgetOptions, refreshing ); - c.widgetInit[ name[ index ] ] = false; - } - } - }, - - refreshWidgets : function( table, doAll, dontapply ) { - table = $( table )[ 0 ]; // see issue #243 - var indx, widget, - c = table.config, - curWidgets = c.widgets, - widgets = ts.widgets, - len = widgets.length, - list = [], - callback = function( table ) { - $( table ).triggerHandler( 'refreshComplete' ); - }; - // remove widgets not defined in config.widgets, unless doAll is true - for ( indx = 0; indx < len; indx++ ) { - widget = widgets[ indx ]; - if ( widget && widget.id && ( doAll || $.inArray( widget.id, curWidgets ) < 0 ) ) { - list[ list.length ] = widget.id; - } - } - ts.removeWidget( table, list.join( ',' ), true ); - if ( dontapply !== true ) { - // call widget init if - ts.applyWidget( table, doAll || false, callback ); - if ( doAll ) { - // apply widget format - ts.applyWidget( table, false, callback ); - } - } else { - callback( table ); - } - }, - - /* - ██ ██ ██████ ██ ██ ██ ██████ ██ ██████ ▄█████ - ██ ██ ██ ██ ██ ██ ██ ██ ██▄▄ ▀█▄ - ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀█▄ - ▀████▀ ██ ██ ██████ ██ ██ ██ ██████ █████▀ - */ - benchmark : function( diff ) { - return ( ' ( ' + ( new Date().getTime() - diff.getTime() ) + 'ms )' ); - }, - // deprecated ts.log - log : function() { - console.log( arguments ); - }, - - // $.isEmptyObject from jQuery v1.4 - isEmptyObject : function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - isValueInArray : function( column, arry ) { - var indx, - len = arry && arry.length || 0; - for ( indx = 0; indx < len; indx++ ) { - if ( arry[ indx ][ 0 ] === column ) { - return indx; - } - } - return -1; - }, - - formatFloat : function( str, table ) { - if ( typeof str !== 'string' || str === '' ) { return str; } - // allow using formatFloat without a table; defaults to US number format - var num, - usFormat = table && table.config ? table.config.usNumberFormat !== false : - typeof table !== 'undefined' ? table : true; - if ( usFormat ) { - // US Format - 1,234,567.89 -> 1234567.89 - str = str.replace( ts.regex.comma, '' ); - } else { - // German Format = 1.234.567,89 -> 1234567.89 - // French Format = 1 234 567,89 -> 1234567.89 - str = str.replace( ts.regex.digitNonUS, '' ).replace( ts.regex.comma, '.' ); - } - if ( ts.regex.digitNegativeTest.test( str ) ) { - // make (#) into a negative number -> (10) = -10 - str = str.replace( ts.regex.digitNegativeReplace, '-$1' ); - } - num = parseFloat( str ); - // return the text instead of zero - return isNaN( num ) ? $.trim( str ) : num; - }, - - isDigit : function( str ) { - // replace all unwanted chars and match - return isNaN( str ) ? - ts.regex.digitTest.test( str.toString().replace( ts.regex.digitReplace, '' ) ) : - str !== ''; - }, - - // computeTableHeaderCellIndexes from: - // http://www.javascripttoolbox.com/lib/table/examples.php - // http://www.javascripttoolbox.com/temp/table_cellindex.html - computeColumnIndex : function( $rows, c ) { - var i, j, k, l, cell, cells, rowIndex, rowSpan, colSpan, firstAvailCol, - // total columns has been calculated, use it to set the matrixrow - columns = c && c.columns || 0, - matrix = [], - matrixrow = new Array( columns ); - for ( i = 0; i < $rows.length; i++ ) { - cells = $rows[ i ].cells; - for ( j = 0; j < cells.length; j++ ) { - cell = cells[ j ]; - rowIndex = cell.parentNode.rowIndex; - rowSpan = cell.rowSpan || 1; - colSpan = cell.colSpan || 1; - if ( typeof matrix[ rowIndex ] === 'undefined' ) { - matrix[ rowIndex ] = []; - } - // Find first available column in the first row - for ( k = 0; k < matrix[ rowIndex ].length + 1; k++ ) { - if ( typeof matrix[ rowIndex ][ k ] === 'undefined' ) { - firstAvailCol = k; - break; - } - } - // jscs:disable disallowEmptyBlocks - if ( columns && cell.cellIndex === firstAvailCol ) { - // don't to anything - } else if ( cell.setAttribute ) { - // jscs:enable disallowEmptyBlocks - // add data-column (setAttribute = IE8+) - cell.setAttribute( 'data-column', firstAvailCol ); - } else { - // remove once we drop support for IE7 - 1/12/2016 - $( cell ).attr( 'data-column', firstAvailCol ); - } - for ( k = rowIndex; k < rowIndex + rowSpan; k++ ) { - if ( typeof matrix[ k ] === 'undefined' ) { - matrix[ k ] = []; - } - matrixrow = matrix[ k ]; - for ( l = firstAvailCol; l < firstAvailCol + colSpan; l++ ) { - matrixrow[ l ] = 'x'; - } - } - } - } - return matrixrow.length; - }, - - // automatically add a colgroup with col elements set to a percentage width - fixColumnWidth : function( table ) { - table = $( table )[ 0 ]; - var overallWidth, percent, $tbodies, len, index, - c = table.config, - $colgroup = c.$table.children( 'colgroup' ); - // remove plugin-added colgroup, in case we need to refresh the widths - if ( $colgroup.length && $colgroup.hasClass( ts.css.colgroup ) ) { - $colgroup.remove(); - } - if ( c.widthFixed && c.$table.children( 'colgroup' ).length === 0 ) { - $colgroup = $( '' ); - overallWidth = c.$table.width(); - // only add col for visible columns - fixes #371 - $tbodies = c.$tbodies.find( 'tr:first' ).children( ':visible' ); - len = $tbodies.length; - for ( index = 0; index < len; index++ ) { - percent = parseInt( ( $tbodies.eq( index ).width() / overallWidth ) * 1000, 10 ) / 10 + '%'; - $colgroup.append( $( '' ).css( 'width', percent ) ); - } - c.$table.prepend( $colgroup ); - } - }, - - // get sorter, string, empty, etc options for each column from - // jQuery data, metadata, header option or header class name ('sorter-false') - // priority = jQuery data > meta > headers option > header class name - getData : function( header, configHeader, key ) { - var meta, cl4ss, - val = '', - $header = $( header ); - if ( !$header.length ) { return ''; } - meta = $.metadata ? $header.metadata() : false; - cl4ss = ' ' + ( $header.attr( 'class' ) || '' ); - if ( typeof $header.data( key ) !== 'undefined' || - typeof $header.data( key.toLowerCase() ) !== 'undefined' ) { - // 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder' - // 'data-sort-initial-order' is assigned to 'sortInitialOrder' - val += $header.data( key ) || $header.data( key.toLowerCase() ); - } else if ( meta && typeof meta[ key ] !== 'undefined' ) { - val += meta[ key ]; - } else if ( configHeader && typeof configHeader[ key ] !== 'undefined' ) { - val += configHeader[ key ]; - } else if ( cl4ss !== ' ' && cl4ss.match( ' ' + key + '-' ) ) { - // include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser' - val = cl4ss.match( new RegExp( '\\s' + key + '-([\\w-]+)' ) )[ 1 ] || ''; - } - return $.trim( val ); - }, - - getColumnData : function( table, obj, indx, getCell, $headers ) { - if ( typeof obj === 'undefined' || obj === null ) { return; } - table = $( table )[ 0 ]; - var $header, key, - c = table.config, - $cells = ( $headers || c.$headers ), - // c.$headerIndexed is not defined initially - $cell = c.$headerIndexed && c.$headerIndexed[ indx ] || - $cells.filter( '[data-column="' + indx + '"]:last' ); - if ( obj[ indx ] ) { - return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ]; - } - for ( key in obj ) { - if ( typeof key === 'string' ) { - $header = $cell - // header cell with class/id - .filter( key ) - // find elements within the header cell with cell/id - .add( $cell.find( key ) ); - if ( $header.length ) { - return obj[ key ]; - } - } - } - return; - }, - - // *** Process table *** - // add processing indicator - isProcessing : function( $table, toggle, $headers ) { - $table = $( $table ); - var c = $table[ 0 ].config, - // default to all headers - $header = $headers || $table.find( '.' + ts.css.header ); - if ( toggle ) { - // don't use sortList if custom $headers used - if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) { - // get headers from the sortList - $header = $header.filter( function() { - // get data-column from attr to keep compatibility with jQuery 1.2.6 - return this.sortDisabled ? - false : - ts.isValueInArray( parseFloat( $( this ).attr( 'data-column' ) ), c.sortList ) >= 0; - }); - } - $table.add( $header ).addClass( ts.css.processing + ' ' + c.cssProcessing ); - } else { - $table.add( $header ).removeClass( ts.css.processing + ' ' + c.cssProcessing ); - } - }, - - // detach tbody but save the position - // don't use tbody because there are portions that look for a tbody index (updateCell) - processTbody : function( table, $tb, getIt ) { - table = $( table )[ 0 ]; - if ( getIt ) { - table.isProcessing = true; - $tb.before( '' ); - return $.fn.detach ? $tb.detach() : $tb.remove(); - } - var holdr = $( table ).find( 'colgroup.tablesorter-savemyplace' ); - $tb.insertAfter( holdr ); - holdr.remove(); - table.isProcessing = false; - }, - - clearTableBody : function( table ) { - $( table )[ 0 ].config.$tbodies.children().detach(); - }, - - // used when replacing accented characters during sorting - characterEquivalents : { - 'a' : '\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5', // áàâãäąå - 'A' : '\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5', // ÁÀÂÃÄĄÅ - 'c' : '\u00e7\u0107\u010d', // çćč - 'C' : '\u00c7\u0106\u010c', // ÇĆČ - 'e' : '\u00e9\u00e8\u00ea\u00eb\u011b\u0119', // éèêëěę - 'E' : '\u00c9\u00c8\u00ca\u00cb\u011a\u0118', // ÉÈÊËĚĘ - 'i' : '\u00ed\u00ec\u0130\u00ee\u00ef\u0131', // íìİîïı - 'I' : '\u00cd\u00cc\u0130\u00ce\u00cf', // ÍÌİÎÏ - 'o' : '\u00f3\u00f2\u00f4\u00f5\u00f6\u014d', // óòôõöō - 'O' : '\u00d3\u00d2\u00d4\u00d5\u00d6\u014c', // ÓÒÔÕÖŌ - 'ss': '\u00df', // ß (s sharp) - 'SS': '\u1e9e', // ẞ (Capital sharp s) - 'u' : '\u00fa\u00f9\u00fb\u00fc\u016f', // úùûüů - 'U' : '\u00da\u00d9\u00db\u00dc\u016e' // ÚÙÛÜŮ - }, - - replaceAccents : function( str ) { - var chr, - acc = '[', - eq = ts.characterEquivalents; - if ( !ts.characterRegex ) { - ts.characterRegexArray = {}; - for ( chr in eq ) { - if ( typeof chr === 'string' ) { - acc += eq[ chr ]; - ts.characterRegexArray[ chr ] = new RegExp( '[' + eq[ chr ] + ']', 'g' ); - } - } - ts.characterRegex = new RegExp( acc + ']' ); - } - if ( ts.characterRegex.test( str ) ) { - for ( chr in eq ) { - if ( typeof chr === 'string' ) { - str = str.replace( ts.characterRegexArray[ chr ], chr ); - } - } - } - return str; - }, - - // restore headers - restoreHeaders : function( table ) { - var index, $cell, - c = $( table )[ 0 ].config, - $headers = c.$table.find( c.selectorHeaders ), - len = $headers.length; - // don't use c.$headers here in case header cells were swapped - for ( index = 0; index < len; index++ ) { - $cell = $headers.eq( index ); - // only restore header cells if it is wrapped - // because this is also used by the updateAll method - if ( $cell.find( '.' + ts.css.headerIn ).length ) { - $cell.html( c.headerContent[ index ] ); - } - } - }, - - destroy : function( table, removeClasses, callback ) { - table = $( table )[ 0 ]; - if ( !table.hasInitialized ) { return; } - // remove all widgets - ts.removeWidget( table, true, false ); - var events, - $t = $( table ), - c = table.config, - debug = c.debug, - $h = $t.find( 'thead:first' ), - $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ), - $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' ); - if ( removeClasses === false && $.inArray( 'uitheme', c.widgets ) >= 0 ) { - // reapply uitheme classes, in case we want to maintain appearance - $t.triggerHandler( 'applyWidgetId', [ 'uitheme' ] ); - $t.triggerHandler( 'applyWidgetId', [ 'zebra' ] ); - } - // remove widget added rows, just in case - $h.find( 'tr' ).not( $r ).remove(); - // disable tablesorter - not using .unbind( namespace ) because namespacing was - // added in jQuery v1.4.3 - see http://api.jquery.com/event.namespace/ - events = 'sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton ' + - 'appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave ' + - 'keypress sortBegin sortEnd resetToLoadState '.split( ' ' ) - .join( c.namespace + ' ' ); - $t - .removeData( 'tablesorter' ) - .unbind( events.replace( ts.regex.spaces, ' ' ) ); - c.$headers - .add( $f ) - .removeClass( [ ts.css.header, c.cssHeader, c.cssAsc, c.cssDesc, ts.css.sortAsc, ts.css.sortDesc, ts.css.sortNone ].join( ' ' ) ) - .removeAttr( 'data-column' ) - .removeAttr( 'aria-label' ) - .attr( 'aria-disabled', 'true' ); - $r - .find( c.selectorSort ) - .unbind( ( 'mousedown mouseup keypress '.split( ' ' ).join( c.namespace + ' ' ) ).replace( ts.regex.spaces, ' ' ) ); - ts.restoreHeaders( table ); - $t.toggleClass( ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false ); - // clear flag in case the plugin is initialized again - table.hasInitialized = false; - delete table.config.cache; - if ( typeof callback === 'function' ) { - callback( table ); - } - if ( debug ) { - console.log( 'tablesorter has been removed' ); - } - } - - }; - - $.fn.tablesorter = function( settings ) { - return this.each( function() { - var table = this, - // merge & extend config options - c = $.extend( true, {}, ts.defaults, settings, ts.instanceMethods ); - // save initial settings - c.originalSettings = settings; - // create a table from data (build table widget) - if ( !table.hasInitialized && ts.buildTable && this.nodeName !== 'TABLE' ) { - // return the table (in case the original target is the table's container) - ts.buildTable( table, c ); - } else { - ts.setup( table, c ); - } - }); - }; - - // set up debug logs - if ( !( window.console && window.console.log ) ) { - // access $.tablesorter.logs for browsers that don't have a console... - ts.logs = []; - console = {}; - console.log = console.warn = console.error = console.table = function() { - var arg = arguments.length > 1 ? arguments : arguments[0]; - ts.logs[ ts.logs.length ] = { date: Date.now(), log: arg }; - }; - } - - // add default parsers - ts.addParser({ - id : 'no-parser', - is : function() { - return false; - }, - format : function() { - return ''; - }, - type : 'text' - }); - - ts.addParser({ - id : 'text', - is : function() { - return true; - }, - format : function( str, table ) { - var c = table.config; - if ( str ) { - str = $.trim( c.ignoreCase ? str.toLocaleLowerCase() : str ); - str = c.sortLocaleCompare ? ts.replaceAccents( str ) : str; - } - return str; - }, - type : 'text' - }); - - ts.regex.nondigit = /[^\w,. \-()]/g; - ts.addParser({ - id : 'digit', - is : function( str ) { - return ts.isDigit( str ); - }, - format : function( str, table ) { - var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table ); - return str && typeof num === 'number' ? num : - str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str; - }, - type : 'numeric' - }); - - ts.regex.currencyReplace = /[+\-,. ]/g; - ts.regex.currencyTest = /^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/; - ts.addParser({ - id : 'currency', - is : function( str ) { - str = ( str || '' ).replace( ts.regex.currencyReplace, '' ); - // test for £$€¤¥¢ - return ts.regex.currencyTest.test( str ); - }, - format : function( str, table ) { - var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table ); - return str && typeof num === 'number' ? num : - str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str; - }, - type : 'numeric' - }); - - // too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme - // now, this regex can be updated before initialization - ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//; - ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\//; - ts.addParser({ - id : 'url', - is : function( str ) { - return ts.regex.urlProtocolTest.test( str ); - }, - format : function( str ) { - return str ? $.trim( str.replace( ts.regex.urlProtocolReplace, '' ) ) : str; - }, - parsed : true, // filter widget flag - type : 'text' - }); - - ts.regex.dash = /-/g; - ts.regex.isoDate = /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/; - ts.addParser({ - id : 'isoDate', - is : function( str ) { - return ts.regex.isoDate.test( str ); - }, - format : function( str, table ) { - var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str; - return date instanceof Date && isFinite( date ) ? date.getTime() : str; - }, - type : 'numeric' - }); - - ts.regex.percent = /%/g; - ts.regex.percentTest = /(\d\s*?%|%\s*?\d)/; - ts.addParser({ - id : 'percent', - is : function( str ) { - return ts.regex.percentTest.test( str ) && str.length < 15; - }, - format : function( str, table ) { - return str ? ts.formatFloat( str.replace( ts.regex.percent, '' ), table ) : str; - }, - type : 'numeric' - }); - - // added image parser to core v2.17.9 - ts.addParser({ - id : 'image', - is : function( str, table, node, $node ) { - return $node.find( 'img' ).length > 0; - }, - format : function( str, table, cell ) { - return $( cell ).find( 'img' ).attr( table.config.imgAttr || 'alt' ) || str; - }, - parsed : true, // filter widget flag - type : 'text' - }); - - ts.regex.dateReplace = /(\S)([AP]M)$/i; // used by usLongDate & time parser - ts.regex.usLongDateTest1 = /^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i; - ts.regex.usLongDateTest2 = /^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i; - ts.addParser({ - id : 'usLongDate', - is : function( str ) { - // two digit years are not allowed cross-browser - // Jan 01, 2013 12:34:56 PM or 01 Jan 2013 - return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str ); - }, - format : function( str, table ) { - var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str; - return date instanceof Date && isFinite( date ) ? date.getTime() : str; - }, - type : 'numeric' - }); - - // testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included - ts.regex.shortDateTest = /(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/; - // escaped "-" because JSHint in Firefox was showing it as an error - ts.regex.shortDateReplace = /[\-.,]/g; - // XXY covers MDY & DMY formats - ts.regex.shortDateXXY = /(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/; - ts.regex.shortDateYMD = /(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/; - ts.convertFormat = function( dateString, format ) { - dateString = ( dateString || '' ) - .replace( ts.regex.spaces, ' ' ) - .replace( ts.regex.shortDateReplace, '/' ); - if ( format === 'mmddyyyy' ) { - dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$1/$2' ); - } else if ( format === 'ddmmyyyy' ) { - dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$2/$1' ); - } else if ( format === 'yyyymmdd' ) { - dateString = dateString.replace( ts.regex.shortDateYMD, '$1/$2/$3' ); - } - var date = new Date( dateString ); - return date instanceof Date && isFinite( date ) ? date.getTime() : ''; - }; - - ts.addParser({ - id : 'shortDate', // 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd' - is : function( str ) { - str = ( str || '' ).replace( ts.regex.spaces, ' ' ).replace( ts.regex.shortDateReplace, '/' ); - return ts.regex.shortDateTest.test( str ); - }, - format : function( str, table, cell, cellIndex ) { - if ( str ) { - var c = table.config, - $header = c.$headerIndexed[ cellIndex ], - format = $header.length && $header.data( 'dateFormat' ) || - ts.getData( $header, ts.getColumnData( table, c.headers, cellIndex ), 'dateFormat' ) || - c.dateFormat; - // save format because getData can be slow... - if ( $header.length ) { - $header.data( 'dateFormat', format ); - } - return ts.convertFormat( str, format ) || str; - } - return str; - }, - type : 'numeric' - }); - - // match 24 hour time & 12 hours time + am/pm - see http://regexr.com/3c3tk - ts.regex.timeTest = /^([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i; - ts.regex.timeMatch = /([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i; - ts.addParser({ - id : 'time', - is : function( str ) { - return ts.regex.timeTest.test( str ); - }, - format : function( str, table ) { - // isolate time... ignore month, day and year - var temp, - timePart = ( str || '' ).match( ts.regex.timeMatch ), - orig = new Date( str ), - // no time component? default to 00:00 by leaving it out, but only if str is defined - time = str && ( timePart !== null ? timePart[ 0 ] : '00:00 AM' ), - date = time ? new Date( '2000/01/01 ' + time.replace( ts.regex.dateReplace, '$1 $2' ) ) : time; - if ( date instanceof Date && isFinite( date ) ) { - temp = orig instanceof Date && isFinite( orig ) ? orig.getTime() : 0; - // if original string was a valid date, add it to the decimal so the column sorts in some kind of order - // luckily new Date() ignores the decimals - return temp ? parseFloat( date.getTime() + '.' + orig.getTime() ) : date.getTime(); - } - return str; - }, - type : 'numeric' - }); - - ts.addParser({ - id : 'metadata', - is : function() { - return false; - }, - format : function( str, table, cell ) { - var c = table.config, - p = ( !c.parserMetadataName ) ? 'sortValue' : c.parserMetadataName; - return $( cell ).metadata()[ p ]; - }, - type : 'numeric' - }); - - /* - ██████ ██████ █████▄ █████▄ ▄████▄ - ▄█▀ ██▄▄ ██▄▄██ ██▄▄██ ██▄▄██ - ▄█▀ ██▀▀ ██▀▀██ ██▀▀█ ██▀▀██ - ██████ ██████ █████▀ ██ ██ ██ ██ - */ - // add default widgets - ts.addWidget({ - id : 'zebra', - priority : 90, - format : function( table, c, wo ) { - var $visibleRows, $row, count, isEven, tbodyIndex, rowIndex, len, - child = new RegExp( c.cssChildRow, 'i' ), - $tbodies = c.$tbodies.add( $( c.namespace + '_extra_table' ).children( 'tbody:not(.' + c.cssInfoBlock + ')' ) ); - for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { - // loop through the visible rows - count = 0; - $visibleRows = $tbodies.eq( tbodyIndex ).children( 'tr:visible' ).not( c.selectorRemove ); - len = $visibleRows.length; - for ( rowIndex = 0; rowIndex < len; rowIndex++ ) { - $row = $visibleRows.eq( rowIndex ); - // style child rows the same way the parent row was styled - if ( !child.test( $row[ 0 ].className ) ) { count++; } - isEven = ( count % 2 === 0 ); - $row - .removeClass( wo.zebra[ isEven ? 1 : 0 ] ) - .addClass( wo.zebra[ isEven ? 0 : 1 ] ); - } - } - }, - remove : function( table, c, wo, refreshing ) { - if ( refreshing ) { return; } - var tbodyIndex, $tbody, - $tbodies = c.$tbodies, - toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' ); - for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ){ - $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody - $tbody.children().removeClass( toRemove ); - ts.processTbody( table, $tbody, false ); // restore tbody - } - } - }); - -})( jQuery ); diff --git a/public/js/lib/jquery.tablesorter.min.js b/public/js/lib/jquery.tablesorter.min.js deleted file mode 100644 index b8605df1e7..0000000000 --- a/public/js/lib/jquery.tablesorter.min.js +++ /dev/null @@ -1,4 +0,0 @@ - -(function($){$.extend({tablesorter:new -function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((ab)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i table ID/index on page > data - if (!values[url]) { - values[url] = {}; - } - values[url][id] = value; - // *** set value *** - if (hasStorage) { - window[storageType][key] = JSON.stringify(values); - } else { - date = new Date(); - date.setTime(date.getTime() + (31536e+6)); // 365 days - document.cookie = key + '=' + (JSON.stringify(values)).replace(/\"/g, '\"') + '; expires=' + date.toGMTString() + '; path=/'; - } - } else { - return values && values[url] ? values[url][id] : ''; - } - }; - -})(jQuery, window, document); - -/*! Widget: uitheme - updated 3/26/2015 (v2.21.3) */ -;(function ($) { - 'use strict'; - var ts = $.tablesorter || {}; - - ts.themes = { - 'bootstrap' : { - table : 'table table-bordered table-striped', - caption : 'caption', - // header class names - header : 'bootstrap-header', // give the header a gradient background (theme.bootstrap_2.css) - sortNone : '', - sortAsc : '', - sortDesc : '', - active : '', // applied when column is sorted - hover : '', // custom css required - a defined bootstrap style may not override other classes - // icon class names - icons : '', // add 'icon-white' to make them white; this icon class is added to the in the header - iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted - iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort - iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort - filterRow : '', // filter row class - footerRow : '', - footerCells : '', - even : '', // even row zebra striping - odd : '' // odd row zebra striping - }, - 'jui' : { - table : 'ui-widget ui-widget-content ui-corner-all', // table classes - caption : 'ui-widget-content', - // header class names - header : 'ui-widget-header ui-corner-all ui-state-default', // header classes - sortNone : '', - sortAsc : '', - sortDesc : '', - active : 'ui-state-active', // applied when column is sorted - hover : 'ui-state-hover', // hover class - // icon class names - icons : 'ui-icon', // icon class added to the in the header - iconSortNone : 'ui-icon-carat-2-n-s', // class name added to icon when column is not sorted - iconSortAsc : 'ui-icon-carat-1-n', // class name added to icon when column has ascending sort - iconSortDesc : 'ui-icon-carat-1-s', // class name added to icon when column has descending sort - filterRow : '', - footerRow : '', - footerCells : '', - even : 'ui-widget-content', // even row zebra striping - odd : 'ui-state-default' // odd row zebra striping - } - }; - - $.extend(ts.css, { - wrapper : 'tablesorter-wrapper' // ui theme & resizable - }); - - ts.addWidget({ - id: 'uitheme', - priority: 10, - format: function(table, c, wo) { - var i, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme, - themesAll = ts.themes, - $table = c.$table.add( $( c.namespace + '_extra_table' ) ), - $headers = c.$headers.add( $( c.namespace + '_extra_headers' ) ), - theme = c.theme || 'jui', - themes = themesAll[theme] || {}, - remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ), - iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ); - if (c.debug) { time = new Date(); } - // initialization code - run once - if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) { - wo.uitheme_applied = true; - oldtheme = themesAll[c.appliedTheme] || {}; - hasOldTheme = !$.isEmptyObject(oldtheme); - oldremove = hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : ''; - oldIconRmv = hasOldTheme ? [ oldtheme.iconSortNone, oldtheme.iconSortDesc, oldtheme.iconSortAsc ].join( ' ' ) : ''; - if (hasOldTheme) { - wo.zebra[0] = $.trim( ' ' + wo.zebra[0].replace(' ' + oldtheme.even, '') ); - wo.zebra[1] = $.trim( ' ' + wo.zebra[1].replace(' ' + oldtheme.odd, '') ); - c.$tbodies.children().removeClass( [ oldtheme.even, oldtheme.odd ].join(' ') ); - } - // update zebra stripes - if (themes.even) { wo.zebra[0] += ' ' + themes.even; } - if (themes.odd) { wo.zebra[1] += ' ' + themes.odd; } - // add caption style - $table.children('caption') - .removeClass(oldtheme.caption || '') - .addClass(themes.caption); - // add table/footer class names - $tfoot = $table - // remove other selected themes - .removeClass( (c.appliedTheme ? 'tablesorter-' + (c.appliedTheme || '') : '') + ' ' + (oldtheme.table || '') ) - .addClass('tablesorter-' + theme + ' ' + (themes.table || '')) // add theme widget class name - .children('tfoot'); - c.appliedTheme = c.theme; - - if ($tfoot.length) { - $tfoot - // if oldtheme.footerRow or oldtheme.footerCells are undefined, all class names are removed - .children('tr').removeClass(oldtheme.footerRow || '').addClass(themes.footerRow) - .children('th, td').removeClass(oldtheme.footerCells || '').addClass(themes.footerCells); - } - // update header classes - $headers - .removeClass( (hasOldTheme ? [ oldtheme.header, oldtheme.hover, oldremove ].join(' ') : '') || '' ) - .addClass(themes.header) - .not('.sorter-false') - .unbind('mouseenter.tsuitheme mouseleave.tsuitheme') - .bind('mouseenter.tsuitheme mouseleave.tsuitheme', function(event) { - // toggleClass with switch added in jQuery 1.3 - $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || ''); - }); - - $headers.each(function(){ - var $this = $(this); - if (!$this.find('.' + ts.css.wrapper).length) { - // Firefox needs this inner div to position the icon & resizer correctly - $this.wrapInner('
    '); - } - }); - if (c.cssIcon) { - // if c.cssIcon is '', then no is added to the header - $headers - .find('.' + ts.css.icon) - .removeClass(hasOldTheme ? [ oldtheme.icons, oldIconRmv ].join(' ') : '') - .addClass(themes.icons || ''); - } - if ($table.hasClass('hasFilters')) { - $table.children('thead').children('.' + ts.css.filterRow) - .removeClass(hasOldTheme ? oldtheme.filterRow || '' : '') - .addClass(themes.filterRow || ''); - } - } - for (i = 0; i < c.columns; i++) { - $header = c.$headers - .add($(c.namespace + '_extra_headers')) - .not('.sorter-false') - .filter('[data-column="' + i + '"]'); - $icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $(); - $h = $headers.not('.sorter-false').filter('[data-column="' + i + '"]:last'); - if ($h.length) { - $header.removeClass(remove); - $icon.removeClass(iconRmv); - if ($h[0].sortDisabled) { - // no sort arrows for disabled columns! - $icon.removeClass(themes.icons || ''); - } else { - hdr = themes.sortNone; - icon = themes.iconSortNone; - if ($h.hasClass(ts.css.sortAsc)) { - hdr = [ themes.sortAsc, themes.active ].join(' '); - icon = themes.iconSortAsc; - } else if ($h.hasClass(ts.css.sortDesc)) { - hdr = [ themes.sortDesc, themes.active ].join(' '); - icon = themes.iconSortDesc; - } - $header.addClass(hdr); - $icon.addClass(icon || ''); - } - } - } - if (c.debug) { - console.log('Applying ' + theme + ' theme' + ts.benchmark(time)); - } - }, - remove: function(table, c, wo, refreshing) { - if (!wo.uitheme_applied) { return; } - var $table = c.$table, - theme = c.appliedTheme || 'jui', - themes = ts.themes[ theme ] || ts.themes.jui, - $headers = $table.children('thead').children(), - remove = themes.sortNone + ' ' + themes.sortDesc + ' ' + themes.sortAsc, - iconRmv = themes.iconSortNone + ' ' + themes.iconSortDesc + ' ' + themes.iconSortAsc; - $table.removeClass('tablesorter-' + theme + ' ' + themes.table); - wo.uitheme_applied = false; - if (refreshing) { return; } - $table.find(ts.css.header).removeClass(themes.header); - $headers - .unbind('mouseenter.tsuitheme mouseleave.tsuitheme') // remove hover - .removeClass(themes.hover + ' ' + remove + ' ' + themes.active) - .filter('.' + ts.css.filterRow) - .removeClass(themes.filterRow); - $headers.find('.' + ts.css.icon).removeClass(themes.icons + ' ' + iconRmv); - } - }); - -})(jQuery); - -/*! Widget: columns */ -;(function ($) { - 'use strict'; - var ts = $.tablesorter || {}; - - ts.addWidget({ - id: 'columns', - priority: 30, - options : { - columns : [ 'primary', 'secondary', 'tertiary' ] - }, - format: function(table, c, wo) { - var $tbody, tbodyIndex, $rows, rows, $row, $cells, remove, indx, - $table = c.$table, - $tbodies = c.$tbodies, - sortList = c.sortList, - len = sortList.length, - // removed c.widgetColumns support - css = wo && wo.columns || [ 'primary', 'secondary', 'tertiary' ], - last = css.length - 1; - remove = css.join(' '); - // check if there is a sort (on initialization there may not be one) - for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { - $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // detach tbody - $rows = $tbody.children('tr'); - // loop through the visible rows - $rows.each(function() { - $row = $(this); - if (this.style.display !== 'none') { - // remove all columns class names - $cells = $row.children().removeClass(remove); - // add appropriate column class names - if (sortList && sortList[0]) { - // primary sort column class - $cells.eq(sortList[0][0]).addClass(css[0]); - if (len > 1) { - for (indx = 1; indx < len; indx++) { - // secondary, tertiary, etc sort column classes - $cells.eq(sortList[indx][0]).addClass( css[indx] || css[last] ); - } - } - } - } - }); - ts.processTbody(table, $tbody, false); - } - // add classes to thead and tfoot - rows = wo.columns_thead !== false ? [ 'thead tr' ] : []; - if (wo.columns_tfoot !== false) { - rows.push('tfoot tr'); - } - if (rows.length) { - $rows = $table.find( rows.join(',') ).children().removeClass(remove); - if (len) { - for (indx = 0; indx < len; indx++) { - // add primary. secondary, tertiary, etc sort column classes - $rows.filter('[data-column="' + sortList[indx][0] + '"]').addClass(css[indx] || css[last]); - } - } - } - }, - remove: function(table, c, wo) { - var tbodyIndex, $tbody, - $tbodies = c.$tbodies, - remove = (wo.columns || [ 'primary', 'secondary', 'tertiary' ]).join(' '); - c.$headers.removeClass(remove); - c.$table.children('tfoot').children('tr').children('th, td').removeClass(remove); - for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { - $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // remove tbody - $tbody.children('tr').each(function() { - $(this).children().removeClass(remove); - }); - ts.processTbody(table, $tbody, false); // restore tbody - } - } - }); - -})(jQuery); - -/*! Widget: filter - updated 4/29/2016 (v2.25.9) *//* - * Requires tablesorter v2.8+ and jQuery 1.7+ - * by Rob Garrison - */ -;( function ( $ ) { - 'use strict'; - var tsf, tsfRegex, - ts = $.tablesorter || {}, - tscss = ts.css, - tskeyCodes = ts.keyCodes; - - $.extend( tscss, { - filterRow : 'tablesorter-filter-row', - filter : 'tablesorter-filter', - filterDisabled : 'disabled', - filterRowHide : 'hideme' - }); - - $.extend( tskeyCodes, { - backSpace : 8, - escape : 27, - space : 32, - left : 37, - down : 40 - }); - - ts.addWidget({ - id: 'filter', - priority: 50, - options : { - filter_cellFilter : '', // css class name added to the filter cell ( string or array ) - filter_childRows : false, // if true, filter includes child row content in the search - filter_childByColumn : false, // ( filter_childRows must be true ) if true = search child rows by column; false = search all child row text grouped - filter_childWithSibs : true, // if true, include matching child row siblings - filter_columnAnyMatch: true, // if true, allows using '#:{query}' in AnyMatch searches ( column:query ) - filter_columnFilters : true, // if true, a filter will be added to the top of each table column - filter_cssFilter : '', // css class name added to the filter row & each input in the row ( tablesorter-filter is ALWAYS added ) - filter_defaultAttrib : 'data-value', // data attribute in the header cell that contains the default filter value - filter_defaultFilter : {}, // add a default column filter type '~{query}' to make fuzzy searches default; '{q1} AND {q2}' to make all searches use a logical AND. - filter_excludeFilter : {}, // filters to exclude, per column - filter_external : '', // jQuery selector string ( or jQuery object ) of external filters - filter_filteredRow : 'filtered', // class added to filtered rows; define in css with "display:none" to hide the filtered-out rows - filter_formatter : null, // add custom filter elements to the filter row - filter_functions : null, // add custom filter functions using this option - filter_hideEmpty : true, // hide filter row when table is empty - filter_hideFilters : false, // collapse filter row when mouse leaves the area - filter_ignoreCase : true, // if true, make all searches case-insensitive - filter_liveSearch : true, // if true, search column content while the user types ( with a delay ) - filter_matchType : { 'input': 'exact', 'select': 'exact' }, // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class - filter_onlyAvail : 'filter-onlyAvail', // a header with a select dropdown & this class name will only show available ( visible ) options within the drop down - filter_placeholder : { search : '', select : '' }, // default placeholder text ( overridden by any header 'data-placeholder' setting ) - filter_reset : null, // jQuery selector string of an element used to reset the filters - filter_resetOnEsc : true, // Reset filter input when the user presses escape - normalized across browsers - filter_saveFilters : false, // Use the $.tablesorter.storage utility to save the most recent filters - filter_searchDelay : 300, // typing delay in milliseconds before starting a search - filter_searchFiltered: true, // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true - filter_selectSource : null, // include a function to return an array of values to be added to the column filter select - filter_selectSourceSeparator : '|', // filter_selectSource array text left of the separator is added to the option value, right into the option text - filter_serversideFiltering : false, // if true, must perform server-side filtering b/c client-side filtering is disabled, but the ui and events will still be used. - filter_startsWith : false, // if true, filter start from the beginning of the cell contents - filter_useParsedData : false // filter all data using parsed content - }, - format: function( table, c, wo ) { - if ( !c.$table.hasClass( 'hasFilters' ) ) { - tsf.init( table, c, wo ); - } - }, - remove: function( table, c, wo, refreshing ) { - var tbodyIndex, $tbody, - $table = c.$table, - $tbodies = c.$tbodies, - events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ' - .split( ' ' ).join( c.namespace + 'filter ' ); - $table - .removeClass( 'hasFilters' ) - // add filter namespace to all BUT search - .unbind( events.replace( ts.regex.spaces, ' ' ) ) - // remove the filter row even if refreshing, because the column might have been moved - .find( '.' + tscss.filterRow ).remove(); - wo.filter_initialized = false; - if ( refreshing ) { return; } - for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { - $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody - $tbody.children().removeClass( wo.filter_filteredRow ).show(); - ts.processTbody( table, $tbody, false ); // restore tbody - } - if ( wo.filter_reset ) { - $( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' ); - } - } - }); - - tsf = ts.filter = { - - // regex used in filter 'check' functions - not for general use and not documented - regex: { - regex : /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/, // regex to test for regex - child : /tablesorter-childRow/, // child row class name; this gets updated in the script - filtered : /filtered/, // filtered (hidden) row class name; updated in the script - type : /undefined|number/, // check type - exact : /(^[\"\'=]+)|([\"\'=]+$)/g, // exact match (allow '==') - operators : /[<>=]/g, // replace operators - query : '(q|query)', // replace filter queries - wild01 : /\?/g, // wild card match 0 or 1 - wild0More : /\*/g, // wild care match 0 or more - quote : /\"/g, - isNeg1 : /(>=?\s*-\d)/, - isNeg2 : /(<=?\s*\d)/ - }, - // function( c, data ) { } - // c = table.config - // data.$row = jQuery object of the row currently being processed - // data.$cells = jQuery object of all cells within the current row - // data.filters = array of filters for all columns ( some may be undefined ) - // data.filter = filter for the current column - // data.iFilter = same as data.filter, except lowercase ( if wo.filter_ignoreCase is true ) - // data.exact = table cell text ( or parsed data if column parser enabled; may be a number & not a string ) - // data.iExact = same as data.exact, except lowercase ( if wo.filter_ignoreCase is true; may be a number & not a string ) - // data.cache = table cell text from cache, so it has been parsed ( & in all lower case if c.ignoreCase is true ) - // data.cacheArray = An array of parsed content from each table cell in the row being processed - // data.index = column index; table = table element ( DOM ) - // data.parsed = array ( by column ) of boolean values ( from filter_useParsedData or 'filter-parsed' class ) - types: { - or : function( c, data, vars ) { - // look for "|", but not if it is inside of a regular expression - if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) && - // this test for regex has potential to slow down the overall search - !tsfRegex.regex.test( data.filter ) ) { - var indx, filterMatched, query, regex, - // duplicate data but split filter - data2 = $.extend( {}, data ), - filter = data.filter.split( tsfRegex.orSplit ), - iFilter = data.iFilter.split( tsfRegex.orSplit ), - len = filter.length; - for ( indx = 0; indx < len; indx++ ) { - data2.nestedFilters = true; - data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' ); - data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' ); - query = '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')'; - try { - // use try/catch, because query may not be a valid regex if "|" is contained within a partial regex search, - // e.g "/(Alex|Aar" -> Uncaught SyntaxError: Invalid regular expression: /(/(Alex)/: Unterminated group - regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' ); - // filterMatched = data2.filter === '' && indx > 0 ? true - // look for an exact match with the 'or' unless the 'filter-match' class is found - filterMatched = regex.test( data2.exact ) || tsf.processTypes( c, data2, vars ); - if ( filterMatched ) { - return filterMatched; - } - } catch ( error ) { - return null; - } - } - // may be null from processing types - return filterMatched || false; - } - return null; - }, - // Look for an AND or && operator ( logical and ) - and : function( c, data, vars ) { - if ( tsfRegex.andTest.test( data.filter ) ) { - var indx, filterMatched, result, query, regex, - // duplicate data but split filter - data2 = $.extend( {}, data ), - filter = data.filter.split( tsfRegex.andSplit ), - iFilter = data.iFilter.split( tsfRegex.andSplit ), - len = filter.length; - for ( indx = 0; indx < len; indx++ ) { - data2.nestedFilters = true; - data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' ); - data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' ); - query = ( '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')' ) - // replace wild cards since /(a*)/i will match anything - .replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ); - try { - // use try/catch just in case RegExp is invalid - regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' ); - // look for an exact match with the 'and' unless the 'filter-match' class is found - result = ( regex.test( data2.exact ) || tsf.processTypes( c, data2, vars ) ); - if ( indx === 0 ) { - filterMatched = result; - } else { - filterMatched = filterMatched && result; - } - } catch ( error ) { - return null; - } - } - // may be null from processing types - return filterMatched || false; - } - return null; - }, - // Look for regex - regex: function( c, data ) { - if ( tsfRegex.regex.test( data.filter ) ) { - var matches, - // cache regex per column for optimal speed - regex = data.filter_regexCache[ data.index ] || tsfRegex.regex.exec( data.filter ), - isRegex = regex instanceof RegExp; - try { - if ( !isRegex ) { - // force case insensitive search if ignoreCase option set? - // if ( c.ignoreCase && !regex[2] ) { regex[2] = 'i'; } - data.filter_regexCache[ data.index ] = regex = new RegExp( regex[1], regex[2] ); - } - matches = regex.test( data.exact ); - } catch ( error ) { - matches = false; - } - return matches; - } - return null; - }, - // Look for operators >, >=, < or <= - operators: function( c, data ) { - // ignore empty strings... because '' < 10 is true - if ( tsfRegex.operTest.test( data.iFilter ) && data.iExact !== '' ) { - var cachedValue, result, txt, - table = c.table, - parsed = data.parsed[ data.index ], - query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ), - parser = c.parsers[ data.index ] || {}, - savedSearch = query; - // parse filter value in case we're comparing numbers ( dates ) - if ( parsed || parser.type === 'numeric' ) { - txt = $.trim( '' + data.iFilter.replace( tsfRegex.operators, '' ) ); - result = tsf.parseFilter( c, txt, data, true ); - query = ( typeof result === 'number' && result !== '' && !isNaN( result ) ) ? result : query; - } - // iExact may be numeric - see issue #149; - // check if cached is defined, because sometimes j goes out of range? ( numeric columns ) - if ( ( parsed || parser.type === 'numeric' ) && !isNaN( query ) && - typeof data.cache !== 'undefined' ) { - cachedValue = data.cache; - } else { - txt = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact; - cachedValue = ts.formatFloat( txt, table ); - } - if ( tsfRegex.gtTest.test( data.iFilter ) ) { - result = tsfRegex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query; - } else if ( tsfRegex.ltTest.test( data.iFilter ) ) { - result = tsfRegex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query; - } - // keep showing all rows if nothing follows the operator - if ( !result && savedSearch === '' ) { - result = true; - } - return result; - } - return null; - }, - // Look for a not match - notMatch: function( c, data ) { - if ( tsfRegex.notTest.test( data.iFilter ) ) { - var indx, - txt = data.iFilter.replace( '!', '' ), - filter = tsf.parseFilter( c, txt, data ) || ''; - if ( tsfRegex.exact.test( filter ) ) { - // look for exact not matches - see #628 - filter = filter.replace( tsfRegex.exact, '' ); - return filter === '' ? true : $.trim( filter ) !== data.iExact; - } else { - indx = data.iExact.search( $.trim( filter ) ); - return filter === '' ? true : !( c.widgetOptions.filter_startsWith ? indx === 0 : indx >= 0 ); - } - } - return null; - }, - // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric - exact: function( c, data ) { - if ( tsfRegex.exact.test( data.iFilter ) ) { - var txt = data.iFilter.replace( tsfRegex.exact, '' ), - filter = tsf.parseFilter( c, txt, data ) || ''; - return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact; - } - return null; - }, - // Look for a range ( using ' to ' or ' - ' ) - see issue #166; thanks matzhu! - range : function( c, data ) { - if ( tsfRegex.toTest.test( data.iFilter ) ) { - var result, tmp, range1, range2, - table = c.table, - index = data.index, - parsed = data.parsed[index], - // make sure the dash is for a range and not indicating a negative number - query = data.iFilter.split( tsfRegex.toSplit ); - - tmp = query[0].replace( ts.regex.nondigit, '' ) || ''; - range1 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); - tmp = query[1].replace( ts.regex.nondigit, '' ) || ''; - range2 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); - // parse filter value in case we're comparing numbers ( dates ) - if ( parsed || c.parsers[ index ].type === 'numeric' ) { - result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index ); - range1 = ( result !== '' && !isNaN( result ) ) ? result : range1; - result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index ); - range2 = ( result !== '' && !isNaN( result ) ) ? result : range2; - } - if ( ( parsed || c.parsers[ index ].type === 'numeric' ) && !isNaN( range1 ) && !isNaN( range2 ) ) { - result = data.cache; - } else { - tmp = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact; - result = ts.formatFloat( tmp, table ); - } - if ( range1 > range2 ) { - tmp = range1; range1 = range2; range2 = tmp; // swap - } - return ( result >= range1 && result <= range2 ) || ( range1 === '' || range2 === '' ); - } - return null; - }, - // Look for wild card: ? = single, * = multiple, or | = logical OR - wild : function( c, data ) { - if ( tsfRegex.wildOrTest.test( data.iFilter ) ) { - var query = '' + ( tsf.parseFilter( c, data.iFilter, data ) || '' ); - // look for an exact match with the 'or' unless the 'filter-match' class is found - if ( !tsfRegex.wildTest.test( query ) && data.nestedFilters ) { - query = data.isMatch ? query : '^(' + query + ')$'; - } - // parsing the filter may not work properly when using wildcards =/ - try { - return new RegExp( - query.replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ), - c.widgetOptions.filter_ignoreCase ? 'i' : '' - ) - .test( data.exact ); - } catch ( error ) { - return null; - } - } - return null; - }, - // fuzzy text search; modified from https://github.com/mattyork/fuzzy ( MIT license ) - fuzzy: function( c, data ) { - if ( tsfRegex.fuzzyTest.test( data.iFilter ) ) { - var indx, - patternIndx = 0, - len = data.iExact.length, - txt = data.iFilter.slice( 1 ), - pattern = tsf.parseFilter( c, txt, data ) || ''; - for ( indx = 0; indx < len; indx++ ) { - if ( data.iExact[ indx ] === pattern[ patternIndx ] ) { - patternIndx += 1; - } - } - return patternIndx === pattern.length; - } - return null; - } - }, - init: function( table ) { - // filter language options - ts.language = $.extend( true, {}, { - to : 'to', - or : 'or', - and : 'and' - }, ts.language ); - - var options, string, txt, $header, column, val, fxn, noSelect, - c = table.config, - wo = c.widgetOptions; - c.$table.addClass( 'hasFilters' ); - c.lastSearch = []; - - // define timers so using clearTimeout won't cause an undefined error - wo.filter_searchTimer = null; - wo.filter_initTimer = null; - wo.filter_formatterCount = 0; - wo.filter_formatterInit = []; - wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]'; - wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]'; - - val = '\\{' + tsfRegex.query + '\\}'; - $.extend( tsfRegex, { - child : new RegExp( c.cssChildRow ), - filtered : new RegExp( wo.filter_filteredRow ), - alreadyFiltered : new RegExp( '(\\s+(' + ts.language.or + '|-|' + ts.language.to + ')\\s+)', 'i' ), - toTest : new RegExp( '\\s+(-|' + ts.language.to + ')\\s+', 'i' ), - toSplit : new RegExp( '(?:\\s+(?:-|' + ts.language.to + ')\\s+)', 'gi' ), - andTest : new RegExp( '\\s+(' + ts.language.and + '|&&)\\s+', 'i' ), - andSplit : new RegExp( '(?:\\s+(?:' + ts.language.and + '|&&)\\s+)', 'gi' ), - orTest : new RegExp( '(\\||\\s+' + ts.language.or + '\\s+)', 'i' ), - orSplit : new RegExp( '(?:\\s+(?:' + ts.language.or + ')\\s+|\\|)', 'gi' ), - iQuery : new RegExp( val, 'i' ), - igQuery : new RegExp( val, 'ig' ), - operTest : /^[<>]=?/, - gtTest : />/, - gteTest : />=/, - ltTest : /' + - ( $header.data( 'placeholder' ) || - $header.attr( 'data-placeholder' ) || - wo.filter_placeholder.select || - '' - ) + - '' : ''; - val = string; - txt = string; - if ( string.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) { - val = string.split( wo.filter_selectSourceSeparator ); - txt = val[1]; - val = val[0]; - } - options += ''; - } - } - c.$table - .find( 'thead' ) - .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' ) - .append( options ); - txt = wo.filter_selectSource; - fxn = typeof txt === 'function' ? true : ts.getColumnData( table, txt, column ); - if ( fxn ) { - // updating so the extra options are appended - tsf.buildSelect( c.table, column, '', true, $header.hasClass( wo.filter_onlyAvail ) ); - } - } - } - } - } - // not really updating, but if the column has both the 'filter-select' class & - // filter_functions set to true, it would append the same options twice. - tsf.buildDefault( table, true ); - - tsf.bindSearch( table, c.$table.find( '.' + tscss.filter ), true ); - if ( wo.filter_external ) { - tsf.bindSearch( table, wo.filter_external ); - } - - if ( wo.filter_hideFilters ) { - tsf.hideFilters( c ); - } - - // show processing icon - if ( c.showProcessing ) { - txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter ' ); - c.$table - .unbind( txt.replace( ts.regex.spaces, ' ' ) ) - .bind( txt, function( event, columns ) { - // only add processing to certain columns to all columns - $header = ( columns ) ? - c.$table - .find( '.' + tscss.header ) - .filter( '[data-column]' ) - .filter( function() { - return columns[ $( this ).data( 'column' ) ] !== ''; - }) : ''; - ts.isProcessing( table, event.type === 'filterStart', columns ? $header : '' ); - }); - } - - // set filtered rows count ( intially unfiltered ) - c.filteredRows = c.totalRows; - - // add default values - txt = 'tablesorter-initialized pagerBeforeInitialized '.split( ' ' ).join( c.namespace + 'filter ' ); - c.$table - .unbind( txt.replace( ts.regex.spaces, ' ' ) ) - .bind( txt, function() { - tsf.completeInit( this ); - }); - // if filter widget is added after pager has initialized; then set filter init flag - if ( c.pager && c.pager.initialized && !wo.filter_initialized ) { - c.$table.triggerHandler( 'filterFomatterUpdate' ); - setTimeout( function() { - tsf.filterInitComplete( c ); - }, 100 ); - } else if ( !wo.filter_initialized ) { - tsf.completeInit( table ); - } - }, - completeInit: function( table ) { - // redefine 'c' & 'wo' so they update properly inside this callback - var c = table.config, - wo = c.widgetOptions, - filters = tsf.setDefaults( table, c, wo ) || []; - if ( filters.length ) { - // prevent delayInit from triggering a cache build if filters are empty - if ( !( c.delayInit && filters.join( '' ) === '' ) ) { - ts.setFilters( table, filters, true ); - } - } - c.$table.triggerHandler( 'filterFomatterUpdate' ); - // trigger init after setTimeout to prevent multiple filterStart/End/Init triggers - setTimeout( function() { - if ( !wo.filter_initialized ) { - tsf.filterInitComplete( c ); - } - }, 100 ); - }, - - // $cell parameter, but not the config, is passed to the filter_formatters, - // so we have to work with it instead - formatterUpdated: function( $cell, column ) { - // prevent error if $cell is undefined - see #1056 - var wo = $cell && $cell.closest( 'table' )[0].config.widgetOptions; - if ( wo && !wo.filter_initialized ) { - // add updates by column since this function - // may be called numerous times before initialization - wo.filter_formatterInit[ column ] = 1; - } - }, - filterInitComplete: function( c ) { - var indx, len, - wo = c.widgetOptions, - count = 0, - completed = function() { - wo.filter_initialized = true; - c.$table.triggerHandler( 'filterInit', c ); - tsf.findRows( c.table, c.$table.data( 'lastSearch' ) || [] ); - }; - if ( $.isEmptyObject( wo.filter_formatter ) ) { - completed(); - } else { - len = wo.filter_formatterInit.length; - for ( indx = 0; indx < len; indx++ ) { - if ( wo.filter_formatterInit[ indx ] === 1 ) { - count++; - } - } - clearTimeout( wo.filter_initTimer ); - if ( !wo.filter_initialized && count === wo.filter_formatterCount ) { - // filter widget initialized - completed(); - } else if ( !wo.filter_initialized ) { - // fall back in case a filter_formatter doesn't call - // $.tablesorter.filter.formatterUpdated( $cell, column ), and the count is off - wo.filter_initTimer = setTimeout( function() { - completed(); - }, 500 ); - } - } - }, - // encode or decode filters for storage; see #1026 - processFilters: function( filters, encode ) { - var indx, - mode = encode ? encodeURIComponent : decodeURIComponent, - len = filters.length; - for ( indx = 0; indx < len; indx++ ) { - if ( filters[ indx ] ) { - filters[ indx ] = mode( filters[ indx ] ); - } - } - return filters; - }, - setDefaults: function( table, c, wo ) { - var isArray, saved, indx, col, $filters, - // get current ( default ) filters - filters = ts.getFilters( table ) || []; - if ( wo.filter_saveFilters && ts.storage ) { - saved = ts.storage( table, 'tablesorter-filters' ) || []; - isArray = $.isArray( saved ); - // make sure we're not just getting an empty array - if ( !( isArray && saved.join( '' ) === '' || !isArray ) ) { - filters = tsf.processFilters( saved ); - } - } - // if no filters saved, then check default settings - if ( filters.join( '' ) === '' ) { - // allow adding default setting to external filters - $filters = c.$headers.add( wo.filter_$externalFilters ) - .filter( '[' + wo.filter_defaultAttrib + ']' ); - for ( indx = 0; indx <= c.columns; indx++ ) { - // include data-column='all' external filters - col = indx === c.columns ? 'all' : indx; - filters[ indx ] = $filters - .filter( '[data-column="' + col + '"]' ) - .attr( wo.filter_defaultAttrib ) || filters[indx] || ''; - } - } - c.$table.data( 'lastSearch', filters ); - return filters; - }, - parseFilter: function( c, filter, data, parsed ) { - return parsed || data.parsed[ data.index ] ? - c.parsers[ data.index ].format( filter, c.table, [], data.index ) : - filter; - }, - buildRow: function( table, c, wo ) { - var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp, - // c.columns defined in computeThIndexes() - cellFilter = wo.filter_cellFilter, - columns = c.columns, - arry = $.isArray( cellFilter ), - buildFilter = ''; - for ( column = 0; column < columns; column++ ) { - if ( c.$headerIndexed[ column ].length ) { - // account for entire column set with colspan. See #1047 - tmp = c.$headerIndexed[ column ] && c.$headerIndexed[ column ][0].colSpan || 0; - if ( tmp > 1 ) { - buildFilter += '' ).appendTo( $filter ); - } else { - ffxn = ts.getColumnData( table, wo.filter_formatter, column ); - if ( ffxn ) { - wo.filter_formatterCount++; - buildFilter = ffxn( $filter, column ); - // no element returned, so lets go find it - if ( buildFilter && buildFilter.length === 0 ) { - buildFilter = $filter.children( 'input' ); - } - // element not in DOM, so lets attach it - if ( buildFilter && ( buildFilter.parent().length === 0 || - ( buildFilter.parent().length && buildFilter.parent()[0] !== $filter[0] ) ) ) { - $filter.append( buildFilter ); - } - } else { - buildFilter = $( '' ).appendTo( $filter ); - } - if ( buildFilter ) { - tmp = $header.data( 'placeholder' ) || - $header.attr( 'data-placeholder' ) || - wo.filter_placeholder.search || ''; - buildFilter.attr( 'placeholder', tmp ); - } - } - if ( buildFilter ) { - // add filter class name - name = ( $.isArray( wo.filter_cssFilter ) ? - ( typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '' ) : - wo.filter_cssFilter ) || ''; - // copy data-column from table cell (it will include colspan) - buildFilter.addClass( tscss.filter + ' ' + name ).attr( 'data-column', $filter.attr( 'data-column' ) ); - if ( disabled ) { - buildFilter.attr( 'placeholder', '' ).addClass( tscss.filterDisabled )[0].disabled = true; - } - } - } - } - }, - bindSearch: function( table, $el, internal ) { - table = $( table )[0]; - $el = $( $el ); // allow passing a selector string - if ( !$el.length ) { return; } - var tmp, - c = table.config, - wo = c.widgetOptions, - namespace = c.namespace + 'filter', - $ext = wo.filter_$externalFilters; - if ( internal !== true ) { - // save anyMatch element - tmp = wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector; - wo.filter_$anyMatch = $el.filter( tmp ); - if ( $ext && $ext.length ) { - wo.filter_$externalFilters = wo.filter_$externalFilters.add( $el ); - } else { - wo.filter_$externalFilters = $el; - } - // update values ( external filters added after table initialization ) - ts.setFilters( table, c.$table.data( 'lastSearch' ) || [], internal === false ); - } - // unbind events - tmp = ( 'keypress keyup keydown search change input '.split( ' ' ).join( namespace + ' ' ) ); - $el - // use data attribute instead of jQuery data since the head is cloned without including - // the data/binding - .attr( 'data-lastSearchTime', new Date().getTime() ) - .unbind( tmp.replace( ts.regex.spaces, ' ' ) ) - .bind( 'keydown' + namespace, function( event ) { - if ( event.which === tskeyCodes.escape && !wo.filter_resetOnEsc ) { - // prevent keypress event - return false; - } - }) - .bind( 'keyup' + namespace, function( event ) { - var column = parseInt( $( this ).attr( 'data-column' ), 10 ); - $( this ).attr( 'data-lastSearchTime', new Date().getTime() ); - // emulate what webkit does.... escape clears the filter - if ( event.which === tskeyCodes.escape ) { - // make sure to restore the last value on escape - this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column]; - // live search - } else if ( wo.filter_liveSearch === false ) { - return; - // don't return if the search value is empty ( all rows need to be revealed ) - } else if ( this.value !== '' && ( - // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace - ( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) || - // let return & backspace continue on, but ignore arrows & non-valid characters - ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace && - ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) { - return; - } - // change event = no delay; last true flag tells getFilters to skip newest timed input - tsf.searching( table, true, true ); - }) - // include change for select - fixes #473 - .bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) { - // don't get cached data, in case data-column changes dynamically - var column = parseInt( $( this ).attr( 'data-column' ), 10 ); - // don't allow 'change' event to process if the input value is the same - fixes #685 - if ( wo.filter_initialized && ( event.which === tskeyCodes.enter || event.type === 'search' || - ( event.type === 'change' ) && this.value !== c.lastSearch[column] ) || - // only "input" event fires in MS Edge when clicking the "x" to clear the search - ( event.type === 'input' && this.value === '' ) ) { - event.preventDefault(); - // init search with no delay - $( this ).attr( 'data-lastSearchTime', new Date().getTime() ); - tsf.searching( table, event.type !== 'keypress', true ); - } - }); - }, - searching: function( table, filter, skipFirst ) { - var wo = table.config.widgetOptions; - clearTimeout( wo.filter_searchTimer ); - if ( typeof filter === 'undefined' || filter === true ) { - // delay filtering - wo.filter_searchTimer = setTimeout( function() { - tsf.checkFilters( table, filter, skipFirst ); - }, wo.filter_liveSearch ? wo.filter_searchDelay : 10 ); - } else { - // skip delay - tsf.checkFilters( table, filter, skipFirst ); - } - }, - checkFilters: function( table, filter, skipFirst ) { - var c = table.config, - wo = c.widgetOptions, - filterArray = $.isArray( filter ), - filters = ( filterArray ) ? filter : ts.getFilters( table, true ), - combinedFilters = ( filters || [] ).join( '' ); // combined filter values - // prevent errors if delay init is set - if ( $.isEmptyObject( c.cache ) ) { - // update cache if delayInit set & pager has initialized ( after user initiates a search ) - if ( c.delayInit && ( !c.pager || c.pager && c.pager.initialized ) ) { - ts.updateCache( c, function() { - tsf.checkFilters( table, false, skipFirst ); - }); - } - return; - } - // add filter array back into inputs - if ( filterArray ) { - ts.setFilters( table, filters, false, skipFirst !== true ); - if ( !wo.filter_initialized ) { c.lastCombinedFilter = ''; } - } - if ( wo.filter_hideFilters ) { - // show/hide filter row as needed - c.$table - .find( '.' + tscss.filterRow ) - .triggerHandler( combinedFilters === '' ? 'mouseleave' : 'mouseenter' ); - } - // return if the last search is the same; but filter === false when updating the search - // see example-widget-filter.html filter toggle buttons - if ( c.lastCombinedFilter === combinedFilters && filter !== false ) { - return; - } else if ( filter === false ) { - // force filter refresh - c.lastCombinedFilter = null; - c.lastSearch = []; - } - // define filter inside it is false - filters = filters || []; - // convert filters to strings - see #1070 - filters = Array.prototype.map ? - filters.map( String ) : - // for IE8 & older browsers - maybe not the best method - filters.join( '\ufffd' ).split( '\ufffd' ); - - if ( wo.filter_initialized ) { - c.$table.triggerHandler( 'filterStart', [ filters ] ); - } - if ( c.showProcessing ) { - // give it time for the processing icon to kick in - setTimeout( function() { - tsf.findRows( table, filters, combinedFilters ); - return false; - }, 30 ); - } else { - tsf.findRows( table, filters, combinedFilters ); - return false; - } - }, - hideFilters: function( c, $table ) { - var timer, - $row = ( $table || c.$table ).find( '.' + tscss.filterRow ).addClass( tscss.filterRowHide ); - $row - .bind( 'mouseenter mouseleave', function( e ) { - // save event object - http://bugs.jquery.com/ticket/12140 - var event = e, - $filterRow = $( this ); - clearTimeout( timer ); - timer = setTimeout( function() { - if ( /enter|over/.test( event.type ) ) { - $filterRow.removeClass( tscss.filterRowHide ); - } else { - // don't hide if input has focus - // $( ':focus' ) needs jQuery 1.6+ - if ( $( document.activeElement ).closest( 'tr' )[0] !== $filterRow[0] ) { - // don't hide row if any filter has a value - if ( c.lastCombinedFilter === '' ) { - $filterRow.addClass( tscss.filterRowHide ); - } - } - } - }, 200 ); - }) - .find( 'input, select' ).bind( 'focus blur', function( e ) { - var event = e, - $row = $( this ).closest( 'tr' ); - clearTimeout( timer ); - timer = setTimeout( function() { - clearTimeout( timer ); - // don't hide row if any filter has a value - if ( ts.getFilters( c.$table ).join( '' ) === '' ) { - $row.toggleClass( tscss.filterRowHide, event.type !== 'focus' ); - } - }, 200 ); - }); - }, - defaultFilter: function( filter, mask ) { - if ( filter === '' ) { return filter; } - var regex = tsfRegex.iQuery, - maskLen = mask.match( tsfRegex.igQuery ).length, - query = maskLen > 1 ? $.trim( filter ).split( /\s/ ) : [ $.trim( filter ) ], - len = query.length - 1, - indx = 0, - val = mask; - if ( len < 1 && maskLen > 1 ) { - // only one 'word' in query but mask has >1 slots - query[1] = query[0]; - } - // replace all {query} with query words... - // if query = 'Bob', then convert mask from '!{query}' to '!Bob' - // if query = 'Bob Joe Frank', then convert mask '{q} OR {q}' to 'Bob OR Joe OR Frank' - while ( regex.test( val ) ) { - val = val.replace( regex, query[indx++] || '' ); - if ( regex.test( val ) && indx < len && ( query[indx] || '' ) !== '' ) { - val = mask.replace( regex, val ); - } - } - return val; - }, - getLatestSearch: function( $input ) { - if ( $input ) { - return $input.sort( function( a, b ) { - return $( b ).attr( 'data-lastSearchTime' ) - $( a ).attr( 'data-lastSearchTime' ); - }); - } - return $input || $(); - }, - findRange: function( c, val, ignoreRanges ) { - // look for multiple columns '1-3,4-6,8' in data-column - var temp, ranges, range, start, end, singles, i, indx, len, - columns = []; - if ( /^[0-9]+$/.test( val ) ) { - // always return an array - return [ parseInt( val, 10 ) ]; - } - // process column range - if ( !ignoreRanges && /-/.test( val ) ) { - ranges = val.match( /(\d+)\s*-\s*(\d+)/g ); - len = ranges ? ranges.length : 0; - for ( indx = 0; indx < len; indx++ ) { - range = ranges[indx].split( /\s*-\s*/ ); - start = parseInt( range[0], 10 ) || 0; - end = parseInt( range[1], 10 ) || ( c.columns - 1 ); - if ( start > end ) { - temp = start; start = end; end = temp; // swap - } - if ( end >= c.columns ) { - end = c.columns - 1; - } - for ( ; start <= end; start++ ) { - columns[ columns.length ] = start; - } - // remove processed range from val - val = val.replace( ranges[ indx ], '' ); - } - } - // process single columns - if ( !ignoreRanges && /,/.test( val ) ) { - singles = val.split( /\s*,\s*/ ); - len = singles.length; - for ( i = 0; i < len; i++ ) { - if ( singles[ i ] !== '' ) { - indx = parseInt( singles[ i ], 10 ); - if ( indx < c.columns ) { - columns[ columns.length ] = indx; - } - } - } - } - // return all columns - if ( !columns.length ) { - for ( indx = 0; indx < c.columns; indx++ ) { - columns[ columns.length ] = indx; - } - } - return columns; - }, - getColumnElm: function( c, $elements, column ) { - // data-column may contain multiple columns '1-3,5-6,8' - // replaces: c.$filters.filter( '[data-column="' + column + '"]' ); - return $elements.filter( function() { - var cols = tsf.findRange( c, $( this ).attr( 'data-column' ) ); - return $.inArray( column, cols ) > -1; - }); - }, - multipleColumns: function( c, $input ) { - // look for multiple columns '1-3,4-6,8' in data-column - var wo = c.widgetOptions, - // only target 'all' column inputs on initialization - // & don't target 'all' column inputs if they don't exist - targets = wo.filter_initialized || !$input.filter( wo.filter_anyColumnSelector ).length, - val = $.trim( tsf.getLatestSearch( $input ).attr( 'data-column' ) || '' ); - return tsf.findRange( c, val, !targets ); - }, - processTypes: function( c, data, vars ) { - var ffxn, - filterMatched = null, - matches = null; - for ( ffxn in tsf.types ) { - if ( $.inArray( ffxn, vars.excludeMatch ) < 0 && matches === null ) { - matches = tsf.types[ffxn]( c, data, vars ); - if ( matches !== null ) { - filterMatched = matches; - } - } - } - return filterMatched; - }, - matchType: function( c, columnIndex ) { - var isMatch, - wo = c.widgetOptions, - $el = c.$headerIndexed[ columnIndex ]; - // filter-exact > filter-match > filter_matchType for type - if ( $el.hasClass( 'filter-exact' ) ) { - isMatch = false; - } else if ( $el.hasClass( 'filter-match' ) ) { - isMatch = true; - } else { - // filter-select is not applied when filter_functions are used, so look for a select - if ( wo.filter_columnFilters ) { - $el = c.$filters - .find( '.' + tscss.filter ) - .add( wo.filter_$externalFilters ) - .filter( '[data-column="' + columnIndex + '"]' ); - } else if ( wo.filter_$externalFilters ) { - $el = wo.filter_$externalFilters.filter( '[data-column="' + columnIndex + '"]' ); - } - isMatch = $el.length ? - c.widgetOptions.filter_matchType[ ( $el[ 0 ].nodeName || '' ).toLowerCase() ] === 'match' : - // default to exact, if no inputs found - false; - } - return isMatch; - }, - processRow: function( c, data, vars ) { - var result, filterMatched, - fxn, ffxn, txt, - wo = c.widgetOptions, - showRow = true, - - // if wo.filter_$anyMatch data-column attribute is changed dynamically - // we don't want to do an "anyMatch" search on one column using data - // for the entire row - see #998 - columnIndex = wo.filter_$anyMatch && wo.filter_$anyMatch.length ? - // look for multiple columns '1-3,4-6,8' - tsf.multipleColumns( c, wo.filter_$anyMatch ) : - []; - - data.$cells = data.$row.children(); - if ( data.anyMatchFlag && columnIndex.length > 1 || data.anyMatchFilter ) { - data.anyMatch = true; - data.isMatch = true; - data.rowArray = data.$cells.map( function( i ) { - if ( $.inArray( i, columnIndex ) > -1 || data.anyMatchFilter ) { - if ( data.parsed[ i ] ) { - txt = data.cacheArray[ i ]; - } else { - txt = data.rawArray[ i ]; - txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt ); - if ( c.sortLocaleCompare ) { - txt = ts.replaceAccents( txt ); - } - } - return txt; - } - }).get(); - data.filter = data.anyMatchFilter; - data.iFilter = data.iAnyMatchFilter; - data.exact = data.rowArray.join( ' ' ); - data.iExact = wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact; - data.cache = data.cacheArray.slice( 0, -1 ).join( ' ' ); - vars.excludeMatch = vars.noAnyMatch; - filterMatched = tsf.processTypes( c, data, vars ); - if ( filterMatched !== null ) { - showRow = filterMatched; - } else { - if ( wo.filter_startsWith ) { - showRow = false; - // data.rowArray may not contain all columns - columnIndex = Math.min( c.columns, data.rowArray.length ); - while ( !showRow && columnIndex > 0 ) { - columnIndex--; - showRow = showRow || data.rowArray[ columnIndex ].indexOf( data.iFilter ) === 0; - } - } else { - showRow = ( data.iExact + data.childRowText ).indexOf( data.iFilter ) >= 0; - } - } - data.anyMatch = false; - // no other filters to process - if ( data.filters.join( '' ) === data.filter ) { - return showRow; - } - } - - for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) { - data.filter = data.filters[ columnIndex ]; - data.index = columnIndex; - - // filter types to exclude, per column - vars.excludeMatch = vars.excludeFilter[ columnIndex ]; - - // ignore if filter is empty or disabled - if ( data.filter ) { - data.cache = data.cacheArray[ columnIndex ]; - result = data.parsed[ columnIndex ] ? data.cache : data.rawArray[ columnIndex ] || ''; - data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405 - data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ? - data.exact.toLowerCase() : data.exact; - data.isMatch = tsf.matchType( c, columnIndex ); - - result = showRow; // if showRow is true, show that row - - // in case select filter option has a different value vs text 'a - z|A through Z' - ffxn = wo.filter_columnFilters ? - c.$filters.add( wo.filter_$externalFilters ) - .filter( '[data-column="' + columnIndex + '"]' ) - .find( 'select option:selected' ) - .attr( 'data-function-name' ) || '' : ''; - // replace accents - see #357 - if ( c.sortLocaleCompare ) { - data.filter = ts.replaceAccents( data.filter ); - } - - // replace column specific default filters - see #1088 - if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) { - data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] ); - } - - // data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ), - // data.filter = case sensitive - data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter; - fxn = vars.functions[ columnIndex ]; - filterMatched = null; - if ( fxn ) { - if ( fxn === true ) { - // default selector uses exact match unless 'filter-match' class is found - filterMatched = data.isMatch ? - // data.iExact may be a number - ( '' + data.iExact ).search( data.iFilter ) >= 0 : - data.filter === data.exact; - } else if ( typeof fxn === 'function' ) { - // filter callback( exact cell content, parser normalized content, - // filter input value, column index, jQuery row object ) - filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data ); - } else if ( typeof fxn[ ffxn || data.filter ] === 'function' ) { - // selector option function - txt = ffxn || data.filter; - filterMatched = - fxn[ txt ]( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data ); - } - } - if ( filterMatched === null ) { - // cycle through the different filters - // filters return a boolean or null if nothing matches - filterMatched = tsf.processTypes( c, data, vars ); - if ( filterMatched !== null ) { - result = filterMatched; - // Look for match, and add child row data for matching - } else { - txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) ); - result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) ); - } - } else { - result = filterMatched; - } - showRow = ( result ) ? showRow : false; - } - } - return showRow; - }, - findRows: function( table, filters, combinedFilters ) { - if ( table.config.lastCombinedFilter === combinedFilters || - !table.config.widgetOptions.filter_initialized ) { - return; - } - var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex, - isChild, childRow, lastSearch, showRow, showParent, time, val, indx, - notFiltered, searchFiltered, query, injected, res, id, txt, - storedFilters = $.extend( [], filters ), - c = table.config, - wo = c.widgetOptions, - // data object passed to filters; anyMatch is a flag for the filters - data = { - anyMatch: false, - filters: filters, - // regex filter type cache - filter_regexCache : [] - }, - vars = { - // anyMatch really screws up with these types of filters - noAnyMatch: [ 'range', 'notMatch', 'operators' ], - // cache filter variables that use ts.getColumnData in the main loop - functions : [], - excludeFilter : [], - defaultColFilter : [], - defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '' - }; - - // parse columns after formatter, in case the class is added at that point - data.parsed = []; - for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) { - data.parsed[ columnIndex ] = wo.filter_useParsedData || - // parser has a "parsed" parameter - ( c.parsers && c.parsers[ columnIndex ] && c.parsers[ columnIndex ].parsed || - // getData may not return 'parsed' if other 'filter-' class names exist - // ( e.g. ) - ts.getData && ts.getData( c.$headerIndexed[ columnIndex ], - ts.getColumnData( table, c.headers, columnIndex ), 'filter' ) === 'parsed' || - c.$headerIndexed[ columnIndex ].hasClass( 'filter-parsed' ) ); - - vars.functions[ columnIndex ] = - ts.getColumnData( table, wo.filter_functions, columnIndex ) || - c.$headerIndexed[ columnIndex ].hasClass( 'filter-select' ); - vars.defaultColFilter[ columnIndex ] = - ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || ''; - vars.excludeFilter[ columnIndex ] = - ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ ); - } - - if ( c.debug ) { - console.log( 'Filter: Starting filter widget search', filters ); - time = new Date(); - } - // filtered rows count - c.filteredRows = 0; - c.totalRows = 0; - // combindedFilters are undefined on init - combinedFilters = ( storedFilters || [] ).join( '' ); - - for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) { - $tbody = ts.processTbody( table, c.$tbodies.eq( tbodyIndex ), true ); - // skip child rows & widget added ( removable ) rows - fixes #448 thanks to @hempel! - // $rows = $tbody.children( 'tr' ).not( c.selectorRemove ); - columnIndex = c.columns; - // convert stored rows into a jQuery object - norm_rows = c.cache[ tbodyIndex ].normalized; - $rows = $( $.map( norm_rows, function( el ) { - return el[ columnIndex ].$row.get(); - }) ); - - if ( combinedFilters === '' || wo.filter_serversideFiltering ) { - $rows - .removeClass( wo.filter_filteredRow ) - .not( '.' + c.cssChildRow ) - .css( 'display', '' ); - } else { - // filter out child rows - $rows = $rows.not( '.' + c.cssChildRow ); - len = $rows.length; - - if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) || - typeof filters[c.columns] !== 'undefined' ) { - data.anyMatchFlag = true; - data.anyMatchFilter = '' + ( - filters[ c.columns ] || - wo.filter_$anyMatch && tsf.getLatestSearch( wo.filter_$anyMatch ).val() || - '' - ); - if ( wo.filter_columnAnyMatch ) { - // specific columns search - query = data.anyMatchFilter.split( tsfRegex.andSplit ); - injected = false; - for ( indx = 0; indx < query.length; indx++ ) { - res = query[ indx ].split( ':' ); - if ( res.length > 1 ) { - // make the column a one-based index ( non-developers start counting from one :P ) - id = parseInt( res[0], 10 ) - 1; - if ( id >= 0 && id < c.columns ) { // if id is an integer - filters[ id ] = res[1]; - query.splice( indx, 1 ); - indx--; - injected = true; - } - } - } - if ( injected ) { - data.anyMatchFilter = query.join( ' && ' ); - } - } - } - - // optimize searching only through already filtered rows - see #313 - searchFiltered = wo.filter_searchFiltered; - lastSearch = c.lastSearch || c.$table.data( 'lastSearch' ) || []; - if ( searchFiltered ) { - // cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669 - for ( indx = 0; indx < columnIndex + 1; indx++ ) { - val = filters[indx] || ''; - // break out of loop if we've already determined not to search filtered rows - if ( !searchFiltered ) { indx = columnIndex; } - // search already filtered rows if... - searchFiltered = searchFiltered && lastSearch.length && - // there are no changes from beginning of filter - val.indexOf( lastSearch[indx] || '' ) === 0 && - // if there is NOT a logical 'or', or range ( 'to' or '-' ) in the string - !tsfRegex.alreadyFiltered.test( val ) && - // if we are not doing exact matches, using '|' ( logical or ) or not '!' - !tsfRegex.exactTest.test( val ) && - // don't search only filtered if the value is negative - // ( '> -10' => '> -100' will ignore hidden rows ) - !( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) && - // if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593 - !( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length && - !tsf.matchType( c, indx ) ); - } - } - notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length; - // can't search when all rows are hidden - this happens when looking for exact matches - if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; } - if ( c.debug ) { - console.log( 'Filter: Searching through ' + - ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' ); - } - if ( data.anyMatchFlag ) { - if ( c.sortLocaleCompare ) { - // replace accents - data.anyMatchFilter = ts.replaceAccents( data.anyMatchFilter ); - } - if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultAnyFilter ) ) { - data.anyMatchFilter = tsf.defaultFilter( data.anyMatchFilter, vars.defaultAnyFilter ); - // clear search filtered flag because default filters are not saved to the last search - searchFiltered = false; - } - // make iAnyMatchFilter lowercase unless both filter widget & core ignoreCase options are true - // when c.ignoreCase is true, the cache contains all lower case data - data.iAnyMatchFilter = !( wo.filter_ignoreCase && c.ignoreCase ) ? - data.anyMatchFilter : - data.anyMatchFilter.toLowerCase(); - } - - // loop through the rows - for ( rowIndex = 0; rowIndex < len; rowIndex++ ) { - - txt = $rows[ rowIndex ].className; - // the first row can never be a child row - isChild = rowIndex && tsfRegex.child.test( txt ); - // skip child rows & already filtered rows - if ( isChild || ( searchFiltered && tsfRegex.filtered.test( txt ) ) ) { - continue; - } - - data.$row = $rows.eq( rowIndex ); - data.cacheArray = norm_rows[ rowIndex ]; - rowData = data.cacheArray[ c.columns ]; - data.rawArray = rowData.raw; - data.childRowText = ''; - - if ( !wo.filter_childByColumn ) { - txt = ''; - // child row cached text - childRow = rowData.child; - // so, if 'table.config.widgetOptions.filter_childRows' is true and there is - // a match anywhere in the child row, then it will make the row visible - // checked here so the option can be changed dynamically - for ( indx = 0; indx < childRow.length; indx++ ) { - txt += ' ' + childRow[indx].join( ' ' ) || ''; - } - data.childRowText = wo.filter_childRows ? - ( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) : - ''; - } - - showRow = false; - showParent = tsf.processRow( c, data, vars ); - $row = rowData.$row; - - // don't pass reference to val - val = showParent ? true : false; - childRow = rowData.$row.filter( ':gt(0)' ); - if ( wo.filter_childRows && childRow.length ) { - if ( wo.filter_childByColumn ) { - if ( !wo.filter_childWithSibs ) { - // hide all child rows - childRow.addClass( wo.filter_filteredRow ); - // if only showing resulting child row, only include parent - $row = $row.eq( 0 ); - } - // cycle through each child row - for ( indx = 0; indx < childRow.length; indx++ ) { - data.$row = childRow.eq( indx ); - data.cacheArray = rowData.child[ indx ]; - data.rawArray = data.cacheArray; - val = tsf.processRow( c, data, vars ); - // use OR comparison on child rows - showRow = showRow || val; - if ( !wo.filter_childWithSibs && val ) { - childRow.eq( indx ).removeClass( wo.filter_filteredRow ); - } - } - } - // keep parent row match even if no child matches... see #1020 - showRow = showRow || showParent; - } else { - showRow = val; - } - $row - .toggleClass( wo.filter_filteredRow, !showRow )[0] - .display = showRow ? '' : 'none'; - } - } - c.filteredRows += $rows.not( '.' + wo.filter_filteredRow ).length; - c.totalRows += $rows.length; - ts.processTbody( table, $tbody, false ); - } - c.lastCombinedFilter = combinedFilters; // save last search - // don't save 'filters' directly since it may have altered ( AnyMatch column searches ) - c.lastSearch = storedFilters; - c.$table.data( 'lastSearch', storedFilters ); - if ( wo.filter_saveFilters && ts.storage ) { - ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) ); - } - if ( c.debug ) { - console.log( 'Completed filter widget search' + ts.benchmark(time) ); - } - if ( wo.filter_initialized ) { - c.$table.triggerHandler( 'filterBeforeEnd', c ); - c.$table.triggerHandler( 'filterEnd', c ); - } - setTimeout( function() { - ts.applyWidget( c.table ); // make sure zebra widget is applied - }, 0 ); - }, - getOptionSource: function( table, column, onlyAvail ) { - table = $( table )[0]; - var c = table.config, - wo = c.widgetOptions, - arry = false, - source = wo.filter_selectSource, - last = c.$table.data( 'lastSearch' ) || [], - fxn = typeof source === 'function' ? true : ts.getColumnData( table, source, column ); - - if ( onlyAvail && last[column] !== '' ) { - onlyAvail = false; - } - - // filter select source option - if ( fxn === true ) { - // OVERALL source - arry = source( table, column, onlyAvail ); - } else if ( fxn instanceof $ || ( $.type( fxn ) === 'string' && fxn.indexOf( '' ) >= 0 ) ) { - // selectSource is a jQuery object or string of options - return fxn; - } else if ( $.isArray( fxn ) ) { - arry = fxn; - } else if ( $.type( source ) === 'object' && fxn ) { - // custom select source function for a SPECIFIC COLUMN - arry = fxn( table, column, onlyAvail ); - } - if ( arry === false ) { - // fall back to original method - arry = tsf.getOptions( table, column, onlyAvail ); - } - - return tsf.processOptions( table, column, arry ); - - }, - processOptions: function( table, column, arry ) { - if ( !$.isArray( arry ) ) { - return false; - } - table = $( table )[0]; - var cts, txt, indx, len, parsedTxt, str, - c = table.config, - validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns, - parsed = []; - // get unique elements and sort the list - // if $.tablesorter.sortText exists ( not in the original tablesorter ), - // then natural sort the list otherwise use a basic sort - arry = $.grep( arry, function( value, indx ) { - if ( value.text ) { - return true; - } - return $.inArray( value, arry ) === indx; - }); - if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) { - // unsorted select options - return arry; - } else { - len = arry.length; - // parse select option values - for ( indx = 0; indx < len; indx++ ) { - txt = arry[ indx ]; - // check for object - str = txt.text ? txt.text : txt; - // sortNatural breaks if you don't pass it strings - parsedTxt = ( validColumn && c.parsers && c.parsers.length && - c.parsers[ column ].format( str, table, [], column ) || str ).toString(); - parsedTxt = c.widgetOptions.filter_ignoreCase ? parsedTxt.toLowerCase() : parsedTxt; - // parse array data using set column parser; this DOES NOT pass the original - // table cell to the parser format function - if ( txt.text ) { - txt.parsed = parsedTxt; - parsed[ parsed.length ] = txt; - } else { - parsed[ parsed.length ] = { - text : txt, - // check parser length - fixes #934 - parsed : parsedTxt - }; - } - } - // sort parsed select options - cts = c.textSorter || ''; - parsed.sort( function( a, b ) { - var x = a.parsed, - y = b.parsed; - if ( validColumn && typeof cts === 'function' ) { - // custom OVERALL text sorter - return cts( x, y, true, column, table ); - } else if ( validColumn && typeof cts === 'object' && cts.hasOwnProperty( column ) ) { - // custom text sorter for a SPECIFIC COLUMN - return cts[column]( x, y, true, column, table ); - } else if ( ts.sortNatural ) { - // fall back to natural sort - return ts.sortNatural( x, y ); - } - // using an older version! do a basic sort - return true; - }); - // rebuild arry from sorted parsed data - arry = []; - len = parsed.length; - for ( indx = 0; indx < len; indx++ ) { - arry[ arry.length ] = parsed[indx]; - } - return arry; - } - }, - getOptions: function( table, column, onlyAvail ) { - table = $( table )[0]; - var rowIndex, tbodyIndex, len, row, cache, indx, child, childLen, - c = table.config, - wo = c.widgetOptions, - arry = []; - for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) { - cache = c.cache[tbodyIndex]; - len = c.cache[tbodyIndex].normalized.length; - // loop through the rows - for ( rowIndex = 0; rowIndex < len; rowIndex++ ) { - // get cached row from cache.row ( old ) or row data object - // ( new; last item in normalized array ) - row = cache.row ? - cache.row[ rowIndex ] : - cache.normalized[ rowIndex ][ c.columns ].$row[0]; - // check if has class filtered - if ( onlyAvail && row.className.match( wo.filter_filteredRow ) ) { - continue; - } - // get non-normalized cell content - if ( wo.filter_useParsedData || - c.parsers[column].parsed || - c.$headerIndexed[column].hasClass( 'filter-parsed' ) ) { - arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ column ]; - // child row parsed data - if ( wo.filter_childRows && wo.filter_childByColumn ) { - childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length - 1; - for ( indx = 0; indx < childLen; indx++ ) { - arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ c.columns ].child[ indx ][ column ]; - } - } - } else { - // get raw cached data instead of content directly from the cells - arry[ arry.length ] = cache.normalized[ rowIndex ][ c.columns ].raw[ column ]; - // child row unparsed data - if ( wo.filter_childRows && wo.filter_childByColumn ) { - childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length; - for ( indx = 1; indx < childLen; indx++ ) { - child = cache.normalized[ rowIndex ][ c.columns ].$row.eq( indx ).children().eq( column ); - arry[ arry.length ] = '' + ts.getElementText( c, child, column ); - } - } - } - } - } - return arry; - }, - buildSelect: function( table, column, arry, updating, onlyAvail ) { - table = $( table )[0]; - column = parseInt( column, 10 ); - if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) { - return; - } - - var indx, val, txt, t, $filters, $filter, option, - c = table.config, - wo = c.widgetOptions, - node = c.$headerIndexed[ column ], - // t.data( 'placeholder' ) won't work in jQuery older than 1.4.3 - options = '', - // Get curent filter value - currentValue = c.$table - .find( 'thead' ) - .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' ) - .val(); - - // nothing included in arry ( external source ), so get the options from - // filter_selectSource or column data - if ( typeof arry === 'undefined' || arry === '' ) { - arry = tsf.getOptionSource( table, column, onlyAvail ); - } - - if ( $.isArray( arry ) ) { - // build option list - for ( indx = 0; indx < arry.length; indx++ ) { - option = arry[ indx ]; - if ( option.text ) { - // OBJECT!! add data-function-name in case the value is set in filter_functions - option['data-function-name'] = typeof option.value === 'undefined' ? option.text : option.value; - - // support jQuery < v1.8, otherwise the below code could be shortened to - // options += $( '