1717 * along with this program. If not, see <https://www.gnu.org/licenses/>.
1818 */
1919
20- import UIWindowShare from './UIWindowShare.js' ;
2120import UIWindowPublishWebsite from './UIWindowPublishWebsite.js' ;
2221import UIWindowItemProperties from './UIWindowItemProperties.js' ;
2322import UIWindowSaveAccount from './UIWindowSaveAccount.js' ;
@@ -127,7 +126,6 @@ async function UIItem (options) {
127126 options . visible = options . visible ?? 'visible' ; // one of 'visible', 'revealed', 'hidden'
128127 options . is_dir = options . is_dir ?? false ;
129128 options . is_selected = options . is_selected ?? false ;
130- options . is_shared = options . is_shared ?? false ;
131129 options . is_shortcut = options . is_shortcut ?? 0 ;
132130 options . is_trash = options . is_trash ?? false ;
133131 options . metadata = options . metadata ?? '' ;
@@ -136,7 +134,6 @@ async function UIItem (options) {
136134 options . shortcut_to_path = options . shortcut_to_path ?? '' ;
137135 options . immutable = ( options . immutable === false || options . immutable === 0 || options . immutable === undefined ? 0 : 1 ) ;
138136 options . sort_container_after_append = ( options . sort_container_after_append !== undefined ? options . sort_container_after_append : false ) ;
139- const is_shared_with_me = ( options . path !== `/${ window . user . username } ` && ! options . path . startsWith ( `/${ window . user . username } /` ) ) ;
140137 const workers = Array . isArray ( options . workers ) ? options . workers : [ ] ;
141138 const is_worker = ! options . is_dir && workers . length > 0 ;
142139 const worker_url = is_worker ? workers [ 0 ] . address : '' ;
@@ -221,22 +218,6 @@ async function UIItem (options) {
221218 data-item-id="${ item_id } "
222219 >` ;
223220
224- // shared badge
225- h += `<img class="item-badge item-badge-has-permission"
226- style="display: ${ is_shared_with_me ? 'block' : 'none' } ;
227- background-color: #ffffff;
228- padding: 2px;" src="${ html_encode ( window . icons [ 'shared.svg' ] ) } "
229- data-item-id="${ item_id } "
230- title="${ i18n ( 'item_shared_with_you' ) } ">` ;
231- // owner-shared badge
232- h += `<img class="item-badge item-is-shared"
233- style="background-color: #ffffff; padding: 2px; ${ ! is_shared_with_me && options . is_shared ? 'display:block;' : '' } "
234- src="${ html_encode ( window . icons [ 'owner-shared.svg' ] ) } "
235- data-item-id="${ item_id } "
236- data-item-uid="${ options . uid } "
237- data-item-path="${ html_encode ( options . path ) } "
238- title="${ i18n ( 'item_shared_by_you' ) } "
239- >` ;
240221 // shortcut badge
241222 h += `<img class="item-badge item-shortcut"
242223 style="background-color: #ffffff; padding: 2px; ${ options . is_shortcut !== 0 ? 'display:block;' : '' } "
@@ -966,34 +947,6 @@ async function UIItem (options) {
966947 menu_items . push ( '-' ) ;
967948 }
968949 if ( ! are_trashed ) {
969- menu_items . push ( {
970- html : i18n ( 'Share With…' ) ,
971- onClick : async function ( ) {
972- if ( window . user . is_temp &&
973- ! await UIWindowSaveAccount ( {
974- send_confirmation_code : true ,
975- message : 'Please create an account to proceed.' ,
976- window_options : {
977- backdrop : true ,
978- close_on_backdrop_click : false ,
979- } ,
980- } ) )
981- {
982- return ;
983- }
984- else if ( ! window . user . email_confirmed && ! await UIWindowEmailConfirmationRequired ( ) )
985- {
986- return ;
987- }
988-
989- let items = [ ] ;
990- $selected_items . each ( function ( ) {
991- const ell = this ;
992- items . push ( { uid : $ ( ell ) . attr ( 'data-uid' ) , path : $ ( ell ) . attr ( 'data-path' ) , icon : $ ( ell ) . find ( '.item-icon img' ) . attr ( 'src' ) , name : $ ( ell ) . attr ( 'data-name' ) } ) ;
993- } ) ;
994- UIWindowShare ( items ) ;
995- } ,
996- } ) ;
997950 // -------------------------------------------
998951 // Open in AI
999952 // -------------------------------------------
@@ -1150,15 +1103,14 @@ async function UIItem (options) {
11501103 if ( ! are_trashed && window . feature_flags . create_shortcut ) {
11511104 menu_items . push ( {
11521105 html : i18n ( 'create_shortcut' ) ,
1153- html : is_shared_with_me ? i18n ( 'create_desktop_shortcut_s' ) : i18n ( 'create_shortcut_s' ) ,
1106+ html : i18n ( 'create_shortcut_s' ) ,
11541107 onClick : async function ( ) {
11551108 $selected_items . each ( function ( ) {
11561109 let base_dir = path . dirname ( $ ( this ) . attr ( 'data-path' ) ) ;
11571110 // Trash on Desktop is a special case
11581111 if ( $ ( this ) . attr ( 'data-path' ) && $ ( this ) . closest ( '.item-container' ) . attr ( 'data-path' ) === window . desktop_path ) {
11591112 base_dir = window . desktop_path ;
11601113 }
1161- if ( is_shared_with_me ) base_dir = window . desktop_path ;
11621114 // create shortcut
11631115 window . create_shortcut (
11641116 path . basename ( $ ( this ) . attr ( 'data-path' ) ) ,
@@ -1316,35 +1268,9 @@ async function UIItem (options) {
13161268 }
13171269 }
13181270 // -------------------------------------------
1319- // Share With…
1271+ // Open in AI
13201272 // -------------------------------------------
13211273 if ( ! is_trashed && ! is_trash ) {
1322- menu_items . push ( {
1323- html : i18n ( 'Share With…' ) ,
1324- onClick : async function ( ) {
1325- if ( window . user . is_temp &&
1326- ! await UIWindowSaveAccount ( {
1327- send_confirmation_code : true ,
1328- message : 'Please create an account to proceed.' ,
1329- window_options : {
1330- backdrop : true ,
1331- close_on_backdrop_click : false ,
1332- } ,
1333- } ) )
1334- {
1335- return ;
1336- }
1337- else if ( ! window . user . email_confirmed && ! await UIWindowEmailConfirmationRequired ( ) )
1338- {
1339- return ;
1340- }
1341-
1342- UIWindowShare ( [ { uid : $ ( el_item ) . attr ( 'data-uid' ) , path : $ ( el_item ) . attr ( 'data-path' ) , name : $ ( el_item ) . attr ( 'data-name' ) , icon : $ ( el_item_icon ) . find ( 'img' ) . attr ( 'src' ) } ] ) ;
1343- } ,
1344- } ) ;
1345- // -------------------------------------------
1346- // Open in AI
1347- // -------------------------------------------
13481274 menu_items . push ( {
13491275 html : i18n ( 'open_in_ai' ) ,
13501276 onClick : async function ( ) {
@@ -1573,7 +1499,7 @@ async function UIItem (options) {
15731499 // -------------------------------------------
15741500 // Cut
15751501 // -------------------------------------------
1576- if ( $ ( el_item ) . attr ( 'data-immutable' ) === '0' && ! is_shared_with_me ) {
1502+ if ( $ ( el_item ) . attr ( 'data-immutable' ) === '0' ) {
15771503 menu_items . push ( {
15781504 html : i18n ( 'cut' ) ,
15791505 onClick : function ( ) {
@@ -1624,16 +1550,14 @@ async function UIItem (options) {
16241550 // -------------------------------------------
16251551 if ( ! is_trashed && window . feature_flags . create_shortcut ) {
16261552 menu_items . push ( {
1627- html : is_shared_with_me ? i18n ( 'create_desktop_shortcut' ) : i18n ( 'create_shortcut' ) ,
1553+ html : i18n ( 'create_shortcut' ) ,
16281554 onClick : async function ( ) {
16291555 let base_dir = path . dirname ( $ ( el_item ) . attr ( 'data-path' ) ) ;
16301556 // Trash on Desktop is a special case
16311557 if ( $ ( el_item ) . attr ( 'data-path' ) && $ ( el_item ) . closest ( '.item-container' ) . attr ( 'data-path' ) === window . desktop_path ) {
16321558 base_dir = window . desktop_path ;
16331559 }
16341560
1635- if ( is_shared_with_me ) base_dir = window . desktop_path ;
1636-
16371561 window . create_shortcut (
16381562 path . basename ( $ ( el_item ) . attr ( 'data-path' ) ) ,
16391563 options . is_dir ,
@@ -1648,7 +1572,7 @@ async function UIItem (options) {
16481572 // -------------------------------------------
16491573 // Delete
16501574 // -------------------------------------------
1651- if ( $ ( el_item ) . attr ( 'data-immutable' ) === '0' && ! is_trashed && ! is_shared_with_me ) {
1575+ if ( $ ( el_item ) . attr ( 'data-immutable' ) === '0' && ! is_trashed ) {
16521576 menu_items . push ( {
16531577 html : i18n ( 'delete' ) ,
16541578 onClick : async function ( ) {
0 commit comments