rahuljs / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

php generated js file causes error 400 #216

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
im using the latest beta version,

i have a file called i18n_js.php that is called using path_info through the 
index file, 
contents is below:

<? header('Content-type: text/javascript'); ?>

var ccmi18n = { 

    error: "<?=t('Error')?>",
    deleteBlock: "<?=t('Delete')?>",
    deleteBlockMsg: "<?=t('The block has been removed successfully.')?>",
    addBlock: "<?=t('Add Block')?>",
    addBlockNew: "<?=t('Add Block')?>",
    addBlockPaste: "<?=t('Paste from Scrapbook')?>",
    changeAreaCSS: "<?=t('Design')?>",
    editAreaLayout: "<?=t('Edit Layout')?>",
    addAreaLayout: "<?=t('Add Layout')?>",
    moveLayoutUp: "<?=t('Move Up')?>",
    moveLayoutDown: "<?=t('Move Down')?>",
    moveLayoutAtBoundary: "<?=t('This layout section can not be moved further in this direction.')?>", 
    lockAreaLayout: "<?=t('Lock Layout')?>", 
    unlockAreaLayout: "<?=t('Unlock Layout')?>", 
    deleteLayout: "<?=t('Delete')?>",
    deleteLayoutOptsTitle: "<?=t('Delete Layout')?>", 
    confirmLayoutPresetDelete: "<?=t('Are you sure you want to delete this layout preset?')?>",
    setAreaPermissions: "<?=t('Set Permissions')?>",
    addBlockMsg: "<?=t('The block has been added successfully.')?>",
    updateBlock: "<?=t('Update Block')?>",
    updateBlockMsg: "<?=t('The block has been saved successfully.')?>",
    closeWindow: "<?=t('Close')?>",
    editBlock: "<?=t('Edit')?>",
    compareVersions: "<?=t('Compare Versions')?>",
    blockAreaMenu: "<?=t("Add Block")?>",
    arrangeBlock: "<?=t('Move')?>",
    arrangeBlockMsg: "<?=t('Blocks arranged successfully.')?>",
    copyBlockToScrapbook: "<?=t('Copy to Scrapbook')?>",
    changeBlockTemplate: "<?=t('Custom Template')?>",
    changeBlockCSS: "<?=t("Design")?>",
    errorCustomStylePresetNoName: "<?=t('You must give your custom style preset a name.')?>",
    changeBlockBaseStyle: "<?=t("Set Block Styles")?>",
    confirmCssReset: "<?=t("Are you sure you want to remove all of these custom styles?")?>",
    confirmCssPresetDelete: "<?=t("Are you sure you want to delete this custom style preset?")?>",
    setBlockPermissions: "<?=t('Set Permissions')?>",
    setBlockAlias: "<?=t('Setup on Child Pages')?>",
    clear: "<?=t('Clear')?>",
    helpPopup: "<?=t('Help')?>",
    community: "<?=t('concrete5 Community')?>",
    noIE6: "<?=t('Concrete5 does not support Internet Explorer 6 in edit mode.')?>",
    helpPopupLoginMsg: "<?=t('Get more help on your question by posting it to the concrete5 help center on concrete5.org')?>",
    marketplaceErrorMsg: "<?=t('<p>You package could not be installed.  An unknown error occured.</p>')?>",
    marketplaceInstallMsg: "<?=t('<p>Your package will now be downloaded and installed.</p>')?>",
    marketplaceLoadingMsg: "<?=t('<p>Retrieving information from the Concrete5 Marketplace.</p>')?>",
    marketplaceLoginMsg: "<?=t('<p>You must be logged into the concrete5 Marketplace to install add-ons and themes.  Please log in.</p>')?>",
    marketplaceLoginSuccessMsg: "<?=t('<p>You have successfully logged into the concrete5 Marketplace.</p>')?>",
    marketplaceLogoutSuccessMsg: "<?=t('<p>You are now logged out of concrete5 Marketplace.</p>')?>",
    deleteAttributeValue: "<?=t('Are you sure you want to remove this value?')?>",
    customizeSearch: "<?=t('Customize Search')?>",
    properties: "<?=t('Properties')?>",
    savePropertiesMsg: "<?=t('Page Properties saved.')?>",
    ok: "<?=t('Ok')?>",
    x: "<?=t('x')?>"
}

var ccmi18n_sitemap = {

    visitExternalLink: "<?=t('Visit')?>",
    editExternalLink: "<?=t('Edit External Link')?>",
    deleteExternalLink: "<?=t('Delete')?>",
    addExternalLink: "<?=t('Add External Link')?>",
    sendToTop: "<?=t('Send To Top')?>",
    sendToBottom: "<?=t('Send To Bottom')?>",

    visitPage: "<?=t('Visit')?>",
    pageProperties: "<?=t('Properties')?>",
    setPagePermissions: "<?=t('Set Permissions')?>",
    setPagePermissionsMsg: "<?=t('Page permissions updated successfully.')?>",
    pageDesignMsg: "<?=t('Theme and page type updated successfully.')?>",
    pageDesign: "<?=t('Design')?>",
    pageVersions: "<?=t('Versions')?>",
    deletePage: "<?=t('Delete')?>",
    deletePageSuccessMsg: "<?=t('The page has been removed successfully.')?>",
    addPage: "<?=t('Add Page')?>",
    moveCopyPage: "<?=t('Move/Copy')?>",
    reorderPage: "<?=t('Change Page Order')?>",
    reorderPageMessage: "<?=t('Move or reorder pages by dragging their icons.')?>",
    moveCopyPageMessage: "<?=t('Choose a new parent page from the sitemap.')?>",

    searchPages: "<?=t('Search Pages')?>",
    explorePages: "<?=t('Flat View')?>",
    backToSitemap: "<?=t('Back to Sitemap')?>",
    searchResults: "<?=t('Search Results')?>",
    createdBy: "<?=t('Created By')?>",

    viewing: "<?=t('Viewing')?>",
    results: "<?=t('Result(s)')?>",
    max: "<?=t('max')?>",
    noResults: "<?=t('No results found.')?>",
    areYouSure: "<?=t('Are you sure?')?>",
    loadError: "<?=t('Unable to load sitemap data. Response received: ')?>",
    loadErrorTitle: "<?=t('Unable to load sitemap data.')?>",
    on: "<?=t('on')?>"  

}

var ccmi18n_spellchecker = {

    resumeEditing: "<?=t('Resume Editing')?>",
    noSuggestions: "<?=t('No Suggestions')?>"

}

var ccmi18n_filemanager = {

    view: "<?=t('View')?>",
    download: "<?=t('Download')?>",
    select: "<?=t('Choose')?>",
    duplicateFile: "<?=t('Copy File')?>",
    clear: "<?=t('Clear')?>",
    edit: "<?=t('Edit')?>",
    replace: "<?=t('Replace')?>",
    duplicate: "<?=t('Copy')?>",
    chooseNew: "<?=t('Choose New File')?>",
    sets: "<?=t('Sets')?>",
    permissions: "<?=t('Access & Permissions')?>",
    properties: "<?=t('Properties')?>",
    deleteFile: "<?=t('Delete')?>",
    title: "<?=t('File Manager')?>",
    uploadErrorChooseFile: "<?=t('You must choose a file.')?>",
    rescan: "<?=t('Rescan')?>",
    pending: "<?=t('Pending')?>",
    uploadComplete: "<?=t('Upload Complete')?>",

    PTYPE_CUSTOM: "<?=FilePermissions::PTYPE_CUSTOM?>",
    PTYPE_NONE: "<?=FilePermissions::PTYPE_NONE?>",
    PTYPE_ALL: "<?=FilePermissions::PTYPE_ALL?>",

    FTYPE_IMAGE: "<?=FileType::T_IMAGE?>",  
    FTYPE_VIDEO: "<?=FileType::T_VIDEO?>",  
    FTYPE_TEXT: "<?=FileType::T_TEXT?>",    
    FTYPE_AUDIO: "<?=FileType::T_AUDIO?>",  
    FTYPE_DOCUMENT: "<?=FileType::T_DOCUMENT?>",    
    FTYPE_APPLICATION: "<?=FileType::T_APPLICATION?>"

}

The t() is for gettext so you can ignore that, when its generated it looks like:

var ccmi18n = { 

    error: "Error",
    deleteBlock: "Delete",
    deleteBlockMsg: "The block has been removed successfully.",
    addBlock: "Add Block",
    addBlockNew: "Add Block",
    addBlockPaste: "Paste from Scrapbook",
    changeAreaCSS: "Design",
    editAreaLayout: "Edit Layout",
    addAreaLayout: "Add Layout",
    moveLayoutUp: "Move Up",
    moveLayoutDown: "Move Down",
    moveLayoutAtBoundary: "This layout section can not be moved further in this direction.", 
    lockAreaLayout: "Lock Layout", 
    unlockAreaLayout: "Unlock Layout", 
    deleteLayout: "Delete",
    deleteLayoutOptsTitle: "Delete Layout", 
    confirmLayoutPresetDelete: "Are you sure you want to delete this layout preset?",
    setAreaPermissions: "Set Permissions",
    addBlockMsg: "The block has been added successfully.",
    updateBlock: "Update Block",
    updateBlockMsg: "The block has been saved successfully.",
    closeWindow: "Close",
    editBlock: "Edit",
    compareVersions: "Compare Versions",
    blockAreaMenu: "Add Block",
    arrangeBlock: "Move",
    arrangeBlockMsg: "Blocks arranged successfully.",
    copyBlockToScrapbook: "Copy to Scrapbook",
    changeBlockTemplate: "Custom Template",
    changeBlockCSS: "Design",
    errorCustomStylePresetNoName: "You must give your custom style preset a name.",
    changeBlockBaseStyle: "Set Block Styles",
    confirmCssReset: "Are you sure you want to remove all of these custom styles?",
    confirmCssPresetDelete: "Are you sure you want to delete this custom style preset?",
    setBlockPermissions: "Set Permissions",
    setBlockAlias: "Setup on Child Pages",
    clear: "Clear",
    helpPopup: "Help",
    community: "concrete5 Community",
    noIE6: "Concrete5 does not support Internet Explorer 6 in edit mode.",
    helpPopupLoginMsg: "Get more help on your question by posting it to the concrete5 help center on concrete5.org",
    marketplaceErrorMsg: "<p>You package could not be installed.  An unknown error occured.</p>",
    marketplaceInstallMsg: "<p>Your package will now be downloaded and installed.</p>",
    marketplaceLoadingMsg: "<p>Retrieving information from the Concrete5 Marketplace.</p>",
    marketplaceLoginMsg: "<p>You must be logged into the concrete5 Marketplace to install add-ons and themes.  Please log in.</p>",
    marketplaceLoginSuccessMsg: "<p>You have successfully logged into the concrete5 Marketplace.</p>",
    marketplaceLogoutSuccessMsg: "<p>You are now logged out of concrete5 Marketplace.</p>",
    deleteAttributeValue: "Are you sure you want to remove this value?",
    customizeSearch: "Customize Search",
    properties: "Properties",
    savePropertiesMsg: "Page Properties saved.",
    ok: "Ok",
    x: "x"
}

var ccmi18n_sitemap = {

    visitExternalLink: "Visit",
    editExternalLink: "Edit External Link",
    deleteExternalLink: "Delete",
    addExternalLink: "Add External Link",
    sendToTop: "Send To Top",
    sendToBottom: "Send To Bottom",

    visitPage: "Visit",
    pageProperties: "Properties",
    setPagePermissions: "Set Permissions",
    setPagePermissionsMsg: "Page permissions updated successfully.",
    pageDesignMsg: "Theme and page type updated successfully.",
    pageDesign: "Design",
    pageVersions: "Versions",
    deletePage: "Delete",
    deletePageSuccessMsg: "The page has been removed successfully.",
    addPage: "Add Page",
    moveCopyPage: "Move/Copy",
    reorderPage: "Change Page Order",
    reorderPageMessage: "Move or reorder pages by dragging their icons.",
    moveCopyPageMessage: "Choose a new parent page from the sitemap.",

    searchPages: "Search Pages",
    explorePages: "Flat View",
    backToSitemap: "Back to Sitemap",
    searchResults: "Search Results",
    createdBy: "Created By",

    viewing: "Viewing",
    results: "Result(s)",
    max: "max",
    noResults: "No results found.",
    areYouSure: "Are you sure?",
    loadError: "Unable to load sitemap data. Response received: ",
    loadErrorTitle: "Unable to load sitemap data.",
    on: "on"    

}

var ccmi18n_spellchecker = {

    resumeEditing: "Resume Editing",
    noSuggestions: "No Suggestions"

}

var ccmi18n_filemanager = {

    view: "View",
    download: "Download",
    select: "Choose",
    duplicateFile: "Copy File",
    clear: "Clear",
    edit: "Edit",
    replace: "Replace",
    duplicate: "Copy",
    chooseNew: "Choose New File",
    sets: "Sets",
    permissions: "Access & Permissions",
    properties: "Properties",
    deleteFile: "Delete",
    title: "File Manager",
    uploadErrorChooseFile: "You must choose a file.",
    rescan: "Rescan",
    pending: "Pending",
    uploadComplete: "Upload Complete",

    PTYPE_CUSTOM: "7",
    PTYPE_NONE: "0",
    PTYPE_ALL: "10",

    FTYPE_IMAGE: "1",   
    FTYPE_VIDEO: "2",   
    FTYPE_TEXT: "3",    
    FTYPE_AUDIO: "4",   
    FTYPE_DOCUMENT: "5",    
    FTYPE_APPLICATION: "6"

}

viewing it alone works fine, as soon as i try to use the minifier with it i get 
error 400 bad request,

Any help is appreciated,

Original issue reported on code.google.com by mnk...@gmail.com on 5 Jan 2011 at 3:05

GoogleCodeExporter commented 9 years ago
You must use a source object if your content is not a flat file. See:
http://code.google.com/p/minify/wiki/CustomSource#Non-File_Sources
Please use the google group for support.

Original comment by mrclay....@gmail.com on 5 Jan 2011 at 3:11