Przeglądaj źródła

remove old txt editor

marinofaggiana 4 lat temu
rodzic
commit
3f030e265d

+ 0 - 20
Nextcloud.xcodeproj/project.pbxproj

@@ -205,8 +205,6 @@
 		F73CC07C1E813DFF006E3047 /* BKTouchIDManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0661E813DFF006E3047 /* BKTouchIDManager.m */; };
 		F73CC07E1E813DFF006E3047 /* BKTouchIDSwitchView.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0681E813DFF006E3047 /* BKTouchIDSwitchView.m */; };
 		F73CC07F1E813DFF006E3047 /* BKTouchIDSwitchView.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0681E813DFF006E3047 /* BKTouchIDSwitchView.m */; };
-		F73D71621F2673C200E233EB /* NCText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73D71611F2673C200E233EB /* NCText.swift */; };
-		F73D71641F2674A400E233EB /* NCText.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F73D71631F2674A400E233EB /* NCText.storyboard */; };
 		F73F537F1E929C8500F8678D /* CCMore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73F537E1E929C8500F8678D /* CCMore.swift */; };
 		F7417DB3216CE925007D05F5 /* NCTrashSectionHeaderFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7417DB2216CE925007D05F5 /* NCTrashSectionHeaderFooter.swift */; };
 		F7421EAF2294044B00C4B7C1 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7421EAE2294044B00C4B7C1 /* Accelerate.framework */; };
@@ -503,7 +501,6 @@
 		F7DFB7E1219C312D00680748 /* NCRichDocumentTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7DF219C312D00680748 /* NCRichDocumentTemplate.m */; };
 		F7DFB7E2219C312D00680748 /* NCRichDocumentTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7DF219C312D00680748 /* NCRichDocumentTemplate.m */; };
 		F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7EF219C5B8000680748 /* NCCreateFormUploadAssets.swift */; };
-		F7DFB7F2219C5C0000680748 /* NCCreateFormUploadFileText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7F1219C5C0000680748 /* NCCreateFormUploadFileText.swift */; };
 		F7DFB7F4219C5CA800680748 /* NCCreateFormUploadScanDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7F3219C5CA800680748 /* NCCreateFormUploadScanDocument.swift */; };
 		F7E09CE323E3088000FB3E9E /* NCMainRefreshControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E09CE223E3087F00FB3E9E /* NCMainRefreshControl.swift */; };
 		F7E09CE523E3088C00FB3E9E /* NCSplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E09CE423E3088A00FB3E9E /* NCSplitViewController.swift */; };
@@ -813,8 +810,6 @@
 		F73CC0661E813DFF006E3047 /* BKTouchIDManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKTouchIDManager.m; sourceTree = "<group>"; };
 		F73CC0671E813DFF006E3047 /* BKTouchIDSwitchView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKTouchIDSwitchView.h; sourceTree = "<group>"; };
 		F73CC0681E813DFF006E3047 /* BKTouchIDSwitchView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKTouchIDSwitchView.m; sourceTree = "<group>"; };
-		F73D71611F2673C200E233EB /* NCText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCText.swift; sourceTree = "<group>"; };
-		F73D71631F2674A400E233EB /* NCText.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCText.storyboard; sourceTree = "<group>"; };
 		F73F537E1E929C8500F8678D /* CCMore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCMore.swift; sourceTree = "<group>"; };
 		F7417DB2216CE925007D05F5 /* NCTrashSectionHeaderFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrashSectionHeaderFooter.swift; sourceTree = "<group>"; };
 		F7421EAE2294044B00C4B7C1 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
@@ -1186,7 +1181,6 @@
 		F7DFB7DE219C312D00680748 /* NCRichDocumentTemplate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCRichDocumentTemplate.h; sourceTree = "<group>"; };
 		F7DFB7DF219C312D00680748 /* NCRichDocumentTemplate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NCRichDocumentTemplate.m; sourceTree = "<group>"; };
 		F7DFB7EF219C5B8000680748 /* NCCreateFormUploadAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadAssets.swift; sourceTree = "<group>"; };
-		F7DFB7F1219C5C0000680748 /* NCCreateFormUploadFileText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadFileText.swift; sourceTree = "<group>"; };
 		F7DFB7F3219C5CA800680748 /* NCCreateFormUploadScanDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadScanDocument.swift; sourceTree = "<group>"; };
 		F7E09CE223E3087F00FB3E9E /* NCMainRefreshControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMainRefreshControl.swift; sourceTree = "<group>"; };
 		F7E09CE423E3088A00FB3E9E /* NCSplitViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCSplitViewController.swift; sourceTree = "<group>"; };
@@ -1691,15 +1685,6 @@
 			path = BKPasscodeView;
 			sourceTree = "<group>";
 		};
-		F73D71561F26739100E233EB /* Text */ = {
-			isa = PBXGroup;
-			children = (
-				F73D71611F2673C200E233EB /* NCText.swift */,
-				F73D71631F2674A400E233EB /* NCText.storyboard */,
-			);
-			path = Text;
-			sourceTree = "<group>";
-		};
 		F74D3DB81BAC1941000BAE4B /* Networking */ = {
 			isa = PBXGroup;
 			children = (
@@ -2347,7 +2332,6 @@
 				F704B5E62430C06700632F5F /* NCCreateFormUploadConflictCell.xib */,
 				F7651A8823A2A3F2001403D2 /* NCCreateFormUploadDocuments.storyboard */,
 				F7651A8923A2A3F2001403D2 /* NCCreateFormUploadDocuments.swift */,
-				F7DFB7F1219C5C0000680748 /* NCCreateFormUploadFileText.swift */,
 				F7DFB7F3219C5CA800680748 /* NCCreateFormUploadScanDocument.swift */,
 				F747BA1E22354D2000971601 /* NCCreateFormUploadVoiceNote.storyboard */,
 				F7020FCD2233D7F700B7297D /* NCCreateFormUploadVoiceNote.swift */,
@@ -2442,7 +2426,6 @@
 				F728CE741BF6322C00E69702 /* Share */,
 				F7169A161EE590930086BD69 /* Shares */,
 				F7B0C0CA1EE7E7750033AC24 /* Synchronize */,
-				F73D71561F26739100E233EB /* Text */,
 				F7E9C41320F4CA870040CF18 /* Transfers */,
 				F78F74322163753B00C2ADAD /* Trash */,
 				F70784811A2C8A0D00AC9FFF /* UploadFromOtherUpp */,
@@ -2799,7 +2782,6 @@
 				F78F74342163757000C2ADAD /* NCTrash.storyboard in Resources */,
 				F79A65C32191D90F00FF6DCC /* NCSelect.storyboard in Resources */,
 				F7169A1E1EE590930086BD69 /* NCSharesCell.xib in Resources */,
-				F73D71641F2674A400E233EB /* NCText.storyboard in Resources */,
 				F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */,
 				F7632FBF21832F8700721B71 /* NCTrashSectionHeaderMenu.xib in Resources */,
 				F739513A221B127F00D986C8 /* NCSectionMediaHeader.xib in Resources */,
@@ -3134,7 +3116,6 @@
 				F78E7065219F096B006F23E4 /* NCAvatar.swift in Sources */,
 				F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */,
 				F762CB0C1EACB66200B38484 /* XLFormSectionDescriptor.m in Sources */,
-				F7DFB7F2219C5C0000680748 /* NCCreateFormUploadFileText.swift in Sources */,
 				371B5A2E23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift in Sources */,
 				F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */,
 				F77444F8222816D5000D5EB0 /* NCPhotosPickerViewController.swift in Sources */,
@@ -3225,7 +3206,6 @@
 				F7F878AE1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */,
 				F7DBC37C23325E02001A85BA /* NCAppConfigView.swift in Sources */,
 				F762CB141EACB66200B38484 /* XLFormRightImageButton.m in Sources */,
-				F73D71621F2673C200E233EB /* NCText.swift in Sources */,
 				F73B4EF81F470D9100BBEE4B /* LangDanishModel.cpp in Sources */,
 				F738143A240FE48D00404AC7 /* NCViewerImageCommon.swift in Sources */,
 				3781B9B023DB2B7E006B4B1D /* AppDelegate+Menu.swift in Sources */,

+ 0 - 267
iOSClient/Main/Create cloud/NCCreateFormUploadFileText.swift

@@ -1,267 +0,0 @@
-//
-//  NCCreateFormUploadFileText.swift
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 14/11/2018.
-//  Copyright © 2018 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import Foundation
-
-class NCCreateFormUploadFileText: XLFormViewController, NCSelectDelegate {
-    
-    var serverUrl = ""
-    var titleServerUrl = ""
-    var fileName = ""
-    var text = ""
-    
-    let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    
-    convenience init(serverUrl: String, text: String, fileName: String) {
-        
-        self.init()
-        
-        if serverUrl == CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl) {
-            titleServerUrl = "/"
-        } else {
-            titleServerUrl = (serverUrl as NSString).lastPathComponent
-        }
-        
-        self.fileName = fileName
-        self.serverUrl = serverUrl
-        self.text = text
-    }
-    
-    // MARK: - View Life Cycle
-    
-    override func viewDidLoad() {
-        
-        super.viewDidLoad()
-        
-        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(save))
-        self.navigationItem.rightBarButtonItem = saveButton
-        self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
-        
-        // Theming view
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
-        changeTheming()
-    }
-    
-    @objc func changeTheming() {
-           appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
-           initializeForm()
-    }
-    
-    //MARK: XLForm
-    
-    func initializeForm() {
-        
-        let form : XLFormDescriptor = XLFormDescriptor(title: NSLocalizedString("_text_upload_title_", comment: "")) as XLFormDescriptor
-        form.rowNavigationOptions = XLFormRowNavigationOptions.stopDisableRow
-        
-        var section : XLFormSectionDescriptor
-        var row : XLFormRowDescriptor
-        
-        // Section: Destination Folder
-        
-        section = XLFormSectionDescriptor.formSection(withTitle: NSLocalizedString("_save_path_", comment: ""))
-        form.addFormSection(section)
-        
-        row = XLFormRowDescriptor(tag: "ButtonDestinationFolder", rowType: XLFormRowDescriptorTypeButton, title: self.titleServerUrl)
-        row.action.formSelector = #selector(changeDestinationFolder(_:))
-        row.cellConfig["backgroundColor"] = NCBrandColor.sharedInstance.backgroundForm
-
-        row.cellConfig["imageView.image"] = CCGraphics.changeThemingColorImage(UIImage(named: "folder")!, width: 50, height: 50, color: NCBrandColor.sharedInstance.brandElement) as UIImage
-        
-        row.cellConfig["textLabel.textAlignment"] = NSTextAlignment.right.rawValue
-        row.cellConfig["textLabel.font"] = UIFont.systemFont(ofSize: 15.0)
-        row.cellConfig["textLabel.textColor"] = NCBrandColor.sharedInstance.textView
-
-        section.addFormRow(row)
-        
-        // Section: File Name
-        
-        section = XLFormSectionDescriptor.formSection(withTitle: NSLocalizedString("_filename_", comment: ""))
-        form.addFormSection(section)
-        
-        row = XLFormRowDescriptor(tag: "fileName", rowType: XLFormRowDescriptorTypeAccount, title: NSLocalizedString("_filename_", comment: ""))
-        row.value = self.fileName
-        row.cellConfig["backgroundColor"] = NCBrandColor.sharedInstance.backgroundForm
-
-        row.cellConfig["textLabel.font"] = UIFont.systemFont(ofSize: 15.0)
-        row.cellConfig["textLabel.textColor"] = NCBrandColor.sharedInstance.textView
-
-        row.cellConfig["textField.textAlignment"] = NSTextAlignment.right.rawValue
-        row.cellConfig["textField.font"] = UIFont.systemFont(ofSize: 15.0)
-        row.cellConfig["textField.textColor"] = NCBrandColor.sharedInstance.textView
-
-        section.addFormRow(row)
-        
-        self.form = form
-    }
-    
-    override func formRowDescriptorValueHasChanged(_ formRow: XLFormRowDescriptor!, oldValue: Any!, newValue: Any!) {
-        
-        super.formRowDescriptorValueHasChanged(formRow, oldValue: oldValue, newValue: newValue)
-        
-        if formRow.tag == "fileName" {
-            
-            self.form.delegate = nil
-            
-            if let fileNameNew = formRow.value {
-                self.fileName = CCUtility.removeForbiddenCharactersServer(fileNameNew as? String)
-            }
-            
-            formRow.value = self.fileName
-            self.title = fileName
-            
-            self.updateFormRow(formRow)
-            
-            self.form.delegate = self
-        }
-    }
-    
-    override func textFieldDidBeginEditing(_ textField: UITextField) {
-        
-        let cell = textField.formDescriptorCell()
-        let tag = cell?.rowDescriptor.tag
-        
-        if tag == "fileName" {
-            CCUtility.selectFileName(from: textField)
-        }
-    }
-    
-    // MARK: - Action
-    
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
-        
-        if serverUrl != nil {
-            
-            self.serverUrl = serverUrl!
-            
-            if serverUrl == CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl) {
-                self.titleServerUrl = "/"
-            } else {
-                self.titleServerUrl = (serverUrl! as NSString).lastPathComponent
-            }
-            
-            // Update
-            let row : XLFormRowDescriptor  = self.form.formRow(withTag: "ButtonDestinationFolder")!
-            row.title = self.titleServerUrl
-            self.updateFormRow(row)
-        }
-    }
-    
-    @objc func save() {
-        
-        let rowFileName : XLFormRowDescriptor  = self.form.formRow(withTag: "fileName")!
-        guard let name = rowFileName.value else {
-            return
-        }
-        let ext = (name as! NSString).pathExtension.uppercased()
-        var fileNameSave = ""
-        
-        if (ext == "") {
-            fileNameSave = name as! String + ".txt"
-        } else if (CCUtility.isDocumentModifiableExtension(ext)) {
-            fileNameSave = name as! String
-        } else {
-            fileNameSave = (name as! NSString).deletingPathExtension + ".txt"
-        }
-        
-        let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView == %@", appDelegate.activeAccount, self.serverUrl, fileNameSave))
-        if (metadata != nil) {
-            
-            let alertController = UIAlertController(title: fileNameSave, message: NSLocalizedString("_file_already_exists_", comment: ""), preferredStyle: .alert)
-            
-            let cancelAction = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .default) { (action:UIAlertAction) in
-            }
-            
-            let overwriteAction = UIAlertAction(title: NSLocalizedString("_overwrite_", comment: ""), style: .cancel) { (action:UIAlertAction) in
-                self.dismissAndUpload(fileNameSave, ocId: metadata!.ocId, serverUrl: self.serverUrl)
-            }
-            
-            alertController.addAction(cancelAction)
-            alertController.addAction(overwriteAction)
-            
-            self.present(alertController, animated: true, completion:nil)
-            
-        } else {
-            dismissAndUpload(fileNameSave, ocId: UUID().uuidString, serverUrl: serverUrl)
-        }
-    }
-    
-    func dismissAndUpload(_ fileNameSave: String, ocId: String, serverUrl: String) {
-        
-        self.dismiss(animated: true, completion: {
-            
-            let data = self.text.data(using: .utf8)
-            let success = FileManager.default.createFile(atPath: CCUtility.getDirectoryProviderStorageOcId(ocId, fileNameView: fileNameSave), contents: data, attributes: nil)
-            
-            if success {
-                
-                let metadataForUpload = tableMetadata()
-                
-                metadataForUpload.account = self.appDelegate.activeAccount
-                metadataForUpload.date = NSDate()
-                metadataForUpload.ocId = ocId
-                metadataForUpload.fileName = fileNameSave
-                metadataForUpload.fileNameView = fileNameSave
-                metadataForUpload.serverUrl = serverUrl
-                metadataForUpload.session = k_upload_session
-                metadataForUpload.sessionSelector = selectorUploadFile
-                metadataForUpload.status = Int(k_metadataStatusWaitUpload)
-                
-                NCManageDatabase.sharedInstance.addMetadata(metadataForUpload)
-                NCMainCommon.sharedInstance.reloadDatasource(ServerUrl: self.serverUrl, ocId: nil, action: Int32(k_action_NULL))
-
-                self.appDelegate.startLoadAutoDownloadUpload()                
-            
-            } else {
-                
-                NCContentPresenter.shared.messageNotification("_error_", description: "_error_creation_file_", delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.info, errorCode: 0)
-            }
-        })
-    }
-    
-    func cancel() {
-        
-        self.dismiss(animated: true, completion: nil)
-    }
-    
-    @objc func changeDestinationFolder(_ sender: XLFormRowDescriptor) {
-        
-        self.deselectFormRow(sender)
-        
-        let storyboard = UIStoryboard(name: "NCSelect", bundle: nil)
-        let navigationController = storyboard.instantiateInitialViewController() as! UINavigationController
-        let viewController = navigationController.topViewController as! NCSelect
-        
-        viewController.delegate = self
-        viewController.hideButtonCreateFolder = false
-        viewController.includeDirectoryE2EEncryption = true
-        viewController.includeImages = false
-        viewController.layoutViewSelect = k_layout_view_move
-        viewController.selectFile = false
-        viewController.titleButtonDone = NSLocalizedString("_select_", comment: "")
-        viewController.type = ""
-        
-        navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
-        self.present(navigationController, animated: true, completion: nil)
-    }
-}

+ 0 - 2
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -226,8 +226,6 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
             
             if (ext == "") {
                 fileNameSave = name as! String + ".m4a"
-            } else if (CCUtility.isDocumentModifiableExtension(ext)) {
-                fileNameSave = name as! String
             } else {
                 fileNameSave = (name as! NSString).deletingPathExtension + ".m4a"
             }

+ 1 - 10
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -84,16 +84,7 @@ extension AppDelegate {
                     appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
                 })
             )
-        } else {
-            actions.append(
-                NCMenuAction(title: NSLocalizedString("_upload_file_text_", comment: ""), icon: CCGraphics.changeThemingColorImage(UIImage(named: "file_txt"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon), action: { menuAction in
-                    let storyboard = UIStoryboard(name: "NCText", bundle: nil)
-                    let controller = storyboard.instantiateViewController(withIdentifier: "NCText")
-                    controller.modalPresentationStyle = UIModalPresentationStyle.pageSheet
-                    appDelegate.activeMain.present(controller, animated: true, completion: nil)
-                })
-            )
-        }
+        } 
         
         #if !targetEnvironment(simulator)
             if #available(iOS 11.0, *) {

+ 0 - 20
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -28,8 +28,6 @@ extension NCDetailNavigationController {
 
     private func initMoreMenu(viewController: UIViewController, metadata: tableMetadata) -> [NCMenuAction] {
         var actions = [NCMenuAction]()
-        let fileNameExtension = (metadata.fileNameView as NSString).pathExtension.uppercased()
-        let directEditingCreators = NCManageDatabase.sharedInstance.getDirectEditingCreators(account: appDelegate.activeAccount)
         var titleFavorite = NSLocalizedString("_add_favorites_", comment: "")
         if metadata.favorite { titleFavorite = NSLocalizedString("_remove_favorites_", comment: "") }
         let localFile = NCManageDatabase.sharedInstance.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
@@ -204,24 +202,6 @@ extension NCDetailNavigationController {
             }
         }
                 
-        if CCUtility.isDocumentModifiableExtension(fileNameExtension) && (directEditingCreators == nil || !appDelegate.reachability.isReachable()) {
-            actions.append(
-                NCMenuAction(title: NSLocalizedString("_internal_modify_", comment: ""),
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "edit"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                    action: { menuAction in
-                        if let navigationController = UIStoryboard(name: "NCText", bundle: nil).instantiateViewController(withIdentifier: "NCText") as? UINavigationController {
-                            navigationController.modalPresentationStyle = .pageSheet
-                            navigationController.modalTransitionStyle = .crossDissolve
-                            if let textViewController = navigationController.topViewController as? NCText {
-                                textViewController.metadata = metadata;
-                                viewController.present(navigationController, animated: true, completion: nil)
-                            }
-                        }
-                    }
-                )
-            )
-        }
-        
         // CLOSE
         
         actions.append(

+ 0 - 83
iOSClient/Text/NCText.storyboard

@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <scenes>
-        <!--Text-->
-        <scene sceneID="l1e-ys-YzZ">
-            <objects>
-                <viewController id="oRF-nm-GrS" customClass="NCText" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="Uyq-V3-KbV"/>
-                        <viewControllerLayoutGuide type="bottom" id="5fD-Qb-N57"/>
-                    </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="skk-fU-Vk6">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" keyboardDismissMode="interactive" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="pmg-g2-Fbs">
-                                <rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
-                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                <textInputTraits key="textInputTraits"/>
-                            </textView>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                        <constraints>
-                            <constraint firstItem="5fD-Qb-N57" firstAttribute="top" secondItem="pmg-g2-Fbs" secondAttribute="bottom" id="KKy-aG-Q0G"/>
-                            <constraint firstItem="pmg-g2-Fbs" firstAttribute="top" secondItem="Uyq-V3-KbV" secondAttribute="bottom" id="MOE-fS-vSb"/>
-                            <constraint firstAttribute="trailing" secondItem="pmg-g2-Fbs" secondAttribute="trailing" id="dYU-vc-Fz6"/>
-                            <constraint firstItem="pmg-g2-Fbs" firstAttribute="leading" secondItem="skk-fU-Vk6" secondAttribute="leading" id="jcN-jR-tMp"/>
-                        </constraints>
-                    </view>
-                    <extendedEdge key="edgesForExtendedLayout"/>
-                    <toolbarItems/>
-                    <navigationItem key="navigationItem" id="LYL-SD-Ayv">
-                        <barButtonItem key="leftBarButtonItem" title="Item" id="brk-EO-iNZ">
-                            <connections>
-                                <action selector="cancelButtonTapped:" destination="oRF-nm-GrS" id="bZ7-ow-Bbq"/>
-                            </connections>
-                        </barButtonItem>
-                        <barButtonItem key="rightBarButtonItem" title="Item" id="Hyb-2c-5Hb">
-                            <connections>
-                                <action selector="nextButtonTapped:" destination="oRF-nm-GrS" id="tzB-m8-8BJ"/>
-                            </connections>
-                        </barButtonItem>
-                    </navigationItem>
-                    <connections>
-                        <outlet property="bottomConstraint" destination="KKy-aG-Q0G" id="Vl0-1L-h0O"/>
-                        <outlet property="cancelButton" destination="brk-EO-iNZ" id="8gM-f2-AtV"/>
-                        <outlet property="nextButton" destination="Hyb-2c-5Hb" id="Zmo-Th-UUq"/>
-                        <outlet property="textView" destination="pmg-g2-Fbs" id="T5E-gh-UZ6"/>
-                    </connections>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="r2i-QZ-Y8W" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="1040.8" y="-197.45127436281859"/>
-        </scene>
-        <!--Navigation Controller-->
-        <scene sceneID="lyP-Qo-Lgl">
-            <objects>
-                <navigationController storyboardIdentifier="NCText" automaticallyAdjustsScrollViewInsets="NO" id="zKl-U9-avf" sceneMemberID="viewController">
-                    <extendedEdge key="edgesForExtendedLayout"/>
-                    <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="UIP-td-6cq">
-                        <rect key="frame" x="0.0" y="20" width="375" height="44"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </navigationBar>
-                    <nil name="viewControllers"/>
-                    <connections>
-                        <segue destination="oRF-nm-GrS" kind="relationship" relationship="rootViewController" id="gPZ-9Y-e4E"/>
-                    </connections>
-                </navigationController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="jdZ-ZN-JEs" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="10" y="-197"/>
-        </scene>
-    </scenes>
-</document>

+ 0 - 214
iOSClient/Text/NCText.swift

@@ -1,214 +0,0 @@
-//
-//  NCText.swift
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 24/07/17.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-
-import Foundation
-import WebKit
-
-@objc protocol NCTextDelegate {
-    func dismissTextView()
-}
-
-class NCText: UIViewController, UITextViewDelegate {
-
-    @IBOutlet weak var cancelButton: UIBarButtonItem!
-    @IBOutlet weak var nextButton: UIBarButtonItem!
-    @IBOutlet weak var textView: UITextView!
-    
-    @IBOutlet weak var bottomConstraint: NSLayoutConstraint!
-    
-    let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    
-    @objc var metadata: tableMetadata?
-    @objc var delegate: NCTextDelegate?
-    var loadText: String?
-    
-    override func viewDidLoad() {
-        
-        super.viewDidLoad()
-        
-        NotificationCenter.default.addObserver(self, selector:#selector(keyboardWillShowHandle(info:)), name: UIResponder.keyboardWillShowNotification, object: nil)
-        NotificationCenter.default.addObserver(self, selector:#selector(keyboardWillHideHandle), name: UIResponder.keyboardWillHideNotification, object: nil)
-        
-        self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("_untitled_txt_", comment: "")
-                
-        cancelButton.title = NSLocalizedString("_cancel_", comment: "")
-        nextButton.title = NSLocalizedString("_next_", comment: "")
-        
-        // Modify
-        if let metadata = metadata {
-            
-            loadText = ""
-            let path = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
-            let data = NSData(contentsOfFile: path)
-            
-            if let data = data {
-            
-                let encodingCFName = NCUchardet.sharedNUCharDet().encodingCFStringDetect(with: data as Data)
-                let se = CFStringConvertEncodingToNSStringEncoding(encodingCFName)
-                let encoding = String.Encoding(rawValue: se)
-                
-                loadText = try? String(contentsOfFile: path, encoding: encoding)
-                textView.text = loadText
-                nextButton.title = NSLocalizedString("_save_", comment: "")
-                self.navigationController?.navigationBar.topItem?.title = NSLocalizedString(metadata.fileNameView, comment: "")
-            }
-                
-        } else {
-            
-            loadText = ""
-        }
-        
-        textView.isUserInteractionEnabled = true
-        textView.becomeFirstResponder()
-        textView.delegate = self
-        textView.selectedTextRange = textView.textRange(from: textView.beginningOfDocument, to: textView.beginningOfDocument)
-        textView.font = UIFont(name: "NameOfTheFont", size: 20)
-
-        // Theming view
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
-        changeTheming()
-        
-        textViewDidChange(textView)
-    }
-
-    @objc func keyboardWillShowHandle(info:NSNotification) {
-        
-        let frameView = self.view.convert(self.view.bounds, to: self.view.window)
-        let endView = frameView.origin.y + frameView.size.height
-        
-        if let keyboardSize = (info.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let _ = self.view.window?.frame {
-            
-            if endView - keyboardSize.origin.y > 0 {
-                bottomConstraint.constant = endView - keyboardSize.origin.y
-            } else {
-                bottomConstraint.constant = 0
-            }
-        }
-    }
-    
-    override func viewDidDisappear(_ animated: Bool) {
-        super.viewDidDisappear(animated)
-        
-        if appDelegate.activeDetail != nil && appDelegate.activeDetail.backgroundView?.subviews.first != nil {
-            if appDelegate.activeDetail.backgroundView.subviews.first is WKWebView {
-                appDelegate.activeDetail.viewUnload()
-            }
-        }
-    }
-    
-    @objc func keyboardWillHideHandle() {
-        bottomConstraint.constant = 0
-    }
-    
-    func textViewDidChange(_ textView: UITextView) {
-        
-        if textView.text.count == 0 {
-            nextButton.isEnabled = false
-        } else {
-            nextButton.isEnabled = true
-        }
-    }
-    
-    @objc func changeTheming() {
-    
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
-        
-        textView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
-        textView.textColor = NCBrandColor.sharedInstance.textView
-    }
-    
-    @IBAction func cancelButtonTapped(_ sender: AnyObject) {
-        
-        if textView.text != loadText {
-            
-            let alertController = UIAlertController(title: NSLocalizedString("_info_", comment: ""), message: NSLocalizedString("_save_exit_", comment: ""), preferredStyle: .alert)
-            
-            let actionYes = UIAlertAction(title: NSLocalizedString("_yes_", comment: ""), style: .default) { (action:UIAlertAction) in
-                self.dismiss(animated: true, completion: {
-                    self.delegate?.dismissTextView()
-                })
-            }
-            
-            let actionNo = UIAlertAction(title: NSLocalizedString("_no_", comment: ""), style: .cancel) { (action:UIAlertAction) in
-                print("You've pressed No button")
-            }
-            
-            alertController.addAction(actionYes)
-            alertController.addAction(actionNo)
-            
-            self.present(alertController, animated: true, completion:nil)
-            
-        } else {
-            
-            self.dismiss(animated: true, completion: {
-                self.delegate?.dismissTextView()
-            })
-        }
-    }
-    
-    @IBAction func nextButtonTapped(_ sender: AnyObject) {
-        
-        let serverUrl = self.appDelegate.getTabBarControllerActiveServerUrl()
-        
-        if let metadata = metadata {
-            
-            if textView.text != loadText {
-            
-                let data = textView.text.data(using: .utf8)
-                let success = FileManager.default.createFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), contents: data, attributes: nil)
-                if success {
-                
-                    appDelegate.activeMain.clearDateReadDataSource(nil)
-                
-                    self.dismiss(animated: true, completion: {
-                        
-                        metadata.session = k_upload_session
-                        metadata.sessionSelector = selectorUploadFile
-                        metadata.status = Int(k_metadataStatusWaitUpload)
-
-                        NCManageDatabase.sharedInstance.addMetadata(metadata)
-                        NCMainCommon.sharedInstance.reloadDatasource(ServerUrl: serverUrl, ocId: metadata.ocId, action: Int32(k_action_MOD))
-                        
-                        self.appDelegate.startLoadAutoDownloadUpload()
-
-                        self.delegate?.dismissTextView()
-                    })
-
-                } else {
-                    NCContentPresenter.shared.messageNotification("_error_", description: "_error_creation_file_", delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: Int(k_CCErrorInternalError))
-                }
-                
-            } else {
-                self.dismiss(animated: true, completion: {
-                    self.delegate?.dismissTextView()
-                })
-            }
-            
-        } else {
-            
-            let formViewController = NCCreateFormUploadFileText.init(serverUrl: serverUrl!, text: self.textView.text, fileName: NSLocalizedString("_untitled_txt_", comment: ""))
-            self.navigationController?.pushViewController(formViewController, animated: true)
-        }
-    }
-}

+ 0 - 2
iOSClient/Utility/CCUtility.h

@@ -237,8 +237,6 @@
 
 + (NSArray *)createNameSubFolder:(PHFetchResult *)assets;
 
-+ (BOOL)isDocumentModifiableExtension:(NSString *)fileExtension;
-
 + (NSString *)getDirectoryScan;
 
 + (NSString *)getMimeType:(NSString *)fileNameView;

+ 0 - 7
iOSClient/Utility/CCUtility.m

@@ -1359,13 +1359,6 @@
     return (NSArray *)datesSubFolder;
 }
 
-+ (BOOL)isDocumentModifiableExtension:(NSString *)fileExtension
-{
-    // Use UPPERCASE extension :
-    
-    return [@[@"TXT", @"MD", @"MARKDOWN", @"ORG"] containsObject:fileExtension];
-}
-
 + (NSString *)getMimeType:(NSString *)fileNameView
 {
     CFStringRef fileUTI = nil;

+ 0 - 27
iOSClient/Viewer/NCViewerDocumentWeb.swift

@@ -88,33 +88,6 @@ class NCViewerDocumentWeb: WKWebView {
                 print("error")
             }
             
-        } else if CCUtility.isDocumentModifiableExtension(fileNameExtension) {
-            
-            let session = URLSession(configuration: URLSessionConfiguration.default)
-            var request = URLRequest(url: url)
-            request.httpMethod = "HEAD"
-            
-            let task = session.dataTask(with: request) { (data, response, error) in
-                
-                guard let data = data else {
-                    return
-                }
-                guard let response = response else {
-                    return
-                }
-                
-                DispatchQueue.main.async {
-                    
-                    guard let encodingName = NCUchardet.sharedNUCharDet()?.encodingStringDetect(with: data) else {
-                        return
-                    }
-                    self.mimeType = response.mimeType
-                    self.load(data, mimeType: response.mimeType!, characterEncodingName: encodingName, baseURL: url)
-                }
-            }
-            
-            task.resume()
-            
         } else {
             
             load(URLRequest(url: url))