extras-evolution / morephoto

simple add more photos for document
0 stars 2 forks source link

Правки (не работает на новых версиях MODx #2

Open Azariil opened 7 years ago

Azariil commented 7 years ago

Перестал работать Morephoto. Для работоспособности в новых версиях MODx предлагаю добавить в jquery.multiphotos.js следующий код: `function function_exists( function_name ) { // Return TRUE if the given function has been defined // // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Steve Clay // + improved by: Legaev Andrey

if (typeof function_name == 'string'){
    return (typeof window[function_name] == 'function');
} else{
    return (function_name instanceof Function);
}

}

if (!function_exists('SetUrl')) { var lastFileCtrl, lastImageCtrl;

function SetUrl(url, width, height, alt) { if (lastFileCtrl) { var c = document.mutate[lastFileCtrl]; if (c) c.value = url; lastFileCtrl = '' } else if (lastImageCtrl) { var c = document.mutate[lastImageCtrl]; if (c) c.value = url; lastImageCtrl = '' } else { return } } }

if (!function_exists('OpenServerBrowser')) { function OpenServerBrowser(url, width, height ) { var iLeft = (screen.width - width) / 2 ; var iTop = (screen.height - height) / 2 ; var sOptions = 'toolbar=no,status=no,resizable=yes,dependent=yes' ; sOptions += ',width=' + width ; sOptions += ',height=' + height ; sOptions += ',left=' + iLeft ; sOptions += ',top=' + iTop ; var oWindow = window.open( url, 'FCKBrowseWindow', sOptions ) ; } }` Функции OpenServerBrowser и SetUrl взяты отсюда: https://github.com/64j/multiphotos_custom/blob/master/jquery.multiphotos.js Функция function_exists взята отсюда: http://javascript.ru/php/function_exists

Dmi3yy commented 7 years ago

Если получиться сделайте пул реквест я приму без проблем а то сам пока не успеваю :(

От 7 января 2017 г. в 18:52:00, Azariil (notifications@github.com) написал:

Перестал работать Morephoto. Для работоспособности в новых версиях MODx предлагаю добавить в jquery.multiphotos.js следующий код: `function function_exists( function_name ) { // Return TRUE if the given function has been defined // // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Steve Clay // + improved by: Legaev Andrey

if (typeof function_name == 'string'){ return (typeof window[function_name] == 'function'); } else{ return (function_name instanceof Function); }

}

if (!function_exists('SetUrl')) { var lastFileCtrl, lastImageCtrl;

function SetUrl(url, width, height, alt) { if (lastFileCtrl) { var c = document.mutate[lastFileCtrl]; if (c) c.value = url; lastFileCtrl = '' } else if (lastImageCtrl) { var c = document.mutate[lastImageCtrl]; if (c) c.value = url; lastImageCtrl = '' } else { return } } }

if (!function_exists('OpenServerBrowser')) { function OpenServerBrowser(url, width, height ) { var iLeft = (screen.width - width) / 2 ; var iTop = (screen.height - height) / 2 ; var sOptions = 'toolbar=no,status=no,resizable=yes,dependent=yes' ; sOptions += ',width=' + width ; sOptions += ',height=' + height ; sOptions += ',left=' + iLeft ; sOptions += ',top=' + iTop ; var oWindow = window.open( url, 'FCKBrowseWindow', sOptions ) ; } }` Функции OpenServerBrowser и SetUrl взяты отсюда: https://github.com/64j/multiphotos_custom/blob/master/jquery.multiphotos.js Функция function_exists взята отсюда: http://javascript.ru/php/function_exists

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/extras-evolution/morephoto/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AAo3M6u1rbk65bv-Foztg2lbGypv3nbLks5rP8KvgaJpZM4Lddx_ .

Azariil commented 7 years ago

Сделал pull request. В pull request не добавил функцию SetUrl, т.к. только во время pull request заметил, что она все же присутствует в файле в разделе "DON'T MODIFY THIS!".