1
-
1
+
2
2
( function ( ) {
3
3
var Formatters = {
4
4
407
407
var className = 'ascending'
408
408
if ( $ ( this ) . hasClass ( 'ascending' ) ) {
409
409
className = 'descending' ;
410
- }
410
+ }
411
411
412
412
oWebDAV . Sort ( $ ( this ) . data ( 'sort-column' ) , className == 'ascending' ) ;
413
413
} )
448
448
} ,
449
449
450
450
_OnPopState : function ( oEvent ) {
451
- if ( ! oWebDAV . GetHashValue ( 'search' ) ) {
451
+ if ( oWebDAV . GetHashValue ( 'search' ) ) {
452
+ oSearchForm . LoadFromHash ( ) ;
453
+ }
454
+ else {
452
455
var sUrl = oEvent . state && oEvent . state . Url || window . location . href . split ( "#" ) [ 0 ] ;
453
456
oWebDAV . NavigateFolder ( sUrl ) ;
454
457
}
570
573
sPath = this . CurrentFolder . Href ;
571
574
}
572
575
576
+ //set upload url for uploader control
577
+ if ( typeof WebDAVUploaderGridView !== 'undefined' ) {
578
+ WebDAVUploaderGridView . SetUploadUrl ( sPath ) ;
579
+ }
580
+
573
581
if ( sortColumn ) {
574
582
this . CurrentSortColumn = sortColumn ;
575
583
this . CurrentSortAscending = sortAscending ;
681
689
this . SnippetPropertyName
682
690
] ;
683
691
684
- this . CurrentFolder . GetSearchPageByQueryAsync ( searchQuery , ( currentPageNumber - 1 ) * pageSize , pageSize , function ( oResult ) {
685
- /** @type {ITHit.WebDAV.Client.AsyncResult } oResult */
692
+ function _getSearchPageByQuery ( ) {
693
+ oWebDAV . CurrentFolder . GetSearchPageByQueryAsync ( searchQuery , ( currentPageNumber - 1 ) * pageSize , pageSize , function ( oResult ) {
694
+ /** @type {ITHit.WebDAV.Client.AsyncResult } oResult */
695
+
696
+ /** @type {ITHit.WebDAV.Client.HierarchyItem[] } aItems */
697
+
698
+ fCallback && fCallback ( oResult ) ;
699
+ } ) ;
700
+ }
701
+
702
+ if ( window . location . href . split ( "#" ) [ 0 ] != this . CurrentFolder . Href ) {
703
+ this . WebDavSession . OpenFolderAsync ( window . location . href . split ( "#" ) [ 0 ] , [ ] , function ( oResponse ) {
704
+ oWebDAV . CurrentFolder = oResponse . Result ;
705
+ oBreadcrumbs . SetHierarchyItem ( oWebDAV . CurrentFolder ) ;
706
+ _getSearchPageByQuery ( ) ;
707
+ } ) ;
708
+ }
709
+ else {
710
+ _getSearchPageByQuery ( ) ;
711
+ }
686
712
687
- /** @type {ITHit.WebDAV.Client.HierarchyItem[] } aItems */
688
713
689
- fCallback && fCallback ( oResult ) ;
690
- } ) ;
691
714
} ,
692
715
693
716
Sort : function ( columnName , sortAscending ) {
776
799
* Sets values to hash
777
800
*/
778
801
SetHashValues : function ( arrayValues ) {
802
+ var hashValue = '' ;
779
803
var params = [ ] ;
780
804
var hashConfig = this . _parseUrlHash ( ) ;
781
805
787
811
params . push ( key + '=' + hashConfig [ key ] ) ;
788
812
}
789
813
790
- location . hash = params . length > 0 ? ( '#' + params . join ( '&' ) ) : '' ;
814
+ hashValue = params . length > 0 ? ( '#' + params . join ( '&' ) ) : '' ;
815
+
816
+ if ( hashValue != location . hash ) {
817
+ location . hash = hashValue ;
818
+ }
791
819
792
820
if ( location . href [ location . href . length - 1 ] == '#' ) {
793
821
oHistoryApi . PushState ( ) ;
801
829
this . SetHashValues ( [ { Name : name , Value : value } ] ) ;
802
830
} ,
803
831
832
+ /**
833
+ * Returns url of app installer
834
+ */
835
+ GetInstallerFileUrl : function ( ) {
836
+ return webDavSettings . ApplicationProtocolsPath + ITHit . WebDAV . Client . DocManager . GetInstallFileName ( ) ;
837
+ } ,
838
+
804
839
/**
805
840
* Adds name and value to array
806
841
* @return {Array }
807
842
*/
808
843
_addParameterToArray : function ( name , value , arrayParams ) {
809
- var nameExist = false ;
844
+ var nameExist = false ;
810
845
811
846
for ( var key in arrayParams ) {
812
847
if ( arrayParams . hasOwnProperty ( key ) ) {
851
886
* @private
852
887
*/
853
888
_ProtocolInstallMessage : function ( ) {
889
+ var installerFilePath = this . GetInstallerFileUrl ( ) ;
890
+
854
891
if ( ITHit . WebDAV . Client . DocManager . IsDavProtocolSupported ( ) ) {
855
892
oConfirmModal . Confirm ( 'This action requires a protocol installation. <br/><br/>' +
856
893
'Make sure a web browser extension is enabled after protocol installation.<br/>' +
860
897
'Select OK to download the protocol installer.' , function ( ) {
861
898
// IT Hit WebDAV Ajax Library protocol installers path.
862
899
// Used to open non-MS Office documents or if MS Office is
863
- // not installed as well as to open OS File Manager.
900
+ // not installed as well as to open OS File Manager.
901
+
864
902
865
- var installerFilePath = webDavSettings . ApplicationProtocolsPath + ITHit . WebDAV . Client . DocManager . GetInstallFileName ( ) ;
866
903
window . open ( installerFilePath ) ;
867
904
} , { size : 'lg' } ) ;
868
905
}
888
925
oWebDAV . NavigateFolder ( window . location . href . split ( "#" ) [ 0 ] ) ;
889
926
}
890
927
891
- // Set Ajax lib version
928
+ // Set Ajax lib version
892
929
if ( ITHit . WebDAV . Client . DocManager . IsDavProtocolSupported ( ) ) {
893
930
var $installerLink = $ ( '<a></a>' )
894
931
. attr ( 'href' , webDavSettings . ApplicationProtocolsPath + ITHit . WebDAV . Client . DocManager . GetInstallFileName ( ) )
897
934
} else {
898
935
$ ( '.ithit-version-value' ) . text ( 'v' + ITHit . WebDAV . Client . WebDavSession . Version + ' (Protocol v' + ITHit . WebDAV . Client . WebDavSession . ProtocolVersion + ')' ) ;
899
936
}
900
-
901
-
902
937
$ ( '.ithit-current-folder-value' ) . text ( oWebDAV . GetMountUrl ( ) ) ;
903
938
904
939
} ) ( ) ;
0 commit comments