GPI_Translation_Services_Connector - Version 1.0.0.1

Version Notes

Always install the latest, stable version of the GPI Translation Services Connector for Magento.

Download this release

Release Info

Developer Globalization Partners International, LLC.
Extension GPI_Translation_Services_Connector
Version 1.0.0.1
Comparing to
See all releases


Version 1.0.0.1

Files changed (99) hide show
  1. app/code/community/Gpi/Tsc/Block/Adminhtml/ITscClientPlugin.php +114 -0
  2. app/code/community/Gpi/Tsc/Block/Adminhtml/Tsc.php +21 -0
  3. app/code/community/Gpi/Tsc/Block/Adminhtml/Tsc/Grid.php +113 -0
  4. app/code/community/Gpi/Tsc/Helper/Admin.php +20 -0
  5. app/code/community/Gpi/Tsc/Helper/Data.php +15 -0
  6. app/code/community/Gpi/Tsc/Helper/shareddata/popo/PojoFactory.php +109 -0
  7. app/code/community/Gpi/Tsc/Helper/shareddata/popo/RemoteConfig.php +76 -0
  8. app/code/community/Gpi/Tsc/Helper/shareddata/popo/RemoteQuote.php +259 -0
  9. app/code/community/Gpi/Tsc/Helper/shareddata/popo/TreeNode.php +10 -0
  10. app/code/community/Gpi/Tsc/Helper/shareddata/popo/WorkStatus.php +51 -0
  11. app/code/community/Gpi/Tsc/Helper/webclient/AbstractTscClientPlugin.php +373 -0
  12. app/code/community/Gpi/Tsc/Helper/webclient/BackgroundJob.php +57 -0
  13. app/code/community/Gpi/Tsc/Helper/webclient/ClientConfigurationService.php +56 -0
  14. app/code/community/Gpi/Tsc/Helper/webclient/ClientConfigurationServiceImpl.php +131 -0
  15. app/code/community/Gpi/Tsc/Helper/webclient/ConnectorConfiguration.php +44 -0
  16. app/code/community/Gpi/Tsc/Helper/webclient/Constants.php +7 -0
  17. app/code/community/Gpi/Tsc/Helper/webclient/ExportArguments.php +37 -0
  18. app/code/community/Gpi/Tsc/Helper/webclient/ExportBackgroundJob.php +127 -0
  19. app/code/community/Gpi/Tsc/Helper/webclient/ITscClientPlugin.php +114 -0
  20. app/code/community/Gpi/Tsc/Helper/webclient/ImportArguments.php +23 -0
  21. app/code/community/Gpi/Tsc/Helper/webclient/ImportBackgroundJob.php +88 -0
  22. app/code/community/Gpi/Tsc/Helper/webclient/NameIDPair.php +35 -0
  23. app/code/community/Gpi/Tsc/Helper/webclient/RemoteConnection.php +56 -0
  24. app/code/community/Gpi/Tsc/Helper/webclient/Utils.php +75 -0
  25. app/code/community/Gpi/Tsc/Helper/webclient/WorkerContext.php +63 -0
  26. app/code/community/Gpi/Tsc/Helper/webclient/WorkerList.php +18 -0
  27. app/code/community/Gpi/Tsc/Helper/webclient/Xxtea.php +97 -0
  28. app/code/community/Gpi/Tsc/Model/Backgroundjobs.php +9 -0
  29. app/code/community/Gpi/Tsc/Model/Configurations.php +9 -0
  30. app/code/community/Gpi/Tsc/Model/MagentoGpiClient.php +91 -0
  31. app/code/community/Gpi/Tsc/Model/Resource/Backgroundjobs.php +9 -0
  32. app/code/community/Gpi/Tsc/Model/Resource/Backgroundjobs/Collection.php +9 -0
  33. app/code/community/Gpi/Tsc/Model/Resource/Configurations.php +9 -0
  34. app/code/community/Gpi/Tsc/Model/Resource/Configurations/Collection.php +10 -0
  35. app/code/community/Gpi/Tsc/Model/Tsc.php +23 -0
  36. app/code/community/Gpi/Tsc/Model/Utilities.php +125 -0
  37. app/code/community/Gpi/Tsc/controllers/IndexController.php +82 -0
  38. app/code/community/Gpi/Tsc/controllers/adminhtml/TscController.php +116 -0
  39. app/code/community/Gpi/Tsc/data/gpi_tsc_setup/data-install-1.0.0.1.php +20 -0
  40. app/code/community/Gpi/Tsc/etc/adminhtml.xml +54 -0
  41. app/code/community/Gpi/Tsc/etc/config.xml +98 -0
  42. app/code/community/Gpi/Tsc/sql/gpi_tsc_setup/install-1.0.0.1.php +58 -0
  43. app/design/adminhtml/default/default/layout/gpi_tsc.xml +37 -0
  44. app/design/adminhtml/default/default/template/gpi/tsc.phtml +220 -0
  45. app/etc/modules/Gpi_Tsc.xml +12 -0
  46. app/locale/en_US/Gpi_Tsc.csv +44 -0
  47. js/gpi_tsc/Crypto.js +123 -0
  48. js/gpi_tsc/Crypto.min.js +0 -0
  49. js/gpi_tsc/EcmaScript5.js +93 -0
  50. js/gpi_tsc/EcmaScript5.min.js +1 -0
  51. js/gpi_tsc/JSON.js +271 -0
  52. js/gpi_tsc/JSON.min.js +1 -0
  53. js/gpi_tsc/JSON.min.js.mine +1 -0
  54. js/gpi_tsc/JSON.min.js.r118 +1 -0
  55. js/gpi_tsc/JSON.min.js.r175 +1 -0
  56. js/gpi_tsc/langs/en.js +3 -0
  57. js/gpi_tsc/langs/en.min.js +1 -0
  58. js/gpi_tsc/tsc.js +1587 -0
  59. js/gpi_tsc/tsc.min.js +1 -0
  60. js/gpi_tsc/tsc.min.js.mine +1 -0
  61. js/gpi_tsc/tsc.min.js.r118 +1 -0
  62. js/gpi_tsc/tsc.min.js.r175 +1 -0
  63. package.xml +18 -0
  64. skin/adminhtml/base/default/css/gpiconnector_tsc.css +914 -0
  65. skin/adminhtml/base/default/images/gpi_tsc/YesNo.png +0 -0
  66. skin/adminhtml/base/default/images/gpi_tsc/accept.png +0 -0
  67. skin/adminhtml/base/default/images/gpi_tsc/back.png +0 -0
  68. skin/adminhtml/base/default/images/gpi_tsc/box__arrow.png +0 -0
  69. skin/adminhtml/base/default/images/gpi_tsc/document__pencil.png +0 -0
  70. skin/adminhtml/base/default/images/gpi_tsc/envelope_arrow.png +0 -0
  71. skin/adminhtml/base/default/images/gpi_tsc/error.png +0 -0
  72. skin/adminhtml/base/default/images/gpi_tsc/expand__tree.png +0 -0
  73. skin/adminhtml/base/default/images/gpi_tsc/icon_plus.png +0 -0
  74. skin/adminhtml/base/default/images/gpi_tsc/info.png +0 -0
  75. skin/adminhtml/base/default/images/gpi_tsc/input-focus.png +0 -0
  76. skin/adminhtml/base/default/images/gpi_tsc/input-normal.png +0 -0
  77. skin/adminhtml/base/default/images/gpi_tsc/loading.gif +0 -0
  78. skin/adminhtml/base/default/images/gpi_tsc/lock.png +0 -0
  79. skin/adminhtml/base/default/images/gpi_tsc/logo.png +0 -0
  80. skin/adminhtml/base/default/images/gpi_tsc/magnifier__arrow.png +0 -0
  81. skin/adminhtml/base/default/images/gpi_tsc/minus_circle.png +0 -0
  82. skin/adminhtml/base/default/images/gpi_tsc/progressBar.png +0 -0
  83. skin/adminhtml/base/default/images/gpi_tsc/required.png +0 -0
  84. skin/adminhtml/base/default/images/gpi_tsc/settings.png +0 -0
  85. skin/adminhtml/base/default/images/gpi_tsc/success.png +0 -0
  86. skin/adminhtml/base/default/images/gpi_tsc/transparency.png +0 -0
  87. skin/adminhtml/base/default/images/gpi_tsc/tree/checkboxes.png +0 -0
  88. skin/adminhtml/base/default/images/gpi_tsc/tree/folderClosed.png +0 -0
  89. skin/adminhtml/base/default/images/gpi_tsc/tree/folderOpen.png +0 -0
  90. skin/adminhtml/base/default/images/gpi_tsc/tree/iconText.png +0 -0
  91. skin/adminhtml/base/default/images/gpi_tsc/tree/iconTexts.png +0 -0
  92. skin/adminhtml/base/default/images/gpi_tsc/tree/leaf.png +0 -0
  93. skin/adminhtml/base/default/images/gpi_tsc/tree/lines.png +0 -0
  94. skin/adminhtml/base/default/images/gpi_tsc/tree/minus.png +0 -0
  95. skin/adminhtml/base/default/images/gpi_tsc/tree/plus.png +0 -0
  96. skin/adminhtml/base/default/images/gpi_tsc/tsc_styles.css +914 -0
  97. skin/adminhtml/base/default/images/gpi_tsc/tsc_styles.min.css +1 -0
  98. skin/adminhtml/base/default/images/gpi_tsc/validation.png +0 -0
  99. skin/adminhtml/base/default/images/gpi_tsc/warning.png +0 -0
app/code/community/Gpi/Tsc/Block/Adminhtml/ITscClientPlugin.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Public interface that exposes client-specific method calls
4
+ */
5
+ interface ITscClientPlugin {
6
+
7
+ /**
8
+ * Lists all the statuses (if any) for any running background worker (both Import and Export)
9
+ */
10
+ public function GetStatuses();
11
+
12
+ /**
13
+ * Lists all the children nodes that have pParentNodeID as parent
14
+ * @param parentNodeID The parent node ID
15
+ * @param sourceLanguage Source language used to filter possible nodes
16
+ * @param paneID The ID of the pane that requested the nodes
17
+ * @return A collection of TreeNodes, or an empty list if the node does not has any children
18
+ */
19
+ public function GetChildren($parentNodeID, $sourceLanguage, $paneID);
20
+
21
+ /**
22
+ * Imports the translated document(s) to the specified quote.
23
+ * @param quoteID The quote ID.
24
+ * @param userName The name of the user doing the operation
25
+ */
26
+ public function Import($quoteID, $userName);
27
+
28
+
29
+ /**
30
+ * Gets the connector configuration.
31
+ * @return A ConnectorConfiguration object
32
+ */
33
+ public function GetConfiguration();
34
+
35
+ /**
36
+ * Gets the custom configuration.
37
+ * @return A String that the client has to deserialize in order to get the custom configuration values
38
+ */
39
+ public function GetCustomConfiguration();
40
+
41
+ /**
42
+ * Sets the custom configuration.
43
+ * @param customConfiguration The custom configuration serialized as a String.
44
+ */
45
+ public function SetCustomConfiguration($customConfiguration);
46
+
47
+
48
+ /**
49
+ * Saves the configuration.
50
+ * @param authorizationToken The authorization token. This token is encrypted and contains the user/password and project id
51
+ * @param tscServerEndPoint The TSC server end point.
52
+ */
53
+ function SaveConfiguration($authorizationToken, $tscServerEndPoint);
54
+
55
+ /**
56
+ *
57
+ * @return
58
+ */
59
+ public function ListQuotes();
60
+
61
+ /**
62
+ *
63
+ * @param quoteName
64
+ * @param quoteComments
65
+ * @param sourceLanguage
66
+ * @param languages
67
+ * @param userName
68
+ * @return
69
+ */
70
+ public function CreateQuote($quoteName, $quoteComments, $sourceLanguage, string $languages, $userName);
71
+
72
+ /**
73
+ *
74
+ * @param quoteID
75
+ * @param userName
76
+ */
77
+ public function DeleteQuote($quoteID, $userName);
78
+
79
+ /**
80
+ *
81
+ * @param quoteID
82
+ * @param userName
83
+ */
84
+ public function CloseQuote($quoteID, $userName);
85
+
86
+ /**
87
+ *
88
+ * @return
89
+ */
90
+ public function ListLogs();
91
+
92
+ /**
93
+ *
94
+ * @param quoteID
95
+ * @param userName
96
+ * @param quickQuote
97
+ */
98
+ public function SendQuoteToGpms($quoteID, $userName, $quickQuote);
99
+
100
+ /**
101
+ *
102
+ * @param quoteID
103
+ * @return
104
+ */
105
+ public function ListPackageFiles($quoteID);
106
+
107
+ /**
108
+ *
109
+ * @param quoteID
110
+ * @param userName
111
+ * @param files
112
+ */
113
+ public function ModifyPackageFiles($quoteID, $userName, string $files);
114
+ }
app/code/community/Gpi/Tsc/Block/Adminhtml/Tsc.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News List admin grid container
4
+ *
5
+ * @author Magento
6
+ */
7
+ class Gpi_Tsc_Block_Adminhtml_Tsc extends Mage_Adminhtml_Block_Widget_Grid_Container
8
+ {
9
+ /**
10
+ * Block constructor
11
+ */
12
+ public function __construct()
13
+ {
14
+ $this->_blockGroup = 'gpi_tsc';
15
+ $this->_controller = 'adminhtml_tsc';
16
+ $this->_headerText = Mage::helper('gpi_tsc')->__('Manage Packages');
17
+
18
+ //Mage::log(print_r('open Gpi_Tsc_Block_adminhtml_Tsc',true));
19
+ parent::__construct();
20
+ }
21
+ }
app/code/community/Gpi/Tsc/Block/Adminhtml/Tsc/Grid.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News List admin grid
4
+ *
5
+ * @author Magento
6
+ */
7
+ class Gpi_Tsc_Block_Adminhtml_Tsc_Grid extends Mage_Adminhtml_Block_Widget_Grid
8
+ {
9
+ /**
10
+ * Init Grid default properties
11
+ *
12
+ */
13
+ public function __construct()
14
+ {
15
+ parent::__construct();
16
+ /*$this->setId('news_list_grid');
17
+ $this->setDefaultSort('created_at');
18
+ $this->setDefaultDir('DESC');
19
+ $this->setSaveParametersInSession(true);*/
20
+ $this->setUseAjax(true);
21
+ }
22
+
23
+ /**
24
+ * Prepare collection for Grid
25
+ *
26
+ * @return Magentostudy_News_Block_Adminhtml_Grid
27
+ */
28
+ protected function _prepareCollection()
29
+ {
30
+ $collection = Mage::getModel('gpi_tsc/tsc')->getResourceCollection();
31
+
32
+ $this->setCollection($collection);
33
+ return parent::_prepareCollection();
34
+ }
35
+
36
+ /**
37
+ * Prepare Grid columns
38
+ *
39
+ * @return Mage_Adminhtml_Block_Catalog_Search_Grid
40
+ */
41
+ protected function _prepareColumns()
42
+ {
43
+ // $this->addColumn('news_id', array(
44
+ // 'header' => Mage::helper('magentostudy_news')->__('ID'),
45
+ // 'width' => '50px',
46
+ // 'index' => 'news_id',
47
+ // ));
48
+ //
49
+ // $this->addColumn('title', array(
50
+ // 'header' => Mage::helper('magentostudy_news')->__('News Title'),
51
+ // 'index' => 'title',
52
+ // ));
53
+ //
54
+ // $this->addColumn('author', array(
55
+ // 'header' => Mage::helper('magentostudy_news')->__('Author'),
56
+ // 'index' => 'author',
57
+ // ));
58
+ //
59
+ // $this->addColumn('published_at', array(
60
+ // 'header' => Mage::helper('magentostudy_news')->__('Published On'),
61
+ // 'sortable' => true,
62
+ // 'width' => '170px',
63
+ // 'index' => 'published_at',
64
+ // 'type' => 'date',
65
+ // ));
66
+ //
67
+ // $this->addColumn('created_at', array(
68
+ // 'header' => Mage::helper('magentostudy_news')->__('Created'),
69
+ // 'sortable' => true,
70
+ // 'width' => '170px',
71
+ // 'index' => 'created_at',
72
+ // 'type' => 'datetime',
73
+ // ));
74
+ //
75
+ // $this->addColumn('action',
76
+ // array(
77
+ // 'header' => Mage::helper('magentostudy_news')->__('Action'),
78
+ // 'width' => '100px',
79
+ // 'type' => 'action',
80
+ // 'getter' => 'getId',
81
+ // 'actions' => array(array(
82
+ // 'caption' => Mage::helper('magentostudy_news')->__('Edit'),
83
+ // 'url' => array('base' => '*/*/edit'),
84
+ // 'field' => 'id'
85
+ // )),
86
+ // 'filter' => false,
87
+ // 'sortable' => false,
88
+ // 'index' => 'news',
89
+ // ));
90
+ //
91
+ // return parent::_prepareColumns();
92
+ }
93
+ //
94
+ // /**
95
+ // * Return row URL for js event handlers
96
+ // *
97
+ // * @return string
98
+ // */
99
+ // public function getRowUrl($row)
100
+ // {
101
+ // return $this->getUrl('*/*/edit', array('id' => $row->getId()));
102
+ // }
103
+ //
104
+ // /**
105
+ // * Grid url getter
106
+ // *
107
+ // * @return string current grid url
108
+ // */
109
+ // public function getGridUrl()
110
+ // {
111
+ // return $this->getUrl('*/*/grid', array('_current' => true));
112
+ // }
113
+ }
app/code/community/Gpi/Tsc/Helper/Admin.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News Admin helper
4
+ *
5
+ * @author Magento
6
+ */
7
+ class Gpi_Tsc_Helper_Admin extends Mage_Core_Helper_Abstract
8
+ {
9
+ /**
10
+ * Check permission for passed action
11
+ *
12
+ * @param string $action
13
+ * @return bool
14
+ */
15
+ public function isActionAllowed($action)
16
+ {
17
+ //return Mage::getSingleton('admin/session')->isAllowed('tsc/manage/' . $action);
18
+ return Mage::getSingleton('admin/session')->isAllowed('tsc/manage');
19
+ }
20
+ }
app/code/community/Gpi/Tsc/Helper/Data.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News Data helper
4
+ *
5
+ * @author Magento
6
+ */
7
+ class Gpi_Tsc_Helper_Data extends Mage_Core_Helper_Data
8
+ {
9
+ /*
10
+ const XML_PATH_ENABLED = 'tsc/views/enabled';
11
+
12
+ public function isEnabled($store = null) {
13
+ return Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $store);
14
+ }*/
15
+ }
app/code/community/Gpi/Tsc/Helper/shareddata/popo/PojoFactory.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class PojoFactory {
4
+
5
+ /*
6
+ * ArrayOfRemoteQuote
7
+ */
8
+ public static function toArray($arrayOfRemoteQuote){
9
+ $remoteQuotes = array();
10
+ //Iterator<org.datacontract.schemas._2004._07.tsc_shareddata.RemoteQuote> $iter = $arrayOfRemoteQuote->getRemoteQuote().iterator();
11
+ foreach($arrayOfRemoteQuote as $key => $value) {
12
+ $remoteQuote = toPojo($value);
13
+ $remoteQuotes[] = $value;
14
+ }
15
+
16
+ return $remoteQuotes;
17
+ }
18
+
19
+ public static function toPojo($src) {
20
+ $remoteQuote = new RemoteQuote();
21
+
22
+ $remoteQuote->setCreatedBy($src->getCreatedBy()->getValue());
23
+ $remoteQuote->setID($src->getID().longValue());
24
+ $remoteQuote->setLastModifiedBy($src->getLastModifiedBy()->getValue());
25
+ $remoteQuote->setLastModifiedOn(jdtogregorian($src->getLastModifiedOn()));
26
+ $remoteQuote->setName($src->getName()->getValue());
27
+ $remoteQuote->setNotes($src->getNotes()->getValue());
28
+ $remoteQuote->setPackageCount($src->getPackageCount().intValue());
29
+ $remoteQuote->setPortalLink($src->getPortalLink()->getValue());
30
+ $remoteQuote->setSourceLanguage($src->getSourceLanguage()->getValue());
31
+ $remoteQuote->setSourceLanguageIsoCode($src->getSourceLanguageISOCode()->getValue());
32
+ $remoteQuote->setStatus($src->getStatus()->value());
33
+ $remoteQuote->setTargetLanguages($src->getTargetLanguages()->getValue());
34
+
35
+ return remoteQuote;
36
+ }
37
+
38
+ /*
39
+ public static function toArray($arrayOfTreeNode){
40
+ $treeNodes = array();
41
+ $iter = $arrayOfTreeNode->getTreeNode()->getIterator();
42
+
43
+ while($iter->hasNext()) {
44
+ $treeNode = toPojo(next($iter));
45
+ $treeNodes[] = $treeNode;
46
+ }
47
+
48
+ return $treeNodes.toArray(new TreeNode[0]);
49
+ }
50
+
51
+ public static function toPojo($src) {
52
+ $treeNode = array();
53
+
54
+ $treeNode->setID($src->getID()->getValue());
55
+ $treeNode->setContentType($src->getContentType().value());
56
+ $treeNode->setSelected($src->isSelected());
57
+ $treeNode->setName($src->getName()->getValue());
58
+ $treeNode->setLastModificationDate(jdtogregorian($src->getLastModificationDate()));
59
+
60
+ $arrayOfTreeNode = $src->getChildren()->getValue();
61
+ if (null != $arrayOfTreeNode) {
62
+ $treeNode->setChildren(toArray($arrayOfTreeNode));
63
+ }
64
+
65
+ return $treeNode;
66
+ }*/
67
+
68
+ /*
69
+ * TreeNode $src
70
+ */
71
+
72
+ public static function fromPojo($src) {
73
+ //org.datacontract.schemas._2004._07.tsc_shareddata.TreeNode
74
+ $treeNode = new org.datacontract.schemas._2004._07.tsc_shareddata.TreeNode();
75
+
76
+ $factory = new ObjectFactory();//TODO: To check this class
77
+
78
+ $treeNode->setID($factory->createTreeNodeID($src->getID()));
79
+ $treeNode->setContentType(TreeContentType.fromValue($src->getContentType()));
80
+ //TODO: to change TreeContentType funtionality
81
+
82
+ $treeNode->setSelected($src->getSelected());
83
+ $treeNode->setName($factory->createTreeNodeName($src->getName()));
84
+
85
+
86
+ $calendar = $src->getLastModificationDate();
87
+ if (null != $calendar) {
88
+ $gCal = new GregorianCalendar();
89
+ $gCal.setTimeInMillis($calendar.getTimeInMillis());//TODO: to check Calendar PHP functionality
90
+ try {
91
+ $cal = DatatypeFactory.newInstance().newXMLGregorianCalendar($gCal);//TODO: to check Calendar PHP functionality
92
+ $treeNode->setLastModificationDate($cal);
93
+ } catch (Exception $e) {
94
+
95
+ }
96
+ }
97
+
98
+ $children = $src.getChildren();
99
+ if (null != $children) {
100
+ $treeNodes = new ArrayOfTreeNode();
101
+ foreach($children as $node){
102
+ $treeNodes->getTreeNode().add(fromPojo($node));//TODO: To check functionality
103
+ }
104
+ $treeNode->setChildren($factory->createTreeNodeChildren($treeNodes));
105
+ }
106
+
107
+ return $treeNode;
108
+ }
109
+ }
app/code/community/Gpi/Tsc/Helper/shareddata/popo/RemoteConfig.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ public class RemoteConfig {
4
+ private $projectId;
5
+ private $authorizationUsername;
6
+ private $authorizationPassword;
7
+
8
+ public function RemoteConfig() {
9
+ }
10
+
11
+ public function __construct($projectId, $authorizationUsername, $authorizationPassword) {
12
+
13
+ $this->projectId = $projectId;
14
+ $this->authorizationUsername = $authorizationUsername;
15
+ $this->authorizationPassword = $authorizationPassword;
16
+ }
17
+
18
+
19
+ /**
20
+ * Gets the authorizationUsername value for this RemoteConfig.
21
+ *
22
+ * @return message
23
+ */
24
+ public function getAuthorizationUsername() {
25
+ return $authorizationUsername;
26
+ }
27
+
28
+
29
+ /**
30
+ * Sets the authorizationUsername value for this RemoteConfig.
31
+ *
32
+ * @param message
33
+ */
34
+ public function setAuthorizationUsername($authorizationUsername) {
35
+ $this->authorizationUsername = $authorizationUsername;
36
+ }
37
+
38
+ /**
39
+ * Gets the authorizationPassword value for this RemoteConfig.
40
+ *
41
+ * @return message
42
+ */
43
+ public function getAuthorizationPassword() {
44
+ return $authorizationPassword;
45
+ }
46
+
47
+
48
+ /**
49
+ * Sets the authorizationPassword value for this RemoteConfig.
50
+ *
51
+ * @param message
52
+ */
53
+ public function setAuthorizationPassword($authorizationPassword) {
54
+ $this->authorizationPassword = $authorizationPassword;
55
+ }
56
+
57
+
58
+ /**
59
+ * Gets the projectId value for this RemoteConfig.
60
+ *
61
+ * @return projectId
62
+ */
63
+ public long getProjectId() {
64
+ return $projectId;
65
+ }
66
+
67
+
68
+ /**
69
+ * Sets the projectId value for this RemoteConfig.
70
+ *
71
+ * @param projectId
72
+ */
73
+ public function setProjectId($projectId) {
74
+ $this->projectId = $projectId;
75
+ }
76
+ }
app/code/community/Gpi/Tsc/Helper/shareddata/popo/RemoteQuote.php ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class RemoteQuote {
4
+
5
+ protected $createdBy;
6
+ protected $ID;
7
+ protected $lastModifiedBy;
8
+ protected $lastModifiedOn;
9
+ protected $name;
10
+ protected $notes;
11
+ protected $packageCount;
12
+ protected $portalLink;
13
+ protected $sourceLanguage;
14
+ protected $sourceLanguageIsoCode;
15
+ protected $status;
16
+ protected $targetLanguages = array();
17
+
18
+ public function __construct(){
19
+
20
+ }
21
+
22
+
23
+ /**
24
+ * Gets the createdBy value for this RemoteQuote.
25
+ *
26
+ * @return createdBy
27
+ */
28
+ public function getCreatedBy() {
29
+ return $createdBy;
30
+ }
31
+
32
+
33
+ /**
34
+ * Sets the createdBy value for this RemoteQuote.
35
+ *
36
+ * @param createdBy
37
+ */
38
+ public function setCreatedBy($createdBy) {
39
+ $this->createdBy = $createdBy;
40
+ }
41
+
42
+
43
+ /**
44
+ * Gets the ID value for this RemoteQuote.
45
+ *
46
+ * @return ID
47
+ */
48
+ public function getID() {
49
+ return $ID;
50
+ }
51
+
52
+
53
+ /**
54
+ * Sets the ID value for this RemoteQuote.
55
+ *
56
+ * @param ID
57
+ */
58
+ public function setID($id) {
59
+ $this->ID = $id;
60
+ }
61
+
62
+
63
+ /**
64
+ * Gets the lastModifiedBy value for this RemoteQuote.
65
+ *
66
+ * @return lastModifiedBy
67
+ */
68
+ public function getLastModifiedBy() {
69
+ return $lastModifiedBy;
70
+ }
71
+
72
+
73
+ /**
74
+ * Sets the lastModifiedBy value for this RemoteQuote.
75
+ *
76
+ * @param lastModifiedBy
77
+ */
78
+ public function setLastModifiedBy($lastModifiedBy) {
79
+ $this->lastModifiedBy = $lastModifiedBy;
80
+ }
81
+
82
+
83
+ /**
84
+ * Gets the lastModifiedOn value for this RemoteQuote.
85
+ *
86
+ * @return lastModifiedOn
87
+ */
88
+ public function getLastModifiedOn() {
89
+ return $lastModifiedOn;
90
+ }
91
+
92
+
93
+ /**
94
+ * Sets the lastModifiedOn value for this RemoteQuote.
95
+ *
96
+ * @param lastModifiedOn
97
+ */
98
+ public function setLastModifiedOn($lastModifiedOn) {
99
+ $this->lastModifiedOn = $lastModifiedOn;
100
+ }
101
+
102
+
103
+ /**
104
+ * Gets the name value for this RemoteQuote.
105
+ *
106
+ * @return name
107
+ */
108
+ public function getName() {
109
+ return $name;
110
+ }
111
+
112
+
113
+ /**
114
+ * Sets the name value for this RemoteQuote.
115
+ *
116
+ * @param name
117
+ */
118
+ public function setName($name) {
119
+ $this->name = $name;
120
+ }
121
+
122
+
123
+ /**
124
+ * Gets the notes value for this RemoteQuote.
125
+ *
126
+ * @return notes
127
+ */
128
+ public function getNotes() {
129
+ return $notes;
130
+ }
131
+
132
+
133
+ /**
134
+ * Sets the notes value for this RemoteQuote.
135
+ *
136
+ * @param notes
137
+ */
138
+ public function setNotes($notes) {
139
+ $this->notes = $notes;
140
+ }
141
+
142
+
143
+ /**
144
+ * Gets the packageCount value for this RemoteQuote.
145
+ *
146
+ * @return packageCount
147
+ */
148
+ public function getPackageCount() {
149
+ return $packageCount;
150
+ }
151
+
152
+
153
+ /**
154
+ * Sets the packageCount value for this RemoteQuote.
155
+ *
156
+ * @param packageCount
157
+ */
158
+ public function setPackageCount($packageCount) {
159
+ $this->packageCount = $packageCount;
160
+ }
161
+
162
+
163
+ /**
164
+ * Gets the portalLink value for this RemoteQuote.
165
+ *
166
+ * @return portalLink
167
+ */
168
+ public function getPortalLink() {
169
+ return $portalLink;
170
+ }
171
+
172
+
173
+ /**
174
+ * Sets the portalLink value for this RemoteQuote.
175
+ *
176
+ * @param portalLink
177
+ */
178
+ public function setPortalLink($portalLink) {
179
+ $this->portalLink = $portalLink;
180
+ }
181
+
182
+
183
+ /**
184
+ * Gets the sourceLanguage value for this RemoteQuote.
185
+ *
186
+ * @return sourceLanguage
187
+ */
188
+ public function getSourceLanguage() {
189
+ return $sourceLanguage;
190
+ }
191
+
192
+
193
+ /**
194
+ * Sets the sourceLanguage value for this RemoteQuote.
195
+ *
196
+ * @param sourceLanguage
197
+ */
198
+ public function setSourceLanguage($sourceLanguage) {
199
+ $this->sourceLanguage = $sourceLanguage;
200
+ }
201
+
202
+ /**
203
+ * Gets the targetLanguages value for this RemoteQuote.
204
+ *
205
+ * @return targetLanguages
206
+ */
207
+ public function getTargetLanguages() {
208
+ return $targetLanguages;
209
+ }
210
+
211
+
212
+ /**
213
+ * Sets the targetLanguages value for this RemoteQuote.
214
+ *
215
+ * @param targetLanguages
216
+ */
217
+ public function setTargetLanguages($targetLanguages) {
218
+ $this->targetLanguages = $targetLanguages;
219
+ }
220
+
221
+
222
+ /**
223
+ * Gets the sourceLanguageIsoCode value for this RemoteQuote.
224
+ *
225
+ * @return sourceLanguageIsoCode
226
+ */
227
+ public function getSourceLanguageIsoCode() {
228
+ return $sourceLanguageIsoCode;
229
+ }
230
+
231
+
232
+ /**
233
+ * Sets the sourceLanguageIsoCode value for this RemoteQuote.
234
+ *
235
+ * @param sourceLanguageIsoCode
236
+ */
237
+ public function setSourceLanguageIsoCode($sourceLanguageIsoCode) {
238
+ $this->sourceLanguageIsoCode = $sourceLanguageIsoCode;
239
+ }
240
+
241
+ /**
242
+ * Gets the status value for this RemoteQuote.
243
+ *
244
+ * @return status
245
+ */
246
+ public function getStatus() {
247
+ return $status;
248
+ }
249
+
250
+
251
+ /**
252
+ * Sets the status value for this RemoteQuote.
253
+ *
254
+ * @param status
255
+ */
256
+ public function setStatus($status) {
257
+ $this->status = $status;
258
+ }
259
+ }
app/code/community/Gpi/Tsc/Helper/shareddata/popo/TreeNode.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TreeNode {
4
+ public $ID;
5
+ public $ContentType;
6
+ public $Selected;
7
+ public $Name;
8
+ public $LastModificationDate;
9
+ public $Children = array();
10
+ }
app/code/community/Gpi/Tsc/Helper/shareddata/popo/WorkStatus.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WorkStatus {
4
+ private $percentaje;
5
+ private $message;
6
+
7
+ public function __construct($percentaje, $message) {
8
+ $this->percentaje = $percentaje;
9
+ $this->message = $message;
10
+ }
11
+
12
+
13
+ /**
14
+ * Gets the message value for this WorkStatus.
15
+ *
16
+ * @return message
17
+ */
18
+ public function getMessage() {
19
+ return $message;
20
+ }
21
+
22
+
23
+ /**
24
+ * Sets the message value for this WorkStatus.
25
+ *
26
+ * @param message
27
+ */
28
+ public function setMessage($message) {
29
+ $this->message = $message;
30
+ }
31
+
32
+
33
+ /**
34
+ * Gets the percentaje value for this WorkStatus.
35
+ *
36
+ * @return percentaje
37
+ */
38
+ public function getPercentaje() {
39
+ return $percentaje;
40
+ }
41
+
42
+
43
+ /**
44
+ * Sets the percentaje value for this WorkStatus.
45
+ *
46
+ * @param percentaje
47
+ */
48
+ public function setPercentaje($percentaje) {
49
+ $this->percentaje = $percentaje;
50
+ }
51
+ }
app/code/community/Gpi/Tsc/Helper/webclient/AbstractTscClientPlugin.php ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $helperPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper';
3
+
4
+
5
+ $webclientPath = $helperPath . DS . 'webclient';
6
+ $sharedDataPath = $helperPath . DS . 'shareddata';
7
+
8
+ require($webclientPath . DS . 'ITscClientPlugin.php');
9
+ require($webclientPath . DS . 'RemoteConnection.php');
10
+ //require($webclientPath . DS . 'ImportArguments.php');
11
+ //require($webclientPath . DS . 'ImportBackgroundJob.php');
12
+ require($webclientPath . DS . 'ExportArguments.php');
13
+ //require($webclientPath . DS . 'ExportBackgroundJob.php');
14
+ require($webclientPath . DS . 'WorkerList.php');
15
+
16
+ require($sharedDataPath . DS . 'popo' . DS. 'PojoFactory.php');
17
+ require($sharedDataPath . DS . 'popo' . DS. 'WorkStatus.php');
18
+ require($sharedDataPath . DS . 'popo' . DS. 'TreeNode.php');
19
+ require($sharedDataPath . DS . 'popo' . DS. 'RemoteQuote.php');
20
+
21
+ /**
22
+ *
23
+ * @author Kevin
24
+ *
25
+ */
26
+
27
+ abstract class AbstractTscClientPlugin implements ITscClientPlugin {
28
+
29
+ protected $clientConfiguration;
30
+
31
+ protected $remoteConnection;
32
+
33
+ protected function __construct($clientConfigurationService) {
34
+ $this->clientConfiguration = $clientConfigurationService;
35
+ $this->remoteConnection = new RemoteConnection($clientConfigurationService);
36
+ }
37
+
38
+ public function GetStatuses() {
39
+ //List<WorkStatus> statuses = new ArrayList<WorkStatus>();
40
+ $statuses = array();
41
+
42
+ foreach (WorkerList::$ExportWorkers as $thread) {
43
+ $status = new WorkStatus();
44
+ $status->setPercentaje($thread->getExportProgress());
45
+ //$status->setMessage(String->format("Exported %d documents", thread->getExportedDocuments()));
46
+ $status->setMessage(sprintf("Exported %d documents", $thread->getExportedDocuments()));
47
+
48
+ $statuses[] = $status;
49
+ }
50
+
51
+ foreach (WorkerList::$ImportWorkers as $thread) {
52
+ $status = new WorkStatus();
53
+ $status->setPercentaje($thread->getImportedProgress());
54
+ $status->setMessage(sprintf("Imported %d documents", $thread->getImportedDocuments()));
55
+
56
+ $statuses[] = $status;
57
+ }
58
+
59
+ return $statuses;
60
+ }
61
+
62
+ public abstract function GetChildren($parentNodeID, $sourceLanguage, $paneID);
63
+
64
+ public function Import($quoteID, $userName) {
65
+ $args = new ImportArguments();
66
+ $args->Quote = GetQuoteByID($quoteID);
67
+ $args->Plugin = $this;
68
+ $args->UserName = $userName;
69
+
70
+ $importJob = new ImportBackgroundJob($clientConfiguration);
71
+ $importJob->run($args);
72
+ WorkerList::$ImportWorkers[] = $importJob;
73
+
74
+ /* New Thread Functionality */
75
+ //
76
+ // try
77
+ // {
78
+ // $thread = new ImportWorkerThread();
79
+ // $thread->RunWorkerAsync(new ImportWorkerThreadArguments
80
+ // {
81
+ // $Quote = GetQuoteByID($quoteID),
82
+ // $Plugin = $this,
83
+ // $UserName = $userName
84
+ // });
85
+ // WorkerList::$ImportWorkers[] = $thread;
86
+ // }
87
+ // catch (Exception $e)
88
+ // {
89
+ // throw new RemotingException($e->Message);
90
+ // }
91
+
92
+ }
93
+
94
+ public function GetConfiguration() {
95
+
96
+ $c = $this->GetConfigurationInternal();
97
+ $clientConfig = $this->clientConfiguration;
98
+ $c->AuthorizationToken = $clientConfig->getAuthorizationToken();
99
+
100
+ $c->TscServerEndPoint = $clientConfig->getTscServerEndPoint();
101
+ $languages = $this->remoteConnection->create()->GetLanguagesXlt();
102
+ $c->LanguagesXlt = $languages->GetLanguagesXltResult->LanguageXlt;
103
+
104
+ return json_encode($c);
105
+ }
106
+
107
+ protected abstract function GetConfigurationInternal();
108
+
109
+ public function SaveConfiguration($authorizationToken, $tscServerEndPoint) {
110
+ if (null == $authorizationToken || empty($authorizationToken))
111
+ throw new IllegalArgumentException("An invalid authorization token was supplied.");
112
+
113
+ if (null == $tscServerEndPoint || empty($tscServerEndPoint))
114
+ throw new IllegalArgumentException("An invalid service endpoint was supplied.");
115
+
116
+ $c = $this->clientConfiguration;
117
+ $c->setTscServerEndPoint($tscServerEndPoint);
118
+
119
+ try {
120
+ $valid = $this->remoteConnection->create()->validateAuthenticationToken($authorizationToken);
121
+ } catch(Exception $e) {
122
+ throw new IllegalArgumentException("An invalid service endpoint was supplied.");
123
+ }
124
+
125
+ if (!$valid)
126
+ throw new IllegalArgumentException("An invalid authorization token was supplied.");
127
+
128
+ $c->setAuthorizationToken($authorizationToken);
129
+ $c->save();
130
+ }
131
+
132
+ protected abstract function ConvertTreeNodesToIds($treeRoot);
133
+
134
+ public abstract function GetRemoteDocument($paneID, $nodeID, $context);
135
+
136
+ public abstract function SetRemoteDocument($document, $context);
137
+
138
+ public function BeforeExport($context){}
139
+
140
+ public function BeforeSendQuoteToGpms($context) {}
141
+
142
+ public function AfterExport($context) {}
143
+
144
+ public function ExportFailed($context, $e) {}
145
+
146
+ public function BeforeImport($context) {}
147
+
148
+ public function AfterImport($context) {}
149
+
150
+ public function ImportFailed($context, $e) {}
151
+
152
+ public function GetCustomConfiguration() {
153
+ $projectId = $clientConfiguration->getProjectID();
154
+ return $this->remoteConnection->create()->getCustomConfiguration($projectId);
155
+ }
156
+
157
+ public function SetCustomConfiguration($customConfiguration) {
158
+ $projectId = $clientConfiguration->getProjectID();
159
+ $this->remoteConnection->create()->setCustomConfiguration($projectId, $customConfiguration);
160
+ }
161
+
162
+ public function ListQuotes() {
163
+ $projectId = array('projectId' => $this->clientConfiguration->getProjectID());
164
+
165
+ $response = $this->remoteConnection->create()->ListQuotes($projectId)->ListQuotesResult;
166
+
167
+ $quotes = array();
168
+ if(isset($response->RemoteQuote)) {
169
+ $quotes = $response->RemoteQuote;
170
+
171
+ foreach($quotes as $quote)
172
+ {
173
+ $quote->TargetLanguages = array_values($quote->TargetLanguages->string);
174
+ }
175
+ }
176
+
177
+
178
+ /*
179
+ /* CMS Pages
180
+ /*
181
+ $pages = Mage::getModel('cms/page')->getCollection();
182
+ $page = Mage::getModel('cms/page')->load('home','identifier');
183
+ $title = $page->getTitle();
184
+ $content = $page->getContent();
185
+ $keywords = $page->getMetaKeywords();
186
+ $descriptions = $page->getMetaDescription();
187
+ /*
188
+ /* Create new CMS Page
189
+ $cmsPage = array(
190
+ 'title' => 'Test Page',
191
+ 'identifier' => 'test-page',
192
+ 'content' => 'Sample Test Page',
193
+ 'is_active' => 1,
194
+ 'sort_order' => 0,
195
+ 'stores' => array(0),
196
+ 'root_template' => 'three_columns'
197
+ );
198
+ Mage::getModel('cms/page')->setData($cmsPage)->save();
199
+ */
200
+ /*
201
+ /* CMS Blocks
202
+ /*
203
+ $blocks = Mage::getModel('cms/block')->getCollection();
204
+ $page = Mage::getModel('cms/block')->load('footer_links','identifier');
205
+ $title = $page->getTitle();
206
+ $content = $page->getContent();
207
+
208
+ /* Save New Block
209
+ $staticBlock = array(
210
+ 'title' => 'Test Block',
211
+ 'identifier' => 'test-block',
212
+ 'content' => 'Sample Test Block',
213
+ 'is_active' => 1,
214
+ 'stores' => array(o)
215
+ );
216
+
217
+ Mage::getModel('cms/block')->setData($staticBlock)->save();
218
+ */
219
+ /*
220
+ /* Products */
221
+ /* http://gauss-development.com/blog/e-commerce-blog/magento-mass-export-xml-format/
222
+ /*
223
+ /* $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
224
+ // select all attributes
225
+
226
+ foreach($collection as $product){
227
+ $i++;
228
+ // something
229
+ }
230
+ */
231
+ /*
232
+ /* Products */
233
+ /* http://gauss-development.com/blog/e-commerce-blog/magento-mass-export-xml-format/
234
+ /*
235
+ $category = Mage::getModel ( 'catalog/category' );
236
+ $tree = $category->getTreeModel ();
237
+ $tree->load ();
238
+
239
+ $ids = $tree->getCollection ()->getAllIds ();
240
+
241
+ if ($ids) {
242
+ foreach ( $ids as $id ) {
243
+ $string = $id . ', ' .$category->load($id)->getName() . "\n";
244
+ Mage::log(print_r($string,true));
245
+ }
246
+ }
247
+ */
248
+
249
+ /*
250
+ /* https://github.com/bippo/magento-bulk
251
+ /*
252
+ Mage::log(print_r(Mage::getModel('eav/entity_attribute')->getCollection(),true));
253
+ */
254
+ return json_encode($quotes);
255
+ }
256
+
257
+
258
+ public function CreateQuote($quoteName, $quoteComments, $sourceLanguage, array $languages, $userName) {
259
+ $projectId = $this->clientConfiguration->getProjectID();
260
+
261
+ $strings = array();
262
+
263
+ foreach ($languages as $language) {
264
+ $strings[] = $language;
265
+ }
266
 
267
+ $params = array(
268
+ 'projectId' => $projectId,
269
+ 'quoteName' => $quoteName,
270
+ 'quoteComments' => $quoteComments,
271
+ 'sourceLanguage' => $sourceLanguage,
272
+ 'languages'=> $strings,
273
+ 'userName' => $userName
274
+ );
275
+
276
+ $remoteQuote = $this->remoteConnection->create()
277
+ ->CreateQuote($params)
278
+ ->CreateQuoteResult;
279
+
280
+ return json_encode($remoteQuote);
281
+ }
282
+
283
+ public function DeleteQuote($quoteID, $userName) {
284
+ //$uLong = new Math_BigInteger($quoteID);
285
+ $params = array('quoteId' => $quoteID, 'userName' => $userName);
286
+ $this->remoteConnection->create()->deleteQuote($params);
287
+ }
288
+
289
+ public function CloseQuote($quoteID, $userName) {
290
+ $parmas = array('quoteId'=>$quoteID, 'userName'=>$userName);
291
+ $this->remoteConnection->create()->closeQuote($quoteID, $userName);
292
+ }
293
+
294
+ public function ListLogs(){
295
+ $projectId = $clientConfiguration->getProjectID();
296
+ //$uLong = new Math_BigInteger($projectId);
297
+ $entries = $this->remoteConnection->create()->listLogs($projectId);
298
+ return $entries->getLogEntry()->toArray(new LogEntry());
299
+ }
300
+
301
+
302
+
303
+ private function GetQuoteByID($quoteID) {
304
+ $quotes = json_decode($this->ListQuotes());
305
+ foreach ($quotes as $quote){
306
+
307
+ if ($quote->ID == $quoteID)
308
+ return $quote;
309
+ }
310
+
311
+ throw new IllegalArgumentException();
312
+ }
313
+
314
+ public function SendQuoteToGpms($quoteID, $userName, $quickQuote) {
315
+
316
+ $nodes = json_decode($this->ListPackageFiles($quoteID));
317
+
318
+ $arguments = new ExportArguments();
319
+ $arguments->Quote = $this->GetQuoteByID($quoteID);
320
+ $arguments->Nodes = $nodes;
321
+ $arguments->UserName = $userName;
322
+ $arguments->Plugin = $this;
323
+ $arguments->TotalCount = count($nodes);
324
+ $arguments->QuickQuote = $quickQuote;
325
+
326
+ Mage::log("SendQuoteToGpms ended");
327
+
328
+ //$exportJob = new ExportBackgroundJob($clientConfiguration);
329
+ //$exportJob->run($arguments);
330
+ //WorkerList::$ExportWorkers[] = $exportJob;
331
+
332
+ }
333
+
334
+ // array_walk_recursive pass-by-reference example
335
+
336
+
337
+ public function ListPackageFiles($quoteID) {
338
+
339
+ $createParams = array(
340
+ 'classmap' => array('Children' => 'TreeNode')
341
+ );
342
+
343
+
344
+ $params = array('quoteId'=>$quoteID);
345
+ $client = $this->remoteConnection->create($createParams);
346
+ $response = $client->ListPackageFiles($params)->ListPackageFilesResult;
347
+
348
+ $nodes = array();
349
+ if(isset($response->TreeNode)) {
350
+
351
+ $nodes = $response->TreeNode;
352
+
353
+ foreach ($nodes as $key => $value) {
354
+ $nodes[$key]->Children = $nodes[$key]->Children->TreeNode;
355
+ }
356
+
357
+ }
358
+
359
+ return json_encode($nodes);
360
+ }
361
+
362
+
363
+ /**
364
+ * @see tsc.webclient.ITscClientPlugin#ModifyPackageFiles(long, String, TreeNode[])
365
+ */
366
+ public function ModifyPackageFiles($quoteID, $userName, array $files){
367
+
368
+ $params = array('quoteId'=>$quoteID, 'userName'=>$userName, 'files'=>$files);
369
+ $client = $this->remoteConnection->create();
370
+
371
+ $result = $client->modifyPackageFiles($params);
372
+ }
373
+
374
+ }
app/code/community/Gpi/Tsc/Helper/webclient/BackgroundJob.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ //import tsc.utils.ServiceLocator;
5
+ /*use Zend\Loader\StandardAutoloader;
6
+ use Zend\Feed\Reader\Reader;
7
+ use Zend\Debug\Debug;
8
+
9
+ //include_once(Mage::getBaseDir('lib').'\Zend\Loader\StandardAutoloader.php');
10
+
11
+ $loader = new StandardAutoloader(array('autoregister_zf' => true));
12
+ $loader->register();*/
13
+
14
+ /**
15
+ *
16
+ *
17
+ * @param <TJobArguments>
18
+ */
19
+ abstract class BackgroundJob {
20
+ //extends Thread {
21
+
22
+ /**
23
+ *
24
+ */
25
+ protected $arguments;
26
+
27
+ /**
28
+ *
29
+ */
30
+ protected $remoteConnection;
31
+
32
+
33
+ /**
34
+ *
35
+ * @param resourceResolver
36
+ * @param clientConfigurationService
37
+ */
38
+ protected function __construct($clientConfigurationService) {
39
+ $remoteConnection = new RemoteConnection($clientConfigurationService);
40
+ }
41
+
42
+ /**
43
+ *
44
+ * @param args
45
+ */
46
+ protected abstract function run();
47
+
48
+
49
+ /**
50
+ *
51
+ * @param args
52
+ */
53
+ public function execute($args) {
54
+ $this->$arguments = $args;
55
+ $this->start();
56
+ }
57
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ClientConfigurationService.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ *
6
+ */
7
+ interface ClientConfigurationService {
8
+
9
+ /**
10
+ *
11
+ * @return
12
+ */
13
+ public function getAuthorizationToken();
14
+
15
+ /**
16
+ *
17
+ * @param authorizationToken
18
+ */
19
+ public function setAuthorizationToken($authorizationToken);
20
+
21
+ /**
22
+ *
23
+ * @return
24
+ */
25
+ public function getTscServerEndPoint();
26
+
27
+ /**
28
+ *
29
+ * @param tscServerEndPoint
30
+ */
31
+ public function setTscServerEndPoint($tscServerEndPoint);
32
+
33
+ /**
34
+ *
35
+ * @return
36
+ */
37
+ public function getProjectID();
38
+
39
+ /**
40
+ *
41
+ * @return
42
+ */
43
+ public function getAuthorizationUsername();
44
+
45
+ /**
46
+ *
47
+ * @return
48
+ */
49
+ public function getAuthorizationPassword();
50
+
51
+ /**
52
+ *
53
+ */
54
+ public function save();
55
+
56
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ClientConfigurationServiceImpl.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $webclientPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper' . DS . 'webclient';
4
+
5
+ include($webclientPath . DS . 'ClientConfigurationService.php');
6
+ include($webclientPath . DS . 'Xxtea.php');
7
+
8
+ class ClientConfigurationServiceImpl implements ClientConfigurationService {
9
+
10
+ private $_projectId;
11
+ private $_authorizationToken;
12
+ private $_tscServerEndPoint;
13
+ private $_authorizationUsername;
14
+ private $_authorizationPassword;
15
+
16
+ public function __construct() {
17
+ $this->load();
18
+ }
19
+
20
+ /* (non-Javadoc)
21
+ * @see tsc.webclient.ClientConfiguration#getAuthorizationToken()
22
+ */
23
+ public function getAuthorizationToken() {
24
+ return $this->_authorizationToken;
25
+ }
26
+
27
+ /* (non-Javadoc)
28
+ * @see tsc.webclient.ClientConfiguration#setAuthorizationToken(java.lang.String)
29
+ */
30
+ public function setAuthorizationToken($authorizationToken) {
31
+
32
+ $plaintext = Xxtea::decrypt(base64_decode($authorizationToken), "Gl0b4l12a7i0n");
33
+
34
+ $r = json_decode($plaintext);
35
+
36
+ $this->_authorizationToken = '';
37
+ $this->_projectId = '';
38
+ $this->_authorizationUsername = '';
39
+ $this->_authorizationPassword = '';
40
+
41
+ if(is_object($r)) {
42
+ $this->_authorizationToken = $authorizationToken;
43
+ $this->_projectId = $r->ProjectID;
44
+ $this->_authorizationUsername = $r->AuthorizationUsername;
45
+ $this->_authorizationPassword = $r->AuthorizationPassword;
46
+ }
47
+ }
48
+
49
+ /* (non-Javadoc)
50
+ * @see tsc.webclient.ClientConfiguration#getTscServerEndPoint()
51
+ */
52
+ public function getTscServerEndPoint() {
53
+ return $this->_tscServerEndPoint;
54
+ }
55
+
56
+ /* (non-Javadoc)
57
+ * @see tsc.webclient.ClientConfiguration#setTscServerEndPoint(java.lang.String)
58
+ */
59
+ public function setTscServerEndPoint($tscServerEndPoint) {
60
+
61
+ //$plaintext = Xxtea::decrypt(base64_decode($tscServerEndPoint), "Gl0b4l12a7i0n");
62
+ //$this->_tscServerEndPoint = json_decode($plaintext);
63
+
64
+ $this->_tscServerEndPoint = $tscServerEndPoint;
65
+ }
66
+
67
+ /* (non-Javadoc)
68
+ * @see tsc.webclient.ClientConfiguration#getProjectID()
69
+ */
70
+ public function getProjectID() {
71
+ //return 174481;
72
+ return $this->_projectId;
73
+ }
74
+
75
+ /* (non-Javadoc)
76
+ * @see tsc.webclient.ClientConfiguration#getAuthorizationUsername()
77
+ */
78
+ public function getAuthorizationUsername() {
79
+ return $this->_authorizationUsername;
80
+ }
81
+
82
+ /* (non-Javadoc)
83
+ * @see tsc.webclient.ClientConfiguration#getAuthorizationPassword()
84
+ */
85
+ public function getAuthorizationPassword() {
86
+ return $this->_authorizationPassword;
87
+ }
88
+
89
+ private function load() {
90
+
91
+ //Mage::log(print_r(Mage::getModel('gpi_tsc/configurations'),true));
92
+ $collection = Mage::getModel('gpi_tsc/configurations')->getCollection();
93
+
94
+ //Mage::log(print_r($collection, true));
95
+ $result = $collection->addFieldToFilter('config_name', array('eq' => 'serviceUrl'))->load();
96
+ $infoArray = $result->toArray();
97
+ $this->_tscServerEndPoint = $infoArray['items'][0]['config_value'];
98
+
99
+ $collection = Mage::getModel('gpi_tsc/configurations')->getCollection();
100
+ $result = $collection->addFieldToFilter('config_name', array('eq' => 'authToken'))->load();
101
+ $infoArray = $result->toArray();
102
+ $authorizationToken = $infoArray['items'][0]['config_value'];
103
+ $this->setAuthorizationToken($authorizationToken);
104
+ }
105
+
106
+ /* (non-Javadoc)
107
+ * @see tsc.webclient.ClientConfiguration#save()
108
+ */
109
+ public function save() {
110
+
111
+ $this->updateConfiguration('serviceUrl', $this->_tscServerEndPoint);
112
+ $this->updateConfiguration('authToken', $this->_authorizationToken);
113
+
114
+ $this->load();
115
+ }
116
+
117
+ public function updateConfiguration($name, $value) {
118
+
119
+ $model = Mage::getModel('gpi_tsc/configurations')->getCollection()
120
+ ->addFieldToFilter('config_name', array('eq' => $name))
121
+ ->getFirstItem();
122
+
123
+ $data = array(
124
+ 'config_name' => $name,
125
+ 'config_value' => $value,
126
+ );
127
+
128
+ $model->addData($data)->setId($model->config_id)->save();
129
+
130
+ }
131
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ConnectorConfiguration.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ *
6
+ */
7
+ final class ConnectorConfiguration {
8
+
9
+ /**
10
+ * Current Loged in CMS User
11
+ */
12
+ public $UserName;
13
+
14
+ /**
15
+ * Array of string of enabled languages in magento
16
+ */
17
+ public $SourceLanguages = array();
18
+
19
+ /**
20
+ * Array of string of enabled languages in magento
21
+ */
22
+ public $TargetLanguages = array();
23
+
24
+ /**
25
+ *
26
+ */
27
+ public $DocumentBrowserPanes = array("content","Contents");
28
+
29
+ /**
30
+ *
31
+ */
32
+ public $LanguagesXlt = array();
33
+
34
+ /**
35
+ *
36
+ */
37
+ public $AuthorizationToken;
38
+
39
+ /**
40
+ *
41
+ */
42
+ public $TscServerEndPoint;
43
+
44
+ }
app/code/community/Gpi/Tsc/Helper/webclient/Constants.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ public final class Constants {
4
+ public static final $TRANSFER_SIZE_LIMIT = (4 * 1024 * 1024);//4mb
5
+ public static final $MAX_TRANSFER_SIZE_LIMIT = (4 * 1024 * 1024) + (1 * 1024 * 1024);//5mb
6
+ public static final $MAX_TRANSFER_COUNT_LIMIT = 96;
7
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ExportArguments.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //import tsc.shareddata.pojos.RemoteQuote;
4
+
5
+ class ExportArguments {
6
+
7
+ /**
8
+ *
9
+ */
10
+ public $Quote;
11
+
12
+ /**
13
+ *
14
+ */
15
+ public $Nodes;
16
+
17
+ /**
18
+ *
19
+ */
20
+ public $UserName;
21
+
22
+ /**
23
+ *
24
+ */
25
+ public $Plugin;
26
+
27
+ /**
28
+ *
29
+ */
30
+ public $TotalCount;
31
+
32
+ /**
33
+ *
34
+ */
35
+ public $QuickQuote;
36
+
37
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ExportBackgroundJob.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ */
6
+ class ExportBackgroundJob extends BackgroundJob {
7
+
8
+ /**
9
+ *
10
+ * @param resourceResolver
11
+ * @param clientConfigurationService
12
+ */
13
+ public function __construct($clientConfigurationService) {
14
+ parent::__construct($clientConfigurationService);
15
+ }
16
+
17
+ private static final $_synLock = new Object(); //TODO: Ask behaviour
18
+
19
+ private $_exportedDocuments;
20
+ private $_exportProgress;
21
+
22
+
23
+ /**
24
+ *
25
+ * @return
26
+ */
27
+ public function getExportedDocuments(){
28
+ return $_exportedDocuments;
29
+ }
30
+
31
+ /**
32
+ *
33
+ * @return
34
+ */
35
+ public function getExportProgress(){
36
+ return $_exportProgress;
37
+ }
38
+
39
+ /**
40
+ * @param ExportArguments
41
+ */
42
+ protected function run() {
43
+
44
+ $args = parent::$arguments;
45
+
46
+ $context = WorkerContext->CreateContext();
47
+ $context->SetValue("ExportNodes", $args->Nodes);
48
+ $context->SetValue("CurrentQuote", $args->Quote);
49
+
50
+ try{
51
+ $args->Plugin->BeforeExport($context);
52
+
53
+ //$factory = new ObjectFactory(); //TODO: Check this Object
54
+ $documents = array(); //TODO: Check this Object
55
+
56
+ $count = 0;
57
+ $size = 0;
58
+ $breakNow = false;
59
+ $_exportedDocuments = 0;
60
+
61
+ $userName = $args->UserName;
62
+ $quoteId = $args->Quote->getID();
63
+
64
+ foreach($args->Nodes as $node) {
65
+ $nextDocument = null;
66
+ for ($i = 0, $l = sizeof($node), $last = $l-1; $i < $l; ++$i ) {
67
+ $documentID = $node[$i];
68
+
69
+ //synchronized ($_synLock) { //TODO: to change to PHP
70
+ $doc;
71
+ if (nextDocument == null) {
72
+ $doc = $args->Plugin->GetRemoteDocument($node->getKey(), $documentID, $context);
73
+
74
+ } else {
75
+ $doc = $nextDocument;
76
+ $nextDocument = null;
77
+ }
78
+
79
+ ++$count;
80
+ ++$_exportedDocuments;
81
+
82
+ if ($doc != null) {
83
+ $documents[] = $doc;
84
+ $size += strlen($doc->getContents()->getValue());
85
+ }
86
+
87
+ $_exportProgress = (($_exportedDocuments / $args->TotalCount) * 100);
88
+
89
+ if ($i < $last) {//check if next document size will grown up the total size by more than a mb...
90
+ $nextDocument = $args->Plugin->GetRemoteDocument($node->getKey(), $node[$i+1], $context);
91
+ $breakNow = (($size + sizeof($nextDocument->getContents()->getValue()) > $Constants->MAX_TRANSFER_SIZE_LIMIT);
92
+ }
93
+ //}
94
+
95
+ if (!$breakNow && $count < $Constants->MAX_TRANSFER_COUNT_LIMIT && $size - $Constants->MAX_TRANSFER_SIZE_LIMIT < 0) {//96 files, 4mb limit or next accumulated bigger than 5mb
96
+ continue;
97
+ }
98
+
99
+ //send accumulated documents
100
+ $remoteConnection->create()->addDocuments($quoteId, $documents, $userName);
101
+
102
+ $count = 0;
103
+ $size = 0;
104
+ $breakNow = false;
105
+ unset($documents);
106
+ }
107
+ }
108
+
109
+ if (count($documents) > 0) {
110
+ //some documents left to send
111
+ //send accumulated documents
112
+ $remoteConnection->create()->addDocuments($quoteId, $documents, $userName);
113
+ }
114
+
115
+ $args->Plugin->BeforeSendQuoteToGpms($context);
116
+
117
+ $remoteConnection->create()->sendQuoteToGpms($quoteId, $userName, $args->QuickQuote);
118
+
119
+ $args->Plugin->AfterExport($context);
120
+ } catch ($e) {
121
+ $args->Plugin->ExportFailed($context, $e);
122
+ } finally{
123
+ WorkerList->ExportWorkers->remove($this);
124
+ WorkerContext->DisposeContext($context);
125
+ }
126
+ }
127
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ITscClientPlugin.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Public interface that exposes client-specific method calls
4
+ */
5
+ interface ITscClientPlugin {
6
+
7
+ /**
8
+ * Lists all the statuses (if any) for any running background worker (both Import and Export)
9
+ */
10
+ public function GetStatuses();
11
+
12
+ /**
13
+ * Lists all the children nodes that have pParentNodeID as parent
14
+ * @param parentNodeID The parent node ID
15
+ * @param sourceLanguage Source language used to filter possible nodes
16
+ * @param paneID The ID of the pane that requested the nodes
17
+ * @return A collection of TreeNodes, or an empty list if the node does not has any children
18
+ */
19
+ public function GetChildren($parentNodeID, $sourceLanguage, $paneID);
20
+
21
+ /**
22
+ * Imports the translated document(s) to the specified quote.
23
+ * @param quoteID The quote ID.
24
+ * @param userName The name of the user doing the operation
25
+ */
26
+ public function Import($quoteID, $userName);
27
+
28
+
29
+ /**
30
+ * Gets the connector configuration.
31
+ * @return A ConnectorConfiguration object
32
+ */
33
+ public function GetConfiguration();
34
+
35
+ /**
36
+ * Gets the custom configuration.
37
+ * @return A String that the client has to deserialize in order to get the custom configuration values
38
+ */
39
+ public function GetCustomConfiguration();
40
+
41
+ /**
42
+ * Sets the custom configuration.
43
+ * @param customConfiguration The custom configuration serialized as a String.
44
+ */
45
+ public function SetCustomConfiguration($customConfiguration);
46
+
47
+
48
+ /**
49
+ * Saves the configuration.
50
+ * @param authorizationToken The authorization token. This token is encrypted and contains the user/password and project id
51
+ * @param tscServerEndPoint The TSC server end point.
52
+ */
53
+ function SaveConfiguration($authorizationToken, $tscServerEndPoint);
54
+
55
+ /**
56
+ *
57
+ * @return
58
+ */
59
+ public function ListQuotes();
60
+
61
+ /**
62
+ *
63
+ * @param quoteName
64
+ * @param quoteComments
65
+ * @param sourceLanguage
66
+ * @param languages
67
+ * @param userName
68
+ * @return
69
+ */
70
+ public function CreateQuote($quoteName, $quoteComments, $sourceLanguage, array $languages, $userName);
71
+
72
+ /**
73
+ *
74
+ * @param quoteID
75
+ * @param userName
76
+ */
77
+ public function DeleteQuote($quoteID, $userName);
78
+
79
+ /**
80
+ *
81
+ * @param quoteID
82
+ * @param userName
83
+ */
84
+ public function CloseQuote($quoteID, $userName);
85
+
86
+ /**
87
+ *
88
+ * @return
89
+ */
90
+ public function ListLogs();
91
+
92
+ /**
93
+ *
94
+ * @param quoteID
95
+ * @param userName
96
+ * @param quickQuote
97
+ */
98
+ public function SendQuoteToGpms($quoteID, $userName, $quickQuote);
99
+
100
+ /**
101
+ *
102
+ * @param quoteID
103
+ * @return
104
+ */
105
+ public function ListPackageFiles($quoteID);
106
+
107
+ /**
108
+ *
109
+ * @param quoteID
110
+ * @param userName
111
+ * @param files
112
+ */
113
+ public function ModifyPackageFiles($quoteID, $userName, array $files);
114
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ImportArguments.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ */
6
+ class ImportArguments {
7
+
8
+ /**
9
+ *
10
+ */
11
+ public $Quote;
12
+
13
+ /**
14
+ *
15
+ */
16
+ public $UserName;
17
+
18
+ /**
19
+ *
20
+ */
21
+ public $Plugin;
22
+
23
+ }
app/code/community/Gpi/Tsc/Helper/webclient/ImportBackgroundJob.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include('WorkerList.php');
4
+ include('WorkerContext.php');
5
+ include('BackgroundJob.php');
6
+
7
+ /**
8
+ *
9
+ *
10
+ */
11
+ class ImportBackgroundJob extends BackgroundJob {
12
+
13
+ public function __construct($clientConfigurationService) {
14
+ super($clientConfigurationService); //(call parent constructor
15
+ }
16
+
17
+ //private static final $_synLock = new Object();
18
+ private static $_synLock;
19
+
20
+ private $_importedDocuments;
21
+ private $_importedProgress;
22
+
23
+ /**
24
+ *
25
+ * @return
26
+ */
27
+ public function getImportedDocuments(){
28
+ return $_importedDocuments;
29
+ }
30
+
31
+ /**
32
+ *
33
+ * @return
34
+ */
35
+ public function getImportedProgress(){
36
+ return $_importedProgress;
37
+ }
38
+
39
+ /**
40
+ *
41
+ */
42
+ protected function run($args) {
43
+
44
+ $args = parent::$arguments;
45
+
46
+ $context = $WorkerContext->CreateContext();
47
+ $context->SetValue("CurrentQuote", $args->Quote); //check set value function
48
+
49
+ try {
50
+ $args->Plugin->BeforeImport($context);
51
+
52
+ $count = 0;
53
+ $_importedDocuments = 0;
54
+
55
+ while(true) {
56
+
57
+ $quoteId = $args->Quote->getID();
58
+ $documents = $remoteConnection->create()->getDocuments(strval($context->getID()),
59
+ $quoteId, $args->UserName);
60
+
61
+ $bj = new BackgroundJob();
62
+ $bj->start();
63
+ $bj->synchronized(function ($_synLock) {
64
+ $docs = $documents->getDocuments()->getValue()->getRemoteDocument();
65
+ $count += count($docs);
66
+ foreach ($docs as $document) {
67
+ $args->Plugin->SetRemoteDocument($document, $context);
68
+ ++$_importedDocuments;
69
+ $_importedProgress = (($_importedDocuments / $count) * 100);
70
+ }
71
+ }, $bj);
72
+
73
+ if ($documents->isLastBatch())
74
+ break;
75
+ }
76
+
77
+ $args->Plugin->AfterImport($context);
78
+
79
+ } catch (Exception $e) {
80
+ $args->Plugin->ImportFailed($context, $e);
81
+ } finally {
82
+ //WorkerList->ImportWorkers->remove($this);
83
+ $position = array_keys(WorkerList::$ImportWorkers, $this);
84
+ unset(WorkerList::$ImportWorkers[$position]);
85
+ WorkerContext::DisposeContext($context);
86
+ }
87
+ }
88
+ }
app/code/community/Gpi/Tsc/Helper/webclient/NameIDPair.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ *
6
+ */
7
+ public class NameIDPair {
8
+
9
+ /**
10
+ *
11
+ */
12
+ public function __construct(){
13
+
14
+ }
15
+
16
+ /**
17
+ *
18
+ * @param pID
19
+ * @param pName
20
+ */
21
+ public function NameIDPair($pID, $pName) {
22
+ $ID = $pID;
23
+ $Name = $pName;
24
+ }
25
+
26
+ /**
27
+ *
28
+ */
29
+ public String $ID;
30
+
31
+ /**
32
+ *
33
+ */
34
+ public String $Name;
35
+ }
app/code/community/Gpi/Tsc/Helper/webclient/RemoteConnection.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class used to initiate connections with the remote server
4
+ *
5
+ */
6
+ class RemoteConnection {
7
+
8
+ private $configuration;
9
+
10
+ /**
11
+ *
12
+ * @param clientConfig
13
+ */
14
+ public function __construct($clientConfig) {
15
+ $this->configuration = $clientConfig;
16
+ }
17
+
18
+ /**
19
+ *
20
+ * @return
21
+ */
22
+ public function create($params = null) {
23
+ $service = null;
24
+
25
+ $default = array(
26
+ // We shall only enable TRACING & EXCEPTION for dev
27
+ 'trace' => 1,
28
+ 'exceptions' => true,
29
+ 'cache_wsdl' => WSDL_CACHE_NONE,
30
+ 'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
31
+ );
32
+
33
+ /*
34
+ * Mage::log(print_r($params, true));
35
+ * Mage::log(print_r($default, true));
36
+ */
37
+
38
+ if(isset($params)) {
39
+ $default = array_merge($params, $default);
40
+ //Mage::log(print_r($default, true));
41
+ }
42
+
43
+ try{
44
+ $tscServerEndPointUrl = "http://tsc.globalizationpartners.info/webservices/rpc.svc?wsdl";
45
+ //$configuration->getTscServerEndPoint(); //pull from the database
46
+
47
+ $service = new SoapClient(
48
+ $tscServerEndPointUrl, $default
49
+ );
50
+ }catch(Exception $ex){
51
+ //$ex.printStackTrace();
52
+ }
53
+
54
+ return $service;
55
+ }
56
+ }
app/code/community/Gpi/Tsc/Helper/webclient/Utils.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ *
6
+ */
7
+ class Utils {
8
+
9
+ /**
10
+ *
11
+ * @return
12
+ */
13
+ private static function getDefaultKey() {
14
+ $bytes = new byte[0];
15
+ try {
16
+ $bytes = "Gl0b4l12a7i0n".getBytes("UTF-8");
17
+ } catch ($e) {
18
+
19
+ }
20
+ return $bytes;
21
+ }
22
+
23
+ /**
24
+ *
25
+ * @param bytes
26
+ * @return
27
+ */
28
+ public static function decodeUTF8($bytes) {
29
+ return new String(bytes, UTF8_CHARSET);
30
+ /*string utf8_decode ( string $data )
31
+
32
+ $output_utf8 = mb_convert_encoding($output, 'utf-8', 'utf-8')*/
33
+ }
34
+
35
+ /**
36
+ *
37
+ * @param string
38
+ * @return
39
+ */
40
+ public static function encodeUTF8($string) {
41
+ return string.getBytes(UTF8_CHARSET);
42
+ }
43
+
44
+ /**
45
+ *
46
+ * @param object
47
+ * @return
48
+ */
49
+ public static function encrypt($object) {
50
+ if (null == $object)
51
+ return "";
52
+
53
+ $json = serialize($object);
54
+
55
+ $key = self::getDefaultKey();
56
+ $data = self::encodeUTF8(json);
57
+ $encryptedBytes = XXTEA::encrypt($key, $data);
58
+ return base64_encode($encryptedBytes);
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @param value
64
+ * @param classOfT
65
+ * @return
66
+ */
67
+ public static function decrypt($value) {
68
+ $key = self::getDefaultKey();
69
+ $data = base64_decode($value);
70
+ $decryptedBytes = XXTEA::decrypt($key, $data);
71
+ $json = self::decodeUTF8($decryptedBytes);
72
+
73
+ return unserialize($json);
74
+ }
75
+ }
app/code/community/Gpi/Tsc/Helper/webclient/WorkerContext.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //ASK FOR GUIDANCE
3
+ /**
4
+ * A worker context stores information for a specific import/export context
5
+ */
6
+ class WorkerContext {
7
+ private static $_contexts = array();
8
+ private $_values = array();
9
+
10
+ private $_id;
11
+
12
+ private function __construct() {
13
+ $_id = uniqid();
14
+ }
15
+
16
+
17
+ /**
18
+ *
19
+ * @return
20
+ */
21
+ public function getID() { return $_id; }
22
+
23
+
24
+ /**
25
+ *
26
+ * @param key
27
+ * @param value
28
+ */
29
+ public function SetValue($key, $value) {
30
+ //$_values[] = array($key, $value);
31
+ $_values[$key] = $value;
32
+ }
33
+
34
+
35
+ /**
36
+ *
37
+ * @param key
38
+ * @return
39
+ */
40
+ public function GetValue($key) {
41
+ return $_values[$key];
42
+ }
43
+
44
+ /**
45
+ *
46
+ * @return
47
+ */
48
+ static function CreateContext() {
49
+ $context = new WorkerContext();
50
+ $position = $context->_id;
51
+ $_context[$position] = $context;
52
+ return $context;
53
+ }
54
+
55
+ /**
56
+ *
57
+ * @param context
58
+ */
59
+ static function DisposeContext($context) {
60
+ $position = array_keys($_contexts, $context->_id);
61
+ unset($_contexts[$position]);
62
+ }
63
+ }
app/code/community/Gpi/Tsc/Helper/webclient/WorkerList.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ *
6
+ */
7
+ class WorkerList {
8
+
9
+ /**
10
+ *
11
+ */
12
+ public static $ExportWorkers = array();
13
+
14
+ /**
15
+ *
16
+ */
17
+ public static $ImportWorkers = array();
18
+ }
app/code/community/Gpi/Tsc/Helper/webclient/Xxtea.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Xxtea
4
+ {
5
+ public static function encrypt($str, $key)
6
+ {
7
+ if ($str == "") {
8
+ return "";
9
+ }
10
+ $v = Xxtea::str2long($str, true);
11
+ $k = Xxtea::str2long($key, false);
12
+ $n = count($v) - 1;
13
+
14
+ $z = $v[$n];
15
+ $y = $v[0];
16
+ $delta = 0x9E3779B9;
17
+ $q = floor(6 + 52 / ($n + 1));
18
+ $sum = 0;
19
+ while (0 < $q--) {
20
+ $sum = Xxtea::int32($sum + $delta);
21
+ $e = $sum >> 2 & 3;
22
+ for ($p = 0; $p < $n; $p++) {
23
+ $y = $v[$p + 1];
24
+ $mx = Xxtea::int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ Xxtea::int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
25
+ $z = $v[$p] = Xxtea::int32($v[$p] + $mx);
26
+ }
27
+ $y = $v[0];
28
+ $mx = Xxtea::int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ Xxtea::int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
29
+ $z = $v[$n] = Xxtea::int32($v[$n] + $mx);
30
+ }
31
+ return Xxtea::long2str($v, false);
32
+ }
33
+
34
+ public static function decrypt($str, $key)
35
+ {
36
+ if ($str == "") {
37
+ return "";
38
+ }
39
+ $v = Xxtea::str2long($str, false);
40
+ $k = Xxtea::str2long($key, false);
41
+ $n = count($v) - 1;
42
+
43
+ $z = $v[$n];
44
+ $y = $v[0];
45
+ $delta = 0x9E3779B9;
46
+ $q = floor(6 + 52 / ($n + 1));
47
+ $sum = Xxtea::int32($q * $delta);
48
+ while ($sum != 0) {
49
+ $e = $sum >> 2 & 3;
50
+ for ($p = $n; $p > 0; $p--) {
51
+ $z = $v[$p - 1];
52
+ $mx = Xxtea::int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ Xxtea::int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
53
+ $y = $v[$p] = Xxtea::int32($v[$p] - $mx);
54
+ }
55
+ $z = $v[$n];
56
+ $mx = Xxtea::int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ Xxtea::int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
57
+ $y = $v[0] = Xxtea::int32($v[0] - $mx);
58
+ $sum = Xxtea::int32($sum - $delta);
59
+ }
60
+ return Xxtea::long2str($v, true);
61
+ }
62
+
63
+ private static function long2str($v, $w)
64
+ {
65
+ $len = count($v);
66
+ $s = array();
67
+ for ($i = 0; $i < $len; $i++)
68
+ {
69
+ $s[$i] = pack("V", $v[$i]);
70
+ }
71
+ if ($w) {
72
+ return substr(join('', $s), 0, $v[$len - 1]);
73
+ }
74
+ else {
75
+ return join('', $s);
76
+ }
77
+ }
78
+
79
+ private static function str2long($s, $w)
80
+ {
81
+ $v = unpack("V*", $s. str_repeat("\0", (4 - strlen($s) % 4) & 3));
82
+ $v = array_values($v);
83
+ if ($w) {
84
+ $v[count($v)] = strlen($s);
85
+ }
86
+ return $v;
87
+ }
88
+
89
+ private static function int32($n)
90
+ {
91
+ while ($n >= 2147483648) $n -= 4294967296;
92
+ while ($n <= -2147483649) $n += 4294967296;
93
+ return (int)$n;
94
+ }
95
+ }
96
+
97
+ ?>
app/code/community/Gpi/Tsc/Model/Backgroundjobs.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gpi_Tsc_Model_Backgroundjobs extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('gpi_tsc/backgroundjobs');
8
+ }
9
+ }
app/code/community/Gpi/Tsc/Model/Configurations.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gpi_Tsc_Model_Configurations extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('gpi_tsc/configurations');
8
+ }
9
+ }
app/code/community/Gpi/Tsc/Model/MagentoGpiClient.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $helperPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper';
4
+ $modelPath = Mage::getModuleDir('Model', 'Gpi_Tsc') . DS . 'Model';
5
+
6
+ $webclientPath = $helperPath . DS . 'webclient';
7
+ $sharedDataPath = $helperPath . DS . 'shareddata';
8
+
9
+ include($modelPath . DS . 'Utilities.php');
10
+
11
+ include($webclientPath . DS . 'AbstractTscClientPlugin.php');
12
+ include($webclientPath . DS . 'ClientConfigurationServiceImpl.php');
13
+ include($webclientPath . DS . 'ConnectorConfiguration.php');
14
+
15
+ class MagentoGpiClient extends AbstractTscClientPlugin {
16
+
17
+
18
+ const CONTENT_TYPE_CMS_PAGES = 'CMSpages';
19
+ const CONTENT_TYPE_CMS_BLOCKS = 'CMSblocks';
20
+ const CONTENT_TYPE_CATEGORIES = 'Categories';
21
+ const CONTENT_TYPE_PRODUCTS = 'Products';
22
+
23
+ public function __construct() {
24
+ parent::__construct(new ClientConfigurationServiceImpl());
25
+ }
26
+
27
+ public function GetChildren($parentNodeID, $sourceLanguage, $paneID) {
28
+
29
+ $children = array();
30
+
31
+ switch ($paneID) {
32
+ case self::CONTENT_TYPE_CMS_PAGES:
33
+ $children = Utilities::GetCMSPages();
34
+ break;
35
+ case self::CONTENT_TYPE_CMS_BLOCKS:
36
+ $children = Utilities::GetCMSBlocks();
37
+ break;
38
+ case self::CONTENT_TYPE_CATEGORIES:
39
+ $children = Utilities::GetCategories();
40
+ break;
41
+ case self::CONTENT_TYPE_PRODUCTS:
42
+ $children = Utilities::GetProducts();
43
+ break;
44
+ }
45
+
46
+ return json_encode($children);
47
+
48
+ }
49
+
50
+ protected function GetConfigurationInternal() {
51
+
52
+ $config = new ConnectorConfiguration();
53
+ /* We need to return a connector configuration
54
+ */
55
+
56
+ //GET CURRENT LANGUAGES IN MAGENTO
57
+ $languages = Zend_Locale::getTranslationList("language");
58
+
59
+ $languagesList = array();
60
+ foreach($languages as $id => $name) {
61
+ $languagesList[] = array('ID'=>$id, 'Name'=>$name);
62
+ }
63
+ // Sort language list
64
+ $config->SourceLanguages = $languagesList;
65
+ $config->TargetLanguages = $languagesList;
66
+
67
+ $documentBrowserPanes = array();
68
+ $documentBrowserPanes[] = array('ID'=>self::CONTENT_TYPE_CMS_PAGES, 'Name'=>'CMS Pages');
69
+ $documentBrowserPanes[] = array('ID'=>self::CONTENT_TYPE_CMS_BLOCKS, 'Name'=>'CMS Blocks');
70
+ $documentBrowserPanes[] = array('ID'=>self::CONTENT_TYPE_CATEGORIES, 'Name'=>'Categories');
71
+ $documentBrowserPanes[] = array('ID'=>self::CONTENT_TYPE_PRODUCTS, 'Name'=>'Products');
72
+
73
+ $config->DocumentBrowserPanes = $documentBrowserPanes;
74
+
75
+ $config->UserName = Mage::getSingleton('admin/session')->getUser()->getUsername();
76
+ return $config;
77
+ }
78
+
79
+ protected function ConvertTreeNodesToIds($treeRoot) {
80
+ //check only parents checked if threy are folders with children
81
+ }
82
+
83
+ public function GetRemoteDocument($paneID, $nodeID, $context) {
84
+ $remoteDocument = array();
85
+ return $remoteDocument;
86
+ }
87
+
88
+ public function SetRemoteDocument($document, $context) {
89
+
90
+ }
91
+ }
app/code/community/Gpi/Tsc/Model/Resource/Backgroundjobs.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gpi_Tsc_Model_Resource_Backgroundjobs extends Mage_Core_Model_Resource_Db_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('gpi_tsc/backgroundjobs', 'job_id');
8
+ }
9
+ }
app/code/community/Gpi/Tsc/Model/Resource/Backgroundjobs/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gpi_Tsc_Model_Resource_Backgroundjobs_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('gpi_tsc/backgroundjobs');
8
+ }
9
+ }
app/code/community/Gpi/Tsc/Model/Resource/Configurations.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gpi_Tsc_Model_Resource_Configurations extends Mage_Core_Model_Resource_Db_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('gpi_tsc/configurations','config_id');
8
+ }
9
+ }
app/code/community/Gpi/Tsc/Model/Resource/Configurations/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gpi_Tsc_Model_Resource_Configurations_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('gpi_tsc/configurations');
8
+ }
9
+
10
+ }
app/code/community/Gpi/Tsc/Model/Tsc.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News item model
4
+ *
5
+ * @author Magento
6
+ */
7
+ class Gpi_Tsc_Model_Tsc extends Mage_Core_Model_Abstract
8
+ {
9
+ /**
10
+ * Define resource model
11
+ */
12
+ protected function _construct()
13
+ {
14
+ $this->_init('gpi_tsc/configurations');
15
+ $this->_init('gpi_tsc/backgroundjobs');
16
+ }
17
+
18
+ /**
19
+ * If object is new adds creation date
20
+ *
21
+ * @return Magentostudy_News_Model_News
22
+ */
23
+ }
app/code/community/Gpi/Tsc/Model/Utilities.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Utilities {
5
+
6
+ public static function GetCMSPages () {
7
+
8
+ /*
9
+ /* CMS Pages
10
+ /* */
11
+ //$pages = Mage::getModel('cms/page')->getCollection();
12
+ //$pages = Mage::getModel('cms/page')->load('home','identifier');
13
+ $model = Mage::getModel('cms/page');
14
+ $pages = $model->getCollection();
15
+ $pages->load();
16
+
17
+ $collection = array();
18
+
19
+ foreach ($pages as $page) //loop for getting products
20
+ {
21
+ $pag = new TreeNode();
22
+ $data = $page->getData();
23
+ $pag->ID = $data['page_id'];
24
+ $pag->Name = $data['title'];
25
+ $pag->LastModificationDate = $data['update_time'];
26
+ $collection[] = $pag;
27
+ }
28
+
29
+ return $collection;
30
+
31
+ /*
32
+ $content = $page->getContent();
33
+ $keywords = $page->getMetaKeywords();
34
+ $descriptions = $page->getMetaDescription();
35
+ */
36
+ /* $cmsPage = Mage::log(print_r($content,true));
37
+ $cmsPage = Mage::log(print_r($keywords,true));
38
+ $cmsPage = Mage::log(print_r($descriptions,true));
39
+ /*
40
+ /* Create new CMS Page
41
+ $cmsPage = array(
42
+ 'title' => 'Test Page',
43
+ 'identifier' => 'test-page',
44
+ 'content' => 'Sample Test Page',
45
+ 'is_active' => 1,
46
+ 'sort_order' => 0,
47
+ 'stores' => array(0),
48
+ 'root_template' => 'three_columns'
49
+ );
50
+ Mage::getModel('cms/page')->setData($cmsPage)->save();
51
+ */
52
+ }
53
+
54
+ public static function GetCMSBlocks () {
55
+
56
+ /*
57
+ /* CMS Blocks
58
+ /* */
59
+ $model = Mage::getModel('cms/block');
60
+ $pages = $model->getCollection();
61
+ $pages->load();
62
+
63
+ $collection = array();
64
+
65
+ foreach ($pages as $page) //loop for getting products
66
+ {
67
+ $pag = new TreeNode();
68
+ $data = $page->getData();
69
+ $pag->ID = $data['identifier'];
70
+ $pag->Name = $data['title'];
71
+ $pag->LastModificationDate = $data['update_time'];
72
+ $collection[] = $pag;
73
+ }
74
+
75
+ return $collection;
76
+ }
77
+
78
+ public static function GetProducts () {
79
+
80
+ /*
81
+ /* Products
82
+ /* */
83
+
84
+ $model = Mage::getModel('catalog/product'); //getting product model
85
+ $products = $model->getCollection(); //products collection
86
+
87
+ $collection = array();
88
+
89
+ foreach ($products as $product) //loop for getting products
90
+ {
91
+ $prod = new TreeNode();
92
+ $model->load($product->getId());
93
+ $prod->Name = $model->getName();
94
+ $prod->ID = $product->getId();
95
+ $collection[] = $prod;
96
+ }
97
+
98
+ return $collection;
99
+ }
100
+
101
+ public static function GetCategories () {
102
+
103
+ /*
104
+ /* Categories
105
+ /* */
106
+
107
+ $model = Mage::getModel('catalog/category');
108
+ $tree = $model->getTreeModel();
109
+ $tree->load();
110
+
111
+ $categories = $tree->getCollection()->getAllIds();
112
+
113
+ $collection = array();
114
+
115
+ foreach ($categories as $id ) {
116
+ $categ = new TreeNode();
117
+ $categ->ID = $id;
118
+ $categ->Name = $model->load($id)->getName();
119
+ $collection[] = $categ;
120
+ }
121
+
122
+ return $collection;
123
+ }
124
+
125
+ }
app/code/community/Gpi/Tsc/controllers/IndexController.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * News frontend controller
4
+ *
5
+ * @author Magento
6
+ */
7
+ class Gpi_Tsc_IndexController extends Mage_Core_Controller_Front_Action
8
+ {
9
+ /**
10
+ * Pre dispatch action that allows to redirect to no route page in case of disabled extension through admin panel
11
+ */
12
+ public function preDispatch()
13
+ {
14
+ parent::preDispatch();
15
+
16
+ if (!Mage::helper('gpi_tsc')->isEnabled()) {
17
+ $this->setFlag('', 'no-dispatch', true);
18
+ $this->_redirect('noRoute');
19
+ }
20
+ }
21
+
22
+ /**
23
+ * Index action
24
+ */
25
+ public function indexAction()
26
+ {
27
+ $this->loadLayout();
28
+
29
+ $listBlock = $this->getLayout()->getBlock('tsc.main');
30
+
31
+ if ($listBlock) {
32
+ $currentPage = abs(intval($this->getRequest()->getParam('p')));
33
+ if ($currentPage < 1) {
34
+ $currentPage = 1;
35
+ }
36
+ $listBlock->setCurrentPage($currentPage);
37
+ }
38
+
39
+ $this->renderLayout();
40
+ }
41
+
42
+ /**
43
+ * News view action
44
+ */
45
+ public function viewAction()
46
+ {
47
+
48
+ //$tscId = $this->getRequest()->getParam('id');
49
+ $tscId = $this->getRequest()->getParam();
50
+ if (!$newsId) {
51
+ return $this->_forward('noRoute');
52
+ }
53
+
54
+ // @var $model Magentostudy_News_Model_News
55
+ $model = Mage::getModel('gpi_tsc/tsc');
56
+ $model->load($tscsId);
57
+
58
+ if (!$model->getId()) {
59
+ return $this->_forward('noRoute');
60
+ }
61
+
62
+ Mage::register('tsc_item', $model);
63
+
64
+ //Mage::dispatchEvent('before_news_item_display', array('tsc_item' => $model));
65
+
66
+ $this->loadLayout();
67
+ $itemBlock = $this->getLayout()->getBlock('tsc.main');
68
+
69
+ //if ($itemBlock) {
70
+ // $listBlock = $this->getLayout()->getBlock('tsc.list');
71
+ // if ($listBlock) {
72
+ // $page = (int)$listBlock->getCurrentPage() ? (int)$listBlock->getCurrentPage() : 1;
73
+ // } else {
74
+ // $page = 1;
75
+ // }
76
+ // $itemBlock->setPage($page);
77
+ //}
78
+
79
+ $this->renderLayout();
80
+
81
+ }
82
+ }
app/code/community/Gpi/Tsc/controllers/adminhtml/TscController.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include(Mage::getModuleDir('model', 'Gpi_Tsc') . DS . 'Model' . DS . 'MagentoGpiClient.php');
3
+
4
+ /**
5
+ * News controller
6
+ *
7
+ * @author Magento
8
+ */
9
+ class Gpi_Tsc_adminhtml_TscController extends Mage_Adminhtml_Controller_Action
10
+ {
11
+ /**
12
+ * Init actions
13
+ *
14
+ * @return Magentostudy_News_Adminhtml_NewsController
15
+ */
16
+ protected function _initAction()
17
+ {
18
+ // load layout, set active menu and breadcrumbs
19
+ $this->loadLayout()
20
+ ->_setActiveMenu('tsc/manage')
21
+ ->_addBreadcrumb(
22
+ Mage::helper('gpi_tsc')->__('Tsc'),
23
+ Mage::helper('gpi_tsc')->__('Tsc')
24
+ )
25
+ ->_addBreadcrumb(
26
+ Mage::helper('gpi_tsc')->__('Manage Packages'),
27
+ Mage::helper('gpi_tsc')->__('Manage Packages')
28
+ )
29
+ ;
30
+ return $this;
31
+ }
32
+
33
+ /**
34
+ * Index action
35
+ */
36
+ public function indexAction()
37
+ {
38
+ $this->_title($this->__('Tsc'))
39
+ ->_title($this->__('Manage Packages'));
40
+
41
+ $this->_initAction();
42
+
43
+ $block = $this->getLayout()
44
+ ->createBlock('core/text', 'example-block');
45
+
46
+ $this->_addContent($block);
47
+
48
+ $this->renderLayout();
49
+ }
50
+
51
+ public function postAction()
52
+ {
53
+ //use Zend_Json_Server()
54
+ $server = new Zend_Json_Server();
55
+ $client = new MagentoGpiClient();
56
+ //Mage::log(print_r($_POST, true));
57
+
58
+ $server->setClass($client);
59
+
60
+ $server->handle();
61
+ }
62
+
63
+ protected function _isAllowed()
64
+ {
65
+ /*switch ($this->getRequest()->getActionName()) {
66
+ case 'new':
67
+ case 'save':
68
+ return Mage::getSingleton('admin/session')->isAllowed('news/manage/save');
69
+ break;
70
+ case 'delete':
71
+ return Mage::getSingleton('admin/session')->isAllowed('news/manage/delete');
72
+ break;
73
+ default:
74
+ return Mage::getSingleton('admin/session')->isAllowed('news/manage');
75
+ break;
76
+ }*/
77
+
78
+ return Mage::getSingleton('admin/session')->isAllowed('tsc/manage');
79
+ }
80
+
81
+ /**
82
+ * Filtering posted data. Converting localized data if needed
83
+ *
84
+ * @param array
85
+ * @return array
86
+ */
87
+ protected function _filterPostData($data)
88
+ {
89
+ /*$data = $this->_filterDates($data, array('time_published'));
90
+ return $data;*/
91
+ }
92
+
93
+ /**
94
+ * Grid ajax action
95
+ */
96
+ public function gridAction()
97
+ {
98
+ $this->loadLayout();
99
+ $this->renderLayout();
100
+ }
101
+
102
+ /**
103
+ * Flush News Posts Images Cache action
104
+ */
105
+ public function flushAction()
106
+ {
107
+ /*
108
+ if (Mage::helper('magentostudy_news/image')->flushImagesCache()) {
109
+ $this->_getSession()->addSuccess('Cache successfully flushed');
110
+ } else {
111
+ $this->_getSession()->addError('There was error during flushing cache');
112
+ }
113
+ */
114
+ $this->_forward('index');
115
+ }
116
+ }
app/code/community/Gpi/Tsc/data/gpi_tsc_setup/data-install-1.0.0.1.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $dataRows = array(
6
+ array(
7
+ 'config_name' => 'serviceUrl',
8
+ 'config_value' => '',
9
+ ),
10
+ array(
11
+ 'config_name' => 'authToken',
12
+ 'config_value' => '',
13
+ ),
14
+ );
15
+
16
+
17
+ foreach ($dataRows as $data) {
18
+ $model = Mage::getModel('gpi_tsc/configurations');
19
+ $model->setData($data)->setOrigData()->save();
20
+ }
app/code/community/Gpi/Tsc/etc/adminhtml.xml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento admin config
5
+ *
6
+ * @author Magento
7
+ */
8
+ -->
9
+ <config>
10
+ <menu>
11
+ <tsc translate="title" module="gpi_tsc">
12
+ <title>GPI</title>
13
+ <sort_order>66</sort_order>
14
+ <children>
15
+ <manage translate="title" module="gpi_tsc">
16
+ <title>Translation Services Connector</title>
17
+ <action>adminhtml/tsc</action><!-- Changed from ITscClientPlugin-->
18
+ <sort_order>51</sort_order>
19
+ </manage>
20
+ </children>
21
+ </tsc>
22
+ </menu>
23
+ <acl>
24
+ <resources>
25
+ <admin>
26
+ <children>
27
+ <tsc translate="title" module="gpi_tsc">
28
+ <title>GPI</title>
29
+ <sort_order>66</sort_order>
30
+ <children>
31
+ <manage>
32
+ <children>
33
+ <title>Manage TSC</title>
34
+ <sort_order>0</sort_order>
35
+ </children>
36
+ </manage>
37
+ </children>
38
+ </tsc>
39
+ <system>
40
+ <children>
41
+ <config>
42
+ <children>
43
+ <tsc translate="title" module="gpi_tsc">
44
+ <title>News Package</title>
45
+ </tsc>
46
+ </children>
47
+ </config>
48
+ </children>
49
+ </system>
50
+ </children>
51
+ </admin>
52
+ </resources>
53
+ </acl>
54
+ </config>
app/code/community/Gpi/Tsc/etc/config.xml ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Module configuration
5
+ *
6
+ * @author Magento
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Gpi_Tsc>
12
+ <version>1.0.0.1</version>
13
+ </Gpi_Tsc>
14
+ </modules>
15
+ <global>
16
+ <models>
17
+ <gpi_tsc>
18
+ <class>Gpi_Tsc_Model</class>
19
+ <resourceModel>tsc_resource</resourceModel>
20
+ </gpi_tsc>
21
+ <tsc_resource>
22
+ <class>Gpi_Tsc_Model_Resource</class>
23
+ <entities>
24
+ <!--
25
+ <tsc>
26
+ <table>tsc</table>
27
+ </tsc>
28
+ -->
29
+ <backgroundjobs>
30
+ <table>gpi_backgroundjobs</table>
31
+ </backgroundjobs>
32
+ <configurations>
33
+ <table>gpi_configurations</table>
34
+ </configurations>
35
+
36
+ </entities>
37
+ </tsc_resource>
38
+ </models>
39
+ <helpers>
40
+ <gpi_tsc>
41
+ <class>Gpi_Tsc_Helper</class>
42
+ </gpi_tsc>
43
+ </helpers>
44
+ <blocks>
45
+ <gpi_tsc>
46
+ <class>Gpi_Tsc_Block</class>
47
+ </gpi_tsc>
48
+ </blocks>
49
+ <resources>
50
+ <gpi_tsc_setup>
51
+ <setup>
52
+ <module>Gpi_Tsc</module>
53
+ <class>Mage_Core_Model_Resource_Setup</class>
54
+ </setup>
55
+ </gpi_tsc_setup>
56
+ </resources>
57
+
58
+ <!--<events>
59
+ <before_tsc_items_display>
60
+ <observers>
61
+ <gpi_tsc>
62
+ <class>gpi_tsc/observer</class>
63
+ <method>beforeNewsDisplayed</method>
64
+ </gpi_tsc>
65
+ </observers>
66
+ </before_tsc_items_display>
67
+ </events>-->
68
+ </global>
69
+ <admin>
70
+ <routers>
71
+ <adminhtml>
72
+ <args>
73
+ <modules>
74
+ <Gpi_Tsc before="Mage_Adminhtml">Gpi_Tsc_Adminhtml</Gpi_Tsc>
75
+ </modules>
76
+ </args>
77
+ </adminhtml>
78
+ </routers>
79
+ </admin>
80
+ <adminhtml>
81
+ <layout>
82
+ <updates>
83
+ <gpi_tsc>
84
+ <file>gpi_tsc.xml</file>
85
+ </gpi_tsc>
86
+ </updates>
87
+ </layout>
88
+ <translate>
89
+ <modules>
90
+ <Gpi_Tsc>
91
+ <files>
92
+ <default>Gpi_Tsc.csv</default>
93
+ </files>
94
+ </Gpi_Tsc>
95
+ </modules>
96
+ </translate>
97
+ </adminhtml>
98
+ </config>
app/code/community/Gpi/Tsc/sql/gpi_tsc_setup/install-1.0.0.1.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+
8
+ $table = $installer->getConnection()
9
+ ->newTable($installer->getTable('gpi_tsc/backgroundjobs'))
10
+ ->addColumn('job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
11
+ 'identity' => true,
12
+ 'unsigned' => true,
13
+ 'nullable' => false,
14
+ 'primary' => true,
15
+ ), 'Id')
16
+ ->addColumn('job_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
17
+ 'nullable' => false,
18
+ ), 'Type')
19
+ ->addColumn('project_id', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
20
+ 'nullable' => false,
21
+ ), 'Project')
22
+ ->addIndex($installer->getIdxName(
23
+ $installer->getTable('gpi_tsc/backgroundjobs'),
24
+ array('job_id'),
25
+ Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
26
+ ),
27
+ array('job_id'),
28
+ array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
29
+ )
30
+ ->setComment('GPI BackgroundJobs');
31
+ $installer->getConnection()->createTable($table);
32
+
33
+ $table = $installer->getConnection()
34
+ ->newTable($installer->getTable('gpi_tsc/configurations'))
35
+ ->addColumn('config_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
36
+ 'identity' => true,
37
+ 'unsigned' => true,
38
+ 'nullable' => false,
39
+ 'primary' => true,
40
+ ), 'Id')
41
+ ->addColumn('config_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
42
+ 'nullable' => false,
43
+ ), 'Name')
44
+ ->addColumn('config_value', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
45
+ 'nullable' => false,
46
+ ), 'Value')
47
+ ->addIndex($installer->getIdxName(
48
+ $installer->getTable('gpi_tsc/configurations'),
49
+ array('config_id'),
50
+ Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
51
+ ),
52
+ array('config_id'),
53
+ array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
54
+ )
55
+ ->setComment('GPI Configurations');
56
+ $installer->getConnection()->createTable($table);
57
+
58
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/gpi_tsc.xml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento backend layout
5
+ *
6
+ * @author Magento
7
+ */
8
+ -->
9
+ <layout>
10
+ <adminhtml_tsc_index>
11
+ <reference name="head">
12
+ <action method="addItem">
13
+ <type>js</type>
14
+ <name>gpi_tsc/JSON.js</name>
15
+ </action>
16
+ <action method="addItem">
17
+ <type>js</type>
18
+ <name>gpi_tsc/EcmaScript5.js</name>
19
+ </action>
20
+ <action method="addItem">
21
+ <type>js</type>
22
+ <name>gpi_tsc/Crypto.js</name>
23
+ </action>
24
+ <action method="addItem">
25
+ <type>js</type>
26
+ <name>gpi_tsc/tsc.js</name>
27
+ </action>
28
+ <action method="addItem">
29
+ <type>skin_css</type>
30
+ <name>css/gpiconnector_tsc.css</name>
31
+ </action>
32
+ </reference>
33
+ <reference name="content">
34
+ <block type="gpi_tsc/adminhtml_tsc" name="tsc" template="gpi/tsc.phtml" />
35
+ </reference>
36
+ </adminhtml_tsc_index>
37
+ </layout>
app/design/adminhtml/default/default/template/gpi/tsc.phtml ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Picket Fences s01e14 -->
2
+ <script type="text/javascript">
3
+ efx.startup("<?=$this->getUrl('*/*/post')?>");
4
+ efx.init();
5
+ </script>
6
+
7
+ <script type="text/html" id="status_tpl">
8
+ {{ statuses.forEach(function(status) { }}
9
+ <li><b>{{=status.Message}}</b><i><u style="width: {{=status.Percentaje}}%;">{{=status.Percentaje}}%</u></i></li>
10
+ {{ }); }}
11
+ </script>
12
+
13
+ <script type="text/html" id="add_documents_tpl">
14
+ <div class="grid_12"><h2>{{ if (quickQuote) { }}<?php echo $this->__('QuoteName'); ?> » <?php echo $this->__('Additems'); ?>{{ } else { }}<?php echo $this->__('PackageName'); ?> » <?php echo $this->__('ModifyPackage'); ?> {{ } }}</h2></div>
15
+ <div id="tsc_columns" class="clearfix"></div>
16
+ <div class="buttons">
17
+ {{ if (quickQuote) { }}
18
+ <a href="#" onclick="efx.addSelectedDocuments({{=quote.ID}}, true); return false;" class="button orange"><span><?php echo $this->__('RequestAQuote'); ?></span></a>
19
+ {{ } else { }}
20
+ <a href="#" onclick="efx.addSelectedDocuments({{=quote.ID}}); return false;" class="button orange"><span><?php echo $this->__('UpdatePackage'); ?></span></a>
21
+ &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
22
+ <a href="#" onclick="efx.showScreen('listQuotesScreen'); return false;" class="button khaki"><span><?php echo $this->__('Cancel'); ?></span></a>
23
+ {{ } }}
24
+ </div>
25
+ </script>
26
+
27
+ <script type="text/html" id="createQuote_tpl">
28
+ <div class="grid_12"><h2>{{ if (quickQuote) { }} <?php echo $this->__('CreateQuote'); ?>{{ } else { }} <?php echo $this->__('CreatePackage'); ?>{{ } }}</h2></div>
29
+ <form>
30
+ <div class="grid_8">
31
+ <label for="tsc_Name"><abbr title="required">*</abbr> {{ if (quickQuote) { }}<?php echo $this->__('FormQuoteName'); ?>{{ } else { }}<?php echo $this->__('FormPackageName'); ?>{{ } }}</label>
32
+ <input id="tsc_Name" value="" type="text" tabindex="1" />
33
+ </div>
34
+ <div class="grid_4">
35
+ <label for="tsc_SourceLang"><?php echo $this->__('FormSourceLanguage'); ?></label>
36
+ {{ if (sourceLanguages.length < 2) { }}
37
+ <input disabled="disabled" value="{{=sourceLanguages[0].Name}}" type="text" />
38
+ <input id="tsc_SourceLang" value="{{=sourceLanguages[0].ID}}" type="hidden" />
39
+ {{ } else { }}
40
+ <select id="tsc_SourceLang" tabindex="3">
41
+ {{ sourceLanguages.forEach(function(lang) { }}
42
+ <option value="{{=lang.ID}}">{{=lang.Name}}</option>
43
+ {{ }); }}
44
+ </select>
45
+ {{ } }}
46
+ </div>
47
+ <div class="grid_8">
48
+ <label for="tsc_Notes"><?php echo $this->__('FormComments'); ?></label>
49
+ <textarea rows="9" cols="30" id="tsc_Notes" tabindex="2"></textarea>
50
+ </div>
51
+ <div class="grid_4">
52
+ <label><?php echo $this->__('FormTargetLanguages'); ?></label>
53
+ {{ if (targetLanguages.length < 2) { }}
54
+ <input disabled="disabled" value="{{=targetLanguages[0].Name}}" type="text" />
55
+ <input id="tsc_TargetLangs" value="{{=targetLanguages[0].ID}}" type="hidden" />
56
+ {{ } else { }}
57
+ <div class="tsc_selectMultiple">
58
+ {{ targetLanguages.forEach(function(lang, index) { }}
59
+ <label><input {{ if (index == 0) { }}id="tsc_TargetLangs"{{ } }} type="checkbox" name="tsc_LangNames" value="{{=lang.ID}}" tabindex="{{=(index+4)}}"/> {{=lang.Name}}</label>
60
+ {{ }); }}
61
+ </div>
62
+ {{ } }}
63
+ </div>
64
+ <div class="buttons">
65
+ {{ if (quickQuote) { }}
66
+ <a href="#" onclick="efx.showScreen('createQuote', true); return false;" class="button orange"><span><?php echo $this->__('CreateQuote'); ?></span></a>
67
+ {{ } else { }}
68
+ <a href="#" onclick="efx.showScreen('createQuote'); return false;" class="button orange"><span><?php echo $this->__('CreatePackage'); ?></span></a>
69
+ {{ } }}
70
+
71
+ &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
72
+ <a href="#" onclick="efx.showScreen('listQuotesScreen'); return false;" class="button khaki"><span><?php echo $this->__('Cancel'); ?></span></a>
73
+ </div>
74
+ </form>
75
+ </script>
76
+
77
+ <script type="text/html" id="main_tpl">
78
+ <div class="grid_12">
79
+ <h2><?php echo $this->__('TranslationPackages'); ?> <a href="#" onclick="efx.showScreen('createQuoteScreen'); return false;" class="button orange"><span><?php echo $this->__('CreatePackage'); ?></span></a></h2>
80
+ {{ if (!packages.length) { }}
81
+ <p class="message info"><?php echo $this->__('NoPackages'); ?></p>
82
+ {{ } else { }}
83
+ <table cellpadding="0" cellspacing="0" class="dataTable">
84
+ <col align="left" />
85
+ <col width="128" align="right" />
86
+ <col width="128" align="left" />
87
+ <col width="15%" align="left" />
88
+ <thead>
89
+ <tr>
90
+ <th><?php echo $this->__('Package'); ?></th>
91
+ <th><?php echo $this->__('LastModified'); ?></th>
92
+ <th><?php echo $this->__('By'); ?></th>
93
+ <th><?php echo $this->__('Languages'); ?></th>
94
+ </tr>
95
+ </thead>
96
+ <tbody>
97
+ {{ packages.forEach(function(package) { }}
98
+ <tr>
99
+ <td><span>{{=package.Name}}
100
+ <b class="actions"><i>
101
+ <a href="#" class="link-delete" onclick='return efx.doConfirm("<?php echo $this->__('DeletePackage'); ?>", efx.deletePackage, {{=package.ID}})'><?php echo $this->__('Delete'); ?></a>
102
+ {{ if (package.PackageCount > 0) { }}
103
+ <a href="#" class="link-request" onclick="efx.requestAQuote({{=package.ID}}); return false;"><?php echo $this->__('RequestAQuote'); ?></a>
104
+ {{ } }}
105
+ <a href="#" class="link-add" onclick="efx.showScreen('addDocuments', {{=package.ID}}); return false;"><?php echo $this->__('ModifyPackage'); ?></a>
106
+ </i></b></span></td>
107
+ <td>{{=package.LastModifiedOn}} at {{=package.LastModifiedOn}}</td>
108
+ <td>{{=package.LastModifiedBy || ""}}</td>
109
+ <td>From: {{=package.SourceLanguage}}<br/>To: {{=package.TargetLanguages.join(", ")}}</td>
110
+ </tr>
111
+ {{ }); }}
112
+ </tbody>
113
+ </table>
114
+ {{ } }}
115
+
116
+ <h2><?php echo $this->__('Quotes'); ?> <a href="#" onclick="efx.showScreen('createQuoteScreen', true); return false;" class="button orange"><span><?php echo $this->__('CreateQuote'); ?></span></a></h2>
117
+ {{ if (!quotes.length) { }}
118
+ <p class="message info"><?php echo $this->__('NoQuotes'); ?></p>
119
+ {{ } else { }}
120
+ <table cellpadding="0" cellspacing="0" class="dataTable">
121
+ <col align="left" />
122
+ <col width="128" align="center" />
123
+ <col width="15%" align="left" />
124
+ <thead>
125
+ <tr>
126
+ <th><?php echo $this->__('Quote'); ?></th>
127
+ <th><?php echo $this->__('Status'); ?></th>
128
+ <th><?php echo $this->__('Languages'); ?></th>
129
+ </tr>
130
+ </thead>
131
+ <tbody>
132
+ {{ quotes.forEach(function(quote) { }}
133
+ <tr>
134
+ <td><span>{{=quote.Name}}
135
+ {{ if (quote.Status !== "QuoteOpen" && !String.isNullOrEmpty(quote.PortalLink)) { }}
136
+ <b class="actions"><i>
137
+ <a href="{{=quote.PortalLink}}" class="link-view" target="_blank"><?php echo $this->__('FullReport'); ?></a>
138
+ {{ } }}
139
+ </i></b></span>
140
+ </td>
141
+ <td>{{=quote.HumanStatus}}</td>
142
+ <td><?php echo $this->__('From'); ?> {{=quote.SourceLanguage}}<br/><?php echo $this->__('To'); ?> {{=quote.TargetLanguages.join(", ")}}</td>
143
+ </tr>
144
+ {{ }); }}
145
+ </tbody>
146
+ </table>
147
+ {{ } }}
148
+
149
+ <h2><?php echo $this->__('Projects'); ?></h2>
150
+ {{ if (!projects.length) { }}
151
+ <p class="message info"><?php echo $this->__('NoProjects'); ?></p>
152
+ {{ } else { }}
153
+ <table cellpadding="0" cellspacing="0" class="dataTable">
154
+ <col align="left" />
155
+ <col width="128" align="center" />
156
+ <col width="15%" align="left" />
157
+ <thead>
158
+ <tr>
159
+ <th><?php echo $this->__('Project'); ?></th>
160
+ <th><?php echo $this->__('Status'); ?></th>
161
+ <th><?php echo $this->__('Languages'); ?></th>
162
+ </tr>
163
+ </thead>
164
+ <tbody>
165
+ {{ projects.forEach(function(project) { }}
166
+ <tr>
167
+ <td><span>{{=project.Name}}
168
+ <b class="actions"><i>
169
+ {{ if (project.Status == "ProjectCompleted") { }}
170
+ <a href="#" class="link-import" onclick="efx.importProject({{=project.ID}}); return false;"><?php echo $this->__('ImportTranslations'); ?></a>
171
+ <a href="#" class="link-close" onclick="efx.closeProject({{=project.ID}}); return false;"><?php echo $this->__('CloseProject'); ?></a>
172
+ {{ } }}
173
+
174
+ {{ if (!String.isNullOrEmpty(project.PortalLink)) { }}
175
+ <a href="{{=project.PortalLink}}" class="link-view" target="_blank"><?php echo $this->__('FullReport'); ?></a>
176
+ {{ } }}
177
+ </i></b></span></td>
178
+ <td>{{=project.HumanStatus}}</td>
179
+ <td><?php echo $this->__('From'); ?> {{=project.SourceLanguage}}<br/><?php echo $this->__('To'); ?> {{=project.TargetLanguages.join(", ")}}</td>
180
+ </tr>
181
+ {{ }); }}
182
+ </tbody>
183
+ </table>
184
+ {{ } }}
185
+ </div>
186
+ </script>
187
+
188
+ <script type="text/html" id="config_tpl">
189
+ <div class="grid_12"><h2><?php echo $this->__('Configure'); ?></h2></div>
190
+ <form style="max-width: 600px; margin: 0 auto;">
191
+ <div>
192
+ <label for="tsc_tokenID"><abbr title="required">*</abbr> <?php echo $this->__('Token'); ?></label>
193
+ <textarea rows="4" cols="30" id="tsc_tokenID">{{=configuration.AuthorizationToken}}</textarea>
194
+ </div>
195
+ <div>
196
+ <label for="tsc_Endpoint"><abbr title="required">*</abbr> <?php echo $this->__('Endpoint'); ?></label>
197
+ <input id="tsc_Endpoint" value="{{=configuration.TscServerEndPoint}}" type="text" />
198
+ </div>
199
+ <div class="buttons">
200
+ <a href="#" onclick="efx.saveConfiguration(); return false;" class="button orange"><span><?php echo $this->__('SaveConfiguration'); ?></span></a>
201
+ {{if (fromConfig) {}}
202
+ &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
203
+ <a href="#" onclick="efx.showScreen('listQuotesScreen'); return false;" class="button khaki"><span><?php echo $this->__('Cancel'); ?></span></a>
204
+ {{ } }}
205
+ </div>
206
+ </form>
207
+ </script>
208
+ <div id="tsc_wrapper">
209
+ <div id="tsc_header">
210
+ <a href="http://www.globalizationpartners.com/" id="tsc_logo">Globalization Partners International</a>
211
+ <a href="#" id="tsc_settings" onclick="efx.showScreen('showConfigurationScreen', true); return false;">Settings</a>
212
+ </div>
213
+ <div id="tsc_maincontent">
214
+ <div id="tsc_messages" class="grid_12"></div>
215
+ <div id="tsc_content" class="clearfix"></div>
216
+ <p id="gpiWidgetFooter"><a href="http://www.globalizationpartners.com/" target="_blank">&copy; 2001-2015 Globalization Partners International. All rights reserved. Trademarks are property of their respective owners.</a></p>
217
+ <p id="tsc_working"> </p>
218
+ <ul id="tsc_status"></ul>
219
+ </div>
220
+ </div>
app/etc/modules/Gpi_Tsc.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Gpi_Tsc>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Adminhtml />
9
+ </depends>
10
+ </Gpi_Tsc>
11
+ </modules>
12
+ </config>
app/locale/en_US/Gpi_Tsc.csv ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ exported, Exported {0} documents
2
+ imported, Imported {0} documents
3
+ invalid_authorization, An invalid authorization token was supplied
4
+ invalid_endpoint, An invalid server endpoint was supplied
5
+ InvalidQuoteID, Invalid quote ID
6
+ Additems, Add items
7
+ By, By
8
+ Cancel, Cancel
9
+ CloseProject, Close Project
10
+ Configure, Configure Translation Services Connector
11
+ CreatePackage, Create package
12
+ CreateQuote, Create quote
13
+ Delete, Delete
14
+ DeletePackage, You are about to delete the package [{{=package.Name}}].\\nAre you sure?
15
+ Endpoint, Endpoint URL
16
+ FormComments, Comments
17
+ FormPackageName, Package Name
18
+ FormQuoteName, Quote Name
19
+ FormSourceLanguage, Source Language
20
+ FormTargetLanguages, Target Languages
21
+ From, From:
22
+ <comment>As in "From: English" (language)</comment>
23
+ FullReport, Full Status Report
24
+ ImportTranslations, Import Translations
25
+ Languages, Languages
26
+ LastModified, Last Modified
27
+ ModifyPackage, Modify Package
28
+ NoPackages, There are no packages to list.
29
+ NoProjects, There are no projects to list.
30
+ NoQuotes, There are no quotes to list.
31
+ Package, Package
32
+ PackageName, Package '{{=quote.Name}}'
33
+ Project, Project
34
+ Projects, Projects
35
+ Quote, Quote
36
+ QuoteName, Quote '{{=quote.Name}}'
37
+ Quotes, Quotes
38
+ RequestAQuote, Request a quote
39
+ SaveConfiguration, Save configuration
40
+ Status, Status
41
+ To, To:
42
+ Token, Authorization Token
43
+ TranslationPackages, Translation packages
44
+ UpdatePackage, Update Package
js/gpi_tsc/Crypto.js ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 
2
+ //function b64Sha1(s){return binb2B64(coreSha1(str2Binb(s),s.length * 8));}
3
+
4
+ ///*
5
+ // * Calculate the SHA-1 of an array of big-endian words, and a bit length
6
+ // */
7
+ //function coreSha1(x, len)
8
+ //{
9
+ // /* append padding */
10
+ // x[len >> 5] |= 0x80 << (24 - len % 32);
11
+ // x[((len + 64 >> 9) << 4) + 15] = len;
12
+
13
+ // var w = Array(80);
14
+ // var a = 1732584193;
15
+ // var b = -271733879;
16
+ // var c = -1732584194;
17
+ // var d = 271733878;
18
+ // var e = -1009589776;
19
+
20
+ // for(var i = 0; i < x.length; i += 16)
21
+ // {
22
+ // var olda = a;
23
+ // var oldb = b;
24
+ // var oldc = c;
25
+ // var oldd = d;
26
+ // var olde = e;
27
+
28
+ // for(var j = 0; j < 80; j++)
29
+ // {
30
+ // if(j < 16) w[j] = x[i + j];
31
+ // else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
32
+ // var t = safeAdd(safeAdd(rol(a, 5), sha1Ft(j, b, c, d)),
33
+ // safeAdd(safeAdd(e, w[j]), sha1Kt(j)));
34
+ // e = d;
35
+ // d = c;
36
+ // c = rol(b, 30);
37
+ // b = a;
38
+ // a = t;
39
+ // }
40
+
41
+ // a = safeAdd(a, olda);
42
+ // b = safeAdd(b, oldb);
43
+ // c = safeAdd(c, oldc);
44
+ // d = safeAdd(d, oldd);
45
+ // e = safeAdd(e, olde);
46
+ // }
47
+ // return [a, b, c, d, e];
48
+
49
+ //}
50
+
51
+ ///*
52
+ // * Perform the appropriate triplet combination function for the current
53
+ // * iteration
54
+ // */
55
+ //function sha1Ft(t, b, c, d)
56
+ //{
57
+ // if(t < 20) return (b & c) | ((~b) & d);
58
+ // if(t < 40) return b ^ c ^ d;
59
+ // if(t < 60) return (b & c) | (b & d) | (c & d);
60
+ // return b ^ c ^ d;
61
+ //}
62
+
63
+ ///*
64
+ // * Determine the appropriate additive constant for the current iteration
65
+ // */
66
+ //function sha1Kt(t)
67
+ //{
68
+ // return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
69
+ // (t < 60) ? -1894007588 : -899497514;
70
+ //}
71
+
72
+ ///*
73
+ // * Add integers, wrapping at 2^32. This uses 16-bit operations internally
74
+ // * to work around bugs in some JS interpreters.
75
+ // */
76
+ //function safeAdd(x, y)
77
+ //{
78
+ // var lsw = (x & 0xFFFF) + (y & 0xFFFF);
79
+ // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
80
+ // return (msw << 16) | (lsw & 0xFFFF);
81
+ //}
82
+
83
+ ///*
84
+ // * Bitwise rotate a 32-bit number to the left.
85
+ // */
86
+ //function rol(num, cnt)
87
+ //{
88
+ // return (num << cnt) | (num >>> (32 - cnt));
89
+ //}
90
+
91
+ ///*
92
+ // * Convert an 8-bit or 16-bit string to an array of big-endian words
93
+ // * In 8-bit function, characters >255 have their hi-byte silently ignored.
94
+ // */
95
+ //function str2Binb(str)
96
+ //{
97
+ // var bin = Array();
98
+ // var mask = (1 << 8) - 1;
99
+ // for(var i = 0; i < str.length * 8; i += 8)
100
+ // bin[i>>5] |= (str.charCodeAt(i / 8) & mask) << (32 - 8 - i%32);
101
+ // return bin;
102
+ //}
103
+
104
+ ///*
105
+ // * Convert an array of big-endian words to a base-64 string
106
+ // */
107
+ //function binb2B64(binarray)
108
+ //{
109
+ // var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
110
+ // var str = "";
111
+ // for(var i = 0; i < binarray.length * 4; i += 3)
112
+ // {
113
+ // var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
114
+ // | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
115
+ // | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
116
+ // for(var j = 0; j < 4; j++)
117
+ // {
118
+ // if(i * 8 + j * 6 > binarray.length * 32) str += "=";
119
+ // else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
120
+ // }
121
+ // }
122
+ // return str;
123
+ //}
js/gpi_tsc/Crypto.min.js ADDED
File without changes
js/gpi_tsc/EcmaScript5.js ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //Ecmascript 5 replacement for old browsers..
2
+ if (!Array.isArray) {
3
+ Array.isArray = function (obj) {
4
+ return Object.prototype.toString.call(obj) == "[object Array]";
5
+ };
6
+ }
7
+
8
+ if (!Array.prototype.forEach) {
9
+ Array.prototype.forEach = function (block, thisObject) {
10
+ var len = this.length >>> 0;
11
+ for (var i = 0; i < len; i++) {
12
+ if (i in this) {
13
+ block.call(thisObject, this[i], i, this);
14
+ }
15
+ }
16
+ };
17
+ }
18
+
19
+ if (!Array.prototype.indexOf) {
20
+ Array.prototype.indexOf = function (searchElement) {
21
+ "use strict";
22
+ if (null == this) {
23
+ throw new TypeError();
24
+ }
25
+ var t = Object(this);
26
+ var len = t.length >>> 0;
27
+ if (0 === len) {
28
+ return -1;
29
+ }
30
+ var n = 0;
31
+ if (arguments.length > 0) {
32
+ n = Number(arguments[1]);
33
+ if (n != n) {
34
+ n = 0;
35
+ } else if (n != 0 && n != Infinity && n != -Infinity) {
36
+ n = (n > 0 || -1) * Math.floor(Math.abs(n));
37
+ }
38
+ }
39
+ if (n >= len) {
40
+ return -1;
41
+ }
42
+ var k = n >= 0 ? n : Math.max((len - Math.abs(n), 0));
43
+ for (; k < len; k++) {
44
+ if (k in t && t[k] === searchElement) {
45
+ return k;
46
+ }
47
+ }
48
+ return -1;
49
+ };
50
+ }
51
+
52
+ if (!Object.keys) {
53
+ Object.keys = function (object) {
54
+ var keys = [];
55
+ if (!object) return keys;
56
+
57
+ for (var name in object) {
58
+ if (Object.prototype.hasOwnProperty.call(object, name)) {
59
+ keys.push(name);
60
+ }
61
+ }
62
+ return keys;
63
+ };
64
+ }
65
+
66
+ if (!Date.prototype.toISOString) {
67
+ Date.prototype.toISOString = function () {
68
+ return (
69
+ this.getFullYear() + "-" +
70
+ (this.getMonth() + 1) + "-" +
71
+ this.getDate() + "T" +
72
+ this.getHours() + ":" +
73
+ this.getMinutes() + ":" +
74
+ this.getSeconds() + "Z"
75
+ );
76
+ };
77
+ }
78
+
79
+ if (!Date.prototype.toJSON) {
80
+ Date.prototype.toJSON = function () {
81
+ if (typeof this.toISOString != "function")
82
+ throw new TypeError();
83
+ return this.toISOString();
84
+ };
85
+ }
86
+
87
+ if (!String.prototype.trim) {
88
+ var trimBeginRegexp = /^\s\s*/,
89
+ trimEndRegexp = /\s\s*$/;
90
+ String.prototype.trim = function () {
91
+ return String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, '');
92
+ };
93
+ }
js/gpi_tsc/EcmaScript5.min.js ADDED
@@ -0,0 +1 @@
 
1
+ if(Array.isArray||(Array.isArray=function(n){return Object.prototype.toString.call(n)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(n,t){for(var r=this.length>>>0,i=0;i<r;i++)i in this&&n.call(t,this[i],i,this)}),Array.prototype.indexOf||(Array.prototype.indexOf=function(n){"use strict";var u,r,t,i;if(null==this)throw new TypeError;if((u=Object(this),r=u.length>>>0,0===r)||(t=0,arguments.length>0&&(t=Number(arguments[1]),t!=t?t=0:t!=0&&t!=Infinity&&t!=-Infinity&&(t=(t>0||-1)*Math.floor(Math.abs(t)))),t>=r))return-1;for(i=t>=0?t:Math.max((r-Math.abs(t),0));i<r;i++)if(i in u&&u[i]===n)return i;return-1}),Object.keys||(Object.keys=function(n){var i=[],t;if(!n)return i;for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&i.push(t);return i}),Date.prototype.toISOString||(Date.prototype.toISOString=function(){return this.getFullYear()+"-"+(this.getMonth()+1)+"-"+this.getDate()+"T"+this.getHours()+":"+this.getMinutes()+":"+this.getSeconds()+"Z"}),Date.prototype.toJSON||(Date.prototype.toJSON=function(){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),!String.prototype.trim){var trimBeginRegexp=/^\s\s*/,trimEndRegexp=/\s\s*$/;String.prototype.trim=function(){return String(this).replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}};
js/gpi_tsc/JSON.js ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var JSON = JSON || { };
2
+ (function() {
3
+ "use strict";
4
+ if (typeof String.prototype.toJSON !== 'function') {
5
+ String.prototype.toJSON =
6
+ Number.prototype.toJSON =
7
+ Boolean.prototype.toJSON = function() {
8
+ return this.valueOf();
9
+ };
10
+ }
11
+
12
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g ,
13
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g ,
14
+ gap,
15
+ indent,
16
+ meta = {
17
+ // table of character substitutions
18
+ '\b': '\\b',
19
+ '\t': '\\t',
20
+ '\n': '\\n',
21
+ '\f': '\\f',
22
+ '\r': '\\r',
23
+ '"': '\\"',
24
+ '\\': '\\\\'
25
+ },
26
+ rep;
27
+
28
+
29
+ function quote(string) {
30
+
31
+ // If the string contains no control characters, no quote characters, and no
32
+ // backslash characters, then we can safely slap some quotes around it.
33
+ // Otherwise we must also replace the offending characters with safe escape
34
+ // sequences.
35
+
36
+ escapable.lastIndex = 0;
37
+ return escapable.test(string) ? '"' + string.replace(escapable, function(a) {
38
+ var c = meta[a];
39
+ return typeof c === 'string' ? c :
40
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
41
+ }) + '"' : '"' + string + '"';
42
+ }
43
+
44
+
45
+ function str(key, holder) {
46
+
47
+ // Produce a string from holder[key].
48
+
49
+ var i, // The loop counter.
50
+ k, // The member key.
51
+ v, // The member value.
52
+ length,
53
+ mind = gap,
54
+ partial,
55
+ value = holder[key];
56
+
57
+ // If the value has a toJSON method, call it to obtain a replacement value.
58
+
59
+ if (value && typeof value === 'object' &&
60
+ typeof value.toJSON === 'function') {
61
+ value = value.toJSON(key);
62
+ }
63
+
64
+ // If we were called with a replacer function, then call the replacer to
65
+ // obtain a replacement value.
66
+
67
+ if (typeof rep === 'function') {
68
+ value = rep.call(holder, key, value);
69
+ }
70
+
71
+ // What happens next depends on the value's type.
72
+
73
+ switch (typeof value) {
74
+ case 'string':
75
+ return quote(value);
76
+ case 'number':
77
+ // JSON numbers must be finite. Encode non-finite numbers as null.
78
+
79
+ return isFinite(value) ? String(value) : 'null';
80
+ case 'boolean':
81
+ case 'null':
82
+ // If the value is a boolean or null, convert it to a string. Note:
83
+ // typeof null does not produce 'null'. The case is included here in
84
+ // the remote chance that this gets fixed someday.
85
+
86
+ return String(value);
87
+ // If the type is 'object', we might be dealing with an object or an array or
88
+ // null.
89
+ case 'object':
90
+ // Due to a specification blunder in ECMAScript, typeof null is 'object',
91
+ // so watch out for that case.
92
+
93
+ if (!value) {
94
+ return 'null';
95
+ }
96
+
97
+ // Make an array to hold the partial results of stringifying this object value.
98
+
99
+ gap += indent;
100
+ partial = [];
101
+
102
+ // Is the value an array?
103
+
104
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
105
+
106
+ // The value is an array. Stringify every element. Use null as a placeholder
107
+ // for non-JSON values.
108
+
109
+ length = value.length;
110
+ for (i = 0; i < length; i += 1) {
111
+ partial[i] = str(i, value) || 'null';
112
+ }
113
+
114
+ // Join all of the elements together, separated with commas, and wrap them in
115
+ // brackets.
116
+
117
+ v = partial.length === 0 ? '[]' : gap ?
118
+ '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
119
+ '[' + partial.join(',') + ']';
120
+ gap = mind;
121
+ return v;
122
+ }
123
+
124
+ // If the replacer is an array, use it to select the members to be stringified.
125
+
126
+ if (rep && typeof rep === 'object') {
127
+ length = rep.length;
128
+ for (i = 0; i < length; i += 1) {
129
+ if (typeof rep[i] === 'string') {
130
+ k = rep[i];
131
+ v = str(k, value);
132
+ if (v) {
133
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
134
+ }
135
+ }
136
+ }
137
+ } else {
138
+
139
+ // Otherwise, iterate through all of the keys in the object.
140
+
141
+ for (k in value) {
142
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
143
+ v = str(k, value);
144
+ if (v) {
145
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
146
+ }
147
+ }
148
+ }
149
+ }
150
+
151
+ // Join all of the member texts together, separated with commas,
152
+ // and wrap them in braces.
153
+
154
+ v = partial.length === 0 ? '{}' : gap ?
155
+ '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
156
+ '{' + partial.join(',') + '}';
157
+ gap = mind;
158
+ return v;
159
+ }
160
+
161
+ return quote(value);
162
+ }
163
+
164
+ // If the JSON object does not yet have a stringify method, give it one.
165
+
166
+ if (typeof JSON.stringify !== 'function') {
167
+ JSON.stringify = function(value, replacer, space) {
168
+
169
+ // The stringify method takes a value and an optional replacer, and an optional
170
+ // space parameter, and returns a JSON text. The replacer can be a function
171
+ // that can replace values, or an array of strings that will select the keys.
172
+ // A default replacer method can be provided. Use of the space parameter can
173
+ // produce text that is more easily readable.
174
+
175
+ var i;
176
+ gap = '';
177
+ indent = '';
178
+
179
+ // If the space parameter is a number, make an indent string containing that
180
+ // many spaces.
181
+
182
+ if (typeof space === 'number') {
183
+ for (i = 0; i < space; i += 1) {
184
+ indent += ' ';
185
+ }
186
+
187
+ // If the space parameter is a string, it will be used as the indent string.
188
+
189
+ } else if (typeof space === 'string') {
190
+ indent = space;
191
+ }
192
+
193
+ // If there is a replacer, it must be a function or an array.
194
+ // Otherwise, throw an error.
195
+
196
+ rep = replacer;
197
+ if (replacer && typeof replacer !== 'function' &&
198
+ (typeof replacer !== 'object' ||
199
+ typeof replacer.length !== 'number')) {
200
+ throw new Error('JSON.stringify');
201
+ }
202
+
203
+ // Make a fake root object containing our value under the key of ''.
204
+ // Return the result of stringifying the value.
205
+
206
+ return str('', { '': value });
207
+ };
208
+ }
209
+
210
+
211
+ // If the JSON object does not yet have a parse method, give it one.
212
+
213
+ if (typeof JSON.parse !== 'function') {
214
+ JSON.parse = function(text, reviver) {
215
+
216
+ // The parse method takes a text and an optional reviver function, and returns
217
+ // a JavaScript value if the text is a valid JSON text.
218
+
219
+ var j;
220
+
221
+ function walk(holder, key) {
222
+
223
+ // The walk method is used to recursively walk the resulting structure so
224
+ // that modifications can be made.
225
+
226
+ var k, v, value = holder[key];
227
+ if (value && typeof value === 'object') {
228
+ for (k in value) {
229
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
230
+ v = walk(value, k);
231
+ if (v !== undefined) {
232
+ value[k] = v;
233
+ } else {
234
+ delete value[k];
235
+ }
236
+ }
237
+ }
238
+ }
239
+ return reviver.call(holder, key, value);
240
+ }
241
+
242
+
243
+ // Parsing happens in four stages. In the first stage, we replace certain
244
+ // Unicode characters with escape sequences. JavaScript handles many characters
245
+ // incorrectly, either silently deleting them, or treating them as line endings.
246
+
247
+ text = String(text);
248
+ cx.lastIndex = 0;
249
+ if (cx.test(text)) {
250
+ text = text.replace(cx, function(a) {
251
+ return '\\u' +
252
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
253
+ });
254
+ }
255
+
256
+ if ( /^[\],:{}\s]*$/
257
+ .test(text.replace( /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g , '@')
258
+ .replace( /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g , ']')
259
+ .replace( /(?:^|:|,)(?:\s*\[)+/g , ''))) {
260
+
261
+
262
+ j = eval('(' + text + ')');
263
+
264
+ return typeof reviver === 'function' ?
265
+ walk({ '': j }, '') : j;
266
+ }
267
+
268
+ throw new SyntaxError('JSON.parse');
269
+ };
270
+ }
271
+ } ());
js/gpi_tsc/JSON.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var JSON=JSON||{};(function(){"use strict";function i(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=o[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(f,e){var h,l,c,a,v=n,s,o=e[f];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(f)),typeof t=="function"&&(o=t.call(e,f,o));switch(typeof o){case"string":return i(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,s=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,h=0;h<a;h+=1)s[h]=r(h,o)||"null";return c=s.length===0?"[]":n?"[\n"+n+s.join(",\n"+n)+"\n"+v+"]":"["+s.join(",")+"]",n=v,c}if(t&&typeof t=="object")for(a=t.length,h=0;h<a;h+=1)typeof t[h]=="string"&&(l=t[h],c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));else for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));return c=s.length===0?"{}":n?"{\n"+n+s.join(",\n"+n)+"\n"+v+"}":"{"+s.join(",")+"}",n=v,c}return i(o)}typeof String.prototype.toJSON!="function"&&(String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",u="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return r("",{"":i})}),typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;if(n=String(n),f.lastIndex=0,f.test(n)&&(n=n.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})})();
js/gpi_tsc/JSON.min.js.mine ADDED
@@ -0,0 +1 @@
 
1
+ var JSON=JSON||{};(function(){"use strict";function i(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=o[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(f,e){var h,l,c,a,v=n,s,o=e[f];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(f)),typeof t=="function"&&(o=t.call(e,f,o));switch(typeof o){case"string":return i(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,s=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,h=0;h<a;h+=1)s[h]=r(h,o)||"null";return c=s.length===0?"[]":n?"[\n"+n+s.join(",\n"+n)+"\n"+v+"]":"["+s.join(",")+"]",n=v,c}if(t&&typeof t=="object")for(a=t.length,h=0;h<a;h+=1)typeof t[h]=="string"&&(l=t[h],c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));else for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));return c=s.length===0?"{}":n?"{\n"+n+s.join(",\n"+n)+"\n"+v+"}":"{"+s.join(",")+"}",n=v,c}return i(o)}typeof String.prototype.toJSON!="function"&&(String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",u="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return r("",{"":i})}),typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;if(n=String(n),f.lastIndex=0,f.test(n)&&(n=n.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})})();
js/gpi_tsc/JSON.min.js.r118 ADDED
@@ -0,0 +1 @@
 
1
+ var JSON;JSON||(JSON={}),function(){"use strict";function i(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=o[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(f,e){var h,l,c,a,v=n,s,o=e[f];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(f)),typeof t=="function"&&(o=t.call(e,f,o));switch(typeof o){case"string":return i(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";n+=u,s=[];if(Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,h=0;h<a;h+=1)s[h]=r(h,o)||"null";return c=s.length===0?"[]":n?"[\n"+n+s.join(",\n"+n)+"\n"+v+"]":"["+s.join(",")+"]",n=v,c}if(t&&typeof t=="object")for(a=t.length,h=0;h<a;h+=1)typeof t[h]=="string"&&(l=t[h],c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));else for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));return c=s.length===0?"{}":n?"{\n"+n+s.join(",\n"+n)+"\n"+v+"}":"{"+s.join(",")+"}",n=v,c}return i(o)}typeof String.prototype.toJSON!="function"&&(String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;n="",u="";if(typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);t=f;if(f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return r("",{"":i})}),typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;n=String(n),f.lastIndex=0,f.test(n)&&(n=n.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})}();
js/gpi_tsc/JSON.min.js.r175 ADDED
@@ -0,0 +1 @@
 
1
+ var JSON;JSON||(JSON={}),function(){"use strict";function i(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=o[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(f,e){var h,l,c,a,v=n,s,o=e[f];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(f)),typeof t=="function"&&(o=t.call(e,f,o));switch(typeof o){case"string":return i(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,s=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,h=0;h<a;h+=1)s[h]=r(h,o)||"null";return c=s.length===0?"[]":n?"[\n"+n+s.join(",\n"+n)+"\n"+v+"]":"["+s.join(",")+"]",n=v,c}if(t&&typeof t=="object")for(a=t.length,h=0;h<a;h+=1)typeof t[h]=="string"&&(l=t[h],c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));else for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(c=r(l,o),c&&s.push(i(l)+(n?": ":":")+c));return c=s.length===0?"{}":n?"{\n"+n+s.join(",\n"+n)+"\n"+v+"}":"{"+s.join(",")+"}",n=v,c}return i(o)}typeof String.prototype.toJSON!="function"&&(String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",u="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return r("",{"":i})}),typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;if(n=String(n),f.lastIndex=0,f.test(n)&&(n=n.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})}();
js/gpi_tsc/langs/en.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ efx.addLangResource({
2
+ formError: "There were some errors while checking the form:"
3
+ });
js/gpi_tsc/langs/en.min.js ADDED
@@ -0,0 +1 @@
 
1
+ efx.addLangResource({formError:"There were some errors while checking the form:"});
js/gpi_tsc/tsc.js ADDED
@@ -0,0 +1,1587 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !function (environment) {
2
+ /**
3
+ * load asked file
4
+ * @param files array of files to be loaded
5
+ * @param callback general callback when all files are loaded
6
+ */
7
+ environment['include'] = function(files, callback) {
8
+ var doc = document, body = "body", emptyFn = function() { },
9
+ cache = { }, scriptCounter = 0, time = 1;
10
+
11
+ !files.pop && (files = [files]);
12
+ callback = callback || emptyFn;
13
+
14
+ /**
15
+ * create a script node with asked file
16
+ * @param file the file
17
+ * @param fileCallback the callback for the current script
18
+ * @param obj the object loaded in file
19
+ * @param script placeholder for the script element
20
+ * @return void
21
+ */
22
+ function create(file, fileCallback, obj, script, loaded) {
23
+ script = doc.createElement("script");
24
+ scriptCounter++;
25
+
26
+ script.onload = script.onreadystatechange = function(e, i) {
27
+ i = 0, e = this.readyState || e.type;
28
+
29
+ //seach the loaded, load or complete expression
30
+ if (!e.search("load|complete") && !loaded) {
31
+ obj ?
32
+ //wait the javascript to be parsed to controll if object exists
33
+ (file = function() {
34
+ environment[obj] ? countFiles(fileCallback) : setTimeout(file, time);
35
+ ++i > time && (file = emptyFn);
36
+ })() :
37
+ countFiles(fileCallback);
38
+
39
+ loaded = time;
40
+ }
41
+ };
42
+
43
+ script.async = !0;
44
+ script.src = file;
45
+
46
+ doc[body].appendChild(script);
47
+ }
48
+
49
+ /**
50
+ * count files loaded and launch callback
51
+ * @param fileCallback callback of the current file
52
+ * @return void
53
+ */
54
+ function countFiles(fileCallback) {
55
+ fileCallback();
56
+ !--scriptCounter && callback();
57
+ }
58
+
59
+ /**
60
+ * parse sent script and load them
61
+ * @param i placeholder for the loops
62
+ * @param script placeholder for all scripts
63
+ * @param obj placeholder for the aksed object
64
+ * @param callbackFile placholder for the callback function
65
+ * @return void
66
+ * @return void
67
+ */
68
+ !function include(i, script, obj, callbackFile) {
69
+ if (!doc[body]) return setTimeout(include, time);
70
+
71
+ script = doc.getElementsByTagName("script");
72
+ callbackFile = emptyFn;
73
+
74
+ for (i in script) script[i].src && (cache[script[i].src] = i);
75
+
76
+ for (i = files.length; i--;)
77
+ files[i].pop ?
78
+ (script = files[i][0], callbackFile = files[i][1], obj = files[i][2]) :
79
+ (script = files[i]),
80
+ cache[script] ?
81
+ callbackFile() :
82
+ create(script, callbackFile, obj);
83
+
84
+ !scriptCounter && callback();
85
+ }();
86
+ };
87
+ } (this);
88
+
89
+ function trace(pVal) {
90
+ if (window.opera) {
91
+ opera.postError(pVal);
92
+
93
+ } else if (window.debugService) {
94
+ if (typeof pVal === "object") {
95
+ window.debugService.inspect("trace", pVal);
96
+
97
+ } else {
98
+ window.debugService.trace(pVal);
99
+ }
100
+
101
+ } else if (window.console) {
102
+ if (console.dir && typeof pVal === "object") {
103
+ console.dir(pVal);
104
+
105
+ } else {
106
+ console.log(pVal);
107
+ }
108
+
109
+ } else {
110
+ alert(pVal);
111
+ }
112
+ }
113
+
114
+ window.Date.prototype.f = function (format) {
115
+ format = format + "";
116
+ var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
117
+ dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
118
+ lz = function (x) { return (x < 0 || x > 9 ? "" : "0") + x; },
119
+ date = this,
120
+ result = "",
121
+ iFormat = 0,
122
+ y = date.getYear() + "",
123
+ M = date.getMonth() + 1,
124
+ d = date.getDate(),
125
+ E = date.getDay(),
126
+ H = date.getHours(),
127
+ m = date.getMinutes(),
128
+ s = date.getSeconds(),
129
+ value = new Object();
130
+ // Convert real date parts into formatted versions
131
+ if (y.length < 4) { y = "" + (y - 0 + 1900); }
132
+ value["y"] = "" + y;
133
+ value["yyyy"] = y;
134
+ value["yy"] = y.substr(2, 4);
135
+ value["M"] = M;
136
+ value["MM"] = lz(M);
137
+ value["MMM"] = monthNames[M - 1];
138
+ value["NNN"] = monthNames[M - 1].substr(0, 3);
139
+ value["N"] = monthNames[M - 1].substr(0, 1);
140
+ value["d"] = d;
141
+ value["dd"] = lz(d);
142
+ value["e"] = dayNames[E].substr(0, 1);
143
+ value["ee"] = dayNames[E].substr(0, 2);
144
+ value["E"] = dayNames[E].substr(0, 3);
145
+ value["EE"] = dayNames[E];
146
+ value["H"] = H;
147
+ value["HH"] = lz(H);
148
+ if (H == 0) { value["h"] = 12; }
149
+ else if (H > 12) { value["h"] = H - 12; }
150
+ else { value["h"] = H; }
151
+ value["hh"] = lz(value["h"]);
152
+ if (H > 11) { value["K"] = H - 12; } else { value["K"] = H; }
153
+ value["k"] = H + 1;
154
+ value["KK"] = lz(value["K"]);
155
+ value["kk"] = lz(value["k"]);
156
+ if (H > 11) { value["a"] = "PM"; }
157
+ else { value["a"] = "AM"; }
158
+ value["m"] = m;
159
+ value["mm"] = lz(m);
160
+ value["s"] = s;
161
+ value["ss"] = lz(s);
162
+ while (iFormat < format.length) {
163
+ var c = format.charAt(iFormat), token = "";
164
+ while ((format.charAt(iFormat) == c) && (iFormat < format.length)) {
165
+ token += format.charAt(iFormat++);
166
+ }
167
+ if (value[token] != null) { result = result + value[token]; }
168
+ else { result = result + token; }
169
+ }
170
+ return result;
171
+ };
172
+
173
+ (function(pWindow) {
174
+ "use strict";
175
+ if (!pWindow.efx) {
176
+ pWindow.efx = { };
177
+ }
178
+
179
+ if (!String.isNullOrEmpty) {
180
+ String.isNullOrEmpty = function(str) {
181
+ if (!str) return true;
182
+ return (str.toString()).replace( /^\s*|\s*$/g , '') === '';
183
+ };
184
+ }
185
+
186
+ if (!String.format) {
187
+ var compositeFormattingRegExp = new RegExp( /{(\d+)}|{(\d+):([^\r\n{}]+)}/g );
188
+
189
+ String.format = function(pSource, pParams) {
190
+ if (!(pParams instanceof Array)) pParams = Array.prototype.slice.call(arguments, 1);
191
+ var fmtArgs, cArg, aFmt, theString, target = pSource;
192
+
193
+ while ((fmtArgs = compositeFormattingRegExp.exec(pSource)) != null) {
194
+ cArg = pParams[parseInt(fmtArgs[1] || fmtArgs[2], 10)];
195
+ aFmt = fmtArgs[3] || "";
196
+
197
+ if (isNull(cArg)) {
198
+ theString = "";
199
+
200
+ } else {
201
+ if (cArg.toFormattedString) {
202
+ theString = cArg.toFormattedString(aFmt);
203
+
204
+ } else {
205
+ if (cArg.format) {
206
+ theString = cArg.format(aFmt);
207
+
208
+ } else {
209
+ theString = cArg.toString();
210
+ }
211
+ }
212
+ }
213
+
214
+ target = target.split(fmtArgs[0]).join(theString);
215
+ }
216
+ ;
217
+
218
+ return target;
219
+ };
220
+ }
221
+
222
+ //var rpcUrl = document.location.pathname.replace('index/key/','post/key/'),
223
+ var rpcUrl = "",
224
+ cache = { },
225
+ hasClassRxCache = { },
226
+ removeClassRxCache = { },
227
+ UNDEFINED,
228
+ loaded,
229
+ inited,
230
+ needsInit,
231
+ configurationLoaded,
232
+ configuration = { },
233
+ langResources = { },
234
+ mainDrawArea = function() {
235
+ return document.getElementById("tsc_content");
236
+ },
237
+ localize = function(key) {
238
+ return langResources[key];
239
+ },
240
+ isNull = function(pObject) {
241
+ if (pObject === UNDEFINED) return true;
242
+ if (pObject === null) return true;
243
+ return false;
244
+ },
245
+ getParent = function(node, parentName) {
246
+ ///<param name="parentName" type="String" />
247
+ parentName = parentName.toUpperCase();
248
+ while (node && node.parentNode) {
249
+ node = node.parentNode;
250
+ if (node.nodeType === 1 && node.nodeName.toUpperCase() === parentName)
251
+ return node;
252
+ }
253
+
254
+ return null;
255
+ },
256
+ hasClass = function(node, className) {
257
+ if (!hasClassRxCache[className]) {
258
+ hasClassRxCache[className] = new RegExp('(^|\\s)' + className + '(\\s|$)');
259
+ }
260
+
261
+ return (hasClassRxCache[className].test(node.className));
262
+ },
263
+ addClass = function(node, className) {
264
+ if (!hasClass(node, className))
265
+ node.className = ((node.className || '') == '' ? '' : node.className + ' ') + className;
266
+ },
267
+ removeClass = function(node, className) {
268
+ if (!removeClassRxCache[className]) {
269
+ removeClassRxCache[className] = new RegExp('(^|\\s)' + className);
270
+ }
271
+
272
+ if (String.isNullOrEmpty(className)) return;
273
+ node.className = node.className.replace(removeClassRxCache[className], '').replace( /^\s+|(\s)\s+/g , '$1');
274
+ },
275
+ toogleVisibility = function(node, isVisible) {
276
+ node.style.display = isVisible ? "block" : "none";
277
+ },
278
+ removeNode = function(node) {
279
+ node.parentNode.removeChild(node);
280
+ },
281
+ getElementSize = function(node, includeBorderAndPadding) {
282
+ return includeBorderAndPadding ?
283
+ //get a node's dimensions (including padding and border)
284
+ { w: node.offsetWidth, h: node.offsetHeight } :
285
+ //get dimensions without border but includes padding
286
+ { w: node.clientWidth, h: node.clientHeight };
287
+ },
288
+ initialize = function() {
289
+ if (!needsInit) return;
290
+ if (inited || typeof loaded === 'undefined' || !loaded || !configurationLoaded) return;
291
+ inited = true;
292
+ efx.showScreen("listQuotesScreen");
293
+ },
294
+ oldResizeEvent,
295
+ resizeHooked,
296
+ addResizeEvent = function(method) {
297
+ if (resizeHooked) throw new Error("Resize event already hooked");
298
+
299
+ resizeHooked = true;
300
+ oldResizeEvent = pWindow.onresize;
301
+
302
+ pWindow.onresize = fixEvent(pWindow, function(e) {
303
+ method();
304
+ oldResizeEvent && oldResizeEvent(e);
305
+ });
306
+ },
307
+ removeResizeEvent = function() {
308
+ if (resizeHooked) {
309
+ resizeHooked = false;
310
+ pWindow.onresize = oldResizeEvent;
311
+ }
312
+ },
313
+ eventNodes = "preventDefault stopPropagation type altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
314
+ cloneEvent = function(pEvent) {
315
+ var o = { };
316
+ eventNodes.forEach(function(item) {
317
+ o[item] = pEvent[item];
318
+ });
319
+
320
+ o.originalEvent = pEvent;
321
+ return o;
322
+ },
323
+ standardEventFix = function(node, delegate) {
324
+ return function(event) {
325
+ event = event || window.event;
326
+ //make a copy of the event, so we can overwrite some props...
327
+ var e = event.$cloned ? event : cloneEvent(event),
328
+ target = event.target, t = event.type;
329
+ e.$cloned = true;
330
+ e.currentTarget = node;
331
+
332
+ e.stop = function() {
333
+ event.stopPropagation();
334
+ event.preventDefault();
335
+ };
336
+
337
+ if (t.match( /(click|mouse|menu)/i )) {
338
+ if (isNull(e.pageX) && !isNull(e.clientX)) {
339
+ var doc = document.documentElement, body = document.body;
340
+ e.pageX = e.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
341
+ e.pageY = e.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
342
+ }
343
+
344
+ if (t.match( /DOMMouseScroll|mousewheel/ )) {
345
+ e.wheelDelta = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3;
346
+ }
347
+ }
348
+
349
+ while (target && target.nodeType == 3) target = target.parentNode;
350
+ e.target = target;
351
+ delegate(e, node);
352
+ };
353
+ },
354
+ ieEventFix = function(node, delegate) {
355
+ var d = standardEventFix(node, delegate);
356
+ return function(e) {
357
+ var event = window.event;
358
+ // map .target to .srcElement
359
+ event.target = event.srcElement;
360
+ event.preventDefault = function() { event.returnValue = false; };
361
+ event.stopPropagation = function() { event.cancelBubble = true; };
362
+ d(event);
363
+
364
+ // null out these properties to prevent memory leaks
365
+ event.target = event.relatedTarget = event.preventDefault = event.stopPropagation = event = null;
366
+ };
367
+ },
368
+ fixEvent = document.addEventListener ? standardEventFix : ieEventFix,
369
+ addOnClick = function(node, delegate) {
370
+ node.onclick = fixEvent(node, delegate);
371
+ },
372
+ getAttr = function(node, attr) {
373
+ return node.getAttribute(attr) || (node.attributes[attr] ? node.attributes[attr].nodeValue : null);
374
+ },
375
+ getFormElementType = function(node) {
376
+ var n = node.nodeName.toLowerCase();
377
+ switch (n) {
378
+ case "textarea":
379
+ return n;
380
+ case "select":
381
+ return String.isNullOrEmpty(getAttr(node, "multiple")) ? n : "select-multiple";
382
+ case "input":
383
+ return getAttr(node, "type");
384
+ }
385
+
386
+ return n;
387
+ },
388
+ getValue = function(node, asArray) {
389
+ var ops = [], si, idx = 0, value, n, g = [], nt = getFormElementType(node);
390
+
391
+ n = node.name || "";
392
+ if (n !== "") g = getArguments(document.getElementsByName(n));
393
+
394
+ switch (nt) {
395
+ case 'select':
396
+ si = node.options[node.selectedIndex];
397
+ value = si.value || si.text;
398
+ break;
399
+ case 'select-multiple':
400
+ value = [];
401
+ while ((si = node.selectedIndex) !== -1) {
402
+ (ops[ops.length] = node.options[si]).selected = false;
403
+ value[value.length] = si;
404
+ }
405
+
406
+ ops.forEach(function(option) { option.selected = true; });
407
+ return value;
408
+ case 'checkbox':
409
+ value = [];
410
+
411
+ g.forEach(function(option) {
412
+ if (option.checked || option.selected) {
413
+ ops[ops.length] = option;
414
+ value[value.length] = option.value;
415
+ }
416
+ }
417
+ );
418
+
419
+ return value;
420
+ case 'radio':
421
+ for (var l = g.length; idx < l; ++idx) {
422
+ si = g[idx++];
423
+ if (si.checked || si.selected) {
424
+ value = si.value;
425
+ break;
426
+ }
427
+ }
428
+ ;
429
+ break;
430
+ default:
431
+ value = node.value;
432
+ }
433
+
434
+ return asArray ? [value] : value;
435
+ },
436
+ drawLoading = function(parentUl) {
437
+ var b = document.createElement("b");
438
+ b.className = "loading";
439
+ b.appendChild(document.createTextNode("Loading..."));
440
+ parentUl.appendChild(b);
441
+ return b;
442
+ },
443
+ createTreeNode = function(oldNode) {
444
+ return {
445
+ "ID": oldNode.ID,
446
+ "ContentType": oldNode.ContentType,
447
+ "Selected": oldNode.Selected,
448
+ "Name": oldNode.Name,
449
+ "LastModificationDate": oldNode.LastModificationDate
450
+ };
451
+ },
452
+ isOptionEnabled = function(option) {
453
+ if (!option) return 0;
454
+ if (option.Selected) return 2;
455
+
456
+ var children = option.Children, keys = children && Object.keys(children);
457
+ if (!keys) return 0;
458
+ for (var i = 0; i < keys.length; ++i) {
459
+ if (isOptionEnabled(children[keys[i]]) != 0) return 1;
460
+ }
461
+
462
+ return 0;
463
+ },
464
+ dictionaryToTree = function(dictionary) {
465
+ if (!dictionary || !dictionary.ID) return null;
466
+
467
+ var children = dictionary.Children,
468
+ newChildren = [],
469
+ node = createTreeNode(dictionary);
470
+
471
+ if (dictionary.Selected) return node;
472
+
473
+ if (isOptionEnabled(dictionary) == 1 && children) {
474
+ Object.keys(children).forEach(function(key) {
475
+ var val = children[key];
476
+ var entry = dictionaryToTree(val);
477
+ val && entry && (newChildren[newChildren.length] = entry);
478
+ });
479
+
480
+ newChildren.length && (node.Children = newChildren);
481
+ return node;
482
+ }
483
+
484
+ return null;
485
+ },
486
+ treeToDictionary = function(tree) {
487
+ if (!tree || !tree.ID) return null;
488
+ var i, item,
489
+ children = tree.Children,
490
+ newChildren = { },
491
+ node = createTreeNode(tree);
492
+
493
+ if (children) {
494
+ for (i = 0; i < children.length; ++i) {
495
+ item = children[i];
496
+ newChildren[item.ID] = treeToDictionary(item);
497
+ }
498
+
499
+ i && (node.Children = newChildren);
500
+ }
501
+
502
+ return node;
503
+ },
504
+ createEmptyTreeNode = function(id, type, name) {
505
+ return {
506
+ "ID": id,
507
+ "ContentType": type || "Other",
508
+ "Selected": false,
509
+ "Name": name || "",
510
+ "Children": { },
511
+ "LastModificationDate": new Date()
512
+ };
513
+ },
514
+ HtmlOptions = function(drawInto, optionsID, initialOptionsState, sourceLanguage) {
515
+ initialOptionsState = initialOptionsState || createEmptyTreeNode(optionsID);
516
+ var loading = drawLoading(drawInto),
517
+ optionsName = "tsc_optionsId_" + optionsID,
518
+ e = new RPC(rpcUrl,
519
+ function(data) {
520
+ data = JSON.parse(data);
521
+ removeNode(loading);
522
+ //ID, Name, ContentType: Folder/Content/Mixed/File
523
+ var ul = document.createElement("ul");
524
+ ul.setAttribute("id", optionsName);
525
+ addClass(ul, "tsc_options");
526
+
527
+ data.forEach(function(nodeItem) {
528
+ var li = document.createElement("li"),
529
+ label = document.createElement("label"),
530
+ span = document.createElement("span"),
531
+ checkbox = document.createElement("input"),
532
+ ios = initialOptionsState.Children[nodeItem.ID];
533
+
534
+ //cbID = optionsID + nodeItem.ID
535
+
536
+ label.setAttribute("unselectable", "on");
537
+ checkbox.setAttribute("type", "checkbox");
538
+ checkbox.setAttribute("name", "tsc_options_" + optionsID);
539
+ checkbox.setAttribute("value", nodeItem.ID);
540
+ checkbox.checked = ios && ios.Selected;
541
+
542
+ label.appendChild(checkbox);
543
+ label.appendChild(span);
544
+ span.appendChild(document.createTextNode(nodeItem.Name));
545
+ li.appendChild(label);
546
+ ul.appendChild(li);
547
+ });
548
+
549
+ drawInto.appendChild(ul);
550
+ },
551
+ function(errorMessage) {
552
+ createMessage(String.format("Failed to retrieve options. {0}", errorMessage), "error");
553
+ }
554
+ );
555
+
556
+ e.execute("GetChildren", optionsID, sourceLanguage, optionsID);
557
+
558
+ this.getSelected = function() {
559
+ var tree = document.getElementById(optionsName);
560
+ if (tree) {
561
+ var inputs = getArguments(tree.getElementsByTagName("input"));
562
+ if (inputs && inputs.length) {
563
+ inputs.forEach(function(input) {
564
+ var id = getAttr(input, "value");
565
+ if (input.checked) {
566
+ var t = (initialOptionsState.Children[id] || (initialOptionsState.Children[id] = createEmptyTreeNode(id)));
567
+ t.Selected = true;
568
+ t.LastModificationDate = new Date();
569
+
570
+ } else {
571
+ initialOptionsState.Children[id] = null;
572
+ }
573
+ });
574
+ }
575
+
576
+ return dictionaryToTree(initialOptionsState);
577
+ }
578
+
579
+ return false;
580
+ };
581
+ },
582
+ HtmlTree = function(drawInto, treeID, initialTreeState, sourceLanguage) {
583
+ initialTreeState = initialTreeState || createEmptyTreeNode(treeID);
584
+
585
+ var parents = { },
586
+ setCheckboxState = function(node, state) {
587
+ var startNode = findStartNode(node.value);
588
+ startNode.LastModificationDate = new Date();
589
+
590
+ if (node.nextSibling) {
591
+ node.nextSibling.className = 'tsc_checkstate' + state;
592
+ }
593
+
594
+ switch (state) {
595
+ case 0:
596
+ //not checked
597
+ node.removeAttribute("disabled");
598
+ startNode.Selected = node.checked = false;
599
+ return;
600
+ case 1:
601
+ //grayed out
602
+ node.setAttribute("disabled", "disabled");
603
+ startNode.Selected = !(node.checked = true);
604
+ return;
605
+ case 2:
606
+ //checked
607
+ node.removeAttribute("disabled");
608
+ startNode.Selected = node.checked = true;
609
+ return;
610
+ }
611
+ },
612
+ treeSetCheckboxState = function(node, state) {
613
+ setCheckboxState(getParent(node, "li").getElementsByTagName("input")[0], state);
614
+ },
615
+ treeCheckboxClick = function(event, node) {
616
+ event.stop();
617
+
618
+ node = document.getElementById(getAttr(node, "for")); //node has the "input" to be checked/unchecked
619
+
620
+ var startNode = findStartNode(node.value);
621
+ var isEnabled = String.isNullOrEmpty(getAttr(node, "disabled"));
622
+ if (isEnabled) {
623
+ setCheckboxState(node, node.checked ? 0 : 2);
624
+ //startNode.Selected = node.checked = !node.checked;
625
+ //startNode.LastModificationDate = new Date();
626
+ }
627
+
628
+ recursiveCheckDown(node, node.checked);
629
+ recursiveWalkDown(startNode, node.checked);
630
+ recursiveCheckUp(node);
631
+ },
632
+ findStartNode = function(nodeName) {
633
+ var parent, nodes = [], current = initialTreeState;
634
+ while (parent = parents[nodeName]) {
635
+ nodes[nodes.length] = nodeName.split("|")[1];
636
+ nodeName = parent;
637
+ }
638
+ nodes.reverse();
639
+ for (var i = 0; i < nodes.length; ++i) {
640
+ current = current.Children[nodes[i]];
641
+ }
642
+
643
+ return current;
644
+ },
645
+ recursiveWalkDown = function(startNode, checked) {
646
+ startNode.Selected = checked;
647
+ startNode.LastModificationDate = new Date();
648
+ var children = startNode.Children, keys = children && Object.keys(children);
649
+ if (!(keys && keys.length)) return;
650
+
651
+ keys.forEach(function(key) {
652
+ recursiveWalkDown(children[key], checked);
653
+ });
654
+ },
655
+ recursiveCheckUp = function(node) {
656
+ var parentUl = getParent(node, "ul");
657
+ if (parentUl.length == 0) return;
658
+
659
+ var currentCheckboxes = treeGetChildrenInputs(parentUl),
660
+ checked = 0;
661
+
662
+ currentCheckboxes.forEach(function(input) {
663
+ if (input.checked) ++checked;
664
+ });
665
+
666
+ parentUl = getParent(parentUl, "li");
667
+
668
+ if (parentUl == null) return;
669
+ parentUl = parentUl.getElementsByTagName("input");
670
+ if (parentUl.length === 0) return;
671
+
672
+ node = parentUl[0];
673
+
674
+ if (checked === currentCheckboxes.length) {
675
+ treeSetCheckboxState(node, 2);
676
+
677
+ } else if (checked > 0) {
678
+ treeSetCheckboxState(node, 1);
679
+
680
+ } else {
681
+ treeSetCheckboxState(node, 0);
682
+ }
683
+
684
+ recursiveCheckUp(node);
685
+ },
686
+ recursiveCheckDown = function(node, checked) {
687
+ node.removeAttribute("disabled");
688
+ if (checked) {
689
+ treeSetCheckboxState(node, 2);
690
+ } else {
691
+ treeSetCheckboxState(node, 0);
692
+ }
693
+ var nextUl = treeGetNextUl(node);
694
+ if (nextUl == null) return;
695
+
696
+ treeGetChildrenInputs(nextUl).forEach(function(input) {
697
+ var type = input.value.split("|")[0];
698
+ input.checked = checked;
699
+ if (checked) {
700
+ treeSetCheckboxState(input, 2);
701
+ } else {
702
+ treeSetCheckboxState(input, 0);
703
+ }
704
+ if (type === "Mixed" || type === "Folder") {
705
+ recursiveCheckDown(input, checked);
706
+ }
707
+ });
708
+ },
709
+ treeGetNextUl = function(node) {
710
+ node = getParent(node, "li").childNodes;
711
+ var l = node.length, cn;
712
+ while (l > 0) {
713
+ cn = node[--l];
714
+ if (cn.nodeName.toUpperCase() === "UL") return cn;
715
+ }
716
+
717
+ return null;
718
+ },
719
+ treeGetChildrenInputs = function(node) {
720
+ var ret = [];
721
+ getArguments(node.children).forEach(function(liChild) {
722
+ if (liChild.nodeName.toUpperCase() !== "LI") return;
723
+
724
+ getArguments(liChild.getElementsByTagName("input")).forEach(function(input) {
725
+ if (input.parentNode != liChild) return;
726
+ ret.push(input);
727
+ });
728
+ });
729
+
730
+ return ret;
731
+ },
732
+ treeToogleBranch = function(event, node) {
733
+ event.stop();
734
+
735
+ var parts = node.href.split("|"),
736
+ parentLi = getParent(node, "li"),
737
+ openClass = "open";
738
+
739
+ if (hasClass(node, openClass)) {
740
+ removeClass(node, openClass);
741
+ toogleBranch(parentLi, false);
742
+
743
+ } else {
744
+ addClass(node, openClass);
745
+ if (hasClass(parentLi, "loaded")) {
746
+ toogleBranch(parentLi, true);
747
+
748
+ } else {
749
+ drawBranch(parentLi, parts[1], parts[2], null, node.__enabledOptions, node.__parents);
750
+ }
751
+ }
752
+ },
753
+ toogleBranch = function(node, isBranchVisible) {
754
+ ///<param name="parentNode" type="HTMLElement" />
755
+ ///<param name="isBranchVisible" type="Boolean" />
756
+ toogleVisibility(node.getElementsByTagName("ul")[0], isBranchVisible);
757
+ },
758
+ drawBranch = function(parentNode, parentNodeID, treeName, branchClass, enabledOptions, parentNodeDescription) {
759
+ var loading = drawLoading(parentNode),
760
+ e = new RPC(rpcUrl,
761
+ function(data) {
762
+ removeNode(loading);
763
+ data = JSON.parse(data);
764
+ //ID, Name, ContentType: Folder/Content/Mixed/File
765
+ var ul = document.createElement("ul"),
766
+ checked = parentNode.getElementsByTagName("input");
767
+
768
+ checked = checked.length ? (checked[0].checked && String.isNullOrEmpty(getAttr(checked[0], "disabled"))) : false;
769
+ if (!String.isNullOrEmpty(branchClass)) {
770
+ ul.className = branchClass;
771
+ ul.setAttribute("id", "tsc_treeId_" + treeName);
772
+ }
773
+
774
+ addClass(parentNode, "loaded");
775
+ data.forEach(function(nodeItem) {
776
+ var li = document.createElement("li"),
777
+ div = document.createElement("div"),
778
+ label = document.createElement("label"),
779
+ checkbox = document.createElement("input"),
780
+ cbID = treeName + nodeItem.ContentType + nodeItem.ID,
781
+ nodeInOptions = (enabledOptions[nodeItem.ID] || (enabledOptions[nodeItem.ID] = createEmptyTreeNode(nodeItem.ID, nodeItem.ContentType, nodeItem.Name))),
782
+ value = nodeItem.ContentType + "|" + nodeItem.ID;
783
+
784
+ li.className = "tsc_" + nodeItem.ContentType;
785
+ //li.setAttribute("unselectable", "on");
786
+ label.setAttribute("unselectable", "on");
787
+ label.setAttribute("for", cbID);
788
+
789
+ checkbox.setAttribute("type", "checkbox");
790
+ checkbox.setAttribute("name", "tsc_tree_" + treeName);
791
+
792
+ parents[value] = parentNodeDescription;
793
+
794
+ checkbox.setAttribute("value", value);
795
+ checkbox.setAttribute("id", cbID);
796
+
797
+ if (checked) {
798
+ setCheckboxState(checkbox, 2);
799
+ div.className = 'tsc_checkstate2';
800
+ //checkbox.setAttribute("checked", "checked");
801
+
802
+ } else {
803
+ setCheckboxState(checkbox, isOptionEnabled(nodeInOptions));
804
+ div.className = 'tsc_checkstate' + isOptionEnabled(nodeInOptions);
805
+ }
806
+
807
+ addOnClick(label, treeCheckboxClick);
808
+
809
+ if (nodeItem.ContentType === "Folder" || nodeItem.ContentType === "Mixed") {
810
+ var link = document.createElement("a");
811
+ link.__enabledOptions = nodeInOptions.Children || (nodeInOptions.Children = { });
812
+ link.__parents = value;
813
+ link.setAttribute("href", "#expand|" + nodeItem.ID + "|" + treeName);
814
+
815
+ // Expand all the tree
816
+ var tsc_enabled_search = document.getElementById("tsc_expand_tree");
817
+ if(tsc_enabled_search.className !== "collapse") {
818
+ var openClass = "open";
819
+ drawBranch(li, nodeItem.ID, treeName, null, nodeInOptions.Children || (nodeInOptions.Children = { }), value);
820
+ addClass(link, openClass);
821
+ }
822
+
823
+ addOnClick(link, treeToogleBranch);
824
+ link.appendChild(document.createTextNode("+"));
825
+ li.appendChild(link);
826
+ li.appendChild(document.createTextNode(" "));
827
+ }
828
+
829
+ label.appendChild(document.createTextNode(nodeItem.Name));
830
+ li.appendChild(checkbox);
831
+ li.appendChild(div);
832
+ li.appendChild(label);
833
+ ul.appendChild(li);
834
+ });
835
+
836
+ parentNode.appendChild(ul);
837
+ },
838
+ function(errorMessage) {
839
+ createMessage(String.format("Failed to retrieve tree branch. {0}", errorMessage), "error");
840
+ }
841
+ );
842
+ e.execute("GetChildren", parentNodeID, sourceLanguage, treeName);
843
+ };
844
+
845
+ drawBranch(drawInto, "0", treeID, "tsc_tree", initialTreeState.Children, "0");
846
+ this.getSelected = function() {
847
+ return dictionaryToTree(initialTreeState);
848
+ };
849
+ },
850
+ ResizablePanes = function(container, maxColumns, minColWidth, margin, usePercentaje) {
851
+ minColWidth = minColWidth || 320;
852
+ margin = margin || 18; //0.83333
853
+
854
+ var collapseCols = 0,
855
+ paneCount = 0, panes = container.getElementsByTagName("dl"),
856
+ theItems = [], index, pane,
857
+ oldWidth,
858
+ calcMargin = margin + (usePercentaje ? "%" : "px");
859
+
860
+ for (index = 0; index < panes.length; ++index) {
861
+ pane = panes[index];
862
+ if (pane.parentNode == container && hasClass(pane, "tsc_panel")) {
863
+ pane.setAttribute("id", "tsc_pane" + paneCount);
864
+ theItems[paneCount] = pane;
865
+ ++paneCount;
866
+ }
867
+ ;
868
+ }
869
+
870
+ if (maxColumns > paneCount) maxColumns = paneCount;
871
+
872
+ for (index = 0; index < paneCount; ++index) {
873
+ theItems[theItems.length] = document.getElementById('tsc_pane' + index);
874
+ }
875
+ ;
876
+
877
+ this.draw = function() {
878
+ var w = getElementSize(container).w,
879
+ width = w,
880
+ columns = maxColumns,
881
+ e,
882
+ columnID;
883
+
884
+ if (oldWidth == w) return;
885
+ oldWidth = w;
886
+
887
+ if (!usePercentaje) {
888
+ w -= margin;
889
+ }
890
+
891
+ if (w > minColWidth) {
892
+ for (index = maxColumns - 1; index >= 0; --index) {
893
+ width = w / (index + 1);
894
+ if (width < minColWidth) continue;
895
+ columns = index + 1;
896
+ break;
897
+ }
898
+ } else {
899
+ columns = 1;
900
+ }
901
+
902
+ if (usePercentaje) {
903
+ width = ((100 - margin) / columns - margin) + "%";
904
+
905
+ } else {
906
+ width = ((width - margin) | 0) + "px";
907
+ }
908
+
909
+ var theColumns = [], // html elements
910
+ theColumnHeights = [];
911
+
912
+ // not our first time through so panes have already been moved to column divs
913
+ if (collapseCols > 0) {
914
+ // move panes back into the pane container
915
+ for (index = 0; index < paneCount; ++index) {
916
+ theItems[index].parentNode.removeChild(theItems[index]); // iPad null
917
+ }
918
+ ;
919
+
920
+ // remove existing columns if needed
921
+ for (index = 0; index < collapseCols; ++index) {
922
+ e = document.getElementById('column-' + index);
923
+ e.parentNode.removeChild(e); // iPad null
924
+ }
925
+ ;
926
+ }
927
+ ;
928
+
929
+ collapseCols = columns;
930
+ // add columns if needed
931
+ for (index = 0; index < collapseCols; ++index) {
932
+ var column = document.createElement('div');
933
+ column.id = 'column-' + index;
934
+ addClass(column, "tsc_multi_column");
935
+ column.style.width = width;
936
+ column.style.marginLeft = calcMargin; //column.style.marginRight = margin+(usePercentaje ? "%":"px");
937
+ container.appendChild(column);
938
+ columnID = theColumns.length;
939
+ theColumns[columnID] = column;
940
+ theColumnHeights[columnID] = column.offsetHeight;
941
+ }
942
+ ;
943
+
944
+
945
+ for (index = 0; index < paneCount; ++index) {
946
+ e = theItems[index]; //document.getElementById('tsc_pane' + m);
947
+
948
+ // place the first (number of columns) panes in order
949
+ if (index < theColumns.length) {
950
+ columnID = index;
951
+
952
+ } else {
953
+ // then just fill which ever is the shortest column with the rest
954
+ var minHeight = 0;
955
+ for (var n = 0; n < theColumnHeights.length; n++) {
956
+ if (n == 0 || theColumnHeights[n] < minHeight) {
957
+ minHeight = theColumnHeights[n];
958
+ columnID = n;
959
+ }
960
+ }
961
+ }
962
+ ;
963
+
964
+ if (theColumns[columnID]) {
965
+ // pane order is preserved reading left-right, top-down
966
+ e.parentNode && e.parentNode.removeChild(e); // iPad null
967
+ theColumns[columnID].appendChild(e);
968
+ theColumnHeights[columnID] = theColumns[columnID].offsetHeight;
969
+ }
970
+ ;
971
+ }
972
+ ;
973
+ };
974
+ },
975
+ drawTemplate = function(templateToDraw, args) {
976
+ removeResizeEvent();
977
+ mainDrawArea().innerHTML = template(templateToDraw)(args || { });
978
+ },
979
+ template = function tmpl(str, data) {
980
+ var fn = ! /\W/ .test(str) ? cache[str] = cache[str] || tmpl(document.getElementById(str).innerHTML) : new Function("obj",
981
+ "var p=[]; with(obj){p.push('" +
982
+ str.replace( /[\r\t\n]/g , " ")
983
+ .replace( /'(?=[^{]*}})/g , "\t")
984
+ .split("'").join("\\'")
985
+ .split("\t").join("'")
986
+ .replace( /{{=(.+?)}}/g , "',$1,'")
987
+ .split("{{").join("');")
988
+ .split("}}").join("p.push('")
989
+ + "');}return p.join('');");
990
+ return data ? fn(data) : fn;
991
+ },
992
+ initRequest = function() {
993
+ if (pWindow.XMLHttpRequest) {
994
+ return new pWindow.XMLHttpRequest();
995
+
996
+ } else if (window.ActiveXObject) {
997
+ try {
998
+ return new ActiveXObject("Msxml2.XMLHTTP");
999
+ } catch(e) {
1000
+ try {
1001
+ return new ActiveXObject("Microsoft.XMLHTTP");
1002
+ } catch(e) {
1003
+ }
1004
+ }
1005
+ }
1006
+
1007
+ return false;
1008
+ },
1009
+ itoh = '0123456789ABCDEF',
1010
+ uuid = function() {
1011
+ var s = [], i;
1012
+ for (i = 0; i < 36; i++) {
1013
+ s[i] = Math.floor(Math.random() * 0x10);
1014
+ }
1015
+
1016
+ s[14] = 4;
1017
+ s[19] = (s[19] & 0x3) | 0x8;
1018
+ for (i = 0; i < 36; i++) {
1019
+ s[i] = itoh[s[i]];
1020
+ }
1021
+ s[8] = s[13] = s[18] = s[23] = '-';
1022
+ return s.join('');
1023
+ },
1024
+ isoDateReviver = function(key, value) {
1025
+ if (typeof value === 'string') {
1026
+ var a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:([\+-])(\d{2})\:(\d{2}))?Z?$/ .exec(value);
1027
+ if (a) {
1028
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6]));
1029
+ }
1030
+ }
1031
+ return value;
1032
+ },
1033
+ getArguments = function(pParams, pIdx) {
1034
+ ///<param name="pParams" type="Array">The parameter argument list</param>
1035
+ ///<param name="pIdx" type="Number">Index of the first argument</param>
1036
+ ///<returns type="Array" />
1037
+ pIdx = pIdx || 0;
1038
+ var ret = [];
1039
+ for(var i= pIdx; i < pParams.length; i++) {
1040
+ ret.push(pParams[i]);
1041
+ }
1042
+ return ret;
1043
+ // IE8 does not allow Array.prototype.slice.call on NodeList
1044
+ //return [].slice.call(pParams, pIdx);
1045
+ },
1046
+ createMessage = function(pMessage, pType) {
1047
+ document.getElementById("tsc_messages").innerHTML = "<div class='message " + (pType || "info") + "'>" + pMessage + "</div>";
1048
+ },
1049
+ createFormMessage = function(pMessage, pErrors) {
1050
+ var m = "";
1051
+ pErrors.forEach(function(message) {
1052
+ m += "<li>" + message + "</li>";
1053
+ });
1054
+
1055
+ document.getElementById("tsc_messages").innerHTML = "<div class='message validation'><h4>" + pMessage + "</h4><ul>" + m + "</ul></div>";
1056
+ },
1057
+ clearMessage = function() {
1058
+ document.getElementById("tsc_messages").innerHTML = "";
1059
+ },
1060
+ numberOfWaitings = 0,
1061
+ showWaiting = function(pMessage) {
1062
+ if (numberOfWaitings == 0) {
1063
+ var w = document.getElementById("tsc_working");
1064
+ w.innerHTML = "<strong>" + (pMessage || "Please Wait...") + "</strong>";
1065
+ toogleVisibility(w, true);
1066
+ }
1067
+
1068
+ ++numberOfWaitings;
1069
+ },
1070
+ hideWaiting = function() {
1071
+ --numberOfWaitings;
1072
+ if (numberOfWaitings == 0) toogleVisibility(document.getElementById("tsc_working"), false);
1073
+ },
1074
+ RPC = function(url, onSuccess, onFailure, onComplete) {
1075
+ url = url + (url.indexOf("?") === -1 ? "?" : "&") + "format=json&isAjax=true&form_key="+FORM_KEY;
1076
+
1077
+ var r, running, id, tries = 0,
1078
+ executeSuccess = function(obj) {
1079
+ if (!!onSuccess) onSuccess(obj);
1080
+ },
1081
+ executeFailure = function(error) {
1082
+ if (!!onFailure) onFailure(error);
1083
+ },
1084
+ executeComplete = function() {
1085
+ if (!!onComplete) onComplete();
1086
+ },
1087
+ doRequest = function(data) {
1088
+ r = initRequest();
1089
+ id = uuid();
1090
+ running = true;
1091
+
1092
+ r.onreadystatechange = function() {
1093
+ if (r.readyState !== 4 || !running) {
1094
+ return;
1095
+ }
1096
+
1097
+ running = false;
1098
+
1099
+ var s;
1100
+ try {
1101
+ s = r.status;
1102
+ } catch(e) {
1103
+ s = 200;
1104
+ }
1105
+
1106
+ if (s >= 200 && s <= 300) {
1107
+ var msg = r.responseText, ok = true;
1108
+ if (msg.indexOf('{') === 0) {
1109
+ try {
1110
+ msg = JSON.parse(msg, isoDateReviver);
1111
+
1112
+ } catch(e) {
1113
+ ok = false;
1114
+ executeFailure("Exception " + e + ". Data: " + msg);
1115
+ }
1116
+
1117
+ if (ok) {
1118
+ if (msg.error) {
1119
+ executeFailure(msg.error);
1120
+
1121
+ } else {
1122
+ executeSuccess(msg.result);
1123
+ }
1124
+
1125
+ /* TODO FIX Request response id missmatch
1126
+ else if (msg.id === id) {
1127
+ executeSuccess(msg.result);
1128
+
1129
+ } else {
1130
+ executeFailure(String.format("Invalid response. Sent ID doen't matches received ID. Data: {0}", msg));
1131
+ }*/
1132
+ }
1133
+ }
1134
+
1135
+ } else {
1136
+ if (++tries < 3) {
1137
+ delete r.onreadystatechange;
1138
+ r.onreadystatechange = null;
1139
+ doRequest(data);
1140
+ return;
1141
+ }
1142
+
1143
+ executeFailure(r.statusText + ":" + r.responseText);
1144
+ }
1145
+
1146
+ delete r.onreadystatechange;
1147
+ r.onreadystatechange = null;
1148
+ executeComplete();
1149
+ };
1150
+
1151
+ //r.open('POST', url + "&id=" + id, true);
1152
+ r.open('POST', url, true);
1153
+ r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
1154
+ // r.setRequestHeader("Content-length", data.length);
1155
+
1156
+ // if (configuration) {
1157
+ // r.setRequestHeader('Authorization', 'WSSE profile="UsernameToken"');
1158
+ // var nonce = b64Sha1(uuid());
1159
+ // var created = new Date().toISOString();
1160
+ // var passwordDigest = b64Sha1(nonce + created + configuration.AuthorizationPassword);
1161
+ // r.setRequestHeader('X-Wsse',
1162
+ // 'UsernameToken Username="' + configuration.AuthorizationUsername +
1163
+ // '", PasswordDigest="' + passwordDigest +
1164
+ // '", Created="' + created +
1165
+ // '", Nonce="' + nonce + '"'
1166
+ // );
1167
+ // }
1168
+
1169
+ if (r.overrideMimeType) {
1170
+ //r.setRequestHeader("Connection", "close");
1171
+ r.overrideMimeType('application/json');
1172
+ }
1173
+
1174
+ r.send(data);
1175
+ };
1176
+
1177
+ this.execute = function(pMethod) {
1178
+ var id = uuid();
1179
+ doRequest(JSON.stringify({ "jsonrpc": "2.0", "method": pMethod, "params": getArguments(arguments, 1), "id": id }));
1180
+ };
1181
+ },
1182
+ validate = function(formElements) {
1183
+ var errors = [];
1184
+ if (!Array.isArray(formElements)) formElements = [formElements];
1185
+
1186
+ formElements.forEach(function(validateEntry) {
1187
+ if (!validateEntry.args) validateEntry.args = [];
1188
+ if (!validateEntry.validator.apply(null, validateEntry.args)) {
1189
+ errors.push(validateEntry.message);
1190
+ }
1191
+ });
1192
+
1193
+ return errors;
1194
+ },
1195
+ requiredValidator = function(value) {
1196
+ return value.length > 0;
1197
+ },
1198
+ minLengthValidator = function(value, minValue) {
1199
+ return value.length >= minValue;
1200
+ },
1201
+ doesNotContainValidator = function(value, values) {
1202
+ return values.indexOf(value) === -1;
1203
+ },
1204
+ urlValidator = function(value) {
1205
+ return /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/i .test(value);
1206
+ },
1207
+ packages = [], quotes = [], projects = [], trees,
1208
+ getPackage = function(quoteId) {
1209
+ var retQuote;
1210
+ packages.forEach(function(item) {
1211
+ if (item.ID === quoteId) {
1212
+ retQuote = item;
1213
+ }
1214
+ });
1215
+
1216
+ return retQuote;
1217
+ },
1218
+ showQuotes = function() {
1219
+ drawTemplate("main_tpl", { "packages": packages, "quotes": quotes, "projects": projects });
1220
+ },
1221
+ lastTimeout;
1222
+
1223
+ efx.showScreen = function(screenName) {
1224
+ if (lastTimeout) clearTimeout(lastTimeout);
1225
+ lastTimeout = null;
1226
+ efx[screenName].apply(null, getArguments(arguments, 1));
1227
+ };
1228
+
1229
+ efx.doConfirm = function(title, func) {
1230
+ if (window.confirm(title.split("\\n").join("\n")))
1231
+ func.apply(null, getArguments(arguments, 2));
1232
+
1233
+ return false;
1234
+ };
1235
+
1236
+ efx.listQuotesScreen = function() {
1237
+ new RPC(rpcUrl,
1238
+ function(data) {
1239
+ data = JSON.parse(data);
1240
+
1241
+ clearMessage();
1242
+ packages = [];
1243
+ quotes = [];
1244
+ projects = [];
1245
+
1246
+ data.forEach(function(obj) {
1247
+ var status = obj.Status;
1248
+ obj.HumanStatus = status.replace( /([A-Z])/g , " $1");
1249
+
1250
+ if (status == "QuoteOpen") {
1251
+ packages.push(obj);
1252
+
1253
+ } else if (status.indexOf("Project") === -1) {
1254
+ quotes.push(obj);
1255
+
1256
+ } else {
1257
+ projects.push(obj);
1258
+ }
1259
+ });
1260
+
1261
+ showQuotes();
1262
+ },
1263
+ function(errorMessage) {
1264
+ createMessage(String.format("Failed to retrieve remote data. {0}", errorMessage), "error");
1265
+ },
1266
+ function() {
1267
+ lastTimeout = setTimeout(function() { efx.showScreen("listQuotesScreen"); }, 20000);
1268
+ }
1269
+ ).execute("ListQuotes");
1270
+
1271
+ showQuotes();
1272
+
1273
+ var stats = document.getElementById("tsc_status"),
1274
+ hideStats = function() {
1275
+ toogleVisibility(stats, false);
1276
+ stats.innerHTML = "";
1277
+ };
1278
+
1279
+ new RPC(rpcUrl,
1280
+ function(data) {
1281
+ data = JSON.parse(data);
1282
+
1283
+ if (data && data.length) {
1284
+ toogleVisibility(stats, true);
1285
+ stats.innerHTML = template("status_tpl")({ "statuses": data });
1286
+
1287
+ } else {
1288
+ hideStats();
1289
+ }
1290
+ },
1291
+ hideStats
1292
+ ).execute("GetStatuses");
1293
+ };
1294
+
1295
+ efx.deletePackage = function(packageID) {
1296
+ new RPC(rpcUrl,
1297
+ null,
1298
+ function(errorMessage) {
1299
+ createMessage(String.format("Failed to delete package. {0}", errorMessage), "error");
1300
+ }
1301
+ ).execute("DeleteQuote", packageID, configuration.UserName);
1302
+
1303
+ packages.forEach(function(item, index, arr) {
1304
+ if (item.ID === packageID) {
1305
+ arr.splice(index, 1);
1306
+ }
1307
+ });
1308
+
1309
+ showQuotes();
1310
+ };
1311
+
1312
+ efx.createQuoteScreen = function(isQuickQuote) {
1313
+ drawTemplate("createQuote_tpl", { "sourceLanguages": configuration.SourceLanguages, "targetLanguages": configuration.TargetLanguages, "quickQuote": isQuickQuote });
1314
+ };
1315
+
1316
+ efx.showConfigurationScreen = function(fromConfig) {
1317
+ drawTemplate("config_tpl", { "fromConfig": fromConfig, "configuration": configuration });
1318
+ };
1319
+
1320
+ efx.saveConfiguration = function() {
1321
+ clearMessage();
1322
+ var authToken = getValue(document.getElementById("tsc_tokenID")),
1323
+ endpoint = getValue(document.getElementById("tsc_Endpoint")),
1324
+ e = new RPC(rpcUrl,
1325
+ function() {
1326
+ configuration.AuthorizationToken = authToken;
1327
+ configuration.TscServerEndPoint = endpoint;
1328
+ inited = false;
1329
+ efx.init();
1330
+ },
1331
+ function(errorMessage) {
1332
+ createMessage(String.format("Can not save configuration data. {0}", errorMessage), "error");
1333
+ },
1334
+ function() {
1335
+ hideWaiting();
1336
+ }
1337
+ ),
1338
+ errors = validate([
1339
+ { "validator": requiredValidator, "args": [authToken], "message": "The Authorization Token is required." },
1340
+ { "validator": requiredValidator, "args": [endpoint], "message": "The EndPoint URL is required." },
1341
+ { "validator": urlValidator, "args": [endpoint], "message": "The EndPoint URL is not in a valid form." },
1342
+ ]);
1343
+
1344
+ if (errors.length > 0) {
1345
+ createFormMessage("There were some errors while checking the form:", errors);
1346
+ return;
1347
+ }
1348
+
1349
+ showWaiting();
1350
+ e.execute(
1351
+ "SaveConfiguration",
1352
+ authToken,
1353
+ endpoint
1354
+ );
1355
+ };
1356
+
1357
+ efx.createQuote = function(quickQuote) {
1358
+ clearMessage();
1359
+ var e = new RPC(rpcUrl,
1360
+ function(quote) {
1361
+ quote = JSON.parse(quote);
1362
+ packages.push(quote);
1363
+ efx.addDocuments(quote.ID, quickQuote);
1364
+ },
1365
+ function(errorMessage) {
1366
+ createMessage(String.format("Failed to create quote. {0}", errorMessage), "error");
1367
+ },
1368
+ function() {
1369
+ hideWaiting();
1370
+ }
1371
+ ),
1372
+ name = getValue(document.getElementById("tsc_Name")),
1373
+ sourceLang = getValue(document.getElementById("tsc_SourceLang")),
1374
+ targetLangs = getValue(document.getElementById("tsc_TargetLangs"), true),
1375
+ errors = validate([
1376
+ { "validator": requiredValidator, "args": [name], "message": quickQuote ? "The name of the quote is required." : "The name of the package is required." },
1377
+ { "validator": minLengthValidator, "args": [targetLangs, 1], message: "You have to select at least one target language" },
1378
+ //this should never happen. Needs to be validated on the plugin. Just in case...
1379
+ { "validator": doesNotContainValidator, "args": [sourceLang, targetLangs], message: "You can not select as target language the selected source language" },
1380
+ ]);
1381
+
1382
+ if (errors.length > 0) {
1383
+ createFormMessage("There were some errors while checking the form:", errors);
1384
+ return;
1385
+ }
1386
+
1387
+ showWaiting();
1388
+ e.execute(
1389
+ "CreateQuote",
1390
+ name,
1391
+ getValue(document.getElementById("tsc_Notes")),
1392
+ sourceLang,
1393
+ targetLangs,
1394
+ configuration.UserName
1395
+ );
1396
+ };
1397
+
1398
+ efx.requestAQuote = function(packageID, quickQuote) {
1399
+ new RPC(rpcUrl,
1400
+ function() {
1401
+ packages.forEach(function(item, index, arr) {
1402
+ if (item.ID === packageID) {
1403
+ item.HumanStatus = "Quote In Progress";
1404
+ item.Status = "QuoteInProgress";
1405
+ item.Name = String.format("Creating quote for: {0}", item.Name);
1406
+ quotes.push(item);
1407
+ arr.splice(index, 1);
1408
+ }
1409
+ });
1410
+
1411
+ if (quickQuote) {
1412
+ efx.listQuotesScreen();
1413
+
1414
+ } else {
1415
+ showQuotes();
1416
+ }
1417
+
1418
+ },
1419
+ function(errorMessage) {
1420
+ createMessage(String.format("Failed to request a quote. {0}", errorMessage), "error");
1421
+ }
1422
+ ).execute("SendQuoteToGpms", packageID, configuration.UserName, quickQuote || false);
1423
+ };
1424
+
1425
+ efx.addDocuments = function(quoteId, quickQuote) {
1426
+ showWaiting();
1427
+ new RPC(rpcUrl,
1428
+ function(treeNodes) {
1429
+ treeNodes = JSON.parse(treeNodes) || { };
1430
+ trees = { };
1431
+ var quote = getPackage(quoteId), sourceLang = quote.SourceLanguageISOCode;
1432
+
1433
+ drawTemplate("add_documents_tpl", { "quote": quote, "quickQuote": quickQuote });
1434
+
1435
+ var panes = configuration.DocumentBrowserPanes,
1436
+ container = document.getElementById("tsc_columns"),
1437
+ nodesByID = { }, i;
1438
+
1439
+ for (i = treeNodes.length - 1; i >= 0; --i) {
1440
+ var tn = treeNodes[i];
1441
+ nodesByID[tn.ID] = treeToDictionary(tn);
1442
+ }
1443
+
1444
+ panes.forEach(function(pane) {
1445
+ var dl = document.createElement("dl"),
1446
+ dt = document.createElement("dt"),
1447
+ dd = document.createElement("dd"),
1448
+ paneID = pane.ID;
1449
+ dl.className = "tsc_panel";
1450
+ dt.appendChild(document.createTextNode(pane.Name));
1451
+ dl.appendChild(dt);
1452
+ dl.appendChild(dd);
1453
+ container.appendChild(dl);
1454
+ trees[paneID] = (paneID.indexOf("options_") == 0) ?
1455
+ new HtmlOptions(dd, paneID, nodesByID[paneID], sourceLang) :
1456
+ new HtmlTree(dd, paneID, nodesByID[paneID], sourceLang);
1457
+ });
1458
+
1459
+ var rp = new ResizablePanes(container, 100, 320, 0.833333, true);
1460
+ rp.draw();
1461
+
1462
+ addResizeEvent(rp.draw);
1463
+ },
1464
+ function(errorMessage) {
1465
+ createMessage(String.format("Failed to retrieve selected package items. {0}", errorMessage), "error");
1466
+ },
1467
+ function() {
1468
+ hideWaiting();
1469
+ }
1470
+ ).execute("ListPackageFiles", quoteId);
1471
+ };
1472
+
1473
+ efx.addSelectedDocuments = function(quoteId, quickQuote) {
1474
+ showWaiting();
1475
+ var data = [];
1476
+ Object.keys(trees).forEach(function(key) {
1477
+ var selected = trees[key].getSelected();
1478
+ if (selected) data.push(selected);
1479
+ });
1480
+
1481
+ new RPC(rpcUrl,
1482
+ function() {
1483
+ if (quickQuote) {
1484
+ efx.requestAQuote(quoteId, true);
1485
+
1486
+ } else {
1487
+ efx.listQuotesScreen();
1488
+ }
1489
+ },
1490
+ function(errorMessage) {
1491
+ createMessage(String.format("Failed to export selected documents. {0}", errorMessage), "error");
1492
+ },
1493
+ function() {
1494
+ hideWaiting();
1495
+ }
1496
+ ).execute("ModifyPackageFiles", quoteId, configuration.UserName, data);
1497
+ };
1498
+
1499
+ efx.importProject = function(projectId) {
1500
+ showWaiting();
1501
+ new RPC(rpcUrl,
1502
+ function() {
1503
+ efx.listQuotesScreen();
1504
+ },
1505
+ function(errorMessage) {
1506
+ createMessage(String.format("Failed to import translations. {0}", errorMessage), "error");
1507
+ },
1508
+ function() {
1509
+ hideWaiting();
1510
+ }
1511
+ ).execute("Import", projectId, configuration.UserName);
1512
+ };
1513
+
1514
+ efx.closeProject = function(projectId) {
1515
+ new RPC(rpcUrl,
1516
+ function() {
1517
+ projects.forEach(function(item, index, arr) {
1518
+ if (item.ID === projectId) {
1519
+ arr.splice(index, 1);
1520
+ }
1521
+ });
1522
+
1523
+ showQuotes();
1524
+ },
1525
+ function(errorMessage) {
1526
+ createMessage(String.format("Failed to close project. {0}", errorMessage), "error");
1527
+ }
1528
+ ).execute("CloseQuote", projectId, configuration.UserName);
1529
+ };
1530
+
1531
+ efx.addLangResource = function(obj) {
1532
+ langResources = obj;
1533
+ };
1534
+
1535
+ efx.init = function() {
1536
+ needsInit = true;
1537
+ initialize();
1538
+ };
1539
+
1540
+ efx.startup = function(webServiceUrl) {
1541
+ rpcUrl = webServiceUrl;
1542
+ var includes = [],
1543
+ onloadCallback = function() {
1544
+ new RPC(rpcUrl, function(data) {
1545
+ configuration = JSON.parse(data);
1546
+ configurationLoaded = true;
1547
+ initialize();
1548
+ }, function(errorMessage) {
1549
+ createMessage(String.format("Failed to retrieve configuration. {0}", errorMessage), "error");
1550
+
1551
+ }).execute("GetConfiguration");
1552
+
1553
+ if (navigator)
1554
+
1555
+
1556
+ loaded = true;
1557
+ initialize();
1558
+
1559
+ // var oldOnload = pWindow.onload;
1560
+ // pWindow.onload = function(e) {
1561
+ // loaded = true;
1562
+ // initialize();
1563
+ //
1564
+ // if (oldOnload) {
1565
+ // oldOnload(e);
1566
+ // }
1567
+ // };
1568
+ };
1569
+
1570
+ // if (typeof JSON === 'undefined' || typeof JSON.stringify !== 'function' || typeof JSON.parse !== 'function') {
1571
+ // includes.push('/<%=WebResource("TSC.WebClient.js.JSON.min.js")%>');
1572
+ // }
1573
+
1574
+ if ((typeof Array.isArray === 'undefined') || (typeof Array.prototype.forEach === 'undefined') ||
1575
+ (typeof Object.keys === 'undefined') || (typeof Date.prototype.toISOString === 'undefined') ||
1576
+ (typeof Date.prototype.toJSON === 'undefined') || (typeof String.prototype.trim === 'undefined')) {
1577
+ includes.push('/<%=WebResource("TSC.WebClient.js.EcmaScript5.min.js")%>');
1578
+ }
1579
+
1580
+ if (includes.length) {
1581
+ pWindow.include(includes, onloadCallback);
1582
+
1583
+ } else {
1584
+ onloadCallback();
1585
+ }
1586
+ }
1587
+ })(window);
js/gpi_tsc/tsc.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function trace(n){window.opera?opera.postError(n):window.debugService?typeof n=="object"?window.debugService.inspect("trace",n):window.debugService.trace(n):window.console?console.dir&&typeof n=="object"?console.dir(n):console.log(n):alert(n)}!function(n){n.include=function(t,i){function c(t,i,s,c,l){c=r.createElement("script"),e++,c.onload=c.onreadystatechange=function(r,e){e=0,r=this.readyState||r.type,r.search("load|complete")||l||(s?(t=function(){n[s]?h(i):setTimeout(t,u),++e>u&&(t=f)})():h(i),l=u)},c.async=!0,c.src=t,r[o].appendChild(c)}function h(n){n(),--e||i()}var r=document,o="body",f=function(){},s={},e=0,u=1;t.pop||(t=[t]),i=i||f,!function l(n,h,a,v){if(!r[o])return setTimeout(l,u);h=r.getElementsByTagName("script"),v=f;for(n in h)h[n].src&&(s[h[n].src]=n);for(n=t.length;n--;)t[n].pop?(h=t[n][0],v=t[n][1],a=t[n][2]):h=t[n],s[h]?v():c(h,v,a);e||i()}()}}(this),window.Date.prototype.f=function(n){var w,l;n=n+"";var a=["January","February","March","April","May","June","July","August","September","October","November","December"],h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=function(n){return(n<0||n>9?"":"0")+n},u=this,e="",o=0,f=u.getYear()+"",s=u.getMonth()+1,v=u.getDate(),c=u.getDay(),i=u.getHours(),y=u.getMinutes(),p=u.getSeconds(),t={};for(f.length<4&&(f=""+(+f+1900)),t.y=""+f,t.yyyy=f,t.yy=f.substr(2,4),t.M=s,t.MM=r(s),t.MMM=a[s-1],t.NNN=a[s-1].substr(0,3),t.N=a[s-1].substr(0,1),t.d=v,t.dd=r(v),t.e=h[c].substr(0,1),t.ee=h[c].substr(0,2),t.E=h[c].substr(0,3),t.EE=h[c],t.H=i,t.HH=r(i),t.h=i==0?12:i>12?i-12:i,t.hh=r(t.h),t.K=i>11?i-12:i,t.k=i+1,t.KK=r(t.K),t.kk=r(t.k),t.a=i>11?"PM":"AM",t.m=y,t.mm=r(y),t.s=p,t.ss=r(p);o<n.length;){for(w=n.charAt(o),l="";n.charAt(o)==w&&o<n.length;)l+=n.charAt(o++);e=t[l]!=null?e+t[l]:e+l}return e},function(n){"use strict";var hi,yt,si;n.efx||(n.efx={}),String.isNullOrEmpty||(String.isNullOrEmpty=function(n){return n?n.toString().replace(/^\s*|\s*$/g,"")==="":!0}),String.format||(hi=new RegExp(/{(\d+)}|{(\d+):([^\r\n{}]+)}/g),String.format=function(n,t){t instanceof Array||(t=Array.prototype.slice.call(arguments,1));for(var r,i,f,u,e=n;(r=hi.exec(n))!=null;)i=t[parseInt(r[1]||r[2],10)],f=r[3]||"",u=ht(i)?"":i.toFormattedString?i.toFormattedString(f):i.format?i.format(f):i.toString(),e=e.split(r[0]).join(u);return e});var t="/rpc.axd",pt={},ft={},et={},ci,ot,st,wt,bt,i={},kt={},li=function(){return document.getElementById("tsc_content")},lr=function(n){return kt[n]},ht=function(n){return n===ci?!0:n===null?!0:!1},h=function(n,t){for(t=t.toUpperCase();n&&n.parentNode;)if(n=n.parentNode,n.nodeType===1&&n.nodeName.toUpperCase()===t)return n;return null},p=function(n,t){return ft[t]||(ft[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")),ft[t].test(n.className)},c=function(n,t){p(n,t)||(n.className=((n.className||"")==""?"":n.className+" ")+t)},ai=function(n,t){(et[t]||(et[t]=new RegExp("(^|\\s)"+t)),String.isNullOrEmpty(t))||(n.className=n.className.replace(et[t],"").replace(/^\s+|(\s)\s+/g,"$1"))},l=function(n,t){n.style.display=t?"block":"none"},dt=function(n){n.parentNode.removeChild(n)},vi=function(n,t){return t?{w:n.offsetWidth,h:n.offsetHeight}:{w:n.clientWidth,h:n.clientHeight}},ct=function(){wt&&!st&&typeof ot!="undefined"&&ot&&bt&&(st=!0,efx.showScreen("listQuotesScreen"))},w,b,yi=function(t){if(b)throw new Error("Resize event already hooked");b=!0,w=n.onresize,n.onresize=ni(n,function(n){t(),w&&w(n)})},pi=function(){b&&(b=!1,n.onresize=w)},wi="preventDefault stopPropagation type altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),bi=function(n){var t={};return wi.forEach(function(i){t[i]=n[i]}),t.originalEvent=n,t},gt=function(n,t){return function(i){var u,f;i=i||window.event;var r=i.$cloned?i:bi(i),e=i.target,o=i.type;for(r.$cloned=!0,r.currentTarget=n,r.stop=function(){i.stopPropagation(),i.preventDefault()},o.match(/(click|mouse|menu)/i)&&(ht(r.pageX)&&!ht(r.clientX)&&(u=document.documentElement,f=document.body,r.pageX=r.clientX+(u&&u.scrollLeft||f&&f.scrollLeft||0)-(u&&u.clientLeft||f&&f.clientLeft||0),r.pageY=r.clientY+(u&&u.scrollTop||f&&f.scrollTop||0)-(u&&u.clientTop||f&&f.clientTop||0)),o.match(/DOMMouseScroll|mousewheel/)&&(r.wheelDelta=i.wheelDelta?i.wheelDelta/120:-(i.detail||0)/3));e&&e.nodeType==3;)e=e.parentNode;r.target=e,t(r,n)}},ki=function(n,t){var i=gt(n,t);return function(){var t=window.event;t.target=t.srcElement,t.preventDefault=function(){t.returnValue=!1},t.stopPropagation=function(){t.cancelBubble=!0},i(t),t.target=t.relatedTarget=t.preventDefault=t.stopPropagation=t=null}},ni=document.addEventListener?gt:ki,ti=function(n,t){n.onclick=ni(n,t)},o=function(n,t){return n.getAttribute(t)||(n.attributes[t]?n.attributes[t].nodeValue:null)},di=function(n){var t=n.nodeName.toLowerCase();switch(t){case"textarea":return t;case"select":return String.isNullOrEmpty(o(n,"multiple"))?t:"select-multiple";case"input":return o(n,"type")}return t},s=function(n,t){var u=[],r,o=0,i,s,e=[],h=di(n),c;s=n.name||"",s!==""&&(e=f(document.getElementsByName(s)));switch(h){case"select":r=n.options[n.selectedIndex],i=r.value||r.text;break;case"select-multiple":for(i=[];(r=n.selectedIndex)!==-1;)(u[u.length]=n.options[r]).selected=!1,i[i.length]=r;return u.forEach(function(n){n.selected=!0}),i;case"checkbox":return i=[],e.forEach(function(n){(n.checked||n.selected)&&(u[u.length]=n,i[i.length]=n.value)}),i;case"radio":for(c=e.length;o<c;++o)if(r=e[o++],r.checked||r.selected){i=r.value;break}break;default:i=n.value}return t?[i]:i},ii=function(n){var t=document.createElement("b");return t.className="loading",t.appendChild(document.createTextNode("Loading...")),n.appendChild(t),t},ri=function(n){return{ID:n.ID,ContentType:n.ContentType,Selected:n.Selected,Name:n.Name,LastModificationDate:n.LastModificationDate}},k=function(n){var t,i,r;if(!n)return 0;if(n.Selected)return 2;if(t=n.Children,i=t&&Object.keys(t),!i)return 0;for(r=0;r<i.length;++r)if(k(t[i[r]])!=0)return 1;return 0},lt=function(n){if(!n||!n.ID)return null;var i=n.Children,t=[],r=ri(n);return n.Selected?r:k(n)==1&&i?(Object.keys(i).forEach(function(n){var r=i[n],u=lt(r);r&&u&&(t[t.length]=u)}),t.length&&(r.Children=t),r):null},ui=function(n){if(!n||!n.ID)return null;var t,i,r=n.Children,u={},f=ri(n);if(r){for(t=0;t<r.length;++t)i=r[t],u[i.ID]=ui(i);t&&(f.Children=u)}return f},d=function(n,t,i){return{ID:n,ContentType:t||"Other",Selected:!1,Name:i||"",Children:{},LastModificationDate:new Date}},gi=function(n,i,e,s){e=e||d(i);var l=ii(n),h="tsc_optionsId_"+i,a=new r(t,function(t){dt(l);var r=document.createElement("ul");r.setAttribute("id",h),c(r,"tsc_options"),t.forEach(function(n){var f=document.createElement("li"),u=document.createElement("label"),o=document.createElement("span"),t=document.createElement("input"),s=e.Children[n.ID];u.setAttribute("unselectable","on"),t.setAttribute("type","checkbox"),t.setAttribute("name","tsc_options_"+i),t.setAttribute("value",n.ID),t.checked=s&&s.Selected,u.appendChild(t),u.appendChild(o),o.appendChild(document.createTextNode(n.Name)),f.appendChild(u),r.appendChild(f)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve options. {0}",n),"error")});a.execute("GetChildren",i,s,i),this.getSelected=function(){var t=document.getElementById(h),n;return t?(n=f(t.getElementsByTagName("input")),n&&n.length&&n.forEach(function(n){var t=o(n,"value"),i;n.checked?(i=e.Children[t]||(e.Children[t]=d(t)),i.Selected=!0,i.LastModificationDate=new Date):e.Children[t]=null}),lt(e)):!1}},nr=function(n,i,e,s){e=e||d(i);var w={},v=function(n,t){var i=b(n.value);i.LastModificationDate=new Date,n.nextSibling&&(n.nextSibling.className="tsc_checkstate"+t);switch(t){case 0:n.removeAttribute("disabled"),i.Selected=n.checked=!1;return;case 1:n.setAttribute("disabled","disabled"),i.Selected=!(n.checked=!0);return;case 2:n.removeAttribute("disabled"),i.Selected=n.checked=!0;return}},a=function(n,t){v(h(n,"li").getElementsByTagName("input")[0],t)},ut=function(n,t){n.stop(),t=document.getElementById(o(t,"for"));var i=b(t.value),r=String.isNullOrEmpty(o(t,"disabled"));r&&v(t,t.checked?0:2),tt(t,t.checked),g(i,t.checked),nt(t)},b=function(n){for(var u,t=[],i=e,r;u=w[n];)t[t.length]=n.split("|")[1],n=u;for(t.reverse(),r=0;r<t.length;++r)i=i.Children[t[r]];return i},g=function(n,t){n.Selected=t,n.LastModificationDate=new Date;var i=n.Children,r=i&&Object.keys(i);r&&r.length&&r.forEach(function(n){g(i[n],t)})},nt=function(n){var t=h(n,"ul"),r,i;t.length!=0&&(r=it(t),i=0,r.forEach(function(n){n.checked&&++i}),t=h(t,"li"),t!=null)&&(t=t.getElementsByTagName("input"),t.length!==0)&&(n=t[0],i===r.length?a(n,2):i>0?a(n,1):a(n,0),nt(n))},tt=function(n,t){n.removeAttribute("disabled"),t?a(n,2):a(n,0);var i=ft(n);i!=null&&it(i).forEach(function(n){var i=n.value.split("|")[0];n.checked=t,t?a(n,2):a(n,0),(i==="Mixed"||i==="Folder")&&tt(n,t)})},ft=function(n){n=h(n,"li").childNodes;for(var i=n.length,t;i>0;)if(t=n[--i],t.nodeName.toUpperCase()==="UL")return t;return null},it=function(n){var t=[];return f(n.children).forEach(function(n){n.nodeName.toUpperCase()==="LI"&&f(n.getElementsByTagName("input")).forEach(function(i){i.parentNode==n&&t.push(i)})}),t},et=function(n,t){n.stop();var u=t.href.split("|"),i=h(t,"li"),r="open";p(t,r)?(ai(t,r),rt(i,!1)):(c(t,r),p(i,"loaded")?rt(i,!0):y(i,u[1],u[2],null,t.__enabledOptions,t.__parents))},rt=function(n,t){l(n.getElementsByTagName("ul")[0],t)},y=function(n,i,f,e,h,l){var a=ii(n),p=new r(t,function(t){dt(a);var r=document.createElement("ul"),i=n.getElementsByTagName("input");i=i.length?i[0].checked&&String.isNullOrEmpty(o(i[0],"disabled")):!1,String.isNullOrEmpty(e)||(r.className=e,r.setAttribute("id","tsc_treeId_"+f)),c(n,"loaded"),t.forEach(function(n){var t=document.createElement("li"),p=document.createElement("div"),s=document.createElement("label"),u=document.createElement("input"),b=f+n.ContentType+n.ID,o=h[n.ID]||(h[n.ID]=d(n.ID,n.ContentType,n.Name)),a=n.ContentType+"|"+n.ID,e,g,nt;t.className="tsc_"+n.ContentType,s.setAttribute("unselectable","on"),s.setAttribute("for",b),u.setAttribute("type","checkbox"),u.setAttribute("name","tsc_tree_"+f),w[a]=l,u.setAttribute("value",a),u.setAttribute("id",b),i?(v(u,2),p.className="tsc_checkstate2"):(v(u,k(o)),p.className="tsc_checkstate"+k(o)),ti(s,ut),(n.ContentType==="Folder"||n.ContentType==="Mixed")&&(e=document.createElement("a"),e.__enabledOptions=o.Children||(o.Children={}),e.__parents=a,e.setAttribute("href","#expand|"+n.ID+"|"+f),g=document.getElementById("tsc_expand_tree"),g.className!=="collapse"&&(nt="open",y(t,n.ID,f,null,o.Children||(o.Children={}),a),c(e,nt)),ti(e,et),e.appendChild(document.createTextNode("+")),t.appendChild(e),t.appendChild(document.createTextNode(" "))),s.appendChild(document.createTextNode(n.Name)),t.appendChild(u),t.appendChild(p),t.appendChild(s),r.appendChild(t)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve tree branch. {0}",n),"error")});p.execute("GetChildren",i,s,f)};y(n,"0",i,"tsc_tree",e.Children,"0"),this.getSelected=function(){return lt(e)}},tr=function(n,t,i,r,u){i=i||320,r=r||18;for(var h=0,e=0,l=n.getElementsByTagName("dl"),o=[],s,a,v=r+(u?"%":"px"),f=0;f<l.length;++f)s=l[f],s.parentNode==n&&p(s,"tsc_panel")&&(s.setAttribute("id","tsc_pane"+e),o[e]=s,++e);for(t>e&&(t=e),f=0;f<e;++f)o[o.length]=document.getElementById("tsc_pane"+f);this.draw=function(){var p=vi(n).w,w=p,g=t,l,s,b,d,y,nt,k;if(a!=p){if(a=p,u||(p-=r),p>i){for(f=t-1;f>=0;--f)if(w=p/(f+1),!(w<i)){g=f+1;break}}else g=1;if(w=u?(100-r)/g-r+"%":(w-r|0)+"px",b=[],d=[],h>0){for(f=0;f<e;++f)o[f].parentNode.removeChild(o[f]);for(f=0;f<h;++f)l=document.getElementById("column-"+f),l.parentNode.removeChild(l)}for(h=g,f=0;f<h;++f)y=document.createElement("div"),y.id="column-"+f,c(y,"tsc_multi_column"),y.style.width=w,y.style.marginLeft=v,n.appendChild(y),s=b.length,b[s]=y,d[s]=y.offsetHeight;for(f=0;f<e;++f){if(l=o[f],f<b.length)s=f;else for(nt=0,k=0;k<d.length;k++)(k==0||d[k]<nt)&&(nt=d[k],s=k);b[s]&&(l.parentNode&&l.parentNode.removeChild(l),b[s].appendChild(l),d[s]=b[s].offsetHeight)}}}},g=function(n,t){pi(),li().innerHTML=fi(n)(t||{})},fi=function ir(n,t){var i=/\W/.test(n)?new Function("obj","var p=[]; with(obj){p.push('"+n.replace(/[\r\t\n]/g," ").replace(/'(?=[^{]*}})/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/{{=(.+?)}}/g,"',$1,'").split("{{").join("');").split("}}").join("p.push('")+"');}return p.join('');"):pt[n]=pt[n]||ir(document.getElementById(n).innerHTML);return t?i(t):i},rr=function(){if(n.XMLHttpRequest)return new n.XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}return!1},ur="0123456789ABCDEF",fr=function(){for(var n=[],t=0;t<36;t++)n[t]=Math.floor(Math.random()*16);for(n[14]=4,n[19]=n[19]&3|8,t=0;t<36;t++)n[t]=ur[n[t]];return n[8]=n[13]=n[18]=n[23]="-",n.join("")},er=function(n,t){if(typeof t=="string"){var i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:([\+-])(\d{2})\:(\d{2}))?Z?$/.exec(t);if(i)return new Date(Date.UTC(+i[1],+i[2]-1,+i[3],+i[4],+i[5],+i[6]))}return t},f=function(n,t){var r,i;for(t=t||0,r=[],i=t;i<n.length;i++)r.push(n[i]);return r},u=function(n,t){document.getElementById("tsc_messages").innerHTML="<div class='message "+(t||"info")+"'>"+n+"<\/div>"},ei=function(n,t){var i="";t.forEach(function(n){i+="<li>"+n+"<\/li>"}),document.getElementById("tsc_messages").innerHTML="<div class='message validation'><h4>"+n+"<\/h4><ul>"+i+"<\/ul><\/div>"},at=function(){document.getElementById("tsc_messages").innerHTML=""},nt=0,a=function(n){if(nt==0){var t=document.getElementById("tsc_working");t.innerHTML="<strong>"+(n||"Please Wait...")+"<\/strong>",l(t,!0)}++nt},v=function(){--nt,nt==0&&l(document.getElementById("tsc_working"),!1)},r=function(n,t,i,r){n=n+(n.indexOf("?")===-1?"?":"&")+"format=json";var u,o,s,c=0,l=function(n){!t||t(n)},e=function(n){!i||i(n)},a=function(){!r||r()},h=function(t){u=rr(),s=fr(),o=!0,u.onreadystatechange=function(){var i,n,r;if(u.readyState===4&&o){o=!1;try{i=u.status}catch(f){i=200}if(i>=200&&i<=300){if(n=u.responseText,r=!0,n.indexOf("{")===0){try{n=JSON.parse(n,er)}catch(f){r=!1,e("Exception "+f+". Data: "+n)}r&&(n.Error?e(n.Error):n.Id===s?l(n.Body):e(String.format("Invalid response. Sent ID doen't matches received ID. Data: {0}",n)))}}else{if(++c<3){delete u.onreadystatechange,u.onreadystatechange=null,h(t);return}e(u.statusText+":"+u.responseText)}delete u.onreadystatechange,u.onreadystatechange=null,a()}},u.open("POST",n+"&id="+s,!0),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),u.setRequestHeader("Content-length",t.length),u.overrideMimeType&&(u.setRequestHeader("Connection","close"),u.overrideMimeType("application/json")),u.send(t)};this.execute=function(n){h(JSON.stringify({Method:n,Arguments:f(arguments,1)}))}},oi=function(n){var t=[];return Array.isArray(n)||(n=[n]),n.forEach(function(n){n.args||(n.args=[]),n.validator.apply(null,n.args)||t.push(n.message)}),t},vt=function(n){return n.length>0},or=function(n,t){return n.length>=t},sr=function(n,t){return t.indexOf(n)===-1},hr=function(n){return/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/i.test(n)},e=[],tt=[],it=[],rt,cr=function(n){var t;return e.forEach(function(i){i.ID===n&&(t=i)}),t},y=function(){g("main_tpl",{packages:e,quotes:tt,projects:it})},ut;efx.showScreen=function(n){ut&&clearTimeout(ut),ut=null,efx[n].apply(null,f(arguments,1))},efx.doConfirm=function(n,t){return window.confirm(n.split("\\n").join("\n"))&&t.apply(null,f(arguments,2)),!1},efx.listQuotesScreen=function(){new r(t,function(n){at(),e=[],tt=[],it=[],n.forEach(function(n){var t=n.Status;n.HumanStatus=t.replace(/([A-Z])/g," $1"),t=="QuoteOpen"?e.push(n):t.indexOf("Project")===-1?tt.push(n):it.push(n)}),y()},function(n){u(String.format("Failed to retrieve remote data. {0}",n),"error")},function(){ut=setTimeout(function(){efx.showScreen("listQuotesScreen")},2e4)}).execute("ListQuotes"),y();var n=document.getElementById("tsc_status"),i=function(){l(n,!1),n.innerHTML=""};new r(t,function(t){t&&t.length?(l(n,!0),n.innerHTML=fi("status_tpl")({statuses:t})):i()},i).execute("GetStatuses")},efx.deletePackage=function(n){new r(t,null,function(n){u(String.format("Failed to delete package. {0}",n),"error")}).execute("DeleteQuote",n,i.UserName),e.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),y()},efx.createQuoteScreen=function(n){g("createQuote_tpl",{sourceLanguages:i.SourceLanguages,targetLanguages:i.TargetLanguages,quickQuote:n})},efx.showConfigurationScreen=function(n){g("config_tpl",{fromConfig:n,configuration:i})},efx.saveConfiguration=function(){at();var f=s(document.getElementById("tsc_tokenID")),n=s(document.getElementById("tsc_Endpoint")),o=new r(t,function(){i.AuthorizationToken=f,i.TscServerEndPoint=n,st=!1,efx.init()},function(n){u(String.format("Can not save configuration data. {0}",n),"error")},function(){v()}),e=oi([{validator:vt,args:[f],message:"The Authorization Token is required."},{validator:vt,args:[n],message:"The EndPoint URL is required."},{validator:hr,args:[n],message:"The EndPoint URL is not in a valid form."},]);if(e.length>0){ei("There were some errors while checking the form:",e);return}a(),o.execute("SaveConfiguration",f,n)},efx.createQuote=function(n){at();var l=new r(t,function(t){e.push(t),efx.addDocuments(t.ID,n)},function(n){u(String.format("Failed to create quote. {0}",n),"error")},function(){v()}),o=s(document.getElementById("tsc_Name")),h=s(document.getElementById("tsc_SourceLang")),f=s(document.getElementById("tsc_TargetLangs"),!0),c=oi([{validator:vt,args:[o],message:n?"The name of the quote is required.":"The name of the package is required."},{validator:or,args:[f,1],message:"You have to select at least one target language"},{validator:sr,args:[h,f],message:"You can not select as target language the selected source language"},]);if(c.length>0){ei("There were some errors while checking the form:",c);return}a(),l.execute("CreateQuote",o,s(document.getElementById("tsc_Notes")),h,f,i.UserName)},efx.requestAQuote=function(n,f){new r(t,function(){e.forEach(function(t,i,r){t.ID===n&&(t.HumanStatus="Quote In Progress",t.Status="QuoteInProgress",t.Name=String.format("Creating quote for: {0}",t.Name),tt.push(t),r.splice(i,1))}),f?efx.listQuotesScreen():y()},function(n){u(String.format("Failed to request a quote. {0}",n),"error")}).execute("SendQuoteToGpms",n,i.UserName,f||!1)},efx.addDocuments=function(n,f){a(),new r(t,function(t){var e,o,h,c;t=t||{},rt={},e=cr(n),o=e.SourceLanguageISOCode,g("add_documents_tpl",{quote:e,quickQuote:f});for(var l=i.DocumentBrowserPanes,s=document.getElementById("tsc_columns"),u={},r=t.length-1;r>=0;--r)h=t[r],u[h.ID]=ui(h);l.forEach(function(n){var i=document.createElement("dl"),f=document.createElement("dt"),r=document.createElement("dd"),t=n.ID;i.className="tsc_panel",f.appendChild(document.createTextNode(n.Name)),i.appendChild(f),i.appendChild(r),s.appendChild(i),rt[t]=t.indexOf("options_")==0?new gi(r,t,u[t],o):new nr(r,t,u[t],o)}),c=new tr(s,100,320,.833333,!0),c.draw(),yi(c.draw)},function(n){u(String.format("Failed to retrieve selected package items. {0}",n),"error")},function(){v()}).execute("ListPackageFiles",n)},efx.addSelectedDocuments=function(n,f){a();var e=[];Object.keys(rt).forEach(function(n){var t=rt[n].getSelected();t&&e.push(t)}),new r(t,function(){f?efx.requestAQuote(n,!0):efx.listQuotesScreen()},function(n){u(String.format("Failed to export selected documents. {0}",n),"error")},function(){v()}).execute("ModifyPackageFiles",n,i.UserName,e)},efx.importProject=function(n){a(),new r(t,function(){efx.listQuotesScreen()},function(n){u(String.format("Failed to import translations. {0}",n),"error")},function(){v()}).execute("Import",n,i.UserName)},efx.closeProject=function(n){new r(t,function(){it.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),y()},function(n){u(String.format("Failed to close project. {0}",n),"error")}).execute("CloseQuote",n,i.UserName)},efx.addLangResource=function(n){kt=n},efx.init=function(){wt=!0,ct()},yt=[],si=function(){new r(t,function(n){i=n,bt=!0,ct()},function(n){u(String.format("Failed to retrieve configuration. {0}",n),"error")}).execute("GetConfiguration"),navigator&&(ot=!0),ct()},(typeof Array.isArray=="undefined"||typeof Array.prototype.forEach=="undefined"||typeof Object.keys=="undefined"||typeof Date.prototype.toISOString=="undefined"||typeof Date.prototype.toJSON=="undefined"||typeof String.prototype.trim=="undefined")&&yt.push('/<%=WebResource("TSC.WebClient.js.EcmaScript5.min.js")%>'),yt.length?n.include(yt,si):si()}(window);
js/gpi_tsc/tsc.min.js.mine ADDED
@@ -0,0 +1 @@
 
1
+ function trace(n){window.opera?opera.postError(n):window.debugService?typeof n=="object"?window.debugService.inspect("trace",n):window.debugService.trace(n):window.console?console.dir&&typeof n=="object"?console.dir(n):console.log(n):alert(n)}!function(n){n.include=function(t,i){function l(t,i,h,c,l){c=u.createElement("script"),e++,c.onload=c.onreadystatechange=function(u,e){e=0,u=this.readyState||u.type,u.search("load|complete")||l||(h?(t=function(){n[h]?o(i):setTimeout(t,r),++e>r&&(t=f)})():o(i),l=r)},c.async=!0,c.src=t,u[s].appendChild(c)}function o(n){n(),!--e&&i()}var u=document,s="body",f=function(){},h={},e=0,r=1;!t.pop&&(t=[t]),i=i||f,!function c(n,o,a,v){if(!u[s])return setTimeout(c,r);o=u.getElementsByTagName("script"),v=f;for(n in o)o[n].src&&(h[o[n].src]=n);for(n=t.length;n--;)t[n].pop?(o=t[n][0],v=t[n][1],a=t[n][2]):o=t[n],h[o]?v():l(o,v,a);!e&&i()}()}}(this),window.Date.prototype.f=function(n){var v,e;n=n+"";var a=["January","February","March","April","May","June","July","August","September","October","November","December"],c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=function(n){return(n<0||n>9?"":"0")+n},u=this,s="",h=0,f=u.getYear()+"",o=u.getMonth()+1,w=u.getDate(),l=u.getDay(),i=u.getHours(),y=u.getMinutes(),p=u.getSeconds(),t={};for(f.length<4&&(f=""+(+f+1900)),t.y=""+f,t.yyyy=f,t.yy=f.substr(2,4),t.M=o,t.MM=r(o),t.MMM=a[o-1],t.NNN=a[o-1].substr(0,3),t.N=a[o-1].substr(0,1),t.d=w,t.dd=r(w),t.e=c[l].substr(0,1),t.ee=c[l].substr(0,2),t.E=c[l].substr(0,3),t.EE=c[l],t.H=i,t.HH=r(i),t.h=i==0?12:i>12?i-12:i,t.hh=r(t.h),t.K=i>11?i-12:i,t.k=i+1,t.KK=r(t.K),t.kk=r(t.k),t.a=i>11?"PM":"AM",t.m=y,t.mm=r(y),t.s=p,t.ss=r(p);h<n.length;){for(v=n.charAt(h),e="";n.charAt(h)==v&&h<n.length;)e+=n.charAt(h++);s=t[e]!=null?s+t[e]:s+e}return s},function(n){"use strict";var fi,g,ot;n.efx||(n.efx={}),String.isNullOrEmpty||(String.isNullOrEmpty=function(n){return n?n.toString().replace(/^\s*|\s*$/g,"")==="":!0}),String.format||(fi=new RegExp(/{(\d+)}|{(\d+):([^\r\n{}]+)}/g),String.format=function(n,t){t instanceof Array||(t=Array.prototype.slice.call(arguments,1));for(var u,i,e,r,f=n;(u=fi.exec(n))!=null;)i=t[parseInt(u[1]||u[2],10)],e=u[3]||"",r=pt(i)?"":i.toFormattedString?i.toFormattedString(e):i.format?i.format(e):i.toString(),f=f.split(u[0]).join(r);return f});var i="/rpc.axd",ei={},at={},lt={},ci,yt,ct,gt,ni,t={},bt={},wi=function(){return document.getElementById("tsc_content")},lr=function(n){return bt[n]},pt=function(n){return n===ci?!0:n===null?!0:!1},l=function(n,t){for(t=t.toUpperCase();n&&n.parentNode;)if(n=n.parentNode,n.nodeType===1&&n.nodeName.toUpperCase()===t)return n;return null},ft=function(n,t){return at[t]||(at[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")),at[t].test(n.className)},ut=function(n,t){ft(n,t)||(n.className=((n.className||"")==""?"":n.className+" ")+t)},fr=function(n,t){if(lt[t]||(lt[t]=new RegExp("(^|\\s)"+t)),!String.isNullOrEmpty(t))n.className=n.className.replace(lt[t],"").replace(/^\s+|(\s)\s+/g,"$1")},c=function(n,t){n.style.display=t?"block":"none"},ti=function(n){n.parentNode.removeChild(n)},er=function(n,t){return t?{w:n.offsetWidth,h:n.offsetHeight}:{w:n.clientWidth,h:n.clientHeight}},vt=function(){if(gt&&!ct&&typeof yt!="undefined"&&yt&&ni)ct=!0,efx.showScreen("listQuotesScreen")},d,w,gi=function(t){if(w)throw new Error("Resize event already hooked");w=!0,d=n.onresize,n.onresize=ri(n,function(n){t(),d&&d(n)})},ir=function(){w&&(w=!1,n.onresize=d)},tr="preventDefault stopPropagation type altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),nr=function(n){var t={};return tr.forEach(function(i){t[i]=n[i]}),t.originalEvent=n,t},ui=function(n,t){return function(i){var u,f;i=i||window.event;var r=i.$cloned?i:nr(i),e=i.target,o=i.type;for(r.$cloned=!0,r.currentTarget=n,r.stop=function(){i.stopPropagation(),i.preventDefault()},o.match(/(click|mouse|menu)/i)&&(pt(r.pageX)&&!pt(r.clientX)&&(u=document.documentElement,f=document.body,r.pageX=r.clientX+(u&&u.scrollLeft||f&&f.scrollLeft||0)-(u&&u.clientLeft||f&&f.clientLeft||0),r.pageY=r.clientY+(u&&u.scrollTop||f&&f.scrollTop||0)-(u&&u.clientTop||f&&f.clientTop||0)),o.match(/DOMMouseScroll|mousewheel/)&&(r.wheelDelta=i.wheelDelta?i.wheelDelta/120:-(i.detail||0)/3));e&&e.nodeType==3;)e=e.parentNode;r.target=e,t(r,n)}},yi=function(n,t){var i=ui(n,t);return function(){var t=window.event;t.target=t.srcElement,t.preventDefault=function(){t.returnValue=!1},t.stopPropagation=function(){t.cancelBubble=!0},i(t),t.target=t.relatedTarget=t.preventDefault=t.stopPropagation=t=null}},ri=document.addEventListener?ui:yi,ii=function(n,t){n.onclick=ri(n,t)},o=function(n,t){return n.getAttribute(t)||(n.attributes[t]?n.attributes[t].nodeValue:null)},rr=function(n){var t=n.nodeName.toLowerCase();switch(t){case"textarea":return t;case"select":return String.isNullOrEmpty(o(n,"multiple"))?t:"select-multiple";case"input":return o(n,"type")}return t},s=function(n,t){var u=[],r,s=0,i,o,f=[],c=rr(n),h;o=n.name||"",o!==""&&(f=e(document.getElementsByName(o)));switch(c){case"select":r=n.options[n.selectedIndex],i=r.value||r.text;break;case"select-multiple":for(i=[];(r=n.selectedIndex)!==-1;)(u[u.length]=n.options[r]).selected=!1,i[i.length]=r;return u.forEach(function(n){n.selected=!0}),i;case"checkbox":return i=[],f.forEach(function(n){(n.checked||n.selected)&&(u[u.length]=n,i[i.length]=n.value)}),i;case"radio":for(h=f.length;s<h;++s)if(r=f[s++],r.checked||r.selected){i=r.value;break}break;default:i=n.value}return t?[i]:i},hi=function(n){var t=document.createElement("b");return t.className="loading",t.appendChild(document.createTextNode("Loading...")),n.appendChild(t),t},si=function(n){return{ID:n.ID,ContentType:n.ContentType,Selected:n.Selected,Name:n.Name,LastModificationDate:n.LastModificationDate}},k=function(n){var r,i,t;if(!n)return 0;if(n.Selected)return 2;if(r=n.Children,i=r&&Object.keys(r),!i)return 0;for(t=0;t<i.length;++t)if(k(r[i[t]])!=0)return 1;return 0},ht=function(n){if(!n||!n.ID)return null;var r=n.Children,t=[],i=si(n);return n.Selected?i:k(n)==1&&r?(Object.keys(r).forEach(function(n){var u=r[n],i=ht(u);u&&i&&(t[t.length]=i)}),t.length&&(i.Children=t),i):null},oi=function(n){if(!n||!n.ID)return null;var t,r,i=n.Children,f={},u=si(n);if(i){for(t=0;t<i.length;++t)r=i[t],f[r.ID]=oi(r);t&&(u.Children=f)}return u},b=function(n,t,i){return{ID:n,ContentType:t||"Other",Selected:!1,Name:i||"",Children:{},LastModificationDate:new Date}},bi=function(n,t,f,s){f=f||b(t);var l=hi(n),h="tsc_optionsId_"+t,c=new r(i,function(i){ti(l);var r=document.createElement("ul");r.setAttribute("id",h),ut(r,"tsc_options"),i.forEach(function(n){var o=document.createElement("li"),u=document.createElement("label"),s=document.createElement("span"),i=document.createElement("input"),e=f.Children[n.ID];u.setAttribute("unselectable","on"),i.setAttribute("type","checkbox"),i.setAttribute("name","tsc_options_"+t),i.setAttribute("value",n.ID),i.checked=e&&e.Selected,u.appendChild(i),u.appendChild(s),s.appendChild(document.createTextNode(n.Name)),o.appendChild(u),r.appendChild(o)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve options. {0}",n),"error")});c.execute("GetChildren",t,s,t),this.getSelected=function(){var t=document.getElementById(h),n;return t?(n=e(t.getElementsByTagName("input")),n&&n.length&&n.forEach(function(n){var t=o(n,"value"),i;n.checked?(i=f.Children[t]||(f.Children[t]=b(t)),i.Selected=!0,i.LastModificationDate=new Date):f.Children[t]=null}),ht(f)):!1}},ki=function(n,t,f,s){f=f||b(t);var nt={},a=function(n,t){var i=g(n.value);i.LastModificationDate=new Date,n.nextSibling&&(n.nextSibling.className="tsc_checkstate"+t);switch(t){case 0:n.removeAttribute("disabled"),i.Selected=n.checked=!1;return;case 1:n.setAttribute("disabled","disabled"),i.Selected=!(n.checked=!0);return;case 2:n.removeAttribute("disabled"),i.Selected=n.checked=!0;return}},h=function(n,t){a(l(n,"li").getElementsByTagName("input")[0],t)},rt=function(n,t){n.stop(),t=document.getElementById(o(t,"for"));var r=g(t.value),i=String.isNullOrEmpty(o(t,"disabled"));i&&a(t,t.checked?0:2),y(t,t.checked),tt(r,t.checked),d(t)},g=function(n){for(var u,t=[],r=f,i;u=nt[n];)t[t.length]=n.split("|")[1],n=u;for(t.reverse(),i=0;i<t.length;++i)r=r.Children[t[i]];return r},tt=function(n,t){n.Selected=t,n.LastModificationDate=new Date;var r=n.Children,i=r&&Object.keys(r);if(i&&i.length)i.forEach(function(n){tt(r[n],t)})},d=function(n){var t=l(n,"ul"),r,i;if(t.length!=0&&(r=v(t),i=0,r.forEach(function(n){n.checked&&++i}),t=l(t,"li"),t!=null)&&(t=t.getElementsByTagName("input"),t.length!==0))n=t[0],i===r.length?h(n,2):i>0?h(n,1):h(n,0),d(n)},y=function(n,t){n.removeAttribute("disabled"),t?h(n,2):h(n,0);var i=it(n);if(i!=null)v(i).forEach(function(n){var i=n.value.split("|")[0];n.checked=t,t?h(n,2):h(n,0),(i==="Mixed"||i==="Folder")&&y(n,t)})},it=function(n){n=l(n,"li").childNodes;for(var i=n.length,t;i>0;)if(t=n[--i],t.nodeName.toUpperCase()==="UL")return t;return null},v=function(n){var t=[];return e(n.children).forEach(function(n){if(n.nodeName.toUpperCase()==="LI")e(n.getElementsByTagName("input")).forEach(function(i){if(i.parentNode==n)t.push(i)})}),t},et=function(n,t){n.stop();var u=t.href.split("|"),i=l(t,"li"),r="open";ft(t,r)?(fr(t,r),w(i,!1)):(ut(t,r),ft(i,"loaded")?w(i,!0):p(i,u[1],u[2],null,t.__enabledOptions,t.__parents))},w=function(n,t){c(n.getElementsByTagName("ul")[0],t)},p=function(n,t,f,e,h,c){var v=hi(n),l=new r(i,function(t){ti(v);var r=document.createElement("ul"),i=n.getElementsByTagName("input");i=i.length?i[0].checked&&String.isNullOrEmpty(o(i[0],"disabled")):!1,String.isNullOrEmpty(e)||(r.className=e,r.setAttribute("id","tsc_treeId_"+f)),ut(n,"loaded"),t.forEach(function(n){var e=document.createElement("li"),v=document.createElement("div"),o=document.createElement("label"),t=document.createElement("input"),y=f+n.ContentType+n.ID,s=h[n.ID]||(h[n.ID]=b(n.ID,n.ContentType,n.Name)),l=n.ContentType+"|"+n.ID,u;e.className="tsc_"+n.ContentType,o.setAttribute("unselectable","on"),o.setAttribute("for",y),t.setAttribute("type","checkbox"),t.setAttribute("name","tsc_tree_"+f),nt[l]=c,t.setAttribute("value",l),t.setAttribute("id",y),i?(a(t,2),v.className="tsc_checkstate2"):(a(t,k(s)),v.className="tsc_checkstate"+k(s)),ii(o,rt),(n.ContentType==="Folder"||n.ContentType==="Mixed")&&(u=document.createElement("a"),u.__enabledOptions=s.Children||(s.Children={}),u.__parents=l,u.setAttribute("href","#expand|"+n.ID+"|"+f),ii(u,et),u.appendChild(document.createTextNode("+")),e.appendChild(u),e.appendChild(document.createTextNode(" "))),o.appendChild(document.createTextNode(n.Name)),e.appendChild(t),e.appendChild(v),e.appendChild(o),r.appendChild(e)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve tree branch. {0}",n),"error")});l.execute("GetChildren",t,s,f)};p(n,"0",t,"tsc_tree",f.Children,"0"),this.getSelected=function(){return ht(f)}},di=function(n,t,i,r,u){i=i||320,r=r||18;for(var h=0,e=0,l=n.getElementsByTagName("dl"),o=[],s,c,a=r+(u?"%":"px"),f=0;f<l.length;++f)s=l[f],s.parentNode==n&&ft(s,"tsc_panel")&&(s.setAttribute("id","tsc_pane"+e),o[e]=s,++e);for(t>e&&(t=e),f=0;f<e;++f)o[o.length]=document.getElementById("tsc_pane"+f);this.draw=function(){var w=er(n).w,k=w,d=t,l,s,y,b,v,g,p;if(c!=w){if(c=w,u||(w-=r),w>i)for(f=t-1;f>=0;--f){if(k=w/(f+1),k<i)continue;d=f+1;break}else d=1;if(k=u?(100-r)/d-r+"%":(k-r|0)+"px",y=[],b=[],h>0){for(f=0;f<e;++f)o[f].parentNode.removeChild(o[f]);for(f=0;f<h;++f)l=document.getElementById("column-"+f),l.parentNode.removeChild(l)}for(h=d,f=0;f<h;++f)v=document.createElement("div"),v.id="column-"+f,ut(v,"tsc_multi_column"),v.style.width=k,v.style.marginLeft=a,n.appendChild(v),s=y.length,y[s]=v,b[s]=v.offsetHeight;for(f=0;f<e;++f){if(l=o[f],f<y.length)s=f;else for(g=0,p=0;p<b.length;p++)(p==0||b[p]<g)&&(g=b[p],s=p);y[s]&&(l.parentNode&&l.parentNode.removeChild(l),y[s].appendChild(l),b[s]=y[s].offsetHeight)}}}},y=function(n,t){ir(),wi().innerHTML=kt(n)(t||{})},kt=function sr(n,t){var i=/\W/.test(n)?new Function("obj","var p=[]; with(obj){p.push('"+n.replace(/[\r\t\n]/g," ").replace(/'(?=[^{]*}})/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/{{=(.+?)}}/g,"',$1,'").split("{{").join("');").split("}}").join("p.push('")+"');}return p.join('');"):ei[n]=ei[n]||sr(document.getElementById(n).innerHTML);return t?i(t):i},hr=function(){if(n.XMLHttpRequest)return new n.XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}return!1},cr="0123456789ABCDEF",or=function(){for(var n=[],t=0;t<36;t++)n[t]=Math.floor(Math.random()*16);for(n[14]=4,n[19]=n[19]&3|8,t=0;t<36;t++)n[t]=cr[n[t]];return n[8]=n[13]=n[18]=n[23]="-",n.join("")},ur=function(n,t){if(typeof t=="string"){var i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:([\+-])(\d{2})\:(\d{2}))?Z?$/.exec(t);if(i)return new Date(Date.UTC(+i[1],+i[2]-1,+i[3],+i[4],+i[5],+i[6]))}return t},e=function(n,t){var r,i;for(t=t||0,r=[],i=t;i<n.length;i++)r.push(n[i]);return r},u=function(n,t){document.getElementById("tsc_messages").innerHTML="<div class='message "+(t||"info")+"'>"+n+"</div>"},wt=function(n,t){var i="";t.forEach(function(n){i+="<li>"+n+"</li>"}),document.getElementById("tsc_messages").innerHTML="<div class='message validation'><h4>"+n+"</h4><ul>"+i+"</ul></div>"},et=function(){document.getElementById("tsc_messages").innerHTML=""},tt=0,h=function(n){if(tt==0){var t=document.getElementById("tsc_working");t.innerHTML="<strong>"+(n||"Please Wait...")+"</strong>",c(t,!0)}++tt},a=function(){--tt,tt==0&&c(document.getElementById("tsc_working"),!1)},r=function(n,t,i,r){n=n+(n.indexOf("?")===-1?"?":"&")+"format=json";var u,s,o,c=0,a=function(n){!t||t(n)},f=function(n){!i||i(n)},l=function(){!r||r()},h=function(t){u=hr(),o=or(),s=!0,u.onreadystatechange=function(){var i,n,r;if(u.readyState===4&&s){s=!1;try{i=u.status}catch(e){i=200}if(i>=200&&i<=300){if(n=u.responseText,r=!0,n.indexOf("{")===0){try{n=JSON.parse(n,ur)}catch(e){r=!1,f("Exception "+e+". Data: "+n)}r&&(n.Error?f(n.Error):n.Id===o?a(n.Body):f(String.format("Invalid response. Sent ID doen't matches received ID. Data: {0}",n)))}}else{if(++c<3){delete u.onreadystatechange,u.onreadystatechange=null,h(t);return}f(u.statusText+":"+u.responseText)}delete u.onreadystatechange,u.onreadystatechange=null,l()}},u.open("POST",n+"&id="+o,!0),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),u.setRequestHeader("Content-length",t.length),u.overrideMimeType&&(u.setRequestHeader("Connection","close"),u.overrideMimeType("application/json")),u.send(t)};this.execute=function(n){h(JSON.stringify({Method:n,Arguments:e(arguments,1)}))}},dt=function(n){var t=[];return Array.isArray(n)||(n=[n]),n.forEach(function(n){n.args||(n.args=[]),n.validator.apply(null,n.args)||t.push(n.message)}),t},st=function(n){return n.length>0},pi=function(n,t){return n.length>=t},vi=function(n,t){return t.indexOf(n)===-1},li=function(n){return/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/i.test(n)},f=[],nt=[],it=[],rt,ai=function(n){var t;return f.forEach(function(i){i.ID===n&&(t=i)}),t},v=function(){y("main_tpl",{packages:f,quotes:nt,projects:it})},p;efx.showScreen=function(n){p&&clearTimeout(p),p=null,efx[n].apply(null,e(arguments,1))},efx.doConfirm=function(n,t){return window.confirm(n.split("\\n").join("\n"))&&t.apply(null,e(arguments,2)),!1},efx.listQuotesScreen=function(){new r(i,function(n){et(),f=[],nt=[],it=[],n.forEach(function(n){var t=n.Status;n.HumanStatus=t.replace(/([A-Z])/g," $1"),t=="QuoteOpen"?f.push(n):t.indexOf("Project")===-1?nt.push(n):it.push(n)}),v()},function(n){u(String.format("Failed to retrieve remote data. {0}",n),"error")},function(){p=setTimeout(function(){efx.showScreen("listQuotesScreen")},2e4)}).execute("ListQuotes"),v();var n=document.getElementById("tsc_status"),t=function(){c(n,!1),n.innerHTML=""};new r(i,function(i){i&&i.length?(c(n,!0),n.innerHTML=kt("status_tpl")({statuses:i})):t()},t).execute("GetStatuses")},efx.deletePackage=function(n){new r(i,null,function(n){u(String.format("Failed to delete package. {0}",n),"error")}).execute("DeleteQuote",n,t.UserName),f.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),v()},efx.createQuoteScreen=function(n){y("createQuote_tpl",{sourceLanguages:t.SourceLanguages,targetLanguages:t.TargetLanguages,quickQuote:n})},efx.showConfigurationScreen=function(n){y("config_tpl",{fromConfig:n,configuration:t})},efx.saveConfiguration=function(){et();var f=s(document.getElementById("tsc_tokenID")),n=s(document.getElementById("tsc_Endpoint")),o=new r(i,function(){t.AuthorizationToken=f,t.TscServerEndPoint=n,ct=!1,efx.init()},function(n){u(String.format("Can not save configuration data. {0}",n),"error")},function(){a()}),e=dt([{validator:st,args:[f],message:"The Authorization Token is required."},{validator:st,args:[n],message:"The EndPoint URL is required."},{validator:li,args:[n],message:"The EndPoint URL is not in a valid form."},]);if(e.length>0){wt("There were some errors while checking the form:",e);return}h(),o.execute("SaveConfiguration",f,n)},efx.createQuote=function(n){et();var v=new r(i,function(t){f.push(t),efx.addDocuments(t.ID,n)},function(n){u(String.format("Failed to create quote. {0}",n),"error")},function(){a()}),l=s(document.getElementById("tsc_Name")),c=s(document.getElementById("tsc_SourceLang")),e=s(document.getElementById("tsc_TargetLangs"),!0),o=dt([{validator:st,args:[l],message:n?"The name of the quote is required.":"The name of the package is required."},{validator:pi,args:[e,1],message:"You have to select at least one target language"},{validator:vi,args:[c,e],message:"You can not select as target language the selected source language"},]);if(o.length>0){wt("There were some errors while checking the form:",o);return}h(),v.execute("CreateQuote",l,s(document.getElementById("tsc_Notes")),c,e,t.UserName)},efx.requestAQuote=function(n,e){new r(i,function(){f.forEach(function(t,i,r){t.ID===n&&(t.HumanStatus="Quote In Progress",t.Status="QuoteInProgress",t.Name=String.format("Creating quote for: {0}",t.Name),nt.push(t),r.splice(i,1))}),e?efx.listQuotesScreen():v()},function(n){u(String.format("Failed to request a quote. {0}",n),"error")}).execute("SendQuoteToGpms",n,t.UserName,e||!1)},efx.addDocuments=function(n,f){h(),new r(i,function(i){var s,h,e,o;i=i||{},rt={},s=ai(n),h=s.SourceLanguageISOCode,y("add_documents_tpl",{quote:s,quickQuote:f});for(var l=t.DocumentBrowserPanes,c=document.getElementById("tsc_columns"),u={},r=i.length-1;r>=0;--r)e=i[r],u[e.ID]=oi(e);l.forEach(function(n){var i=document.createElement("dl"),f=document.createElement("dt"),r=document.createElement("dd"),t=n.ID;i.className="tsc_panel",f.appendChild(document.createTextNode(n.Name)),i.appendChild(f),i.appendChild(r),c.appendChild(i),rt[t]=t.indexOf("options_")==0?new bi(r,t,u[t],h):new ki(r,t,u[t],h)}),o=new di(c,100,320,.833333,!0),o.draw(),gi(o.draw)},function(n){u(String.format("Failed to retrieve selected package items. {0}",n),"error")},function(){a()}).execute("ListPackageFiles",n)},efx.addSelectedDocuments=function(n,f){h();var e=[];Object.keys(rt).forEach(function(n){var t=rt[n].getSelected();t&&e.push(t)}),new r(i,function(){f?efx.requestAQuote(n,!0):efx.listQuotesScreen()},function(n){u(String.format("Failed to export selected documents. {0}",n),"error")},function(){a()}).execute("ModifyPackageFiles",n,t.UserName,e)},efx.importProject=function(n){h(),new r(i,function(){efx.listQuotesScreen()},function(n){u(String.format("Failed to import translations. {0}",n),"error")},function(){a()}).execute("Import",n,t.UserName)},efx.closeProject=function(n){new r(i,function(){it.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),v()},function(n){u(String.format("Failed to close project. {0}",n),"error")}).execute("CloseQuote",n,t.UserName)},efx.addLangResource=function(n){bt=n},efx.init=function(){gt=!0,vt()},g=[],ot=function(){new r(i,function(n){t=n,ni=!0,vt()},function(n){u(String.format("Failed to retrieve configuration. {0}",n),"error")}).execute("GetConfiguration"),navigator&&(yt=!0),vt()},(typeof Array.isArray=="undefined"||typeof Array.prototype.forEach=="undefined"||typeof Object.keys=="undefined"||typeof Date.prototype.toISOString=="undefined"||typeof Date.prototype.toJSON=="undefined"||typeof String.prototype.trim=="undefined")&&g.push('/<%=WebResource("TSC.WebClient.js.EcmaScript5.min.js")%>'),g.length?n.include(g,ot):ot()}(window);
js/gpi_tsc/tsc.min.js.r118 ADDED
@@ -0,0 +1 @@
 
1
+ function trace(n){window.opera?opera.postError(n):window.debugService?typeof n=="object"?window.debugService.inspect("trace",n):window.debugService.trace(n):window.console?console.dir&&typeof n=="object"?console.dir(n):console.log(n):alert(n)}!function(n){n.include=function(t,i){function l(t,i,h,c,l){c=u.createElement("script"),e++,c.onload=c.onreadystatechange=function(u,e){e=0,u=this.readyState||u.type,u.search("load|complete")||l||(h?(t=function(){n[h]?o(i):setTimeout(t,r),++e>r&&(t=f)})():o(i),l=r)},c.async=!0,c.src=t,u[s].appendChild(c)}function o(n){n(),!--e&&i()}var u=document,s="body",f=function(){},h={},e=0,r=1;!t.pop&&(t=[t]),i=i||f,!function c(n,o,a,v){if(!u[s])return setTimeout(c,r);o=u.getElementsByTagName("script"),v=f;for(n in o)o[n].src&&(h[o[n].src]=n);for(n=t.length;n--;)t[n].pop?(o=t[n][0],v=t[n][1],a=t[n][2]):o=t[n],h[o]?v():l(o,v,a);!e&&i()}()}}(this),window.Date.prototype.f=function(n){var v,e;n=n+"";var a=["January","February","March","April","May","June","July","August","September","October","November","December"],c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=function(n){return(n<0||n>9?"":"0")+n},u=this,s="",h=0,f=u.getYear()+"",o=u.getMonth()+1,w=u.getDate(),l=u.getDay(),i=u.getHours(),y=u.getMinutes(),p=u.getSeconds(),t={};f.length<4&&(f=""+(+f+1900)),t.y=""+f,t.yyyy=f,t.yy=f.substr(2,4),t.M=o,t.MM=r(o),t.MMM=a[o-1],t.NNN=a[o-1].substr(0,3),t.N=a[o-1].substr(0,1),t.d=w,t.dd=r(w),t.e=c[l].substr(0,1),t.ee=c[l].substr(0,2),t.E=c[l].substr(0,3),t.EE=c[l],t.H=i,t.HH=r(i),t.h=i==0?12:i>12?i-12:i,t.hh=r(t.h),t.K=i>11?i-12:i,t.k=i+1,t.KK=r(t.K),t.kk=r(t.k),t.a=i>11?"PM":"AM",t.m=y,t.mm=r(y),t.s=p,t.ss=r(p);while(h<n.length){v=n.charAt(h),e="";while(n.charAt(h)==v&&h<n.length)e+=n.charAt(h++);s=t[e]!=null?s+t[e]:s+e}return s},function(n){"use strict";var fi,v,ft;n.efx||(n.efx={}),String.isNullOrEmpty||(String.isNullOrEmpty=function(n){return n?n.toString().replace(/^\s*|\s*$/g,"")==="":!0}),String.format||(fi=new RegExp(/{(\d+)}|{(\d+):([^\r\n{}]+)}/g),String.format=function(n,t){t instanceof Array||(t=Array.prototype.slice.call(arguments,1));var u,i,e,r,f=n;while((u=fi.exec(n))!=null)i=t[parseInt(u[1]||u[2],10)],e=u[3]||"",r=yt(i)?"":i.toFormattedString?i.toFormattedString(e):i.format?i.format(e):i.toString(),f=f.split(u[0]).join(r);return f});var i="/rpc.axd",ei={},vt={},lt={},ci,pt,ct,dt,ni,t={},wt={},wi=function(){return document.getElementById("tsc_content")},lr=function(n){return wt[n]},yt=function(n){return n===ci?!0:n===null?!0:!1},l=function(n,t){t=t.toUpperCase();while(n&&n.parentNode){n=n.parentNode;if(n.nodeType===1&&n.nodeName.toUpperCase()===t)return n}return null},ut=function(n,t){return vt[t]||(vt[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")),vt[t].test(n.className)},rt=function(n,t){ut(n,t)||(n.className=((n.className||"")==""?"":n.className+" ")+t)},fr=function(n,t){lt[t]||(lt[t]=new RegExp("(^|\\s)"+t));if(String.isNullOrEmpty(t))return;n.className=n.className.replace(lt[t],"").replace(/^\s+|(\s)\s+/g,"$1")},c=function(n,t){n.style.display=t?"block":"none"},ti=function(n){n.parentNode.removeChild(n)},er=function(n,t){return t?{w:n.offsetWidth,h:n.offsetHeight}:{w:n.clientWidth,h:n.clientHeight}},at=function(){if(!dt)return;if(ct||!pt||!ni)return;ct=!0,efx.showScreen("listQuotesScreen")},w,d,gi=function(t){if(d)throw new Error("Resize event already hooked");d=!0,w=n.onresize,n.onresize=ri(n,function(n){t(),w&&w(n)})},ir=function(){d&&(d=!1,n.onresize=w)},tr="preventDefault stopPropagation type altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),nr=function(n){var t={};return tr.forEach(function(i){t[i]=n[i]}),t.originalEvent=n,t},ui=function(n,t){return function(i){var u,f;i=i||window.event;var r=i.$cloned?i:nr(i),e=i.target,o=i.type;r.$cloned=!0,r.currentTarget=n,r.stop=function(){i.stopPropagation(),i.preventDefault()},o.match(/(click|mouse|menu)/i)&&(yt(r.pageX)&&!yt(r.clientX)&&(u=document.documentElement,f=document.body,r.pageX=r.clientX+(u&&u.scrollLeft||f&&f.scrollLeft||0)-(u&&u.clientLeft||f&&f.clientLeft||0),r.pageY=r.clientY+(u&&u.scrollTop||f&&f.scrollTop||0)-(u&&u.clientTop||f&&f.clientTop||0)),o.match(/DOMMouseScroll|mousewheel/)&&(r.wheelDelta=i.wheelDelta?i.wheelDelta/120:-(i.detail||0)/3));while(e&&e.nodeType==3)e=e.parentNode;r.target=e,t(r,n)}},yi=function(n,t){var i=ui(n,t);return function(n){n.target=n.srcElement,n.preventDefault=function(){n.returnValue=!1},n.stopPropagation=function(){n.cancelBubble=!0},i(n),n.target=n.relatedTarget=n.preventDefault=n.stopPropagation=n=null}},ri=document.addEventListener?ui:yi,ii=function(n,t){n.onclick=ri(n,t)},o=function(n,t){return n.getAttribute(t)||(n.attributes[t]?n.attributes[t].nodeValue:null)},rr=function(n){var t=n.nodeName.toLowerCase();switch(t){case"textarea":return t;case"select":return String.isNullOrEmpty(o(n,"multiple"))?t:"select-multiple";case"input":return o(n,"type")}return t},s=function(n,t){var u=[],r,s=0,i,o,f=[],c=rr(n),h;o=n.name||"",o!==""&&(f=e(document.getElementsByName(o)));switch(c){case"select":r=n.options[n.selectedIndex],i=r.value||r.text;break;case"select-multiple":i=[];while((r=n.selectedIndex)!==-1)(u[u.length]=n.options[r]).selected=!1,i[i.length]=r;return u.forEach(function(n){n.selected=!0}),i;case"checkbox":return i=[],f.forEach(function(n){(n.checked||n.selected)&&(u[u.length]=n,i[i.length]=n.value)}),i;case"radio":for(h=f.length;s<h;++s){r=f[s++];if(r.checked||r.selected){i=r.value;break}}break;default:i=n.value}return t?[i]:i},hi=function(n){var t=document.createElement("b");return t.className="loading",t.appendChild(document.createTextNode("Loading...")),n.appendChild(t),t},si=function(n){return{ID:n.ID,ContentType:n.ContentType,Selected:n.Selected,Name:n.Name,LastModificationDate:n.LastModificationDate}},ht=function(n){var r,i,t;if(!n)return 0;if(n.Selected)return 2;r=n.Children,i=r&&Object.keys(r);if(!i)return 0;for(t=0;t<i.length;++t)if(ht(r[i[t]])!=0)return 1;return 0},st=function(n){if(!n||!n.ID)return null;var r=n.Children,t=[],i=si(n);return n.Selected?i:ht(n)==1&&r?(Object.keys(r).forEach(function(n){var u=r[n],i=st(u);u&&i&&(t[t.length]=i)}),t.length&&(i.Children=t),i):null},oi=function(n){if(!n||!n.ID)return null;var t,r,i=n.Children,f={},u=si(n);if(i){for(t=0;t<i.length;++t)r=i[t],f[r.ID]=oi(r);t&&(u.Children=f)}return u},k=function(n,t,i){return{ID:n,ContentType:t||"Other",Selected:!1,Name:i||"",Children:{},LastModificationDate:new Date}},bi=function(n,t,f,s){f=f||k(t);var l=hi(n),h="tsc_optionsId_"+t,c=new r(i,function(i){ti(l);var r=document.createElement("ul");r.setAttribute("id",h),rt(r,"tsc_options"),i.forEach(function(n){var o=document.createElement("li"),u=document.createElement("label"),s=document.createElement("span"),i=document.createElement("input"),e=f.Children[n.ID];u.setAttribute("unselectable","on"),i.setAttribute("type","checkbox"),i.setAttribute("name","tsc_options_"+t),i.setAttribute("value",n.ID),i.checked=e&&e.Selected,u.appendChild(i),u.appendChild(s),s.appendChild(document.createTextNode(n.Name)),o.appendChild(u),r.appendChild(o)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve options. {0}",n),"error")});c.execute("GetChildren",t,s,t),this.getSelected=function(){var t=document.getElementById(h),n;return t?(n=e(t.getElementsByTagName("input")),n&&n.length&&n.forEach(function(n){var t=o(n,"value"),i;n.checked?(i=f.Children[t]||(f.Children[t]=k(t)),i.Selected=!0,i.LastModificationDate=new Date):f.Children[t]=null}),st(f)):!1}},ki=function(n,t,f,s){f=f||k(t);var g={},h=function(n,t){var i=d(n.value);i.LastModificationDate=new Date;switch(t){case 0:n.removeAttribute("disabled"),i.Selected=n.checked=!1;return;case 1:n.setAttribute("disabled","disabled"),i.Selected=!(n.checked=!0);return;case 2:n.removeAttribute("disabled"),i.Selected=n.checked=!0;return}},a=function(n,t){h(l(n,"li").getElementsByTagName("input")[0],t)},it=function(n,t){n.stop(),t=document.getElementById(o(t,"for"));var r=d(t.value),i=String.isNullOrEmpty(o(t,"disabled"));i&&h(t,t.checked?0:2),y(t,t.checked),nt(r,t.checked),b(t)},d=function(n){var u,t=[],r=f,i;while(u=g[n])t[t.length]=n.split("|")[1],n=u;for(t.reverse(),i=0;i<t.length;++i)r=r.Children[t[i]];return r},nt=function(n,t){n.Selected=t,n.LastModificationDate=new Date;var r=n.Children,i=r&&Object.keys(r);if(!(i&&i.length))return;i.forEach(function(n){nt(r[n],t)})},b=function(n){var t=l(n,"ul"),r,i;if(t.length==0)return;r=v(t),i=0,r.forEach(function(n){n.checked&&++i}),t=l(t,"li");if(t==null)return;t=t.getElementsByTagName("input");if(t.length===0)return;n=t[0],i===r.length?a(n,2):i>0?a(n,1):a(n,0),b(n)},y=function(n,t){n.removeAttribute("disabled");var i=tt(n);if(i==null)return;v(i).forEach(function(n){var i=n.value.split("|")[0];n.checked=t,(i==="Mixed"||i==="Folder")&&y(n,t)})},tt=function(n){n=l(n,"li").childNodes;var i=n.length,t;while(i>0){t=n[--i];if(t.nodeName.toUpperCase()==="UL")return t}return null},v=function(n){var t=[];return e(n.childNodes).forEach(function(n){if(n.nodeName.toUpperCase()!=="LI")return;e(n.getElementsByTagName("input")).forEach(function(i){if(i.parentNode!=n)return;t.push(i)})}),t},ft=function(n,t){n.stop();var u=t.href.split("|"),i=l(t,"li"),r="open";ut(t,r)?(fr(t,r),w(i,!1)):(rt(t,r),ut(i,"loaded")?w(i,!0):p(i,u[1],u[2],null,t.__enabledOptions,t.__parents))},w=function(n,t){c(n.getElementsByTagName("ul")[0],t)},p=function(n,t,f,e,c,l){var v=hi(n),a=new r(i,function(t){ti(v);var r=document.createElement("ul"),i=n.getElementsByTagName("input");i=i.length?i[0].checked&&String.isNullOrEmpty(o(i[0],"disabled")):!1,String.isNullOrEmpty(e)||(r.className=e,r.setAttribute("id","tsc_treeId_"+f)),rt(n,"loaded"),t.forEach(function(n){var e=document.createElement("li"),o=document.createElement("label"),t=document.createElement("input"),v=f+n.ContentType+n.ID,s=c[n.ID]||(c[n.ID]=k(n.ID,n.ContentType,n.Name)),a=n.ContentType+"|"+n.ID,u;e.className="tsc_"+n.ContentType,o.setAttribute("unselectable","on"),o.setAttribute("for",v),t.setAttribute("type","checkbox"),t.setAttribute("name","tsc_tree_"+f),g[a]=l,t.setAttribute("value",a),t.setAttribute("id",v),i?h(t,2):h(t,ht(s)),ii(o,it),(n.ContentType==="Folder"||n.ContentType==="Mixed")&&(u=document.createElement("a"),u.__enabledOptions=s.Children||(s.Children={}),u.__parents=a,u.setAttribute("href","#expand|"+n.ID+"|"+f),ii(u,ft),u.appendChild(document.createTextNode("+")),e.appendChild(u),e.appendChild(document.createTextNode(" "))),o.appendChild(document.createTextNode(n.Name)),e.appendChild(t),e.appendChild(o),r.appendChild(e)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve tree branch. {0}",n),"error")});a.execute("GetChildren",t,s,f)};p(n,"0",t,"tsc_tree",f.Children,"0"),this.getSelected=function(){return st(f)}},di=function(n,t,i,r,u){i=i||320,r=r||18;for(var h=0,e=0,l=n.getElementsByTagName("dl"),o=[],s,c,a=r+(u?"%":"px"),f=0;f<l.length;++f)s=l[f],s.parentNode==n&&ut(s,"tsc_panel")&&(s.setAttribute("id","tsc_pane"+e),o[e]=s,++e);for(t>e&&(t=e),f=0;f<e;++f)o[o.length]=document.getElementById("tsc_pane"+f);this.draw=function(){var w=er(n).w,k=w,d=t,l,s,y,b,v,g,p;if(c==w)return;c=w,u||(w-=r);if(w>i)for(f=t-1;f>=0;--f){k=w/(f+1);if(k<i)continue;d=f+1;break}else d=1;k=u?(100-r)/d-r+"%":(k-r|0)+"px",y=[],b=[];if(h>0){for(f=0;f<e;++f)o[f].parentNode.removeChild(o[f]);for(f=0;f<h;++f)l=document.getElementById("column-"+f),l.parentNode.removeChild(l)}for(h=d,f=0;f<h;++f)v=document.createElement("div"),v.id="column-"+f,rt(v,"tsc_multi_column"),v.style.width=k,v.style.marginLeft=a,n.appendChild(v),s=y.length,y[s]=v,b[s]=v.offsetHeight;for(f=0;f<e;++f){l=o[f];if(f<y.length)s=f;else for(g=0,p=0;p<b.length;p++)(p==0||b[p]<g)&&(g=b[p],s=p);y[s]&&(l.parentNode&&l.parentNode.removeChild(l),y[s].appendChild(l),b[s]=y[s].offsetHeight)}}},b=function(n,t){ir(),wi().innerHTML=bt(n)(t||{})},bt=function sr(n,t){var i=/\W/.test(n)?new Function("obj","var p=[]; with(obj){p.push('"+n.replace(/[\r\t\n]/g," ").replace(/'(?=[^{]*}})/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/{{=(.+?)}}/g,"',$1,'").split("{{").join("');").split("}}").join("p.push('")+"');}return p.join('');"):ei[n]=ei[n]||sr(document.getElementById(n).innerHTML);return t?i(t):i},hr=function(){if(n.XMLHttpRequest)return new n.XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}return!1},cr="0123456789ABCDEF",or=function(){for(var n=[],t=0;t<36;t++)n[t]=Math.floor(Math.random()*16);for(n[14]=4,n[19]=n[19]&3|8,t=0;t<36;t++)n[t]=cr[n[t]];return n[8]=n[13]=n[18]=n[23]="-",n.join("")},ur=function(n,t){if(typeof t=="string"){var i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:([\+-])(\d{2})\:(\d{2}))?Z?$/.exec(t);if(i)return new Date(Date.UTC(+i[1],+i[2]-1,+i[3],+i[4],+i[5],+i[6]))}return t},e=function(n,t){return t=t||0,[].slice.call(n,t)},u=function(n,t){document.getElementById("tsc_messages").innerHTML="<div class='message "+(t||"info")+"'>"+n+"</div>"},kt=function(n,t){var i="";t.forEach(function(n){i+="<li>"+n+"</li>"}),document.getElementById("tsc_messages").innerHTML="<div class='message validation'><h4>"+n+"</h4><ul>"+i+"</ul></div>"},et=function(){document.getElementById("tsc_messages").innerHTML=""},nt=0,h=function(n){if(nt==0){var t=document.getElementById("tsc_working");t.innerHTML="<strong>"+(n||"Please Wait...")+"</strong>",c(t,!0)}++nt},a=function(){--nt,nt==0&&c(document.getElementById("tsc_working"),!1)},r=function(n,t,i,r){n=n+(n.indexOf("?")===-1?"?":"&")+"format=json";var u,s,o,c=0,a=function(n){!t||t(n)},f=function(n){!i||i(n)},l=function(){!r||r()},h=function(t){u=hr(),o=or(),s=!0,u.onreadystatechange=function(){var i,n,r;if(u.readyState!==4||!s)return;s=!1;try{i=u.status}catch(e){i=200}if(i>=200&&i<=300){n=u.responseText,r=!0;if(n.indexOf("{")===0){try{n=JSON.parse(n,ur)}catch(e){r=!1,f("Exception "+e+". Data: "+n)}r&&(n.Error?f(n.Error):n.Id===o?a(n.Body):f(String.format("Invalid response. Sent ID doen't matches received ID. Data: {0}",n)))}}else{if(++c<3){delete u.onreadystatechange,u.onreadystatechange=null,h(t);return}f(u.statusText+":"+u.responseText)}delete u.onreadystatechange,u.onreadystatechange=null,l()},u.open("POST",n+"&id="+o,!0),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),u.setRequestHeader("Content-length",t.length),u.overrideMimeType&&(u.setRequestHeader("Connection","close"),u.overrideMimeType("application/json")),u.send(t)};this.execute=function(n){h(JSON.stringify({Method:n,Arguments:e(arguments,1)}))}},gt=function(n){var t=[];return Array.isArray(n)||(n=[n]),n.forEach(function(n){n.args||(n.args=[]),n.validator.apply(null,n.args)||t.push(n.message)}),t},ot=function(n){return n.length>0},pi=function(n,t){return n.length>=t},vi=function(n,t){return t.indexOf(n)===-1},li=function(n){return/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/i.test(n)},f=[],g=[],tt=[],it,ai=function(n){var t;return f.forEach(function(i){i.ID===n&&(t=i)}),t},y=function(){b("main_tpl",{packages:f,quotes:g,projects:tt})},p;efx.showScreen=function(n){p&&clearTimeout(p),p=null,efx[n].apply(null,e(arguments,1))},efx.doConfirm=function(n,t){return window.confirm(n.split("\\n").join("\n"))&&t.apply(null,e(arguments,2)),!1},efx.listQuotesScreen=function(){new r(i,function(n){et(),f=[],g=[],tt=[],n.forEach(function(n){var t=n.Status;n.HumanStatus=t.replace(/([A-Z])/g," $1"),t=="QuoteOpen"?f.push(n):t.indexOf("Project")===-1?g.push(n):tt.push(n)}),y()},function(n){u(String.format("Failed to retrieve remote data. {0}",n),"error")},function(){p=setTimeout(function(){efx.showScreen("listQuotesScreen")},2e4)}).execute("ListQuotes"),y();var n=document.getElementById("tsc_status"),t=function(){c(n,!1),n.innerHTML=""};new r(i,function(i){i&&i.length?(c(n,!0),n.innerHTML=bt("status_tpl")({statuses:i})):t()},t).execute("GetStatuses")},efx.deletePackage=function(n){new r(i,null,function(n){u(String.format("Failed to delete package. {0}",n),"error")}).execute("DeleteQuote",n,t.UserName),f.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),y()},efx.createQuoteScreen=function(n){b("createQuote_tpl",{sourceLanguages:t.SourceLanguages,targetLanguages:t.TargetLanguages,quickQuote:n})},efx.showConfigurationScreen=function(n){b("config_tpl",{fromConfig:n,configuration:t})},efx.saveConfiguration=function(){et();var f=s(document.getElementById("tsc_tokenID")),n=s(document.getElementById("tsc_Endpoint")),o=new r(i,function(){t.AuthorizationToken=f,t.TscServerEndPoint=n,ct=!1,efx.init()},function(n){u(String.format("Can not save configuration data. {0}",n),"error")},function(){a()}),e=gt([{validator:ot,args:[f],message:"The Authorization Token is required."},{validator:ot,args:[n],message:"The EndPoint URL is required."},{validator:li,args:[n],message:"The EndPoint URL is not in a valid form."},]);if(e.length>0){kt("There were some errors while checking the form:",e);return}h(),o.execute("SaveConfiguration",f,n)},efx.createQuote=function(n){et();var v=new r(i,function(t){f.push(t),efx.addDocuments(t.ID,n)},function(n){u(String.format("Failed to create quote. {0}",n),"error")},function(){a()}),l=s(document.getElementById("tsc_Name")),c=s(document.getElementById("tsc_SourceLang")),e=s(document.getElementById("tsc_TargetLangs"),!0),o=gt([{validator:ot,args:[l],message:n?"The name of the quote is required.":"The name of the package is required."},{validator:pi,args:[e,1],message:"You have to select at least one target language"},{validator:vi,args:[c,e],message:"You can not select as target language the selected source language"},]);if(o.length>0){kt("There were some errors while checking the form:",o);return}h(),v.execute("CreateQuote",l,s(document.getElementById("tsc_Notes")),c,e,t.UserName)},efx.requestAQuote=function(n,e){new r(i,function(){f.forEach(function(t,i,r){t.ID===n&&(t.HumanStatus="Quote In Progress",t.Status="QuoteInProgress",t.Name=String.format("Creating quote for: {0}",t.Name),g.push(t),r.splice(i,1))}),e?efx.listQuotesScreen():y()},function(n){u(String.format("Failed to request a quote. {0}",n),"error")}).execute("SendQuoteToGpms",n,t.UserName,e||!1)},efx.addDocuments=function(n,f){h(),new r(i,function(i){var s,h,e,o;i=i||{},it={},s=ai(n),h=s.SourceLanguageISOCode,b("add_documents_tpl",{quote:s,quickQuote:f});for(var l=t.DocumentBrowserPanes,c=document.getElementById("tsc_columns"),u={},r=i.length-1;r>=0;--r)e=i[r],u[e.ID]=oi(e);l.forEach(function(n){var i=document.createElement("dl"),f=document.createElement("dt"),r=document.createElement("dd"),t=n.ID;i.className="tsc_panel",f.appendChild(document.createTextNode(n.Name)),i.appendChild(f),i.appendChild(r),c.appendChild(i),it[t]=t.indexOf("options_")==0?new bi(r,t,u[t],h):new ki(r,t,u[t],h)}),o=new di(c,100,320,.833333,!0),o.draw(),gi(o.draw)},function(n){u(String.format("Failed to retrieve selected package items. {0}",n),"error")},function(){a()}).execute("ListPackageFiles",n)},efx.addSelectedDocuments=function(n,f){h();var e=[];Object.keys(it).forEach(function(n){var t=it[n].getSelected();t&&e.push(t)}),new r(i,function(){f?efx.requestAQuote(n,!0):efx.listQuotesScreen()},function(n){u(String.format("Failed to export selected documents. {0}",n),"error")},function(){a()}).execute("ModifyPackageFiles",n,t.UserName,e)},efx.importProject=function(n){h(),new r(i,function(){efx.listQuotesScreen()},function(n){u(String.format("Failed to import translations. {0}",n),"error")},function(){a()}).execute("Import",n,t.UserName)},efx.closeProject=function(n){new r(i,function(){tt.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),y()},function(n){u(String.format("Failed to close project. {0}",n),"error")}).execute("CloseQuote",n,t.UserName)},efx.addLangResource=function(n){wt=n},efx.init=function(){dt=!0,at()},v=[],ft=function(){new r(i,function(n){t=n,ni=!0,at()},function(n){u(String.format("Failed to retrieve configuration. {0}",n),"error")}).execute("GetConfiguration");var f=n.onload;n.onload=function(n){pt=!0,at(),f&&f(n)}},JSON&&typeof JSON.stringify=="function"&&typeof JSON.parse=="function"||v.push('/<%=WebResource("TSC.WebClient.js.JSON.min.js")%>'),Array.isArray&&Array.prototype.forEach&&Object.keys&&Date.prototype.toISOString&&Date.prototype.toJSON&&String.prototype.trim||v.push('/<%=WebResource("TSC.WebClient.js.EcmaScript5.min.js")%>'),v.length?n.include(v,ft):ft()}(window);
js/gpi_tsc/tsc.min.js.r175 ADDED
@@ -0,0 +1 @@
 
1
+ function trace(n){window.opera?opera.postError(n):window.debugService?typeof n=="object"?window.debugService.inspect("trace",n):window.debugService.trace(n):window.console?console.dir&&typeof n=="object"?console.dir(n):console.log(n):alert(n)}!function(n){n.include=function(t,i){function l(t,i,h,c,l){c=u.createElement("script"),e++,c.onload=c.onreadystatechange=function(u,e){e=0,u=this.readyState||u.type,u.search("load|complete")||l||(h?(t=function(){n[h]?o(i):setTimeout(t,r),++e>r&&(t=f)})():o(i),l=r)},c.async=!0,c.src=t,u[s].appendChild(c)}function o(n){n(),!--e&&i()}var u=document,s="body",f=function(){},h={},e=0,r=1;!t.pop&&(t=[t]),i=i||f,!function c(n,o,a,v){if(!u[s])return setTimeout(c,r);o=u.getElementsByTagName("script"),v=f;for(n in o)o[n].src&&(h[o[n].src]=n);for(n=t.length;n--;)t[n].pop?(o=t[n][0],v=t[n][1],a=t[n][2]):o=t[n],h[o]?v():l(o,v,a);!e&&i()}()}}(this),window.Date.prototype.f=function(n){var v,e;n=n+"";var a=["January","February","March","April","May","June","July","August","September","October","November","December"],c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=function(n){return(n<0||n>9?"":"0")+n},u=this,s="",h=0,f=u.getYear()+"",o=u.getMonth()+1,w=u.getDate(),l=u.getDay(),i=u.getHours(),y=u.getMinutes(),p=u.getSeconds(),t={};for(f.length<4&&(f=""+(+f+1900)),t.y=""+f,t.yyyy=f,t.yy=f.substr(2,4),t.M=o,t.MM=r(o),t.MMM=a[o-1],t.NNN=a[o-1].substr(0,3),t.N=a[o-1].substr(0,1),t.d=w,t.dd=r(w),t.e=c[l].substr(0,1),t.ee=c[l].substr(0,2),t.E=c[l].substr(0,3),t.EE=c[l],t.H=i,t.HH=r(i),t.h=i==0?12:i>12?i-12:i,t.hh=r(t.h),t.K=i>11?i-12:i,t.k=i+1,t.KK=r(t.K),t.kk=r(t.k),t.a=i>11?"PM":"AM",t.m=y,t.mm=r(y),t.s=p,t.ss=r(p);h<n.length;){for(v=n.charAt(h),e="";n.charAt(h)==v&&h<n.length;)e+=n.charAt(h++);s=t[e]!=null?s+t[e]:s+e}return s},function(n){"use strict";var fi,v,ft;n.efx||(n.efx={}),String.isNullOrEmpty||(String.isNullOrEmpty=function(n){return n?n.toString().replace(/^\s*|\s*$/g,"")==="":!0}),String.format||(fi=new RegExp(/{(\d+)}|{(\d+):([^\r\n{}]+)}/g),String.format=function(n,t){t instanceof Array||(t=Array.prototype.slice.call(arguments,1));for(var u,i,e,r,f=n;(u=fi.exec(n))!=null;)i=t[parseInt(u[1]||u[2],10)],e=u[3]||"",r=yt(i)?"":i.toFormattedString?i.toFormattedString(e):i.format?i.format(e):i.toString(),f=f.split(u[0]).join(r);return f});var i="/rpc.axd",ei={},vt={},lt={},ci,pt,ct,dt,ni,t={},wt={},wi=function(){return document.getElementById("tsc_content")},lr=function(n){return wt[n]},yt=function(n){return n===ci?!0:n===null?!0:!1},l=function(n,t){for(t=t.toUpperCase();n&&n.parentNode;)if(n=n.parentNode,n.nodeType===1&&n.nodeName.toUpperCase()===t)return n;return null},ut=function(n,t){return vt[t]||(vt[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")),vt[t].test(n.className)},rt=function(n,t){ut(n,t)||(n.className=((n.className||"")==""?"":n.className+" ")+t)},fr=function(n,t){(lt[t]||(lt[t]=new RegExp("(^|\\s)"+t)),String.isNullOrEmpty(t))||(n.className=n.className.replace(lt[t],"").replace(/^\s+|(\s)\s+/g,"$1"))},c=function(n,t){n.style.display=t?"block":"none"},ti=function(n){n.parentNode.removeChild(n)},er=function(n,t){return t?{w:n.offsetWidth,h:n.offsetHeight}:{w:n.clientWidth,h:n.clientHeight}},at=function(){dt&&!ct&&pt&&ni&&(ct=!0,efx.showScreen("listQuotesScreen"))},w,d,gi=function(t){if(d)throw new Error("Resize event already hooked");d=!0,w=n.onresize,n.onresize=ri(n,function(n){t(),w&&w(n)})},ir=function(){d&&(d=!1,n.onresize=w)},tr="preventDefault stopPropagation type altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),nr=function(n){var t={};return tr.forEach(function(i){t[i]=n[i]}),t.originalEvent=n,t},ui=function(n,t){return function(i){var u,f;i=i||window.event;var r=i.$cloned?i:nr(i),e=i.target,o=i.type;for(r.$cloned=!0,r.currentTarget=n,r.stop=function(){i.stopPropagation(),i.preventDefault()},o.match(/(click|mouse|menu)/i)&&(yt(r.pageX)&&!yt(r.clientX)&&(u=document.documentElement,f=document.body,r.pageX=r.clientX+(u&&u.scrollLeft||f&&f.scrollLeft||0)-(u&&u.clientLeft||f&&f.clientLeft||0),r.pageY=r.clientY+(u&&u.scrollTop||f&&f.scrollTop||0)-(u&&u.clientTop||f&&f.clientTop||0)),o.match(/DOMMouseScroll|mousewheel/)&&(r.wheelDelta=i.wheelDelta?i.wheelDelta/120:-(i.detail||0)/3));e&&e.nodeType==3;)e=e.parentNode;r.target=e,t(r,n)}},yi=function(n,t){var i=ui(n,t);return function(n){n.target=n.srcElement,n.preventDefault=function(){n.returnValue=!1},n.stopPropagation=function(){n.cancelBubble=!0},i(n),n.target=n.relatedTarget=n.preventDefault=n.stopPropagation=n=null}},ri=document.addEventListener?ui:yi,ii=function(n,t){n.onclick=ri(n,t)},o=function(n,t){return n.getAttribute(t)||(n.attributes[t]?n.attributes[t].nodeValue:null)},rr=function(n){var t=n.nodeName.toLowerCase();switch(t){case"textarea":return t;case"select":return String.isNullOrEmpty(o(n,"multiple"))?t:"select-multiple";case"input":return o(n,"type")}return t},s=function(n,t){var u=[],r,s=0,i,o,f=[],c=rr(n),h;o=n.name||"",o!==""&&(f=e(document.getElementsByName(o)));switch(c){case"select":r=n.options[n.selectedIndex],i=r.value||r.text;break;case"select-multiple":for(i=[];(r=n.selectedIndex)!==-1;)(u[u.length]=n.options[r]).selected=!1,i[i.length]=r;return u.forEach(function(n){n.selected=!0}),i;case"checkbox":return i=[],f.forEach(function(n){(n.checked||n.selected)&&(u[u.length]=n,i[i.length]=n.value)}),i;case"radio":for(h=f.length;s<h;++s)if(r=f[s++],r.checked||r.selected){i=r.value;break}break;default:i=n.value}return t?[i]:i},hi=function(n){var t=document.createElement("b");return t.className="loading",t.appendChild(document.createTextNode("Loading...")),n.appendChild(t),t},si=function(n){return{ID:n.ID,ContentType:n.ContentType,Selected:n.Selected,Name:n.Name,LastModificationDate:n.LastModificationDate}},ht=function(n){var r,i,t;if(!n)return 0;if(n.Selected)return 2;if(r=n.Children,i=r&&Object.keys(r),!i)return 0;for(t=0;t<i.length;++t)if(ht(r[i[t]])!=0)return 1;return 0},st=function(n){if(!n||!n.ID)return null;var r=n.Children,t=[],i=si(n);return n.Selected?i:ht(n)==1&&r?(Object.keys(r).forEach(function(n){var u=r[n],i=st(u);u&&i&&(t[t.length]=i)}),t.length&&(i.Children=t),i):null},oi=function(n){if(!n||!n.ID)return null;var t,r,i=n.Children,f={},u=si(n);if(i){for(t=0;t<i.length;++t)r=i[t],f[r.ID]=oi(r);t&&(u.Children=f)}return u},k=function(n,t,i){return{ID:n,ContentType:t||"Other",Selected:!1,Name:i||"",Children:{},LastModificationDate:new Date}},bi=function(n,t,f,s){f=f||k(t);var l=hi(n),h="tsc_optionsId_"+t,c=new r(i,function(i){ti(l);var r=document.createElement("ul");r.setAttribute("id",h),rt(r,"tsc_options"),i.forEach(function(n){var o=document.createElement("li"),u=document.createElement("label"),s=document.createElement("span"),i=document.createElement("input"),e=f.Children[n.ID];u.setAttribute("unselectable","on"),i.setAttribute("type","checkbox"),i.setAttribute("name","tsc_options_"+t),i.setAttribute("value",n.ID),i.checked=e&&e.Selected,u.appendChild(i),u.appendChild(s),s.appendChild(document.createTextNode(n.Name)),o.appendChild(u),r.appendChild(o)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve options. {0}",n),"error")});c.execute("GetChildren",t,s,t),this.getSelected=function(){var t=document.getElementById(h),n;return t?(n=e(t.getElementsByTagName("input")),n&&n.length&&n.forEach(function(n){var t=o(n,"value"),i;n.checked?(i=f.Children[t]||(f.Children[t]=k(t)),i.Selected=!0,i.LastModificationDate=new Date):f.Children[t]=null}),st(f)):!1}},ki=function(n,t,f,s){f=f||k(t);var g={},h=function(n,t){var i=d(n.value);i.LastModificationDate=new Date;switch(t){case 0:n.removeAttribute("disabled"),i.Selected=n.checked=!1;return;case 1:n.setAttribute("disabled","disabled"),i.Selected=!(n.checked=!0);return;case 2:n.removeAttribute("disabled"),i.Selected=n.checked=!0;return}},a=function(n,t){h(l(n,"li").getElementsByTagName("input")[0],t)},it=function(n,t){n.stop(),t=document.getElementById(o(t,"for"));var r=d(t.value),i=String.isNullOrEmpty(o(t,"disabled"));i&&h(t,t.checked?0:2),y(t,t.checked),nt(r,t.checked),b(t)},d=function(n){for(var u,t=[],r=f,i;u=g[n];)t[t.length]=n.split("|")[1],n=u;for(t.reverse(),i=0;i<t.length;++i)r=r.Children[t[i]];return r},nt=function(n,t){n.Selected=t,n.LastModificationDate=new Date;var r=n.Children,i=r&&Object.keys(r);i&&i.length&&i.forEach(function(n){nt(r[n],t)})},b=function(n){var t=l(n,"ul"),r,i;t.length!=0&&(r=v(t),i=0,r.forEach(function(n){n.checked&&++i}),t=l(t,"li"),t!=null)&&(t=t.getElementsByTagName("input"),t.length!==0)&&(n=t[0],i===r.length?a(n,2):i>0?a(n,1):a(n,0),b(n))},y=function(n,t){n.removeAttribute("disabled");var i=tt(n);i!=null&&v(i).forEach(function(n){var i=n.value.split("|")[0];n.checked=t,(i==="Mixed"||i==="Folder")&&y(n,t)})},tt=function(n){n=l(n,"li").childNodes;for(var i=n.length,t;i>0;)if(t=n[--i],t.nodeName.toUpperCase()==="UL")return t;return null},v=function(n){var t=[];return e(n.childNodes).forEach(function(n){n.nodeName.toUpperCase()==="LI"&&e(n.getElementsByTagName("input")).forEach(function(i){i.parentNode==n&&t.push(i)})}),t},ft=function(n,t){n.stop();var u=t.href.split("|"),i=l(t,"li"),r="open";ut(t,r)?(fr(t,r),w(i,!1)):(rt(t,r),ut(i,"loaded")?w(i,!0):p(i,u[1],u[2],null,t.__enabledOptions,t.__parents))},w=function(n,t){c(n.getElementsByTagName("ul")[0],t)},p=function(n,t,f,e,c,l){var v=hi(n),a=new r(i,function(t){ti(v);var r=document.createElement("ul"),i=n.getElementsByTagName("input");i=i.length?i[0].checked&&String.isNullOrEmpty(o(i[0],"disabled")):!1,String.isNullOrEmpty(e)||(r.className=e,r.setAttribute("id","tsc_treeId_"+f)),rt(n,"loaded"),t.forEach(function(n){var e=document.createElement("li"),o=document.createElement("label"),t=document.createElement("input"),v=f+n.ContentType+n.ID,s=c[n.ID]||(c[n.ID]=k(n.ID,n.ContentType,n.Name)),a=n.ContentType+"|"+n.ID,u;e.className="tsc_"+n.ContentType,o.setAttribute("unselectable","on"),o.setAttribute("for",v),t.setAttribute("type","checkbox"),t.setAttribute("name","tsc_tree_"+f),g[a]=l,t.setAttribute("value",a),t.setAttribute("id",v),i?h(t,2):h(t,ht(s)),ii(o,it),(n.ContentType==="Folder"||n.ContentType==="Mixed")&&(u=document.createElement("a"),u.__enabledOptions=s.Children||(s.Children={}),u.__parents=a,u.setAttribute("href","#expand|"+n.ID+"|"+f),ii(u,ft),u.appendChild(document.createTextNode("+")),e.appendChild(u),e.appendChild(document.createTextNode(" "))),o.appendChild(document.createTextNode(n.Name)),e.appendChild(t),e.appendChild(o),r.appendChild(e)}),n.appendChild(r)},function(n){u(String.format("Failed to retrieve tree branch. {0}",n),"error")});a.execute("GetChildren",t,s,f)};p(n,"0",t,"tsc_tree",f.Children,"0"),this.getSelected=function(){return st(f)}},di=function(n,t,i,r,u){i=i||320,r=r||18;for(var h=0,e=0,l=n.getElementsByTagName("dl"),o=[],s,c,a=r+(u?"%":"px"),f=0;f<l.length;++f)s=l[f],s.parentNode==n&&ut(s,"tsc_panel")&&(s.setAttribute("id","tsc_pane"+e),o[e]=s,++e);for(t>e&&(t=e),f=0;f<e;++f)o[o.length]=document.getElementById("tsc_pane"+f);this.draw=function(){var w=er(n).w,k=w,d=t,l,s,y,b,v,g,p;if(c!=w){if(c=w,u||(w-=r),w>i){for(f=t-1;f>=0;--f)if(k=w/(f+1),!(k<i)){d=f+1;break}}else d=1;if(k=u?(100-r)/d-r+"%":(k-r|0)+"px",y=[],b=[],h>0){for(f=0;f<e;++f)o[f].parentNode.removeChild(o[f]);for(f=0;f<h;++f)l=document.getElementById("column-"+f),l.parentNode.removeChild(l)}for(h=d,f=0;f<h;++f)v=document.createElement("div"),v.id="column-"+f,rt(v,"tsc_multi_column"),v.style.width=k,v.style.marginLeft=a,n.appendChild(v),s=y.length,y[s]=v,b[s]=v.offsetHeight;for(f=0;f<e;++f){if(l=o[f],f<y.length)s=f;else for(g=0,p=0;p<b.length;p++)(p==0||b[p]<g)&&(g=b[p],s=p);y[s]&&(l.parentNode&&l.parentNode.removeChild(l),y[s].appendChild(l),b[s]=y[s].offsetHeight)}}}},b=function(n,t){ir(),wi().innerHTML=bt(n)(t||{})},bt=function sr(n,t){var i=/\W/.test(n)?new Function("obj","var p=[]; with(obj){p.push('"+n.replace(/[\r\t\n]/g," ").replace(/'(?=[^{]*}})/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/{{=(.+?)}}/g,"',$1,'").split("{{").join("');").split("}}").join("p.push('")+"');}return p.join('');"):ei[n]=ei[n]||sr(document.getElementById(n).innerHTML);return t?i(t):i},hr=function(){if(n.XMLHttpRequest)return new n.XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}return!1},cr="0123456789ABCDEF",or=function(){for(var n=[],t=0;t<36;t++)n[t]=Math.floor(Math.random()*16);for(n[14]=4,n[19]=n[19]&3|8,t=0;t<36;t++)n[t]=cr[n[t]];return n[8]=n[13]=n[18]=n[23]="-",n.join("")},ur=function(n,t){if(typeof t=="string"){var i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:([\+-])(\d{2})\:(\d{2}))?Z?$/.exec(t);if(i)return new Date(Date.UTC(+i[1],+i[2]-1,+i[3],+i[4],+i[5],+i[6]))}return t},e=function(n,t){return t=t||0,[].slice.call(n,t)},u=function(n,t){document.getElementById("tsc_messages").innerHTML="<div class='message "+(t||"info")+"'>"+n+"</div>"},kt=function(n,t){var i="";t.forEach(function(n){i+="<li>"+n+"</li>"}),document.getElementById("tsc_messages").innerHTML="<div class='message validation'><h4>"+n+"</h4><ul>"+i+"</ul></div>"},et=function(){document.getElementById("tsc_messages").innerHTML=""},nt=0,h=function(n){if(nt==0){var t=document.getElementById("tsc_working");t.innerHTML="<strong>"+(n||"Please Wait...")+"</strong>",c(t,!0)}++nt},a=function(){--nt,nt==0&&c(document.getElementById("tsc_working"),!1)},r=function(n,t,i,r){n=n+(n.indexOf("?")===-1?"?":"&")+"format=json";var u,s,o,c=0,a=function(n){!t||t(n)},f=function(n){!i||i(n)},l=function(){!r||r()},h=function(t){u=hr(),o=or(),s=!0,u.onreadystatechange=function(){var i,n,r;if(u.readyState===4&&s){s=!1;try{i=u.status}catch(e){i=200}if(i>=200&&i<=300){if(n=u.responseText,r=!0,n.indexOf("{")===0){try{n=JSON.parse(n,ur)}catch(e){r=!1,f("Exception "+e+". Data: "+n)}r&&(n.Error?f(n.Error):n.Id===o?a(n.Body):f(String.format("Invalid response. Sent ID doen't matches received ID. Data: {0}",n)))}}else{if(++c<3){delete u.onreadystatechange,u.onreadystatechange=null,h(t);return}f(u.statusText+":"+u.responseText)}delete u.onreadystatechange,u.onreadystatechange=null,l()}},u.open("POST",n+"&id="+o,!0),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),u.setRequestHeader("Content-length",t.length),u.overrideMimeType&&(u.setRequestHeader("Connection","close"),u.overrideMimeType("application/json")),u.send(t)};this.execute=function(n){h(JSON.stringify({Method:n,Arguments:e(arguments,1)}))}},gt=function(n){var t=[];return Array.isArray(n)||(n=[n]),n.forEach(function(n){n.args||(n.args=[]),n.validator.apply(null,n.args)||t.push(n.message)}),t},ot=function(n){return n.length>0},pi=function(n,t){return n.length>=t},vi=function(n,t){return t.indexOf(n)===-1},li=function(n){return/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/i.test(n)},f=[],g=[],tt=[],it,ai=function(n){var t;return f.forEach(function(i){i.ID===n&&(t=i)}),t},y=function(){b("main_tpl",{packages:f,quotes:g,projects:tt})},p;efx.showScreen=function(n){p&&clearTimeout(p),p=null,efx[n].apply(null,e(arguments,1))},efx.doConfirm=function(n,t){return window.confirm(n.split("\\n").join("\n"))&&t.apply(null,e(arguments,2)),!1},efx.listQuotesScreen=function(){new r(i,function(n){et(),f=[],g=[],tt=[],n.forEach(function(n){var t=n.Status;n.HumanStatus=t.replace(/([A-Z])/g," $1"),t=="QuoteOpen"?f.push(n):t.indexOf("Project")===-1?g.push(n):tt.push(n)}),y()},function(n){u(String.format("Failed to retrieve remote data. {0}",n),"error")},function(){p=setTimeout(function(){efx.showScreen("listQuotesScreen")},2e4)}).execute("ListQuotes"),y();var n=document.getElementById("tsc_status"),t=function(){c(n,!1),n.innerHTML=""};new r(i,function(i){i&&i.length?(c(n,!0),n.innerHTML=bt("status_tpl")({statuses:i})):t()},t).execute("GetStatuses")},efx.deletePackage=function(n){new r(i,null,function(n){u(String.format("Failed to delete package. {0}",n),"error")}).execute("DeleteQuote",n,t.UserName),f.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),y()},efx.createQuoteScreen=function(n){b("createQuote_tpl",{sourceLanguages:t.SourceLanguages,targetLanguages:t.TargetLanguages,quickQuote:n})},efx.showConfigurationScreen=function(n){b("config_tpl",{fromConfig:n,configuration:t})},efx.saveConfiguration=function(){et();var f=s(document.getElementById("tsc_tokenID")),n=s(document.getElementById("tsc_Endpoint")),o=new r(i,function(){t.AuthorizationToken=f,t.TscServerEndPoint=n,ct=!1,efx.init()},function(n){u(String.format("Can not save configuration data. {0}",n),"error")},function(){a()}),e=gt([{validator:ot,args:[f],message:"The Authorization Token is required."},{validator:ot,args:[n],message:"The EndPoint URL is required."},{validator:li,args:[n],message:"The EndPoint URL is not in a valid form."},]);if(e.length>0){kt("There were some errors while checking the form:",e);return}h(),o.execute("SaveConfiguration",f,n)},efx.createQuote=function(n){et();var v=new r(i,function(t){f.push(t),efx.addDocuments(t.ID,n)},function(n){u(String.format("Failed to create quote. {0}",n),"error")},function(){a()}),l=s(document.getElementById("tsc_Name")),c=s(document.getElementById("tsc_SourceLang")),e=s(document.getElementById("tsc_TargetLangs"),!0),o=gt([{validator:ot,args:[l],message:n?"The name of the quote is required.":"The name of the package is required."},{validator:pi,args:[e,1],message:"You have to select at least one target language"},{validator:vi,args:[c,e],message:"You can not select as target language the selected source language"},]);if(o.length>0){kt("There were some errors while checking the form:",o);return}h(),v.execute("CreateQuote",l,s(document.getElementById("tsc_Notes")),c,e,t.UserName)},efx.requestAQuote=function(n,e){new r(i,function(){f.forEach(function(t,i,r){t.ID===n&&(t.HumanStatus="Quote In Progress",t.Status="QuoteInProgress",t.Name=String.format("Creating quote for: {0}",t.Name),g.push(t),r.splice(i,1))}),e?efx.listQuotesScreen():y()},function(n){u(String.format("Failed to request a quote. {0}",n),"error")}).execute("SendQuoteToGpms",n,t.UserName,e||!1)},efx.addDocuments=function(n,f){h(),new r(i,function(i){var s,h,e,o;i=i||{},it={},s=ai(n),h=s.SourceLanguageISOCode,b("add_documents_tpl",{quote:s,quickQuote:f});for(var l=t.DocumentBrowserPanes,c=document.getElementById("tsc_columns"),u={},r=i.length-1;r>=0;--r)e=i[r],u[e.ID]=oi(e);l.forEach(function(n){var i=document.createElement("dl"),f=document.createElement("dt"),r=document.createElement("dd"),t=n.ID;i.className="tsc_panel",f.appendChild(document.createTextNode(n.Name)),i.appendChild(f),i.appendChild(r),c.appendChild(i),it[t]=t.indexOf("options_")==0?new bi(r,t,u[t],h):new ki(r,t,u[t],h)}),o=new di(c,100,320,.833333,!0),o.draw(),gi(o.draw)},function(n){u(String.format("Failed to retrieve selected package items. {0}",n),"error")},function(){a()}).execute("ListPackageFiles",n)},efx.addSelectedDocuments=function(n,f){h();var e=[];Object.keys(it).forEach(function(n){var t=it[n].getSelected();t&&e.push(t)}),new r(i,function(){f?efx.requestAQuote(n,!0):efx.listQuotesScreen()},function(n){u(String.format("Failed to export selected documents. {0}",n),"error")},function(){a()}).execute("ModifyPackageFiles",n,t.UserName,e)},efx.importProject=function(n){h(),new r(i,function(){efx.listQuotesScreen()},function(n){u(String.format("Failed to import translations. {0}",n),"error")},function(){a()}).execute("Import",n,t.UserName)},efx.closeProject=function(n){new r(i,function(){tt.forEach(function(t,i,r){t.ID===n&&r.splice(i,1)}),y()},function(n){u(String.format("Failed to close project. {0}",n),"error")}).execute("CloseQuote",n,t.UserName)},efx.addLangResource=function(n){wt=n},efx.init=function(){dt=!0,at()},v=[],ft=function(){new r(i,function(n){t=n,ni=!0,at()},function(n){u(String.format("Failed to retrieve configuration. {0}",n),"error")}).execute("GetConfiguration");var f=n.onload;n.onload=function(n){pt=!0,at(),f&&f(n)}},JSON&&typeof JSON.stringify=="function"&&typeof JSON.parse=="function"||v.push('/<%=WebResource("TSC.WebClient.js.JSON.min.js")%>'),Array.isArray&&Array.prototype.forEach&&Object.keys&&Date.prototype.toISOString&&Date.prototype.toJSON&&String.prototype.trim||v.push('/<%=WebResource("TSC.WebClient.js.EcmaScript5.min.js")%>'),v.length?n.include(v,ft):ft()}(window);
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>GPI_Translation_Services_Connector</name>
4
+ <version>1.0.0.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>GPI's Translation Services Connector simplfies translation workflows for multiple-language Magento websites. </summary>
10
+ <description>GPI's Translation Services Connector for Magento enables users of Magento-based websites to launch and manage multi-language websites. The Translation Services Connector streamlines content exports and reimports allowing for the initiation of web content translation workflows with a single click. User will gain access to an array of reports to track and manage global translation web projects through GPI's Translation Portal</description>
11
+ <notes>Always install the latest, stable version of the GPI Translation Services Connector for Magento.</notes>
12
+ <authors><author><name>Globalization Partners International, LLC.</name><user>gpiconnector</user><email>kBlakeThomas@globalizationpartners.com</email></author></authors>
13
+ <date>2015-02-27</date>
14
+ <time>20:48:18</time>
15
+ <contents><target name="magecommunity"><dir name="Gpi"><dir name="Tsc"><dir name="Block"><dir name="Adminhtml"><file name="ITscClientPlugin.php" hash="1a20dff985c97bd42647efb3e51557ab"/><dir name="Tsc"><file name="Grid.php" hash="56d842ea3dd2b34d13d6cab01f66cfc7"/></dir><file name="Tsc.php" hash="908839a3705e0802e3548937f5c6c5c2"/></dir></dir><dir name="Helper"><file name="Admin.php" hash="7160b2693a723d2369546cd08a5d829a"/><file name="Data.php" hash="2caf2ff9913bdc98455dcaa49ca9c598"/><dir name="shareddata"><dir name="popo"><file name="PojoFactory.php" hash="65e93b316e599234ef06fc33afabea8c"/><file name="RemoteConfig.php" hash="9c4f2bfcb24225b7561540da0fcc082f"/><file name="RemoteQuote.php" hash="f518c1f94fb5bc6911c039a83f6b38f9"/><file name="TreeNode.php" hash="ce51cce40023022784cb4d77b85099ca"/><file name="WorkStatus.php" hash="b72313bb1e4a3736d7854d2f8368b9c0"/></dir></dir><dir name="webclient"><file name="AbstractTscClientPlugin.php" hash="9c4488068b3bf36465e0f88292e83e0e"/><file name="BackgroundJob.php" hash="05f8ee1f573bb0b948d7ab17a0bced24"/><file name="ClientConfigurationService.php" hash="53c932080d9d42f90466ba1959d16619"/><file name="ClientConfigurationServiceImpl.php" hash="8bccf77aaf294fe7d908dfdeab0a0b3d"/><file name="ConnectorConfiguration.php" hash="bbbd1199c88f9052476ed82edd321bdf"/><file name="Constants.php" hash="7c39d682c5e6a06ed4683eea2c548229"/><file name="ExportArguments.php" hash="3f9d45c57de969af36d66fff5cb402e9"/><file name="ExportBackgroundJob.php" hash="8aa4f4240edcc68f25ef67c15948de54"/><file name="ITscClientPlugin.php" hash="e6895dc6cb63ad8055d7c737208eb9e6"/><file name="ImportArguments.php" hash="abd5920a2990b1d859c80b9f9f114003"/><file name="ImportBackgroundJob.php" hash="e1e927618288ed76ff79599a0b4501e1"/><file name="NameIDPair.php" hash="71b814fc256468d172896787079998f8"/><file name="RemoteConnection.php" hash="aff6f8e8f45244f824a9d8bc1160c1da"/><file name="Utils.php" hash="7e1497cacdb1360641d7c8805d52e343"/><file name="WorkerContext.php" hash="8e7be4331a8a54063dea93cbf25eeba2"/><file name="WorkerList.php" hash="a3eba6f5d525bc51bb74581f2e316c7e"/><file name="Xxtea.php" hash="db82c46cd2ed92658789c5597f224282"/></dir></dir><dir name="Model"><file name="Backgroundjobs.php" hash="94a35eb899f2c0026d2bf4ea31ae65f1"/><file name="Configurations.php" hash="c412c0d0c1a3d7d70b942376411b20f5"/><file name="MagentoGpiClient.php" hash="f38b69b8f8d712824a03241b2324099d"/><dir name="Resource"><dir name="Backgroundjobs"><file name="Collection.php" hash="9f26ec484e0380d10f0264a02ac6caac"/></dir><file name="Backgroundjobs.php" hash="eb4f828adb7ae0bc7f90634dbed71519"/><dir name="Configurations"><file name="Collection.php" hash="7309514526bd3712f199822fef838a95"/></dir><file name="Configurations.php" hash="ea118f6ee2a1c660a969129abfd34370"/></dir><file name="Tsc.php" hash="d8f24ea8886f84ef1ee0db906c597c7a"/><file name="Utilities.php" hash="10b13c8925350a8ec3d5b96ddcdd17f1"/></dir><dir name="controllers"><file name="IndexController.php" hash="c1a118eaefc965b8521021247327aca3"/><dir name="adminhtml"><file name="TscController.php" hash="5a72a45625224f45e490cdf8b4bbf311"/></dir></dir><dir name="data"><dir name="gpi_tsc_setup"><file name="data-install-1.0.0.1.php" hash="130d4463721de0d5aab9215a05325a72"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dcf5d7880d722babb0f2b7eb3376e5af"/><file name="config.xml" hash="61fea351b6b53f4778a1f2ee070e4306"/></dir><dir name="sql"><dir name="gpi_tsc_setup"><file name="install-1.0.0.1.php" hash="278c02b3a65ba38decd6854b1c08e412"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="gpi_tsc.xml" hash="9e48b81a5d22698a163f365881035ff1"/></dir><dir name="template"><dir name="gpi"><file name="tsc.phtml" hash="b0b4f11929d18606733ff09f6f5d8601"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gpi_Tsc.xml" hash="f26ab12182688362116ebc3c70e9b79f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Gpi_Tsc.csv" hash="095cdabff2891e4e419ee372006307c4"/></dir></target><target name="mage"><dir name="js"><dir name="gpi_tsc"><file name="Crypto.js" hash="3861701ea9d2f881d80bb3707a930611"/><file name="Crypto.min.js" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="EcmaScript5.js" hash="61a75a6ea2475bb12d69b7d1f49648dc"/><file name="EcmaScript5.min.js" hash="507aa9c06a0d7e4a8b86954260b89fcf"/><file name="JSON.js" hash="626ef1f5cc397ec996c9008437379bb2"/><file name="JSON.min.js" hash="f9a4a32a6aaf1bede55c14fd9a72f211"/><file name="JSON.min.js.mine" hash="f9a4a32a6aaf1bede55c14fd9a72f211"/><file name="JSON.min.js.r118" hash="fd59f781fae50afcfc8f88e14d098259"/><file name="JSON.min.js.r175" hash="30e7aa2d1d98809514369109f9f08179"/><dir name="langs"><file name="en.js" hash="cf72c74c85ba30da0c14c171b4737677"/><file name="en.min.js" hash="9c3176f90a4f9348efd2b0d9ed249c04"/></dir><file name="tsc.js" hash="5609c80585482298d0b9ea8642e5c2fd"/><file name="tsc.min.js" hash="971d6c939b08da26a483e49d05338e2a"/><file name="tsc.min.js.mine" hash="fc53c843aa24dafd91a71c104e614f88"/><file name="tsc.min.js.r118" hash="e133e0c8aa7208ab1c43ddf29d0527e5"/><file name="tsc.min.js.r175" hash="9fed06c449dd0064d36b0da736c47e1a"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="css"><file name="gpiconnector_tsc.css" hash="818075a27cf6b6dd6ef46038bf03a195"/></dir><dir name="images"><dir name="gpi_tsc"><file name="YesNo.png" hash="6025ac2d2c98339e0f569ad9d749ab4c"/><file name="accept.png" hash="b5a898b96d3d6159097194867a4cfee0"/><file name="back.png" hash="c224e24db0e1a027fc755e07e4676d83"/><file name="box__arrow.png" hash="fbd869339052f79cfae46e1f7d3cd48e"/><file name="document__pencil.png" hash="8cb3d67573814b446c5025b19ff401c3"/><file name="envelope_arrow.png" hash="f982568ed75a4ae8af5dcffa7af5db31"/><file name="error.png" hash="3a9064713f2d4fa72b57c8085cdf5234"/><file name="expand__tree.png" hash="43ae5dd7266c772cd48fdc593b7292df"/><file name="icon_plus.png" hash="403929bd8fc029a8d8e168e3452e8104"/><file name="info.png" hash="5c7fe97d78e6e27ddfa6ba116fae2baf"/><file name="input-focus.png" hash="d20285eeef57c6746f0a5fb51c05f5ba"/><file name="input-normal.png" hash="a324de13591fcd42f5e0407900caf424"/><file name="loading.gif" hash="332841820de58396c9632e359731fef0"/><file name="lock.png" hash="1ec90e836676a761a93f9a8b573f567f"/><file name="logo.png" hash="9524b9a0cf195df1e6e6fbeeb7b05a0e"/><file name="magnifier__arrow.png" hash="6e5b5887bd35ab4cb0890b3b0a059f34"/><file name="minus_circle.png" hash="54975349ccea6124c4e7880b5ca84729"/><file name="progressBar.png" hash="75988d35574d74325ec869e35f5ee0d8"/><file name="required.png" hash="e1904cb7e749547bd5a48504ac253f3f"/><file name="settings.png" hash="7ec53f029df8c2cca7c9cf7951f7acb9"/><file name="success.png" hash="169c64bf6086a79d1344f7fa88c7da09"/><file name="transparency.png" hash="125cb55ab7051f989937f48a67d1e45d"/><dir name="tree"><file name="checkboxes.png" hash="299ad74f9ada13c59af63714806cfb24"/><file name="folderClosed.png" hash="c1832e87bd7309f538ff978be9baaba2"/><file name="folderOpen.png" hash="40d66d2f6e6dbacce6aa74a1bca830d5"/><file name="iconText.png" hash="ffd15319ef6a458160ed30faf78e693f"/><file name="iconTexts.png" hash="116533258d950954c990fbe83bdb28df"/><file name="leaf.png" hash="7bdc23897c9dae10ef126cf1940c48f1"/><file name="lines.png" hash="c8d18f5213baf1171430c68f7f132f1e"/><file name="minus.png" hash="62f0fb56f759699e7b2ba514a03257cc"/><file name="plus.png" hash="d5dc9ef7735dac152239b738bfd9ede0"/></dir><file name="tsc_styles.css" hash="aeae9ff88ff6caa9f132ecfd0efd135f"/><file name="tsc_styles.min.css" hash="af24b63370bb4c7b6e18e7c591641a61"/><file name="validation.png" hash="7c1a391c73d4559bae640e25992194ba"/><file name="warning.png" hash="32ff0ead65d861223a5198eca240ffed"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/adminhtml/base/default/css/gpiconnector_tsc.css ADDED
@@ -0,0 +1,914 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clearfix:after {
2
+ visibility: hidden;
3
+ display: block;
4
+ font-size: 0;
5
+ content: " ";
6
+ clear: both;
7
+ height: 0;
8
+ }
9
+
10
+ #tsc_wrapper {
11
+ font-size: 100%;
12
+ font-family: Candara, Calibri, tahoma, verdana, arial, helvetica, sans-serif;
13
+ vertical-align: baseline;
14
+ background: #f3f3f3 url('../images/gpi_tsc/back.png') repeat-x right top;
15
+ margin: 0;
16
+
17
+ -moz-border-radius: 8px;
18
+ -webkit-border-radius: 8px;
19
+ border-radius: 8px;
20
+ -moz-box-shadow: 0 2px 5px rgba(0,0,0,.5);
21
+ -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.5);
22
+ box-shadow: 0 2px 5px rgba(0,0,0,.5);
23
+ overflow: hidden;
24
+ border: 1px solid #fff;
25
+ }
26
+
27
+ #tsc_wrapper * {
28
+ margin: 0;
29
+ padding: 0;
30
+ border: 0;
31
+ outline: 0;
32
+ }
33
+
34
+ #tsc_wrapper *:link, #tsc_wrapper *:visited, #tsc_wrapper *:hover, #tsc_wrapper *:active, #tsc_wrapper *:focus {
35
+ -webkit-transition: color .25s linear, background-color .25s linear, border-color .25s linear;
36
+ -moz-transition: color .25s linear, background-color .25s linear, border-color .25s linear;
37
+ -o-transition: color .25s linear, background-color .25s linear, border-color .25s linear;
38
+ transition: color .25s linear, background-color .25s linear, border-color .25s linear;
39
+ }
40
+
41
+
42
+ #tsc_header {
43
+ position: relative;
44
+ }
45
+
46
+ #tsc_header #tsc_logo {
47
+ background: url('../images/gpi_tsc/logo.png') no-repeat;
48
+ width: 288px;
49
+ overflow: hidden;
50
+ padding-top: 59px;
51
+ height: 0;
52
+ display: block;
53
+ }
54
+
55
+ #tsc_header #tsc_settings {
56
+ position: absolute;
57
+ top: 16px;
58
+ right: 16px;
59
+ background: url('../images/gpi_tsc/settings.png') no-repeat;
60
+ width: 24px;
61
+ overflow: hidden;
62
+ padding-top: 25px;
63
+ height: 0;
64
+ display: block;
65
+ }
66
+
67
+ #tsc_header #tsc_settings:hover {
68
+ background-position: 0 -25px;
69
+ }
70
+
71
+ #tsc_header #tsc_expand_tree {
72
+ background: url('../images/gpi_tsc/expand__tree.png') no-repeat;
73
+ display:inline-block;
74
+ position: absolute;
75
+ right: 64px;
76
+ top: 16px;
77
+ height: 24px;
78
+ width: 24px;
79
+ }
80
+
81
+ #tsc_header #tsc_expand_tree.collapse {
82
+ background-position: 0 -25px;
83
+ }
84
+
85
+
86
+ #tsc_maincontent {
87
+ padding: 10px 0;
88
+ margin: 0;
89
+ position: relative;
90
+ }
91
+
92
+ #tsc_wrapper h2 a.button, #tsc_wrapper h2 a.button:active {
93
+ position: absolute;
94
+ right: 2px;
95
+ top: 3px;
96
+ }
97
+
98
+ #tsc_wrapper h2 {
99
+ text-shadow: 0 1px 1px #bbb;
100
+ margin: 0 0 .5em 0;
101
+ font-family: Cambria;
102
+ font-size: 1.5em;
103
+ color: #353a40;
104
+ clear: both;
105
+ position: relative;
106
+ }
107
+
108
+ #tsc_wrapper #gpiWidgetFooter {
109
+ clear: both;
110
+ text-align: center;
111
+ display: block;
112
+ margin: 1em 0 0;
113
+ }
114
+
115
+ #tsc_wrapper #gpiWidgetFooter a {
116
+ color: #000033;
117
+ text-decoration: none;
118
+ }
119
+
120
+ #tsc_wrapper #gpiWidgetFooter a:hover {
121
+ text-decoration: none;
122
+ color: #ff3300;
123
+ }
124
+
125
+ #tsc_wrapper button {
126
+ width: 1;
127
+ }
128
+
129
+ #tsc_wrapper a.button,
130
+ #tsc_wrapper button {
131
+ padding: 0;
132
+ text-decoration: none;
133
+ display: inline-block;
134
+ font-weight: bold;
135
+ text-align: center;
136
+ font-size: 16px;
137
+ line-height: 1.2;
138
+ color: #fff;
139
+ border: 1px solid rgba(0, 0, 0, 0.3);
140
+ text-shadow: 0 1px 0 rgba(0,0,0,0.4);
141
+ -moz-box-shadow: 0 0 .05em rgba(0,0,0,0.4);
142
+ -webkit-box-shadow: 0 0 .05em rgba(0,0,0,0.4);
143
+ box-shadow: 0 0 .05em rgba(0,0,0,0.4);
144
+ }
145
+
146
+ #tsc_wrapper a.button,
147
+ #tsc_wrapper a.button span,
148
+ #tsc_wrapper button,
149
+ #tsc_wrapper button span {
150
+ -webkit-border-radius: .4em;
151
+ -moz-border-radius: .4em;
152
+ border-radius: .4em;
153
+
154
+ -moz-user-select: -moz-none;
155
+ -webkit-user-select: none;
156
+ user-select: none;
157
+ -moz-user-drag: -moz-none;
158
+ -webkit-user-drag: none;
159
+ user-drag: none;
160
+ }
161
+
162
+ #tsc_wrapper a.button span,
163
+ #tsc_wrapper button span {
164
+ border-top: 1px solid rgba(255, 255, 255, 0.5);
165
+ display: block;
166
+ padding: .1em 1em .25em;
167
+ line-height: 1.2;
168
+ }
169
+
170
+ #tsc_wrapper a.button:hover,
171
+ #tsc_wrapper button:hover {
172
+ -moz-box-shadow: 0 1px .2em rgba(0,0,0,0.6);
173
+ -webkit-box-shadow: 0 1px .2em rgba(0,0,0,0.6);
174
+ box-shadow: 0 1px .2em rgba(0,0,0,0.6);
175
+ }
176
+
177
+ #tsc_wrapper a.button:active,
178
+ #tsc_wrapper button:active {
179
+ position: relative;
180
+ top: 1px;
181
+ -moz-box-shadow: 0 0 .2em rgba(0,0,0,0.4);
182
+ -webkit-box-shadow: 0 0 .2em rgba(0,0,0,0.4);
183
+ box-shadow: 0 0 .2em rgba(0,0,0,0.4);
184
+ }
185
+
186
+ #tsc_wrapper .blue {
187
+ background: #4477a1;
188
+ background: -webkit-gradient(linear, left top, left bottom, from(#81a8cb), to(#4477a1) );
189
+ background: -moz-linear-gradient(-90deg, #81a8cb, #4477a1);
190
+ background: -o-linear-gradient(-90deg, #81a8cb, #4477a1);
191
+ }
192
+
193
+ #tsc_wrapper .blue:hover {
194
+ background: #81a8cb;
195
+ background: -webkit-gradient(linear, left top, left bottom, from(#4477a1), to(#81a8cb) );
196
+ background: -moz-linear-gradient(-90deg, #4477a1, #81a8cb);
197
+ background: -o-linear-gradient(-90deg, #4477a1, #81a8cb);
198
+ }
199
+
200
+ #tsc_wrapper .khaki {
201
+ background: #A2B598;
202
+ background: -webkit-gradient(linear, left top, left bottom, from(#BDD1B4), to(#A2B598) );
203
+ background:-moz-linear-gradient(-90deg, #BDD1B4, #A2B598);
204
+ background:-o-linear-gradient(-90deg, #BDD1B4, #A2B598);
205
+ }
206
+
207
+ #tsc_wrapper .khaki:hover {
208
+ background: #BDD1B4;
209
+ background: -webkit-gradient(linear, left top, left bottom, from(#A2B598), to(#BDD1B4) );
210
+ background: -moz-linear-gradient(-90deg, #A2B598, #BDD1B4);
211
+ background: -o-linear-gradient(-90deg, #A2B598, #BDD1B4);
212
+ }
213
+
214
+ #tsc_wrapper .green {
215
+ background: #428739;
216
+ background: -webkit-gradient(linear, left top, left bottom, from(#c8dd95), to(#428739) );
217
+ background: -moz-linear-gradient(-90deg, #c8dd95, #428739);
218
+ background: -o-linear-gradient(-90deg, #c8dd95, #428739);
219
+ }
220
+
221
+ #tsc_wrapper .green:hover {
222
+ background: #c8dd95;
223
+ background: -webkit-gradient(linear, left top, left bottom, from(#428739), to(#c8dd95) );
224
+ background: -moz-linear-gradient(-90deg, #428739, #c8dd95);
225
+ background: -o-linear-gradient(-90deg, #428739, #c8dd95);
226
+ }
227
+
228
+ #tsc_wrapper .red {
229
+ background: #D82741;
230
+ background: -webkit-gradient(linear, left top, left bottom, from(#E84B6E), to(#D82741) );
231
+ background: -moz-linear-gradient(-90deg, #E84B6E, #D82741);
232
+ background: -o-linear-gradient(-90deg, #E84B6E, #D82741);
233
+ }
234
+
235
+ #tsc_wrapper .red:hover {
236
+ background: #E84B6E;
237
+ background: -webkit-gradient(linear, left top, left bottom, from(#D82741), to(#E84B6E) );
238
+ background: -moz-linear-gradient(-90deg, #D82741, #E84B6E);
239
+ background: -o-linear-gradient(-90deg, #D82741, #E84B6E);
240
+ }
241
+
242
+ #tsc_wrapper .orange {
243
+ background: #f09c15;
244
+ background: -webkit-gradient(linear, left top, left bottom, from(#f8c939), to(#f09c15) );
245
+ background: -moz-linear-gradient(-90deg, #f8c939, #f09c15);
246
+ background: -o-linear-gradient(-90deg, #f8c939, #f09c15);
247
+ }
248
+
249
+ #tsc_wrapper .orange:hover {
250
+ background: #f8c939;
251
+ background: -webkit-gradient(linear, left top, left bottom, from(#f09c15), to(#f8c939) );
252
+ background: -moz-linear-gradient(-90deg, #f09c15, #f8c939);
253
+ background: -o-linear-gradient(-90deg, #f09c15, #f8c939);
254
+ }
255
+
256
+ #tsc_wrapper .tsc_scrolling {
257
+ max-height: 20em;
258
+ overflow-y: auto;
259
+ }
260
+
261
+ #tsc_wrapper table.dataTable {
262
+ border-collapse: collapse;
263
+ border-spacing: 0;
264
+ table-layout: fixed;
265
+ font-size: 75%;
266
+ border-bottom: 2px solid #353a40;
267
+ width: 100%;
268
+ margin: 0 auto 1em;
269
+ padding:0;
270
+ }
271
+
272
+ #tsc_wrapper table col[align="center"] {
273
+ text-align: center !important;
274
+ }
275
+
276
+ #tsc_wrapper table col[align="right"] {
277
+ text-align: right !important;
278
+ }
279
+
280
+ #tsc_wrapper table.dataTable td,
281
+ #tsc_wrapper table.dataTable th {
282
+ padding: .2em .5em;
283
+ line-height: 1.5;
284
+ color: #000;
285
+ border: 1px solid #fff;
286
+ }
287
+
288
+ #tsc_wrapper table.dataTable th {
289
+ font-weight: bold;
290
+ background: #353a40;
291
+ font-size: 16px;
292
+ color: #fff;
293
+ text-shadow: 0 1px 0px #000;
294
+ }
295
+
296
+ #tsc_wrapper table.dataTable td a,
297
+ #tsc_wrapper table.dataTable td a:visited,
298
+ #tsc_wrapper table.dataTable td a:link {
299
+ text-decoration: none;
300
+ }
301
+
302
+ #tsc_wrapper table.dataTable tr:nth-child(2n) {
303
+ background: #f0f0f0;
304
+ }
305
+
306
+ #tsc_wrapper table.dataTable tr:nth-child(2n+1) {
307
+ background: #e0e0e0;
308
+ }
309
+
310
+ #tsc_wrapper table.dataTable tr:hover td {
311
+ background: #87b5c6;
312
+ }
313
+
314
+ #tsc_wrapper table.dataTable td {
315
+ vertical-align: middle;
316
+ }
317
+
318
+ #tsc_wrapper td span {
319
+ position: relative;
320
+ display: block;
321
+ }
322
+
323
+ #tsc_wrapper td b.actions {
324
+ font-weight: normal;
325
+ display: block;
326
+ position: absolute;
327
+ top: -6px;
328
+ right: 0;
329
+ width: 28px;
330
+ height: 28px;
331
+ line-height: 16px;
332
+ }
333
+
334
+ #tsc_wrapper tr:hover b.actions {
335
+ background: #666 url('../images/gpi_tsc/icon_plus.png') no-repeat center center;
336
+ -moz-border-radius: 4px;
337
+ -webkit-border-radius: 4px;
338
+ -khtml-border-radius: 4px;
339
+ border-radius: 4px;
340
+ }
341
+
342
+ #tsc_wrapper td b.actions i {
343
+ white-space: nowrap;
344
+ display: none;
345
+ /*width: 12em;*/
346
+ font-style: normal;
347
+ position: absolute;
348
+ right: 0;
349
+ top: 0;
350
+ border: 2px solid #fff;
351
+ background: #fff;
352
+ -moz-border-radius: 4px;
353
+ -webkit-border-radius: 4px;
354
+ -khtml-border-radius: 4px;
355
+ border-radius: 4px;
356
+ -moz-box-shadow: 0 0 5px rgba(0,0,0,0.6);
357
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.6);
358
+ box-shadow: 0 0 5px rgba(0,0,0,0.6);
359
+ }
360
+
361
+ #tsc_wrapper td b.actions:hover i {
362
+ display: block;
363
+ z-index: 1000;
364
+ }
365
+
366
+ #tsc_wrapper td b.actions a {
367
+ display: inline-block;
368
+ white-space: nowrap;
369
+ color: #000;
370
+ padding: 4px 8px 4px 24px;
371
+ background-color: #ddd;
372
+ background-repeat: no-repeat;
373
+ background-position: 5px 4px;
374
+
375
+ -moz-border-radius: 4px;
376
+ -webkit-border-radius: 4px;
377
+ -khtml-border-radius: 4px;
378
+ border-radius: 4px;
379
+ font-weight: bold;
380
+ }
381
+
382
+ #tsc_wrapper td b.actions a:hover {
383
+ color: #fff;
384
+ text-shadow: 0 0 2px #000, 0 1px 3px #000;
385
+ background-color: #aaa;
386
+ background-position: 5px -44px;
387
+
388
+ -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
389
+ -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
390
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
391
+ }
392
+
393
+ #tsc_wrapper td b.actions a.link-delete {
394
+ background-image: url('../images/gpi_tsc/minus_circle.png');
395
+ }
396
+
397
+ #tsc_wrapper td b.actions a.link-view {
398
+ background-image: url('../images/gpi_tsc/magnifier__arrow.png');
399
+ }
400
+
401
+ #tsc_wrapper td b.actions a.link-import {
402
+ background-image: url('../images/gpi_tsc/box__arrow.png');
403
+ }
404
+
405
+ #tsc_wrapper td b.actions a.link-close {
406
+ background-image: url('../images/gpi_tsc/lock.png');
407
+ }
408
+
409
+ #tsc_wrapper td b.actions a.link-add {
410
+ background-image: url('../images/gpi_tsc/document__pencil.png');
411
+ }
412
+
413
+ #tsc_wrapper b.actions a.link-request {
414
+ background-image: url('../images/gpi_tsc/envelope_arrow.png');
415
+ }
416
+
417
+
418
+ #tsc_wrapper .message {
419
+ border: 1px solid;
420
+ margin: 10px 0px;
421
+ padding:15px 10px 15px 50px;
422
+ background-repeat: no-repeat;
423
+ background-position: 10px center;
424
+ -moz-border-radius: 8px;
425
+ -webkit-border-radius: 8px;
426
+ border-radius: 8px;
427
+ -moz-box-shadow: 0 1px 4px #aaa;
428
+ -webkit-box-shadow: 0 1px 4px #aaa;
429
+ box-shadow: 0 1px 4px #aaa;
430
+ }
431
+
432
+ #tsc_wrapper .info {
433
+ color: #00529B;
434
+ background-color: #BDE5F8;
435
+ background-image: url('../images/gpi_tsc/info.png');
436
+ }
437
+
438
+ #tsc_wrapper .success {
439
+ color: #4F8A10;
440
+ background-color: #DFF2BF;
441
+ background-image: url('../images/gpi_tsc/success.png');
442
+ }
443
+
444
+ #tsc_wrapper .warning {
445
+ color: #9F6000;
446
+ background-color: #FEEFB3;
447
+ background-image: url('../images/gpi_tsc/warning.png');
448
+ }
449
+
450
+ #tsc_wrapper .error {
451
+ color: #D8000C;
452
+ background-color: #FFBABA;
453
+ background-image: url('../images/gpi_tsc/error.png');
454
+ }
455
+
456
+ #tsc_wrapper .validation {
457
+ color: #D63301;
458
+ background-color: #FFCCBA;
459
+ background-image: url('../images/gpi_tsc/validation.png');
460
+ }
461
+
462
+ #tsc_wrapper .validation ul {
463
+ margin: 0 1.5em 0em;
464
+ }
465
+
466
+ #tsc_wrapper #tsc_working {
467
+ padding: 0;
468
+ margin: 0;
469
+ position: absolute;
470
+ top: 0;
471
+ left: 0;
472
+ width: 100%;
473
+ height: 100%;
474
+ background: url('../images/gpi_tsc/transparency.png');
475
+ z-index: 2;
476
+ text-align: center;
477
+ display: none;
478
+ -moz-border-radius: 8px;
479
+ -webkit-border-radius: 8px;
480
+ border-radius: 8px;
481
+ }
482
+
483
+ #tsc_wrapper #tsc_working strong, #tsc_wrapper b.loading {
484
+ background-image: url('../images/gpi_tsc/loading.gif');
485
+ background-repeat: no-repeat;
486
+ }
487
+
488
+ #tsc_wrapper b.loading {
489
+ display: block;
490
+ padding-left: 18px;
491
+ background-position: 0 center;
492
+ }
493
+
494
+ #tsc_wrapper #tsc_working strong {
495
+ color: #fff;
496
+ text-shadow: 0 0 1px #000, 0 0 2px #000;
497
+ display: inline-block;
498
+ line-height: 48px;
499
+ padding: 0 24px 2px 38px;
500
+
501
+ border: 2px solid #fff;
502
+ -webkit-border-radius: .4em;
503
+ -moz-border-radius: .4em;
504
+ border-radius: .4em;
505
+ -moz-box-shadow: 0 1px 4px #000;
506
+ -webkit-box-shadow: 0 1px 4px #000;
507
+ box-shadow: 0 1px 4px #000;
508
+ background-color: #353a40;
509
+ background-position: 18px center;
510
+ position: relative;
511
+ top: 47%;
512
+ }
513
+
514
+ #tsc_wrapper .tsc_multi_column {
515
+ float: left;
516
+ overflow: hidden;
517
+ }
518
+
519
+ #tsc_wrapper .grid_1 { width: 6.6666666666667%; }
520
+ #tsc_wrapper .grid_2 { width: 15%; }
521
+ #tsc_wrapper .grid_3 { width: 23.333333333333%; }
522
+ #tsc_wrapper .grid_4 { width: 31.666666666667%; }
523
+ #tsc_wrapper .grid_5 { width: 40%; }
524
+ #tsc_wrapper .grid_6 { width: 48.333333333333%; }
525
+ #tsc_wrapper .grid_7 { width: 56.666666666667%; }
526
+ #tsc_wrapper .grid_8 { width: 65%; }
527
+ #tsc_wrapper .grid_9 { width: 73.333333333333%; }
528
+ #tsc_wrapper .grid_10 { width: 81.666666666667%; }
529
+ #tsc_wrapper .grid_11 { width: 90%; }
530
+ #tsc_wrapper .grid_12 { width: 98.333333333333%; }
531
+
532
+ #tsc_wrapper .grid_0,
533
+ #tsc_wrapper .grid_1,
534
+ #tsc_wrapper .grid_2,
535
+ #tsc_wrapper .grid_3,
536
+ #tsc_wrapper .grid_4,
537
+ #tsc_wrapper .grid_5,
538
+ #tsc_wrapper .grid_6,
539
+ #tsc_wrapper .grid_7,
540
+ #tsc_wrapper .grid_8,
541
+ #tsc_wrapper .grid_9,
542
+ #tsc_wrapper .grid_10,
543
+ #tsc_wrapper .grid_11,
544
+ #tsc_wrapper .grid_12 {
545
+ margin-left: 0.83333333333333%;
546
+ margin-right: 0.83333333333333%;
547
+ float: left;
548
+ display: block;
549
+ }
550
+
551
+ #tsc_wrapper .buttons {
552
+ clear: both;
553
+ padding-top: 1em;
554
+ text-align: center;
555
+ }
556
+
557
+ #tsc_wrapper form label, #tsc_wrapper form textarea, #tsc_wrapper form select, #tsc_wrapper form input[type="text"], #tsc_wrapper form input[type="password"] {
558
+ display: block;
559
+ font-family: Candara, Calibri, tahoma, verdana, arial, helvetica, sans-serif;
560
+ font-size: 1em;
561
+ line-height: 1.2;
562
+ font-weight: normal;
563
+ color: #000;
564
+ }
565
+
566
+ #tsc_wrapper form label {
567
+ margin: .5em 0 .25em;
568
+ display: inline-block;
569
+ position: relative;
570
+ }
571
+
572
+ #tsc_wrapper form select {
573
+ width: 100%;
574
+ }
575
+
576
+ #tsc_wrapper form textarea, #tsc_wrapper form input[type="text"], #tsc_wrapper form input[type="password"] {
577
+ width: 98%;
578
+ padding: 1px 1% 2px;
579
+ }
580
+
581
+ input[type="hidden"] {
582
+ display: none;
583
+ }
584
+
585
+ #tsc_wrapper label input {
586
+ width: auto;
587
+ vertical-align: middle;
588
+ }
589
+
590
+ #tsc_wrapper label abbr {
591
+ position: absolute;
592
+ right: -20px;
593
+ top: 3px;
594
+ width: 16px;
595
+ height: 16px;
596
+ text-indent: 2000px;
597
+ overflow: hidden;
598
+ background: url('../images/gpi_tsc/required.png') no-repeat;
599
+ border-bottom: none;
600
+ display: inline-block;
601
+ }
602
+
603
+ #tsc_wrapper input[type="text"], #tsc_wrapper input[type="password"], #tsc_wrapper textarea, #tsc_wrapper .tsc_selectMultiple {
604
+ background: #d0d0d0 url('../images/gpi_tsc/input-normal.png') repeat-x;
605
+ border: 1px solid #666;
606
+ -webkit-border-radius: 4px;
607
+ -moz-border-radius: 4px;
608
+ border-radius: 4px;
609
+ }
610
+
611
+ #tsc_wrapper input[type="text"]:focus, #tsc_wrapper input[type="password"]:focus, #tsc_wrapper textarea:focus {
612
+ background: #fff url('../images/gpi_tsc/input-focus.png') repeat-x;
613
+ }
614
+
615
+ #tsc_wrapper select {
616
+ margin-top: 1px;
617
+ border: 1px solid #666;
618
+ padding: 0;
619
+ width: 452px;
620
+ background: #d0d0d0 url('../images/gpi_tsc/input-normal.png') repeat-x;
621
+ -webkit-border-radius: 4px;
622
+ -moz-border-radius: 4px;
623
+ border-radius: 4px;
624
+ }
625
+
626
+ #tsc_wrapper .tsc_selectMultiple {
627
+ overflow: auto;
628
+ height: 10.6em;
629
+ }
630
+
631
+ #tsc_wrapper .tsc_selectMultiple label {
632
+ display: block;
633
+ margin: 0;
634
+ padding: 3px 6px 4px;
635
+ -webkit-border-radius: 4px;
636
+ -moz-border-radius: 4px;
637
+ border-radius: 4px;
638
+ }
639
+
640
+ #tsc_wrapper .tsc_selectMultiple label:hover {
641
+ background-color: #87b5c6;
642
+ }
643
+
644
+ #tsc_wrapper .tsc_selectMultiple label input {
645
+ margin: -2px 0 0 0;
646
+ }
647
+
648
+
649
+ /* Pannels */
650
+ #tsc_content dl.tsc_panel {
651
+ background: #353a40;
652
+ padding: 4px;
653
+ -moz-border-radius: 4px;
654
+ -webkit-border-radius: 4px;
655
+ border-radius: 4px;
656
+ margin-bottom: 1em;
657
+ }
658
+
659
+ #tsc_content dl.tsc_panel dt {
660
+ color: #ccc;
661
+ font-weight: bold;
662
+ font-size: 18px;
663
+ padding: 0 0 6px 10px;
664
+ line-height: 1;
665
+ text-shadow: -1px -1px 0px #000;
666
+ }
667
+
668
+ #tsc_content dl.tsc_panel dd {
669
+ padding: 0;
670
+ border: 2px solid #fff;
671
+ background: #f3f3f3;
672
+ -moz-border-radius: 2px;
673
+ -webkit-border-radius: 2px;
674
+ border-radius: 2px;
675
+ }
676
+
677
+ /* Tree */
678
+ #tsc_content ul.tsc_tree, #tsc_content ul.tsc_tree ul {
679
+ list-style: none;
680
+ }
681
+
682
+ #tsc_content ul.tsc_tree label {
683
+ cursor: hand;
684
+ cursor: pointer;
685
+ padding-left: 24px;
686
+ /*overflow: hidden;*/
687
+ }
688
+
689
+ #tsc_content ul.tsc_tree li {
690
+ padding: 0 0 0 18px;
691
+ line-height: 26px;
692
+ position: relative;
693
+ background: url('../images/gpi_tsc/tree/lines.png') no-repeat 11px -11px;
694
+
695
+ -moz-user-select: none;
696
+ -khtml-user-select: none;
697
+ -webkit-user-select: none;
698
+ user-select: none;
699
+ }
700
+
701
+ #tsc_content ul.tsc_tree li:first-child {
702
+ background-position: 11px 13px;
703
+ }
704
+
705
+ #tsc_content ul.tsc_tree li:last-child {
706
+ background-position: 11px -1019px;
707
+ }
708
+
709
+ #tsc_content ul.tsc_tree ul li:first-child {
710
+ background-position: 11px -11px;
711
+ }
712
+
713
+ #tsc_content ul.tsc_tree li input {
714
+ display: none;
715
+ }
716
+ /*
717
+ #tsc_content ul.tsc_tree li input + label:before {
718
+ content: " ";
719
+ position: absolute;
720
+ left: 18px;
721
+ top: 1px;
722
+ display: block;
723
+ width: 24px;
724
+ height: 24px;
725
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat;
726
+ zoom: 1;
727
+ }
728
+
729
+ #tsc_content ul.tsc_tree li input:checked + label:before {
730
+ content: " ";
731
+ position: absolute;
732
+ left: 18px;
733
+ top: 1px;
734
+ display: block;
735
+ width: 24px;
736
+ height: 24px;
737
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -24px;
738
+ zoom: 1;
739
+ }
740
+
741
+ #tsc_content ul.tsc_tree li input:disabled + label:before {
742
+ content: " ";
743
+ position: absolute;
744
+ left: 18px;
745
+ top: 1px;
746
+ display: block;
747
+ width: 24px;
748
+ height: 24px;
749
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -48px;
750
+ zoom: 1;
751
+ }*/
752
+
753
+ #tsc_content ul.tsc_tree li div.tsc_checkstate0, #tsc_content ul.tsc_tree li div.tsc_checkstate1, #tsc_content ul.tsc_tree li div.tsc_checkstate2 {
754
+ position: absolute;
755
+ left: 18px;
756
+ top: 1px;
757
+ display: block;
758
+ width: 24px;
759
+ height: 24px;
760
+ zoom: 1;
761
+ }
762
+
763
+ #tsc_content ul.tsc_tree li div.tsc_checkstate0 {
764
+ background: url('../images/gpi_tsc/tree/checkboxes.png') no-repeat;
765
+ }
766
+
767
+ #tsc_content ul.tsc_tree li div.tsc_checkstate2 {
768
+ background: url('../images/gpi_tsc/tree/checkboxes.png') no-repeat 0 -24px;
769
+ }
770
+
771
+ #tsc_content ul.tsc_tree li div.tsc_checkstate1 {
772
+ background: url('../images/gpi_tsc/tree/checkboxes.png') no-repeat 0 -48px;
773
+ }
774
+
775
+ #tsc_content ul.tsc_tree li label {
776
+ padding-left: 40px;
777
+ display: block;
778
+ background-repeat: no-repeat;
779
+ background-position: 24px 5px;
780
+ }
781
+
782
+ #tsc_content ul.tsc_tree li label:hover {
783
+ background-color: #87b5c6;
784
+ -moz-border-radius: 3px;
785
+ -webkit-border-radius: 3px;
786
+ border-radius: 3px;
787
+ }
788
+
789
+ #tsc_content ul.tsc_tree li.tsc_Folder > label {
790
+ background-image: url('../images/gpi_tsc/tree/folderClosed.png');
791
+ background-position: 24px 7px;
792
+ }
793
+
794
+ #tsc_content ul.tsc_tree li.tsc_Folder.open > label {
795
+ background-image: url('../images/gpi_tsc/tree/folderOpen.png');
796
+ background-position: 22px 7px;
797
+ }
798
+
799
+ #tsc_content ul.tsc_tree li.tsc_Content > label {
800
+ background-image: url('../images/gpi_tsc/tree/iconText.png');
801
+ }
802
+
803
+ #tsc_content ul.tsc_tree li.tsc_Mixed > label {
804
+ background-image: url('../images/gpi_tsc/tree/iconTexts.png');
805
+ }
806
+
807
+ #tsc_content ul.tsc_tree li.tsc_File > label {
808
+ background-image: url('../images/gpi_tsc/tree/leaf.png');
809
+ }
810
+
811
+ #tsc_content ul.tsc_tree li > a {
812
+ position: absolute;
813
+ left: -0px;
814
+ background: url('../images/gpi_tsc/tree/plus.png') no-repeat center 9px;
815
+ display: block;
816
+ overflow: hidden;
817
+ text-indent: -32px;
818
+ width: 24px;
819
+ height: 24px;
820
+ line-height: 1;
821
+ }
822
+
823
+ #tsc_content ul.tsc_tree li > a.open {
824
+ background: url('../images/gpi_tsc/tree/minus.png') no-repeat center 9px;
825
+ }
826
+
827
+ #tsc_wrapper #tsc_status {
828
+ position: absolute;
829
+ right: 16px;
830
+ bottom: 16px;
831
+ background: rgba(0, 0, 0, 0.8);
832
+ padding: 0 8px;
833
+ -moz-border-radius: 8px;
834
+ -webkit-border-radius: 8px;
835
+ border-radius: 8px;
836
+ -moz-box-shadow: 0 2px 5px rgba(0,0,0,.5);
837
+ -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.5);
838
+ box-shadow: 0 2px 5px rgba(0,0,0,.5);
839
+ list-style: none;
840
+ color: #fff;
841
+ font-size: .75em;
842
+ line-height: 1.2;
843
+ }
844
+
845
+ #tsc_wrapper #tsc_status li {
846
+ padding: 8px 0;
847
+ }
848
+
849
+ #tsc_wrapper #tsc_status b, #tsc_wrapper #tsc_status i, #tsc_wrapper #tsc_status u {
850
+ display: block;
851
+ font-weight: normal;
852
+ font-style: normal;
853
+ text-decoration: none;
854
+ }
855
+
856
+ #tsc_wrapper #tsc_status i {
857
+ -moz-border-radius: 4px;
858
+ -webkit-border-radius: 4px;
859
+ border-radius: 4px;
860
+ border: 1px solid #aaa;
861
+ background-color: #666;
862
+ }
863
+
864
+ #tsc_wrapper #tsc_status u {
865
+ -moz-border-radius: 4px;
866
+ -webkit-border-radius: 4px;
867
+ border-radius: 4px;
868
+ background-color: royalblue;
869
+ text-align: center;
870
+ }
871
+
872
+ /* options */
873
+ #tsc_wrapper .tsc_options li {
874
+ display:block;
875
+ line-height: 26px;
876
+ padding: 0 0 0 6px;
877
+ list-style: none;
878
+ -moz-user-select: none;
879
+ -khtml-user-select: none;
880
+ -webkit-user-select: none;
881
+ user-select: none;
882
+ }
883
+
884
+ #tsc_wrapper .tsc_options label {
885
+ display: block;
886
+ position: relative;
887
+ }
888
+
889
+ #tsc_wrapper .tsc_options input {
890
+ filter: alpha(opacity=0);
891
+ opacity: 0;
892
+ position: absolute;
893
+ }
894
+
895
+ #tsc_wrapper .tsc_options input + span:before {
896
+ content: " ";
897
+ position: absolute;
898
+ top: 0;
899
+ right: 0;
900
+ background: url('../images/gpi_tsc/YesNo.png') no-repeat;
901
+ display:block;
902
+ width: 61px;
903
+ height: 26px;
904
+ zoom: 1;
905
+ }
906
+
907
+ #tsc_wrapper .tsc_options input:checked + span:before {
908
+ background-position: 0 -53px;
909
+ }
910
+
911
+ #tsc_wrapper .tsc_options li:hover {
912
+ background-color: #87B5C6;
913
+ border-radius: 3px 3px 3px 3px;
914
+ }
skin/adminhtml/base/default/images/gpi_tsc/YesNo.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/accept.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/back.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/box__arrow.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/document__pencil.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/envelope_arrow.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/error.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/expand__tree.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/icon_plus.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/info.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/input-focus.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/input-normal.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/loading.gif ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/lock.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/logo.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/magnifier__arrow.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/minus_circle.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/progressBar.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/required.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/settings.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/success.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/transparency.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/checkboxes.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/folderClosed.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/folderOpen.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/iconText.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/iconTexts.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/leaf.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/lines.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/minus.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tree/plus.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/tsc_styles.css ADDED
@@ -0,0 +1,914 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clearfix:after {
2
+ visibility: hidden;
3
+ display: block;
4
+ font-size: 0;
5
+ content: " ";
6
+ clear: both;
7
+ height: 0;
8
+ }
9
+
10
+ #tsc_wrapper {
11
+ font-size: 100%;
12
+ font-family: Candara, Calibri, tahoma, verdana, arial, helvetica, sans-serif;
13
+ vertical-align: baseline;
14
+ background: #f3f3f3 url('/<%=WebResource("TSC.WebClient.styles.back.png")%>') repeat-x right top;
15
+ margin: 0;
16
+
17
+ -moz-border-radius: 8px;
18
+ -webkit-border-radius: 8px;
19
+ border-radius: 8px;
20
+ -moz-box-shadow: 0 2px 5px rgba(0,0,0,.5);
21
+ -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.5);
22
+ box-shadow: 0 2px 5px rgba(0,0,0,.5);
23
+ overflow: hidden;
24
+ border: 1px solid #fff;
25
+ }
26
+
27
+ #tsc_wrapper * {
28
+ margin: 0;
29
+ padding: 0;
30
+ border: 0;
31
+ outline: 0;
32
+ }
33
+
34
+ #tsc_wrapper *:link, #tsc_wrapper *:visited, #tsc_wrapper *:hover, #tsc_wrapper *:active, #tsc_wrapper *:focus {
35
+ -webkit-transition: color .25s linear, background-color .25s linear, border-color .25s linear;
36
+ -moz-transition: color .25s linear, background-color .25s linear, border-color .25s linear;
37
+ -o-transition: color .25s linear, background-color .25s linear, border-color .25s linear;
38
+ transition: color .25s linear, background-color .25s linear, border-color .25s linear;
39
+ }
40
+
41
+
42
+ #tsc_header {
43
+ position: relative;
44
+ }
45
+
46
+ #tsc_header #tsc_logo {
47
+ background: url('/<%=WebResource("TSC.WebClient.styles.logo.png")%>') no-repeat;
48
+ width: 288px;
49
+ overflow: hidden;
50
+ padding-top: 59px;
51
+ height: 0;
52
+ display: block;
53
+ }
54
+
55
+ #tsc_header #tsc_settings {
56
+ position: absolute;
57
+ top: 16px;
58
+ right: 16px;
59
+ background: url('/<%=WebResource("TSC.WebClient.styles.settings.png")%>') no-repeat;
60
+ width: 24px;
61
+ overflow: hidden;
62
+ padding-top: 25px;
63
+ height: 0;
64
+ display: block;
65
+ }
66
+
67
+ #tsc_header #tsc_settings:hover {
68
+ background-position: 0 -25px;
69
+ }
70
+
71
+ #tsc_header #tsc_expand_tree {
72
+ background: url('/<%=WebResource("TSC.WebClient.styles.expand__tree.png")%>') no-repeat;
73
+ display:inline-block;
74
+ position: absolute;
75
+ right: 64px;
76
+ top: 16px;
77
+ height: 24px;
78
+ width: 24px;
79
+ }
80
+
81
+ #tsc_header #tsc_expand_tree.collapse {
82
+ background-position: 0 -25px;
83
+ }
84
+
85
+
86
+ #tsc_maincontent {
87
+ padding: 10px 0;
88
+ margin: 0;
89
+ position: relative;
90
+ }
91
+
92
+ #tsc_wrapper h2 a.button, #tsc_wrapper h2 a.button:active {
93
+ position: absolute;
94
+ right: 2px;
95
+ top: 3px;
96
+ }
97
+
98
+ #tsc_wrapper h2 {
99
+ text-shadow: 0 1px 1px #bbb;
100
+ margin: 0 0 .5em 0;
101
+ font-family: Cambria;
102
+ font-size: 1.5em;
103
+ color: #353a40;
104
+ clear: both;
105
+ position: relative;
106
+ }
107
+
108
+ #tsc_wrapper #gpiWidgetFooter {
109
+ clear: both;
110
+ text-align: center;
111
+ display: block;
112
+ margin: 1em 0 0;
113
+ }
114
+
115
+ #tsc_wrapper #gpiWidgetFooter a {
116
+ color: #000033;
117
+ text-decoration: none;
118
+ }
119
+
120
+ #tsc_wrapper #gpiWidgetFooter a:hover {
121
+ text-decoration: none;
122
+ color: #ff3300;
123
+ }
124
+
125
+ #tsc_wrapper button {
126
+ width: 1;
127
+ }
128
+
129
+ #tsc_wrapper a.button,
130
+ #tsc_wrapper button {
131
+ padding: 0;
132
+ text-decoration: none;
133
+ display: inline-block;
134
+ font-weight: bold;
135
+ text-align: center;
136
+ font-size: 16px;
137
+ line-height: 1.2;
138
+ color: #fff;
139
+ border: 1px solid rgba(0, 0, 0, 0.3);
140
+ text-shadow: 0 1px 0 rgba(0,0,0,0.4);
141
+ -moz-box-shadow: 0 0 .05em rgba(0,0,0,0.4);
142
+ -webkit-box-shadow: 0 0 .05em rgba(0,0,0,0.4);
143
+ box-shadow: 0 0 .05em rgba(0,0,0,0.4);
144
+ }
145
+
146
+ #tsc_wrapper a.button,
147
+ #tsc_wrapper a.button span,
148
+ #tsc_wrapper button,
149
+ #tsc_wrapper button span {
150
+ -webkit-border-radius: .4em;
151
+ -moz-border-radius: .4em;
152
+ border-radius: .4em;
153
+
154
+ -moz-user-select: -moz-none;
155
+ -webkit-user-select: none;
156
+ user-select: none;
157
+ -moz-user-drag: -moz-none;
158
+ -webkit-user-drag: none;
159
+ user-drag: none;
160
+ }
161
+
162
+ #tsc_wrapper a.button span,
163
+ #tsc_wrapper button span {
164
+ border-top: 1px solid rgba(255, 255, 255, 0.5);
165
+ display: block;
166
+ padding: .1em 1em .25em;
167
+ line-height: 1.2;
168
+ }
169
+
170
+ #tsc_wrapper a.button:hover,
171
+ #tsc_wrapper button:hover {
172
+ -moz-box-shadow: 0 1px .2em rgba(0,0,0,0.6);
173
+ -webkit-box-shadow: 0 1px .2em rgba(0,0,0,0.6);
174
+ box-shadow: 0 1px .2em rgba(0,0,0,0.6);
175
+ }
176
+
177
+ #tsc_wrapper a.button:active,
178
+ #tsc_wrapper button:active {
179
+ position: relative;
180
+ top: 1px;
181
+ -moz-box-shadow: 0 0 .2em rgba(0,0,0,0.4);
182
+ -webkit-box-shadow: 0 0 .2em rgba(0,0,0,0.4);
183
+ box-shadow: 0 0 .2em rgba(0,0,0,0.4);
184
+ }
185
+
186
+ #tsc_wrapper .blue {
187
+ background: #4477a1;
188
+ background: -webkit-gradient(linear, left top, left bottom, from(#81a8cb), to(#4477a1) );
189
+ background: -moz-linear-gradient(-90deg, #81a8cb, #4477a1);
190
+ background: -o-linear-gradient(-90deg, #81a8cb, #4477a1);
191
+ }
192
+
193
+ #tsc_wrapper .blue:hover {
194
+ background: #81a8cb;
195
+ background: -webkit-gradient(linear, left top, left bottom, from(#4477a1), to(#81a8cb) );
196
+ background: -moz-linear-gradient(-90deg, #4477a1, #81a8cb);
197
+ background: -o-linear-gradient(-90deg, #4477a1, #81a8cb);
198
+ }
199
+
200
+ #tsc_wrapper .khaki {
201
+ background: #A2B598;
202
+ background: -webkit-gradient(linear, left top, left bottom, from(#BDD1B4), to(#A2B598) );
203
+ background:-moz-linear-gradient(-90deg, #BDD1B4, #A2B598);
204
+ background:-o-linear-gradient(-90deg, #BDD1B4, #A2B598);
205
+ }
206
+
207
+ #tsc_wrapper .khaki:hover {
208
+ background: #BDD1B4;
209
+ background: -webkit-gradient(linear, left top, left bottom, from(#A2B598), to(#BDD1B4) );
210
+ background: -moz-linear-gradient(-90deg, #A2B598, #BDD1B4);
211
+ background: -o-linear-gradient(-90deg, #A2B598, #BDD1B4);
212
+ }
213
+
214
+ #tsc_wrapper .green {
215
+ background: #428739;
216
+ background: -webkit-gradient(linear, left top, left bottom, from(#c8dd95), to(#428739) );
217
+ background: -moz-linear-gradient(-90deg, #c8dd95, #428739);
218
+ background: -o-linear-gradient(-90deg, #c8dd95, #428739);
219
+ }
220
+
221
+ #tsc_wrapper .green:hover {
222
+ background: #c8dd95;
223
+ background: -webkit-gradient(linear, left top, left bottom, from(#428739), to(#c8dd95) );
224
+ background: -moz-linear-gradient(-90deg, #428739, #c8dd95);
225
+ background: -o-linear-gradient(-90deg, #428739, #c8dd95);
226
+ }
227
+
228
+ #tsc_wrapper .red {
229
+ background: #D82741;
230
+ background: -webkit-gradient(linear, left top, left bottom, from(#E84B6E), to(#D82741) );
231
+ background: -moz-linear-gradient(-90deg, #E84B6E, #D82741);
232
+ background: -o-linear-gradient(-90deg, #E84B6E, #D82741);
233
+ }
234
+
235
+ #tsc_wrapper .red:hover {
236
+ background: #E84B6E;
237
+ background: -webkit-gradient(linear, left top, left bottom, from(#D82741), to(#E84B6E) );
238
+ background: -moz-linear-gradient(-90deg, #D82741, #E84B6E);
239
+ background: -o-linear-gradient(-90deg, #D82741, #E84B6E);
240
+ }
241
+
242
+ #tsc_wrapper .orange {
243
+ background: #f09c15;
244
+ background: -webkit-gradient(linear, left top, left bottom, from(#f8c939), to(#f09c15) );
245
+ background: -moz-linear-gradient(-90deg, #f8c939, #f09c15);
246
+ background: -o-linear-gradient(-90deg, #f8c939, #f09c15);
247
+ }
248
+
249
+ #tsc_wrapper .orange:hover {
250
+ background: #f8c939;
251
+ background: -webkit-gradient(linear, left top, left bottom, from(#f09c15), to(#f8c939) );
252
+ background: -moz-linear-gradient(-90deg, #f09c15, #f8c939);
253
+ background: -o-linear-gradient(-90deg, #f09c15, #f8c939);
254
+ }
255
+
256
+ #tsc_wrapper .tsc_scrolling {
257
+ max-height: 20em;
258
+ overflow-y: auto;
259
+ }
260
+
261
+ #tsc_wrapper table.dataTable {
262
+ border-collapse: collapse;
263
+ border-spacing: 0;
264
+ table-layout: fixed;
265
+ font-size: 75%;
266
+ border-bottom: 2px solid #353a40;
267
+ width: 100%;
268
+ margin: 0 auto 1em;
269
+ padding:0;
270
+ }
271
+
272
+ #tsc_wrapper table col[align="center"] {
273
+ text-align: center !important;
274
+ }
275
+
276
+ #tsc_wrapper table col[align="right"] {
277
+ text-align: right !important;
278
+ }
279
+
280
+ #tsc_wrapper table.dataTable td,
281
+ #tsc_wrapper table.dataTable th {
282
+ padding: .2em .5em;
283
+ line-height: 1.5;
284
+ color: #000;
285
+ border: 1px solid #fff;
286
+ }
287
+
288
+ #tsc_wrapper table.dataTable th {
289
+ font-weight: bold;
290
+ background: #353a40;
291
+ font-size: 16px;
292
+ color: #fff;
293
+ text-shadow: 0 1px 0px #000;
294
+ }
295
+
296
+ #tsc_wrapper table.dataTable td a,
297
+ #tsc_wrapper table.dataTable td a:visited,
298
+ #tsc_wrapper table.dataTable td a:link {
299
+ text-decoration: none;
300
+ }
301
+
302
+ #tsc_wrapper table.dataTable tr:nth-child(2n) {
303
+ background: #f0f0f0;
304
+ }
305
+
306
+ #tsc_wrapper table.dataTable tr:nth-child(2n+1) {
307
+ background: #e0e0e0;
308
+ }
309
+
310
+ #tsc_wrapper table.dataTable tr:hover td {
311
+ background: #87b5c6;
312
+ }
313
+
314
+ #tsc_wrapper table.dataTable td {
315
+ vertical-align: middle;
316
+ }
317
+
318
+ #tsc_wrapper td span {
319
+ position: relative;
320
+ display: block;
321
+ }
322
+
323
+ #tsc_wrapper td b.actions {
324
+ font-weight: normal;
325
+ display: block;
326
+ position: absolute;
327
+ top: -6px;
328
+ right: 0;
329
+ width: 28px;
330
+ height: 28px;
331
+ line-height: 16px;
332
+ }
333
+
334
+ #tsc_wrapper tr:hover b.actions {
335
+ background: #666 url('/<%=WebResource("TSC.WebClient.styles.icon_plus.png")%>') no-repeat center center;
336
+ -moz-border-radius: 4px;
337
+ -webkit-border-radius: 4px;
338
+ -khtml-border-radius: 4px;
339
+ border-radius: 4px;
340
+ }
341
+
342
+ #tsc_wrapper td b.actions i {
343
+ white-space: nowrap;
344
+ display: none;
345
+ /*width: 12em;*/
346
+ font-style: normal;
347
+ position: absolute;
348
+ right: 0;
349
+ top: 0;
350
+ border: 2px solid #fff;
351
+ background: #fff;
352
+ -moz-border-radius: 4px;
353
+ -webkit-border-radius: 4px;
354
+ -khtml-border-radius: 4px;
355
+ border-radius: 4px;
356
+ -moz-box-shadow: 0 0 5px rgba(0,0,0,0.6);
357
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.6);
358
+ box-shadow: 0 0 5px rgba(0,0,0,0.6);
359
+ }
360
+
361
+ #tsc_wrapper td b.actions:hover i {
362
+ display: block;
363
+ z-index: 1000;
364
+ }
365
+
366
+ #tsc_wrapper td b.actions a {
367
+ display: inline-block;
368
+ white-space: nowrap;
369
+ color: #000;
370
+ padding: 4px 8px 4px 24px;
371
+ background-color: #ddd;
372
+ background-repeat: no-repeat;
373
+ background-position: 5px 4px;
374
+
375
+ -moz-border-radius: 4px;
376
+ -webkit-border-radius: 4px;
377
+ -khtml-border-radius: 4px;
378
+ border-radius: 4px;
379
+ font-weight: bold;
380
+ }
381
+
382
+ #tsc_wrapper td b.actions a:hover {
383
+ color: #fff;
384
+ text-shadow: 0 0 2px #000, 0 1px 3px #000;
385
+ background-color: #aaa;
386
+ background-position: 5px -44px;
387
+
388
+ -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
389
+ -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
390
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
391
+ }
392
+
393
+ #tsc_wrapper td b.actions a.link-delete {
394
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.minus_circle.png")%>');
395
+ }
396
+
397
+ #tsc_wrapper td b.actions a.link-view {
398
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.magnifier__arrow.png")%>');
399
+ }
400
+
401
+ #tsc_wrapper td b.actions a.link-import {
402
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.box__arrow.png")%>');
403
+ }
404
+
405
+ #tsc_wrapper td b.actions a.link-close {
406
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.lock.png")%>');
407
+ }
408
+
409
+ #tsc_wrapper td b.actions a.link-add {
410
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.document__pencil.png")%>');
411
+ }
412
+
413
+ #tsc_wrapper b.actions a.link-request {
414
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.envelope_arrow.png")%>');
415
+ }
416
+
417
+
418
+ #tsc_wrapper .message {
419
+ border: 1px solid;
420
+ margin: 10px 0px;
421
+ padding:15px 10px 15px 50px;
422
+ background-repeat: no-repeat;
423
+ background-position: 10px center;
424
+ -moz-border-radius: 8px;
425
+ -webkit-border-radius: 8px;
426
+ border-radius: 8px;
427
+ -moz-box-shadow: 0 1px 4px #aaa;
428
+ -webkit-box-shadow: 0 1px 4px #aaa;
429
+ box-shadow: 0 1px 4px #aaa;
430
+ }
431
+
432
+ #tsc_wrapper .info {
433
+ color: #00529B;
434
+ background-color: #BDE5F8;
435
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.info.png")%>');
436
+ }
437
+
438
+ #tsc_wrapper .success {
439
+ color: #4F8A10;
440
+ background-color: #DFF2BF;
441
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.success.png")%>');
442
+ }
443
+
444
+ #tsc_wrapper .warning {
445
+ color: #9F6000;
446
+ background-color: #FEEFB3;
447
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.warning.png")%>');
448
+ }
449
+
450
+ #tsc_wrapper .error {
451
+ color: #D8000C;
452
+ background-color: #FFBABA;
453
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.error.png")%>');
454
+ }
455
+
456
+ #tsc_wrapper .validation {
457
+ color: #D63301;
458
+ background-color: #FFCCBA;
459
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.validation.png")%>');
460
+ }
461
+
462
+ #tsc_wrapper .validation ul {
463
+ margin: 0 1.5em 0em;
464
+ }
465
+
466
+ #tsc_wrapper #tsc_working {
467
+ padding: 0;
468
+ margin: 0;
469
+ position: absolute;
470
+ top: 0;
471
+ left: 0;
472
+ width: 100%;
473
+ height: 100%;
474
+ background: url('/<%=WebResource("TSC.WebClient.styles.transparency.png")%>');
475
+ z-index: 2;
476
+ text-align: center;
477
+ display: none;
478
+ -moz-border-radius: 8px;
479
+ -webkit-border-radius: 8px;
480
+ border-radius: 8px;
481
+ }
482
+
483
+ #tsc_wrapper #tsc_working strong, #tsc_wrapper b.loading {
484
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.loading.gif")%>');
485
+ background-repeat: no-repeat;
486
+ }
487
+
488
+ #tsc_wrapper b.loading {
489
+ display: block;
490
+ padding-left: 18px;
491
+ background-position: 0 center;
492
+ }
493
+
494
+ #tsc_wrapper #tsc_working strong {
495
+ color: #fff;
496
+ text-shadow: 0 0 1px #000, 0 0 2px #000;
497
+ display: inline-block;
498
+ line-height: 48px;
499
+ padding: 0 24px 2px 38px;
500
+
501
+ border: 2px solid #fff;
502
+ -webkit-border-radius: .4em;
503
+ -moz-border-radius: .4em;
504
+ border-radius: .4em;
505
+ -moz-box-shadow: 0 1px 4px #000;
506
+ -webkit-box-shadow: 0 1px 4px #000;
507
+ box-shadow: 0 1px 4px #000;
508
+ background-color: #353a40;
509
+ background-position: 18px center;
510
+ position: relative;
511
+ top: 47%;
512
+ }
513
+
514
+ #tsc_wrapper .tsc_multi_column {
515
+ float: left;
516
+ overflow: hidden;
517
+ }
518
+
519
+ #tsc_wrapper .grid_1 { width: 6.6666666666667%; }
520
+ #tsc_wrapper .grid_2 { width: 15%; }
521
+ #tsc_wrapper .grid_3 { width: 23.333333333333%; }
522
+ #tsc_wrapper .grid_4 { width: 31.666666666667%; }
523
+ #tsc_wrapper .grid_5 { width: 40%; }
524
+ #tsc_wrapper .grid_6 { width: 48.333333333333%; }
525
+ #tsc_wrapper .grid_7 { width: 56.666666666667%; }
526
+ #tsc_wrapper .grid_8 { width: 65%; }
527
+ #tsc_wrapper .grid_9 { width: 73.333333333333%; }
528
+ #tsc_wrapper .grid_10 { width: 81.666666666667%; }
529
+ #tsc_wrapper .grid_11 { width: 90%; }
530
+ #tsc_wrapper .grid_12 { width: 98.333333333333%; }
531
+
532
+ #tsc_wrapper .grid_0,
533
+ #tsc_wrapper .grid_1,
534
+ #tsc_wrapper .grid_2,
535
+ #tsc_wrapper .grid_3,
536
+ #tsc_wrapper .grid_4,
537
+ #tsc_wrapper .grid_5,
538
+ #tsc_wrapper .grid_6,
539
+ #tsc_wrapper .grid_7,
540
+ #tsc_wrapper .grid_8,
541
+ #tsc_wrapper .grid_9,
542
+ #tsc_wrapper .grid_10,
543
+ #tsc_wrapper .grid_11,
544
+ #tsc_wrapper .grid_12 {
545
+ margin-left: 0.83333333333333%;
546
+ margin-right: 0.83333333333333%;
547
+ float: left;
548
+ display: block;
549
+ }
550
+
551
+ #tsc_wrapper .buttons {
552
+ clear: both;
553
+ padding-top: 1em;
554
+ text-align: center;
555
+ }
556
+
557
+ #tsc_wrapper form label, #tsc_wrapper form textarea, #tsc_wrapper form select, #tsc_wrapper form input[type="text"], #tsc_wrapper form input[type="password"] {
558
+ display: block;
559
+ font-family: Candara, Calibri, tahoma, verdana, arial, helvetica, sans-serif;
560
+ font-size: 1em;
561
+ line-height: 1.2;
562
+ font-weight: normal;
563
+ color: #000;
564
+ }
565
+
566
+ #tsc_wrapper form label {
567
+ margin: .5em 0 .25em;
568
+ display: inline-block;
569
+ position: relative;
570
+ }
571
+
572
+ #tsc_wrapper form select {
573
+ width: 100%;
574
+ }
575
+
576
+ #tsc_wrapper form textarea, #tsc_wrapper form input[type="text"], #tsc_wrapper form input[type="password"] {
577
+ width: 98%;
578
+ padding: 1px 1% 2px;
579
+ }
580
+
581
+ input[type="hidden"] {
582
+ display: none;
583
+ }
584
+
585
+ #tsc_wrapper label input {
586
+ width: auto;
587
+ vertical-align: middle;
588
+ }
589
+
590
+ #tsc_wrapper label abbr {
591
+ position: absolute;
592
+ right: -20px;
593
+ top: 3px;
594
+ width: 16px;
595
+ height: 16px;
596
+ text-indent: 2000px;
597
+ overflow: hidden;
598
+ background: url('/<%=WebResource("TSC.WebClient.styles.required.png")%>') no-repeat;
599
+ border-bottom: none;
600
+ display: inline-block;
601
+ }
602
+
603
+ #tsc_wrapper input[type="text"], #tsc_wrapper input[type="password"], #tsc_wrapper textarea, #tsc_wrapper .tsc_selectMultiple {
604
+ background: #d0d0d0 url('/<%=WebResource("TSC.WebClient.styles.input-normal.png")%>') repeat-x;
605
+ border: 1px solid #666;
606
+ -webkit-border-radius: 4px;
607
+ -moz-border-radius: 4px;
608
+ border-radius: 4px;
609
+ }
610
+
611
+ #tsc_wrapper input[type="text"]:focus, #tsc_wrapper input[type="password"]:focus, #tsc_wrapper textarea:focus {
612
+ background: #fff url('/<%=WebResource("TSC.WebClient.styles.input-focus.png")%>') repeat-x;
613
+ }
614
+
615
+ #tsc_wrapper select {
616
+ margin-top: 1px;
617
+ border: 1px solid #666;
618
+ padding: 0;
619
+ width: 452px;
620
+ background: #d0d0d0 url('/<%=WebResource("TSC.WebClient.styles.input-normal.png")%>') repeat-x;
621
+ -webkit-border-radius: 4px;
622
+ -moz-border-radius: 4px;
623
+ border-radius: 4px;
624
+ }
625
+
626
+ #tsc_wrapper .tsc_selectMultiple {
627
+ overflow: auto;
628
+ height: 10.6em;
629
+ }
630
+
631
+ #tsc_wrapper .tsc_selectMultiple label {
632
+ display: block;
633
+ margin: 0;
634
+ padding: 3px 6px 4px;
635
+ -webkit-border-radius: 4px;
636
+ -moz-border-radius: 4px;
637
+ border-radius: 4px;
638
+ }
639
+
640
+ #tsc_wrapper .tsc_selectMultiple label:hover {
641
+ background-color: #87b5c6;
642
+ }
643
+
644
+ #tsc_wrapper .tsc_selectMultiple label input {
645
+ margin: -2px 0 0 0;
646
+ }
647
+
648
+
649
+ /* Pannels */
650
+ #tsc_content dl.tsc_panel {
651
+ background: #353a40;
652
+ padding: 4px;
653
+ -moz-border-radius: 4px;
654
+ -webkit-border-radius: 4px;
655
+ border-radius: 4px;
656
+ margin-bottom: 1em;
657
+ }
658
+
659
+ #tsc_content dl.tsc_panel dt {
660
+ color: #ccc;
661
+ font-weight: bold;
662
+ font-size: 18px;
663
+ padding: 0 0 6px 10px;
664
+ line-height: 1;
665
+ text-shadow: -1px -1px 0px #000;
666
+ }
667
+
668
+ #tsc_content dl.tsc_panel dd {
669
+ padding: 0;
670
+ border: 2px solid #fff;
671
+ background: #f3f3f3;
672
+ -moz-border-radius: 2px;
673
+ -webkit-border-radius: 2px;
674
+ border-radius: 2px;
675
+ }
676
+
677
+ /* Tree */
678
+ #tsc_content ul.tsc_tree, #tsc_content ul.tsc_tree ul {
679
+ list-style: none;
680
+ }
681
+
682
+ #tsc_content ul.tsc_tree label {
683
+ cursor: hand;
684
+ cursor: pointer;
685
+ padding-left: 24px;
686
+ /*overflow: hidden;*/
687
+ }
688
+
689
+ #tsc_content ul.tsc_tree li {
690
+ padding: 0 0 0 18px;
691
+ line-height: 26px;
692
+ position: relative;
693
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.lines.png")%>') no-repeat 11px -11px;
694
+
695
+ -moz-user-select: none;
696
+ -khtml-user-select: none;
697
+ -webkit-user-select: none;
698
+ user-select: none;
699
+ }
700
+
701
+ #tsc_content ul.tsc_tree li:first-child {
702
+ background-position: 11px 13px;
703
+ }
704
+
705
+ #tsc_content ul.tsc_tree li:last-child {
706
+ background-position: 11px -1019px;
707
+ }
708
+
709
+ #tsc_content ul.tsc_tree ul li:first-child {
710
+ background-position: 11px -11px;
711
+ }
712
+
713
+ #tsc_content ul.tsc_tree li input {
714
+ display: none;
715
+ }
716
+ /*
717
+ #tsc_content ul.tsc_tree li input + label:before {
718
+ content: " ";
719
+ position: absolute;
720
+ left: 18px;
721
+ top: 1px;
722
+ display: block;
723
+ width: 24px;
724
+ height: 24px;
725
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat;
726
+ zoom: 1;
727
+ }
728
+
729
+ #tsc_content ul.tsc_tree li input:checked + label:before {
730
+ content: " ";
731
+ position: absolute;
732
+ left: 18px;
733
+ top: 1px;
734
+ display: block;
735
+ width: 24px;
736
+ height: 24px;
737
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -24px;
738
+ zoom: 1;
739
+ }
740
+
741
+ #tsc_content ul.tsc_tree li input:disabled + label:before {
742
+ content: " ";
743
+ position: absolute;
744
+ left: 18px;
745
+ top: 1px;
746
+ display: block;
747
+ width: 24px;
748
+ height: 24px;
749
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -48px;
750
+ zoom: 1;
751
+ }*/
752
+
753
+ #tsc_content ul.tsc_tree li div.tsc_checkstate0, #tsc_content ul.tsc_tree li div.tsc_checkstate1, #tsc_content ul.tsc_tree li div.tsc_checkstate2 {
754
+ position: absolute;
755
+ left: 18px;
756
+ top: 1px;
757
+ display: block;
758
+ width: 24px;
759
+ height: 24px;
760
+ zoom: 1;
761
+ }
762
+
763
+ #tsc_content ul.tsc_tree li div.tsc_checkstate0 {
764
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat;
765
+ }
766
+
767
+ #tsc_content ul.tsc_tree li div.tsc_checkstate2 {
768
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -24px;
769
+ }
770
+
771
+ #tsc_content ul.tsc_tree li div.tsc_checkstate1 {
772
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -48px;
773
+ }
774
+
775
+ #tsc_content ul.tsc_tree li label {
776
+ padding-left: 40px;
777
+ display: block;
778
+ background-repeat: no-repeat;
779
+ background-position: 24px 5px;
780
+ }
781
+
782
+ #tsc_content ul.tsc_tree li label:hover {
783
+ background-color: #87b5c6;
784
+ -moz-border-radius: 3px;
785
+ -webkit-border-radius: 3px;
786
+ border-radius: 3px;
787
+ }
788
+
789
+ #tsc_content ul.tsc_tree li.tsc_Folder > label {
790
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.tree.folderClosed.png")%>');
791
+ background-position: 24px 7px;
792
+ }
793
+
794
+ #tsc_content ul.tsc_tree li.tsc_Folder.open > label {
795
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.tree.folderOpen.png")%>');
796
+ background-position: 22px 7px;
797
+ }
798
+
799
+ #tsc_content ul.tsc_tree li.tsc_Content > label {
800
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.tree.iconText.png")%>');
801
+ }
802
+
803
+ #tsc_content ul.tsc_tree li.tsc_Mixed > label {
804
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.tree.iconTexts.png")%>');
805
+ }
806
+
807
+ #tsc_content ul.tsc_tree li.tsc_File > label {
808
+ background-image: url('/<%=WebResource("TSC.WebClient.styles.tree.leaf.png")%>');
809
+ }
810
+
811
+ #tsc_content ul.tsc_tree li > a {
812
+ position: absolute;
813
+ left: -0px;
814
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.plus.png")%>') no-repeat center 9px;
815
+ display: block;
816
+ overflow: hidden;
817
+ text-indent: -32px;
818
+ width: 24px;
819
+ height: 24px;
820
+ line-height: 1;
821
+ }
822
+
823
+ #tsc_content ul.tsc_tree li > a.open {
824
+ background: url('/<%=WebResource("TSC.WebClient.styles.tree.minus.png")%>') no-repeat center 9px;
825
+ }
826
+
827
+ #tsc_wrapper #tsc_status {
828
+ position: absolute;
829
+ right: 16px;
830
+ bottom: 16px;
831
+ background: rgba(0, 0, 0, 0.8);
832
+ padding: 0 8px;
833
+ -moz-border-radius: 8px;
834
+ -webkit-border-radius: 8px;
835
+ border-radius: 8px;
836
+ -moz-box-shadow: 0 2px 5px rgba(0,0,0,.5);
837
+ -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.5);
838
+ box-shadow: 0 2px 5px rgba(0,0,0,.5);
839
+ list-style: none;
840
+ color: #fff;
841
+ font-size: .75em;
842
+ line-height: 1.2;
843
+ }
844
+
845
+ #tsc_wrapper #tsc_status li {
846
+ padding: 8px 0;
847
+ }
848
+
849
+ #tsc_wrapper #tsc_status b, #tsc_wrapper #tsc_status i, #tsc_wrapper #tsc_status u {
850
+ display: block;
851
+ font-weight: normal;
852
+ font-style: normal;
853
+ text-decoration: none;
854
+ }
855
+
856
+ #tsc_wrapper #tsc_status i {
857
+ -moz-border-radius: 4px;
858
+ -webkit-border-radius: 4px;
859
+ border-radius: 4px;
860
+ border: 1px solid #aaa;
861
+ background-color: #666;
862
+ }
863
+
864
+ #tsc_wrapper #tsc_status u {
865
+ -moz-border-radius: 4px;
866
+ -webkit-border-radius: 4px;
867
+ border-radius: 4px;
868
+ background-color: royalblue;
869
+ text-align: center;
870
+ }
871
+
872
+ /* options */
873
+ #tsc_wrapper .tsc_options li {
874
+ display:block;
875
+ line-height: 26px;
876
+ padding: 0 0 0 6px;
877
+ list-style: none;
878
+ -moz-user-select: none;
879
+ -khtml-user-select: none;
880
+ -webkit-user-select: none;
881
+ user-select: none;
882
+ }
883
+
884
+ #tsc_wrapper .tsc_options label {
885
+ display: block;
886
+ position: relative;
887
+ }
888
+
889
+ #tsc_wrapper .tsc_options input {
890
+ filter: alpha(opacity=0);
891
+ opacity: 0;
892
+ position: absolute;
893
+ }
894
+
895
+ #tsc_wrapper .tsc_options input + span:before {
896
+ content: " ";
897
+ position: absolute;
898
+ top: 0;
899
+ right: 0;
900
+ background: url('/<%=WebResource("TSC.WebClient.styles.YesNo.png")%>') no-repeat;
901
+ display:block;
902
+ width: 61px;
903
+ height: 26px;
904
+ zoom: 1;
905
+ }
906
+
907
+ #tsc_wrapper .tsc_options input:checked + span:before {
908
+ background-position: 0 -53px;
909
+ }
910
+
911
+ #tsc_wrapper .tsc_options li:hover {
912
+ background-color: #87B5C6;
913
+ border-radius: 3px 3px 3px 3px;
914
+ }
skin/adminhtml/base/default/images/gpi_tsc/tsc_styles.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}#tsc_wrapper{font-size:100%;font-family:Candara,Calibri,tahoma,verdana,arial,helvetica,sans-serif;vertical-align:baseline;background:#f3f3f3 url('/<%=WebResource("TSC.WebClient.styles.back.png")%>') repeat-x right top;margin:0;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;-moz-box-shadow:0 2px 5px rgba(0,0,0,.5);-webkit-box-shadow:0 2px 5px rgba(0,0,0,.5);box-shadow:0 2px 5px rgba(0,0,0,.5);overflow:hidden;border:1px solid #fff}#tsc_wrapper *{margin:0;padding:0;border:0;outline:0}#tsc_wrapper *:link,#tsc_wrapper *:visited,#tsc_wrapper *:hover,#tsc_wrapper *:active,#tsc_wrapper *:focus{-webkit-transition:color .25s linear,background-color .25s linear,border-color .25s linear;-moz-transition:color .25s linear,background-color .25s linear,border-color .25s linear;-o-transition:color .25s linear,background-color .25s linear,border-color .25s linear;transition:color .25s linear,background-color .25s linear,border-color .25s linear}#tsc_header{position:relative}#tsc_header #tsc_logo{background:url('/<%=WebResource("TSC.WebClient.styles.logo.png")%>') no-repeat;width:288px;overflow:hidden;padding-top:59px;height:0;display:block}#tsc_header #tsc_settings{position:absolute;top:16px;right:16px;background:url('/<%=WebResource("TSC.WebClient.styles.settings.png")%>') no-repeat;width:24px;overflow:hidden;padding-top:25px;height:0;display:block}#tsc_header #tsc_settings:hover{background-position:0 -25px}#tsc_header #tsc_expand_tree{background:url('/<%=WebResource("TSC.WebClient.styles.expand__tree.png")%>') no-repeat;display:inline-block;position:absolute;right:64px;top:16px;height:24px;width:24px}#tsc_header #tsc_expand_tree.collapse{background-position:0 -25px}#tsc_maincontent{padding:10px 0;margin:0;position:relative}#tsc_wrapper h2 a.button,#tsc_wrapper h2 a.button:active{position:absolute;right:2px;top:3px}#tsc_wrapper h2{text-shadow:0 1px 1px #bbb;margin:0 0 .5em 0;font-family:Cambria;font-size:1.5em;color:#353a40;clear:both;position:relative}#tsc_wrapper #gpiWidgetFooter{clear:both;text-align:center;display:block;margin:1em 0 0}#tsc_wrapper #gpiWidgetFooter a{color:#003;text-decoration:none}#tsc_wrapper #gpiWidgetFooter a:hover{text-decoration:none;color:#f30}#tsc_wrapper button{width:1}#tsc_wrapper a.button,#tsc_wrapper button{padding:0;text-decoration:none;display:inline-block;font-weight:bold;text-align:center;font-size:16px;line-height:1.2;color:#fff;border:1px solid rgba(0,0,0,.3);text-shadow:0 1px 0 rgba(0,0,0,.4);-moz-box-shadow:0 0 .05em rgba(0,0,0,.4);-webkit-box-shadow:0 0 .05em rgba(0,0,0,.4);box-shadow:0 0 .05em rgba(0,0,0,.4)}#tsc_wrapper a.button,#tsc_wrapper a.button span,#tsc_wrapper button,#tsc_wrapper button span{-webkit-border-radius:.4em;-moz-border-radius:.4em;border-radius:.4em;-moz-user-select:-moz-none;-webkit-user-select:none;user-select:none;-moz-user-drag:-moz-none;-webkit-user-drag:none;user-drag:none}#tsc_wrapper a.button span,#tsc_wrapper button span{border-top:1px solid rgba(255,255,255,.5);display:block;padding:.1em 1em .25em;line-height:1.2}#tsc_wrapper a.button:hover,#tsc_wrapper button:hover{-moz-box-shadow:0 1px .2em rgba(0,0,0,.6);-webkit-box-shadow:0 1px .2em rgba(0,0,0,.6);box-shadow:0 1px .2em rgba(0,0,0,.6)}#tsc_wrapper a.button:active,#tsc_wrapper button:active{position:relative;top:1px;-moz-box-shadow:0 0 .2em rgba(0,0,0,.4);-webkit-box-shadow:0 0 .2em rgba(0,0,0,.4);box-shadow:0 0 .2em rgba(0,0,0,.4)}#tsc_wrapper .blue{background:#4477a1;background:-webkit-gradient(linear,left top,left bottom,from(#81a8cb),to(#4477a1));background:-moz-linear-gradient(-90deg,#81a8cb,#4477a1);background:-o-linear-gradient(-90deg,#81a8cb,#4477a1)}#tsc_wrapper .blue:hover{background:#81a8cb;background:-webkit-gradient(linear,left top,left bottom,from(#4477a1),to(#81a8cb));background:-moz-linear-gradient(-90deg,#4477a1,#81a8cb);background:-o-linear-gradient(-90deg,#4477a1,#81a8cb)}#tsc_wrapper .khaki{background:#a2b598;background:-webkit-gradient(linear,left top,left bottom,from(#bdd1b4),to(#a2b598));background:-moz-linear-gradient(-90deg,#bdd1b4,#a2b598);background:-o-linear-gradient(-90deg,#bdd1b4,#a2b598)}#tsc_wrapper .khaki:hover{background:#bdd1b4;background:-webkit-gradient(linear,left top,left bottom,from(#a2b598),to(#bdd1b4));background:-moz-linear-gradient(-90deg,#a2b598,#bdd1b4);background:-o-linear-gradient(-90deg,#a2b598,#bdd1b4)}#tsc_wrapper .green{background:#428739;background:-webkit-gradient(linear,left top,left bottom,from(#c8dd95),to(#428739));background:-moz-linear-gradient(-90deg,#c8dd95,#428739);background:-o-linear-gradient(-90deg,#c8dd95,#428739)}#tsc_wrapper .green:hover{background:#c8dd95;background:-webkit-gradient(linear,left top,left bottom,from(#428739),to(#c8dd95));background:-moz-linear-gradient(-90deg,#428739,#c8dd95);background:-o-linear-gradient(-90deg,#428739,#c8dd95)}#tsc_wrapper .red{background:#d82741;background:-webkit-gradient(linear,left top,left bottom,from(#e84b6e),to(#d82741));background:-moz-linear-gradient(-90deg,#e84b6e,#d82741);background:-o-linear-gradient(-90deg,#e84b6e,#d82741)}#tsc_wrapper .red:hover{background:#e84b6e;background:-webkit-gradient(linear,left top,left bottom,from(#d82741),to(#e84b6e));background:-moz-linear-gradient(-90deg,#d82741,#e84b6e);background:-o-linear-gradient(-90deg,#d82741,#e84b6e)}#tsc_wrapper .orange{background:#f09c15;background:-webkit-gradient(linear,left top,left bottom,from(#f8c939),to(#f09c15));background:-moz-linear-gradient(-90deg,#f8c939,#f09c15);background:-o-linear-gradient(-90deg,#f8c939,#f09c15)}#tsc_wrapper .orange:hover{background:#f8c939;background:-webkit-gradient(linear,left top,left bottom,from(#f09c15),to(#f8c939));background:-moz-linear-gradient(-90deg,#f09c15,#f8c939);background:-o-linear-gradient(-90deg,#f09c15,#f8c939)}#tsc_wrapper .tsc_scrolling{max-height:20em;overflow-y:auto}#tsc_wrapper table.dataTable{border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:75%;border-bottom:2px solid #353a40;width:100%;margin:0 auto 1em;padding:0}#tsc_wrapper table col[align="center"]{text-align:center!important}#tsc_wrapper table col[align="right"]{text-align:right!important}#tsc_wrapper table.dataTable td,#tsc_wrapper table.dataTable th{padding:.2em .5em;line-height:1.5;color:#000;border:1px solid #fff}#tsc_wrapper table.dataTable th{font-weight:bold;background:#353a40;font-size:16px;color:#fff;text-shadow:0 1px 0 #000}#tsc_wrapper table.dataTable td a,#tsc_wrapper table.dataTable td a:visited,#tsc_wrapper table.dataTable td a:link{text-decoration:none}#tsc_wrapper table.dataTable tr:nth-child(2n){background:#f0f0f0}#tsc_wrapper table.dataTable tr:nth-child(2n+1){background:#e0e0e0}#tsc_wrapper table.dataTable tr:hover td{background:#87b5c6}#tsc_wrapper table.dataTable td{vertical-align:middle}#tsc_wrapper td span{position:relative;display:block}#tsc_wrapper td b.actions{font-weight:normal;display:block;position:absolute;top:-6px;right:0;width:28px;height:28px;line-height:16px}#tsc_wrapper tr:hover b.actions{background:#666 url('/<%=WebResource("TSC.WebClient.styles.icon_plus.png")%>') no-repeat center center;-moz-border-radius:4px;-webkit-border-radius:4px;-khtml-border-radius:4px;border-radius:4px}#tsc_wrapper td b.actions i{white-space:nowrap;display:none;font-style:normal;position:absolute;right:0;top:0;border:2px solid #fff;background:#fff;-moz-border-radius:4px;-webkit-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;-moz-box-shadow:0 0 5px rgba(0,0,0,.6);-webkit-box-shadow:0 0 5px rgba(0,0,0,.6);box-shadow:0 0 5px rgba(0,0,0,.6)}#tsc_wrapper td b.actions:hover i{display:block;z-index:1000}#tsc_wrapper td b.actions a{display:inline-block;white-space:nowrap;color:#000;padding:4px 8px 4px 24px;background-color:#ddd;background-repeat:no-repeat;background-position:5px 4px;-moz-border-radius:4px;-webkit-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;font-weight:bold}#tsc_wrapper td b.actions a:hover{color:#fff;text-shadow:0 0 2px #000,0 1px 3px #000;background-color:#aaa;background-position:5px -44px;-moz-box-shadow:0 1px 3px rgba(0,0,0,.4) inset;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.4) inset;box-shadow:0 1px 3px rgba(0,0,0,.4) inset}#tsc_wrapper td b.actions a.link-delete{background-image:url('/<%=WebResource("TSC.WebClient.styles.minus_circle.png")%>')}#tsc_wrapper td b.actions a.link-view{background-image:url('/<%=WebResource("TSC.WebClient.styles.magnifier__arrow.png")%>')}#tsc_wrapper td b.actions a.link-import{background-image:url('/<%=WebResource("TSC.WebClient.styles.box__arrow.png")%>')}#tsc_wrapper td b.actions a.link-close{background-image:url('/<%=WebResource("TSC.WebClient.styles.lock.png")%>')}#tsc_wrapper td b.actions a.link-add{background-image:url('/<%=WebResource("TSC.WebClient.styles.document__pencil.png")%>')}#tsc_wrapper b.actions a.link-request{background-image:url('/<%=WebResource("TSC.WebClient.styles.envelope_arrow.png")%>')}#tsc_wrapper .message{border:1px solid;margin:10px 0;padding:15px 10px 15px 50px;background-repeat:no-repeat;background-position:10px center;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;-moz-box-shadow:0 1px 4px #aaa;-webkit-box-shadow:0 1px 4px #aaa;box-shadow:0 1px 4px #aaa}#tsc_wrapper .info{color:#00529b;background-color:#bde5f8;background-image:url('/<%=WebResource("TSC.WebClient.styles.info.png")%>')}#tsc_wrapper .success{color:#4f8a10;background-color:#dff2bf;background-image:url('/<%=WebResource("TSC.WebClient.styles.success.png")%>')}#tsc_wrapper .warning{color:#9f6000;background-color:#feefb3;background-image:url('/<%=WebResource("TSC.WebClient.styles.warning.png")%>')}#tsc_wrapper .error{color:#d8000c;background-color:#ffbaba;background-image:url('/<%=WebResource("TSC.WebClient.styles.error.png")%>')}#tsc_wrapper .validation{color:#d63301;background-color:#ffccba;background-image:url('/<%=WebResource("TSC.WebClient.styles.validation.png")%>')}#tsc_wrapper .validation ul{margin:0 1.5em 0}#tsc_wrapper #tsc_working{padding:0;margin:0;position:absolute;top:0;left:0;width:100%;height:100%;background:url('/<%=WebResource("TSC.WebClient.styles.transparency.png")%>');z-index:2;text-align:center;display:none;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}#tsc_wrapper #tsc_working strong,#tsc_wrapper b.loading{background-image:url('/<%=WebResource("TSC.WebClient.styles.loading.gif")%>');background-repeat:no-repeat}#tsc_wrapper b.loading{display:block;padding-left:18px;background-position:0 center}#tsc_wrapper #tsc_working strong{color:#fff;text-shadow:0 0 1px #000,0 0 2px #000;display:inline-block;line-height:48px;padding:0 24px 2px 38px;border:2px solid #fff;-webkit-border-radius:.4em;-moz-border-radius:.4em;border-radius:.4em;-moz-box-shadow:0 1px 4px #000;-webkit-box-shadow:0 1px 4px #000;box-shadow:0 1px 4px #000;background-color:#353a40;background-position:18px center;position:relative;top:47%}#tsc_wrapper .tsc_multi_column{float:left;overflow:hidden}#tsc_wrapper .grid_1{width:6.6666666666667%}#tsc_wrapper .grid_2{width:15%}#tsc_wrapper .grid_3{width:23.333333333333%}#tsc_wrapper .grid_4{width:31.666666666667%}#tsc_wrapper .grid_5{width:40%}#tsc_wrapper .grid_6{width:48.333333333333%}#tsc_wrapper .grid_7{width:56.666666666667%}#tsc_wrapper .grid_8{width:65%}#tsc_wrapper .grid_9{width:73.333333333333%}#tsc_wrapper .grid_10{width:81.666666666667%}#tsc_wrapper .grid_11{width:90%}#tsc_wrapper .grid_12{width:98.333333333333%}#tsc_wrapper .grid_0,#tsc_wrapper .grid_1,#tsc_wrapper .grid_2,#tsc_wrapper .grid_3,#tsc_wrapper .grid_4,#tsc_wrapper .grid_5,#tsc_wrapper .grid_6,#tsc_wrapper .grid_7,#tsc_wrapper .grid_8,#tsc_wrapper .grid_9,#tsc_wrapper .grid_10,#tsc_wrapper .grid_11,#tsc_wrapper .grid_12{margin-left:.83333333333333%;margin-right:.83333333333333%;float:left;display:block}#tsc_wrapper .buttons{clear:both;padding-top:1em;text-align:center}#tsc_wrapper form label,#tsc_wrapper form textarea,#tsc_wrapper form select,#tsc_wrapper form input[type="text"],#tsc_wrapper form input[type="password"]{display:block;font-family:Candara,Calibri,tahoma,verdana,arial,helvetica,sans-serif;font-size:1em;line-height:1.2;font-weight:normal;color:#000}#tsc_wrapper form label{margin:.5em 0 .25em;display:inline-block;position:relative}#tsc_wrapper form select{width:100%}#tsc_wrapper form textarea,#tsc_wrapper form input[type="text"],#tsc_wrapper form input[type="password"]{width:98%;padding:1px 1% 2px}input[type="hidden"]{display:none}#tsc_wrapper label input{width:auto;vertical-align:middle}#tsc_wrapper label abbr{position:absolute;right:-20px;top:3px;width:16px;height:16px;text-indent:2000px;overflow:hidden;background:url('/<%=WebResource("TSC.WebClient.styles.required.png")%>') no-repeat;border-bottom:none;display:inline-block}#tsc_wrapper input[type="text"],#tsc_wrapper input[type="password"],#tsc_wrapper textarea,#tsc_wrapper .tsc_selectMultiple{background:#d0d0d0 url('/<%=WebResource("TSC.WebClient.styles.input-normal.png")%>') repeat-x;border:1px solid #666;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}#tsc_wrapper input[type="text"]:focus,#tsc_wrapper input[type="password"]:focus,#tsc_wrapper textarea:focus{background:#fff url('/<%=WebResource("TSC.WebClient.styles.input-focus.png")%>') repeat-x}#tsc_wrapper select{margin-top:1px;border:1px solid #666;padding:0;width:452px;background:#d0d0d0 url('/<%=WebResource("TSC.WebClient.styles.input-normal.png")%>') repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}#tsc_wrapper .tsc_selectMultiple{overflow:auto;height:10.6em}#tsc_wrapper .tsc_selectMultiple label{display:block;margin:0;padding:3px 6px 4px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}#tsc_wrapper .tsc_selectMultiple label:hover{background-color:#87b5c6}#tsc_wrapper .tsc_selectMultiple label input{margin:-2px 0 0 0}#tsc_content dl.tsc_panel{background:#353a40;padding:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;margin-bottom:1em}#tsc_content dl.tsc_panel dt{color:#ccc;font-weight:bold;font-size:18px;padding:0 0 6px 10px;line-height:1;text-shadow:-1px -1px 0 #000}#tsc_content dl.tsc_panel dd{padding:0;border:2px solid #fff;background:#f3f3f3;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}#tsc_content ul.tsc_tree,#tsc_content ul.tsc_tree ul{list-style:none}#tsc_content ul.tsc_tree label{cursor:hand;cursor:pointer;padding-left:24px}#tsc_content ul.tsc_tree li{padding:0 0 0 18px;line-height:26px;position:relative;background:url('/<%=WebResource("TSC.WebClient.styles.tree.lines.png")%>') no-repeat 11px -11px;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;user-select:none}#tsc_content ul.tsc_tree li:first-child{background-position:11px 13px}#tsc_content ul.tsc_tree li:last-child{background-position:11px -1019px}#tsc_content ul.tsc_tree ul li:first-child{background-position:11px -11px}#tsc_content ul.tsc_tree li input{display:none}#tsc_content ul.tsc_tree li div.tsc_checkstate0,#tsc_content ul.tsc_tree li div.tsc_checkstate1,#tsc_content ul.tsc_tree li div.tsc_checkstate2{position:absolute;left:18px;top:1px;display:block;width:24px;height:24px;zoom:1}#tsc_content ul.tsc_tree li div.tsc_checkstate0{background:url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat}#tsc_content ul.tsc_tree li div.tsc_checkstate2{background:url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -24px}#tsc_content ul.tsc_tree li div.tsc_checkstate1{background:url('/<%=WebResource("TSC.WebClient.styles.tree.checkboxes.png")%>') no-repeat 0 -48px}#tsc_content ul.tsc_tree li label{padding-left:40px;display:block;background-repeat:no-repeat;background-position:24px 5px}#tsc_content ul.tsc_tree li label:hover{background-color:#87b5c6;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#tsc_content ul.tsc_tree li.tsc_Folder>label{background-image:url('/<%=WebResource("TSC.WebClient.styles.tree.folderClosed.png")%>');background-position:24px 7px}#tsc_content ul.tsc_tree li.tsc_Folder.open>label{background-image:url('/<%=WebResource("TSC.WebClient.styles.tree.folderOpen.png")%>');background-position:22px 7px}#tsc_content ul.tsc_tree li.tsc_Content>label{background-image:url('/<%=WebResource("TSC.WebClient.styles.tree.iconText.png")%>')}#tsc_content ul.tsc_tree li.tsc_Mixed>label{background-image:url('/<%=WebResource("TSC.WebClient.styles.tree.iconTexts.png")%>')}#tsc_content ul.tsc_tree li.tsc_File>label{background-image:url('/<%=WebResource("TSC.WebClient.styles.tree.leaf.png")%>')}#tsc_content ul.tsc_tree li>a{position:absolute;left:-0;background:url('/<%=WebResource("TSC.WebClient.styles.tree.plus.png")%>') no-repeat center 9px;display:block;overflow:hidden;text-indent:-32px;width:24px;height:24px;line-height:1}#tsc_content ul.tsc_tree li>a.open{background:url('/<%=WebResource("TSC.WebClient.styles.tree.minus.png")%>') no-repeat center 9px}#tsc_wrapper #tsc_status{position:absolute;right:16px;bottom:16px;background:rgba(0,0,0,.8);padding:0 8px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;-moz-box-shadow:0 2px 5px rgba(0,0,0,.5);-webkit-box-shadow:0 2px 5px rgba(0,0,0,.5);box-shadow:0 2px 5px rgba(0,0,0,.5);list-style:none;color:#fff;font-size:.75em;line-height:1.2}#tsc_wrapper #tsc_status li{padding:8px 0}#tsc_wrapper #tsc_status b,#tsc_wrapper #tsc_status i,#tsc_wrapper #tsc_status u{display:block;font-weight:normal;font-style:normal;text-decoration:none}#tsc_wrapper #tsc_status i{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;border:1px solid #aaa;background-color:#666}#tsc_wrapper #tsc_status u{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#4169e1;text-align:center}#tsc_wrapper .tsc_options li{display:block;line-height:26px;padding:0 0 0 6px;list-style:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;user-select:none}#tsc_wrapper .tsc_options label{display:block;position:relative}#tsc_wrapper .tsc_options input{filter:alpha(opacity=0);opacity:0;position:absolute}#tsc_wrapper .tsc_options input+span:before{content:" ";position:absolute;top:0;right:0;background:url('/<%=WebResource("TSC.WebClient.styles.YesNo.png")%>') no-repeat;display:block;width:61px;height:26px;zoom:1}#tsc_wrapper .tsc_options input:checked+span:before{background-position:0 -53px}#tsc_wrapper .tsc_options li:hover{background-color:#87b5c6;border-radius:3px 3px 3px 3px}
skin/adminhtml/base/default/images/gpi_tsc/validation.png ADDED
Binary file
skin/adminhtml/base/default/images/gpi_tsc/warning.png ADDED
Binary file